From 813a9a2694b3bcff59df3ee9586fba5633e8ec28 Mon Sep 17 00:00:00 2001 From: everbrez Date: Mon, 12 Feb 2024 07:55:07 +0000 Subject: [PATCH] deploy: 7cb11efdda988e9ef73d8d54bc26d43d2d299060 --- ...ssMode.3fb2bfb9.js => cssMode.7a415312.js} | 2 +- ...r2.756d07c5.js => freemarker2.3b2f34fd.js} | 2 +- ...ars.f394fbe4.js => handlebars.18e0667c.js} | 2 +- assets/{html.53b68c08.js => html.1bf06998.js} | 2 +- ...lMode.897a5543.js => htmlMode.abd248db.js} | 2 +- .../{index.af91b668.js => index.88ac6262.js} | 352 +++++++++--------- ...ipt.ffc97e56.js => javascript.85c4a255.js} | 2 +- ...nMode.db6fe524.js => jsonMode.ed18ab76.js} | 2 +- ...{liquid.a3ff61c7.js => liquid.61cc9740.js} | 2 +- assets/{mdx.12093909.js => mdx.1b36e47c.js} | 2 +- ...{python.77882a55.js => python.402e94f8.js} | 2 +- .../{razor.65d26acd.js => razor.d50b3781.js} | 2 +- ...{tsMode.3620dac5.js => tsMode.ec11a955.js} | 2 +- ...ipt.e652792e.js => typescript.5993deda.js} | 2 +- assets/{xml.ea9fa0dc.js => xml.c84ad9c7.js} | 2 +- assets/{yaml.d8459d8e.js => yaml.75677e06.js} | 2 +- index.html | 2 +- 17 files changed, 192 insertions(+), 192 deletions(-) rename assets/{cssMode.3fb2bfb9.js => cssMode.7a415312.js} (99%) rename assets/{freemarker2.756d07c5.js => freemarker2.3b2f34fd.js} (99%) rename assets/{handlebars.f394fbe4.js => handlebars.18e0667c.js} (99%) rename assets/{html.53b68c08.js => html.1bf06998.js} (98%) rename assets/{htmlMode.897a5543.js => htmlMode.abd248db.js} (99%) rename assets/{index.af91b668.js => index.88ac6262.js} (85%) rename assets/{javascript.ffc97e56.js => javascript.85c4a255.js} (89%) rename assets/{jsonMode.db6fe524.js => jsonMode.ed18ab76.js} (99%) rename assets/{liquid.a3ff61c7.js => liquid.61cc9740.js} (98%) rename assets/{mdx.12093909.js => mdx.1b36e47c.js} (98%) rename assets/{python.77882a55.js => python.402e94f8.js} (98%) rename assets/{razor.65d26acd.js => razor.d50b3781.js} (99%) rename assets/{tsMode.3620dac5.js => tsMode.ec11a955.js} (99%) rename assets/{typescript.e652792e.js => typescript.5993deda.js} (98%) rename assets/{xml.ea9fa0dc.js => xml.c84ad9c7.js} (97%) rename assets/{yaml.d8459d8e.js => yaml.75677e06.js} (98%) diff --git a/assets/cssMode.3fb2bfb9.js b/assets/cssMode.7a415312.js similarity index 99% rename from assets/cssMode.3fb2bfb9.js rename to assets/cssMode.7a415312.js index c0ba066..4759533 100644 --- a/assets/cssMode.3fb2bfb9.js +++ b/assets/cssMode.7a415312.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.af91b668.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.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/freemarker2.756d07c5.js b/assets/freemarker2.3b2f34fd.js similarity index 99% rename from assets/freemarker2.756d07c5.js rename to assets/freemarker2.3b2f34fd.js index dc356df..b03d275 100644 --- a/assets/freemarker2.756d07c5.js +++ b/assets/freemarker2.3b2f34fd.js @@ -1,4 +1,4 @@ -import{m as F}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m as F}from"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/handlebars.f394fbe4.js b/assets/handlebars.18e0667c.js similarity index 99% rename from assets/handlebars.f394fbe4.js rename to assets/handlebars.18e0667c.js index b96b3cc..fa00d5a 100644 --- a/assets/handlebars.f394fbe4.js +++ b/assets/handlebars.18e0667c.js @@ -1,4 +1,4 @@ -import{m as i}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/html.53b68c08.js b/assets/html.1bf06998.js similarity index 98% rename from assets/html.53b68c08.js rename to assets/html.1bf06998.js index 772a3c5..8ac7591 100644 --- a/assets/html.53b68c08.js +++ b/assets/html.1bf06998.js @@ -1,4 +1,4 @@ -import{m as d}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/htmlMode.897a5543.js b/assets/htmlMode.abd248db.js similarity index 99% rename from assets/htmlMode.897a5543.js rename to assets/htmlMode.abd248db.js index 21692dc..9308704 100644 --- a/assets/htmlMode.897a5543.js +++ b/assets/htmlMode.abd248db.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.af91b668.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.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/index.af91b668.js b/assets/index.88ac6262.js similarity index 85% rename from assets/index.af91b668.js rename to assets/index.88ac6262.js index 2774bb4..0636b50 100644 --- a/assets/index.af91b668.js +++ b/assets/index.88ac6262.js @@ -1,37 +1,37 @@ -var LNe=Object.defineProperty;var ENe=(i,e,t)=>e in i?LNe(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var bt=(i,e,t)=>(ENe(i,typeof e!="symbol"?e+"":e,t),t),c8=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var ht=(i,e,t)=>(c8(i,e,"read from private field"),t?t.call(i):e.get(i)),Oo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ad=(i,e,t,n)=>(c8(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),ox=(i,e,t,n)=>({set _(o){ad(i,e,o,t)},get _(){return ht(i,e,n)}}),mh=(i,e,t)=>(c8(i,e,"access private method"),t);function Rde(i,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in i)){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}const DNe=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(o){if(o.ep)return;o.ep=!0;const r=t(o);fetch(o.href,r)}};DNe();var rx=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},x={exports:{}},Ui={};/* +var LNe=Object.defineProperty;var ENe=(i,e,t)=>e in i?LNe(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var bt=(i,e,t)=>(ENe(i,typeof e!="symbol"?e+"":e,t),t),d8=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var ht=(i,e,t)=>(d8(i,e,"read from private field"),t?t.call(i):e.get(i)),Oo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ad=(i,e,t,n)=>(d8(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),ox=(i,e,t,n)=>({set _(o){ad(i,e,o,t)},get _(){return ht(i,e,n)}}),mh=(i,e,t)=>(d8(i,e,"access private method"),t);function Mde(i,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in i)){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}const DNe=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(o){if(o.ep)return;o.ep=!0;const r=t(o);fetch(o.href,r)}};DNe();var rx=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},x={exports:{}},Ui={};/* object-assign (c) Sindre Sorhus @license MIT -*/var hJ=Object.getOwnPropertySymbols,kNe=Object.prototype.hasOwnProperty,INe=Object.prototype.propertyIsEnumerable;function TNe(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function NNe(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if(n.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(r){o[r]=r}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Mde=NNe()?Object.assign:function(i,e){for(var t,n=TNe(i),o,r=1;r=_},o=function(){},i.unstable_forceFrameRate=function(j){0>j||125>>1,fe=j[ue];if(fe!==void 0&&0I(be,X))Fe!==void 0&&0>I(Fe,be)?(j[ue]=Fe,j[Se]=X,ue=Se):(j[ue]=be,j[pe]=X,ue=pe);else if(Fe!==void 0&&0>I(Fe,X))j[ue]=Fe,j[Se]=X,ue=Se;else break e}}return G}return null}function I(j,G){var X=j.sortIndex-G.sortIndex;return X!==0?X:j.id-G.id}var k=[],R=[],A=1,P=null,N=3,M=!1,H=!1,B=!1;function F(j){for(var G=D(R);G!==null;){if(G.callback===null)E(R);else if(G.startTime<=j)E(R),G.sortIndex=G.expirationTime,L(k,G);else break;G=D(R)}}function $(j){if(B=!1,F(j),!H)if(D(k)!==null)H=!0,e(z);else{var G=D(R);G!==null&&t($,G.startTime-j)}}function z(j,G){H=!1,B&&(B=!1,n()),M=!0;var X=N;try{for(F(G),P=D(k);P!==null&&(!(P.expirationTime>G)||j&&!i.unstable_shouldYield());){var ue=P.callback;if(typeof ue=="function"){P.callback=null,N=P.priorityLevel;var fe=ue(P.expirationTime<=G);G=i.unstable_now(),typeof fe=="function"?P.callback=fe:P===D(k)&&E(k),F(G)}else E(k);P=D(k)}if(P!==null)var pe=!0;else{var be=D(R);be!==null&&t($,be.startTime-G),pe=!1}return pe}finally{P=null,N=X,M=!1}}var K=o;i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(j){j.callback=null},i.unstable_continueExecution=function(){H||M||(H=!0,e(z))},i.unstable_getCurrentPriorityLevel=function(){return N},i.unstable_getFirstCallbackNode=function(){return D(k)},i.unstable_next=function(j){switch(N){case 1:case 2:case 3:var G=3;break;default:G=N}var X=N;N=G;try{return j()}finally{N=X}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=K,i.unstable_runWithPriority=function(j,G){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var X=N;N=j;try{return G()}finally{N=X}},i.unstable_scheduleCallback=function(j,G,X){var ue=i.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0ue?(j.sortIndex=X,L(R,j),D(k)===null&&j===D(R)&&(B?n():B=!0,t($,X-ue))):(j.sortIndex=fe,L(k,j),H||M||(H=!0,e(z))),j},i.unstable_wrapCallback=function(j){var G=N;return function(){var X=N;N=G;try{return j.apply(this,arguments)}finally{N=X}}}})(qde);$L.exports=qde;/** @license React v17.0.2 + */(function(i){var e,t,n,o;if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;i.unstable_now=function(){return r.now()}}else{var s=Date,a=s.now();i.unstable_now=function(){return s.now()-a}}if(typeof window=="undefined"||typeof MessageChannel!="function"){var l=null,c=null,d=function(){if(l!==null)try{var j=i.unstable_now();l(!0,j),l=null}catch(G){throw setTimeout(d,0),G}};e=function(j){l!==null?setTimeout(e,0,j):(l=j,setTimeout(d,0))},t=function(j,G){c=setTimeout(j,G)},n=function(){clearTimeout(c)},i.unstable_shouldYield=function(){return!1},o=i.unstable_forceFrameRate=function(){}}else{var u=window.setTimeout,h=window.clearTimeout;if(typeof console!="undefined"){var f=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof f!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var g=!1,p=null,v=-1,m=5,_=0;i.unstable_shouldYield=function(){return i.unstable_now()>=_},o=function(){},i.unstable_forceFrameRate=function(j){0>j||125>>1,fe=j[ue];if(fe!==void 0&&0I(be,X))Fe!==void 0&&0>I(Fe,be)?(j[ue]=Fe,j[Se]=X,ue=Se):(j[ue]=be,j[pe]=X,ue=pe);else if(Fe!==void 0&&0>I(Fe,X))j[ue]=Fe,j[Se]=X,ue=Se;else break e}}return G}return null}function I(j,G){var X=j.sortIndex-G.sortIndex;return X!==0?X:j.id-G.id}var k=[],R=[],A=1,P=null,N=3,M=!1,H=!1,B=!1;function F(j){for(var G=D(R);G!==null;){if(G.callback===null)E(R);else if(G.startTime<=j)E(R),G.sortIndex=G.expirationTime,L(k,G);else break;G=D(R)}}function $(j){if(B=!1,F(j),!H)if(D(k)!==null)H=!0,e(z);else{var G=D(R);G!==null&&t($,G.startTime-j)}}function z(j,G){H=!1,B&&(B=!1,n()),M=!0;var X=N;try{for(F(G),P=D(k);P!==null&&(!(P.expirationTime>G)||j&&!i.unstable_shouldYield());){var ue=P.callback;if(typeof ue=="function"){P.callback=null,N=P.priorityLevel;var fe=ue(P.expirationTime<=G);G=i.unstable_now(),typeof fe=="function"?P.callback=fe:P===D(k)&&E(k),F(G)}else E(k);P=D(k)}if(P!==null)var pe=!0;else{var be=D(R);be!==null&&t($,be.startTime-G),pe=!1}return pe}finally{P=null,N=X,M=!1}}var K=o;i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(j){j.callback=null},i.unstable_continueExecution=function(){H||M||(H=!0,e(z))},i.unstable_getCurrentPriorityLevel=function(){return N},i.unstable_getFirstCallbackNode=function(){return D(k)},i.unstable_next=function(j){switch(N){case 1:case 2:case 3:var G=3;break;default:G=N}var X=N;N=G;try{return j()}finally{N=X}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=K,i.unstable_runWithPriority=function(j,G){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var X=N;N=j;try{return G()}finally{N=X}},i.unstable_scheduleCallback=function(j,G,X){var ue=i.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0ue?(j.sortIndex=X,L(R,j),D(k)===null&&j===D(R)&&(B?n():B=!0,t($,X-ue))):(j.sortIndex=fe,L(k,j),H||M||(H=!0,e(z))),j},i.unstable_wrapCallback=function(j){var G=N;return function(){var X=N;N=G;try{return j.apply(this,arguments)}finally{N=X}}}})(Gde);$L.exports=Gde;/** @license React v17.0.2 * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var WO=x.exports,ar=Mde,Vs=$L.exports;function Tt(i){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+i,t=1;te}return!1}function gl(i,e,t,n,o,r,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=t,this.propertyName=i,this.type=e,this.sanitizeURL=r,this.removeEmptyString=s}var da={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){da[i]=new gl(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var e=i[0];da[e]=new gl(e,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){da[i]=new gl(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){da[i]=new gl(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){da[i]=new gl(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){da[i]=new gl(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){da[i]=new gl(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){da[i]=new gl(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){da[i]=new gl(i,5,!1,i.toLowerCase(),null,!1,!1)});var hj=/[\-:]([a-z])/g;function fj(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var e=i.replace(hj,fj);da[e]=new gl(e,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var e=i.replace(hj,fj);da[e]=new gl(e,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var e=i.replace(hj,fj);da[e]=new gl(e,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){da[i]=new gl(i,1,!1,i.toLowerCase(),null,!1,!1)});da.xlinkHref=new gl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){da[i]=new gl(i,1,!1,i.toLowerCase(),null,!0,!0)});function gj(i,e,t,n){var o=da.hasOwnProperty(e)?da[e]:null,r=o!==null?o.type===0:n?!1:!(!(2e}return!1}function gl(i,e,t,n,o,r,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=t,this.propertyName=i,this.type=e,this.sanitizeURL=r,this.removeEmptyString=s}var da={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){da[i]=new gl(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var e=i[0];da[e]=new gl(e,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){da[i]=new gl(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){da[i]=new gl(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){da[i]=new gl(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){da[i]=new gl(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){da[i]=new gl(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){da[i]=new gl(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){da[i]=new gl(i,5,!1,i.toLowerCase(),null,!1,!1)});var fj=/[\-:]([a-z])/g;function gj(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var e=i.replace(fj,gj);da[e]=new gl(e,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var e=i.replace(fj,gj);da[e]=new gl(e,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var e=i.replace(fj,gj);da[e]=new gl(e,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){da[i]=new gl(i,1,!1,i.toLowerCase(),null,!1,!1)});da.xlinkHref=new gl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){da[i]=new gl(i,1,!1,i.toLowerCase(),null,!0,!0)});function pj(i,e,t,n){var o=da.hasOwnProperty(e)?da[e]:null,r=o!==null?o.type===0:n?!1:!(!(2a||o[s]!==r[a])return` -`+o[s].replace(" at new "," at ");while(1<=s&&0<=a);break}}}finally{h8=!1,Error.prepareStackTrace=t}return(i=i?i.displayName||i.name:"")?dL(i):""}function HNe(i){switch(i.tag){case 5:return dL(i.type);case 16:return dL("Lazy");case 13:return dL("Suspense");case 19:return dL("SuspenseList");case 0:case 2:case 15:return i=bN(i.type,!1),i;case 11:return i=bN(i.type.render,!1),i;case 22:return i=bN(i.type._render,!1),i;case 1:return i=bN(i.type,!0),i;default:return""}}function ty(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case sm:return"Fragment";case Z_:return"Portal";case zL:return"Profiler";case pj:return"StrictMode";case UL:return"Suspense";case FM:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case vj:return(i.displayName||"Context")+".Consumer";case mj:return(i._context.displayName||"Context")+".Provider";case VO:var e=i.render;return e=e.displayName||e.name||"",i.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case HO:return ty(i.type);case bj:return ty(i._render);case _j:e=i._payload,i=i._init;try{return ty(i(e))}catch{}}return null}function cv(i){switch(typeof i){case"boolean":case"number":case"object":case"string":case"undefined":return i;default:return""}}function Yde(i){var e=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function $Ne(i){var e=Yde(i)?"checked":"value",t=Object.getOwnPropertyDescriptor(i.constructor.prototype,e),n=""+i[e];if(!i.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var o=t.get,r=t.set;return Object.defineProperty(i,e,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,r.call(this,s)}}),Object.defineProperty(i,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){i._valueTracker=null,delete i[e]}}}}function CN(i){i._valueTracker||(i._valueTracker=$Ne(i))}function Zde(i){if(!i)return!1;var e=i._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return i&&(n=Yde(i)?i.checked?"true":"false":i.value),i=n,i!==t?(e.setValue(i),!0):!1}function BM(i){if(i=i||(typeof document!="undefined"?document:void 0),typeof i=="undefined")return null;try{return i.activeElement||i.body}catch{return i.body}}function H7(i,e){var t=e.checked;return ar({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:i._wrapperState.initialChecked})}function bJ(i,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=cv(e.value!=null?e.value:t),i._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Qde(i,e){e=e.checked,e!=null&&gj(i,"checked",e,!1)}function $7(i,e){Qde(i,e);var t=cv(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&i.value===""||i.value!=t)&&(i.value=""+t):i.value!==""+t&&(i.value=""+t);else if(n==="submit"||n==="reset"){i.removeAttribute("value");return}e.hasOwnProperty("value")?z7(i,e.type,t):e.hasOwnProperty("defaultValue")&&z7(i,e.type,cv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(i.defaultChecked=!!e.defaultChecked)}function CJ(i,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+i._wrapperState.initialValue,t||e===i.value||(i.value=e),i.defaultValue=e}t=i.name,t!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,t!==""&&(i.name=t)}function z7(i,e,t){(e!=="number"||BM(i.ownerDocument)!==i)&&(t==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+t&&(i.defaultValue=""+t))}function zNe(i){var e="";return WO.Children.forEach(i,function(t){t!=null&&(e+=t)}),e}function U7(i,e){return i=ar({children:void 0},e),(e=zNe(e.children))&&(i.children=e),i}function ny(i,e,t,n){if(i=i.options,e){e={};for(var o=0;o=t.length))throw Error(Tt(93));t=t[0]}e=t}e==null&&(e=""),t=e}i._wrapperState={initialValue:cv(t)}}function Jde(i,e){var t=cv(e.value),n=cv(e.defaultValue);t!=null&&(t=""+t,t!==i.value&&(i.value=t),e.defaultValue==null&&i.defaultValue!==t&&(i.defaultValue=t)),n!=null&&(i.defaultValue=""+n)}function wJ(i){var e=i.textContent;e===i._wrapperState.initialValue&&e!==""&&e!==null&&(i.value=e)}var K7={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function eue(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function q7(i,e){return i==null||i==="http://www.w3.org/1999/xhtml"?eue(e):i==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var yN,tue=function(i){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(e,t,n,o){MSApp.execUnsafeLocalFunction(function(){return i(e,t,n,o)})}:i}(function(i,e){if(i.namespaceURI!==K7.svg||"innerHTML"in i)i.innerHTML=e;else{for(yN=yN||document.createElement("div"),yN.innerHTML=""+e.valueOf().toString()+"",e=yN.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;e.firstChild;)i.appendChild(e.firstChild)}});function zE(i,e){if(e){var t=i.firstChild;if(t&&t===i.lastChild&&t.nodeType===3){t.nodeValue=e;return}}i.textContent=e}var jL={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},UNe=["Webkit","ms","Moz","O"];Object.keys(jL).forEach(function(i){UNe.forEach(function(e){e=e+i.charAt(0).toUpperCase()+i.substring(1),jL[e]=jL[i]})});function nue(i,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||jL.hasOwnProperty(i)&&jL[i]?(""+e).trim():e+"px"}function iue(i,e){i=i.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,o=nue(t,e[t],n);t==="float"&&(t="cssFloat"),n?i.setProperty(t,o):i[t]=o}}var jNe=ar({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function G7(i,e){if(e){if(jNe[i]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Tt(137,i));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Tt(60));if(!(typeof e.dangerouslySetInnerHTML=="object"&&"__html"in e.dangerouslySetInnerHTML))throw Error(Tt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Tt(62))}}function X7(i,e){if(i.indexOf("-")===-1)return typeof e.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function wj(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Y7=null,iy=null,oy=null;function SJ(i){if(i=pI(i)){if(typeof Y7!="function")throw Error(Tt(280));var e=i.stateNode;e&&(e=qO(e),Y7(i.stateNode,i.type,e))}}function oue(i){iy?oy?oy.push(i):oy=[i]:iy=i}function rue(){if(iy){var i=iy,e=oy;if(oy=iy=null,SJ(i),e)for(i=0;in?0:1<t;t++)e.push(i);return e}function zO(i,e,t){i.pendingLanes|=e;var n=e-1;i.suspendedLanes&=n,i.pingedLanes&=n,i=i.eventTimes,e=31-dv(e),i[e]=t}var dv=Math.clz32?Math.clz32:a2e,r2e=Math.log,s2e=Math.LN2;function a2e(i){return i===0?32:31-(r2e(i)/s2e|0)|0}var l2e=Vs.unstable_UserBlockingPriority,c2e=Vs.unstable_runWithPriority,LR=!0;function d2e(i,e,t,n){Q_||xj();var o=Ij,r=Q_;Q_=!0;try{sue(o,i,e,t,n)}finally{(Q_=r)||Lj()}}function u2e(i,e,t,n){c2e(l2e,Ij.bind(null,i,e,t,n))}function Ij(i,e,t,n){if(LR){var o;if((o=(e&4)===0)&&0<$h.length&&-1=qL),MJ=String.fromCharCode(32),AJ=!1;function Sue(i,e){switch(i){case"keyup":return A2e.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xue(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var bC=!1;function O2e(i,e){switch(i){case"compositionend":return xue(e);case"keypress":return e.which!==32?null:(AJ=!0,MJ);case"textInput":return i=e.data,i===MJ&&AJ?null:i;default:return null}}function F2e(i,e){if(bC)return i==="compositionend"||!Aj&&Sue(i,e)?(i=yue(),ER=Nj=pm=null,bC=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-i};i=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=BJ(t)}}function kue(i,e){return i&&e?i===e?!0:i&&i.nodeType===3?!1:e&&e.nodeType===3?kue(i,e.parentNode):"contains"in i?i.contains(e):i.compareDocumentPosition?!!(i.compareDocumentPosition(e)&16):!1:!1}function VJ(){for(var i=window,e=BM();e instanceof i.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)i=e.contentWindow;else break;e=BM(i.document)}return e}function tB(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e&&(e==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||e==="textarea"||i.contentEditable==="true")}var q2e=tp&&"documentMode"in document&&11>=document.documentMode,CC=null,nB=null,XL=null,iB=!1;function HJ(i,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;iB||CC==null||CC!==BM(n)||(n=CC,"selectionStart"in n&&tB(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),XL&&XE(XL,n)||(XL=n,n=$M(nB,"onSelect"),0wC||(i.current=rB[wC],rB[wC]=null,wC--)}function Er(i,e){wC++,rB[wC]=i.current,i.current=e}var uv={},Oa=Kv(uv),Ul=Kv(!1),V0=uv;function Qy(i,e){var t=i.type.contextTypes;if(!t)return uv;var n=i.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var o={},r;for(r in t)o[r]=e[r];return n&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=e,i.__reactInternalMemoizedMaskedChildContext=o),o}function jl(i){return i=i.childContextTypes,i!=null}function jM(){Xo(Ul),Xo(Oa)}function YJ(i,e,t){if(Oa.current!==uv)throw Error(Tt(168));Er(Oa,e),Er(Ul,t)}function Oue(i,e,t){var n=i.stateNode;if(i=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var o in n)if(!(o in i))throw Error(Tt(108,ty(e)||"Unknown",o));return ar({},t,n)}function kR(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||uv,V0=Oa.current,Er(Oa,i),Er(Ul,Ul.current),!0}function ZJ(i,e,t){var n=i.stateNode;if(!n)throw Error(Tt(169));t?(i=Oue(i,e,V0),n.__reactInternalMemoizedMergedChildContext=i,Xo(Ul),Xo(Oa),Er(Oa,i)):Xo(Ul),Er(Ul,t)}var Oj=null,w0=null,Y2e=Vs.unstable_runWithPriority,Fj=Vs.unstable_scheduleCallback,sB=Vs.unstable_cancelCallback,Z2e=Vs.unstable_shouldYield,QJ=Vs.unstable_requestPaint,aB=Vs.unstable_now,Q2e=Vs.unstable_getCurrentPriorityLevel,GO=Vs.unstable_ImmediatePriority,Fue=Vs.unstable_UserBlockingPriority,Bue=Vs.unstable_NormalPriority,Wue=Vs.unstable_LowPriority,Vue=Vs.unstable_IdlePriority,L8={},J2e=QJ!==void 0?QJ:function(){},hg=null,IR=null,E8=!1,JJ=aB(),Ra=1e4>JJ?aB:function(){return aB()-JJ};function Jy(){switch(Q2e()){case GO:return 99;case Fue:return 98;case Bue:return 97;case Wue:return 96;case Vue:return 95;default:throw Error(Tt(332))}}function Hue(i){switch(i){case 99:return GO;case 98:return Fue;case 97:return Bue;case 96:return Wue;case 95:return Vue;default:throw Error(Tt(332))}}function H0(i,e){return i=Hue(i),Y2e(i,e)}function ZE(i,e,t){return i=Hue(i),Fj(i,e,t)}function Ef(){if(IR!==null){var i=IR;IR=null,sB(i)}$ue()}function $ue(){if(!E8&&hg!==null){E8=!0;var i=0;try{var e=hg;H0(99,function(){for(;iE?(I=D,D=null):I=D.sibling;var k=h(v,D,_[E],y);if(k===null){D===null&&(D=I);break}i&&D&&k.alternate===null&&e(v,D),m=r(k,m,E),L===null?w=k:L.sibling=k,L=k,D=I}if(E===_.length)return t(v,D),w;if(D===null){for(;E<_.length;E++)D=u(v,_[E],y),D!==null&&(m=r(D,m,E),L===null?w=D:L.sibling=D,L=D);return w}for(D=n(v,D);E<_.length;E++)I=f(D,v,E,_[E],y),I!==null&&(i&&I.alternate!==null&&D.delete(I.key===null?E:I.key),m=r(I,m,E),L===null?w=I:L.sibling=I,L=I);return i&&D.forEach(function(R){return e(v,R)}),w}function p(v,m,_,y){var w=sx(_);if(typeof w!="function")throw Error(Tt(150));if(_=w.call(_),_==null)throw Error(Tt(151));for(var L=w=null,D=m,E=m=0,I=null,k=_.next();D!==null&&!k.done;E++,k=_.next()){D.index>E?(I=D,D=null):I=D.sibling;var R=h(v,D,k.value,y);if(R===null){D===null&&(D=I);break}i&&D&&R.alternate===null&&e(v,D),m=r(R,m,E),L===null?w=R:L.sibling=R,L=R,D=I}if(k.done)return t(v,D),w;if(D===null){for(;!k.done;E++,k=_.next())k=u(v,k.value,y),k!==null&&(m=r(k,m,E),L===null?w=k:L.sibling=k,L=k);return w}for(D=n(v,D);!k.done;E++,k=_.next())k=f(D,v,E,k.value,y),k!==null&&(i&&k.alternate!==null&&D.delete(k.key===null?E:k.key),m=r(k,m,E),L===null?w=k:L.sibling=k,L=k);return i&&D.forEach(function(A){return e(v,A)}),w}return function(v,m,_,y){var w=typeof _=="object"&&_!==null&&_.type===sm&&_.key===null;w&&(_=_.props.children);var L=typeof _=="object"&&_!==null;if(L)switch(_.$$typeof){case cL:e:{for(L=_.key,w=m;w!==null;){if(w.key===L){switch(w.tag){case 7:if(_.type===sm){t(v,w.sibling),m=o(w,_.props.children),m.return=v,v=m;break e}break;default:if(w.elementType===_.type){t(v,w.sibling),m=o(w,_.props),m.ref=hx(v,w,_),m.return=v,v=m;break e}}t(v,w);break}else e(v,w);w=w.sibling}_.type===sm?(m=dy(_.props.children,v.mode,y,_.key),m.return=v,v=m):(y=MR(_.type,_.key,_.props,null,v.mode,y),y.ref=hx(v,m,_),y.return=v,v=y)}return s(v);case Z_:e:{for(w=_.key;m!==null;){if(m.key===w)if(m.tag===4&&m.stateNode.containerInfo===_.containerInfo&&m.stateNode.implementation===_.implementation){t(v,m.sibling),m=o(m,_.children||[]),m.return=v,v=m;break e}else{t(v,m);break}else e(v,m);m=m.sibling}m=R8(_,v.mode,y),m.return=v,v=m}return s(v)}if(typeof _=="string"||typeof _=="number")return _=""+_,m!==null&&m.tag===6?(t(v,m.sibling),m=o(m,_),m.return=v,v=m):(t(v,m),m=N8(_,v.mode,y),m.return=v,v=m),s(v);if(xN(_))return g(v,m,_,y);if(sx(_))return p(v,m,_,y);if(L&&LN(v,_),typeof _=="undefined"&&!w)switch(v.tag){case 1:case 22:case 0:case 11:case 15:throw Error(Tt(152,ty(v.type)||"Component"))}return t(v,m)}}var YM=que(!0),Gue=que(!1),mI={},nf=Kv(mI),JE=Kv(mI),eD=Kv(mI);function e0(i){if(i===mI)throw Error(Tt(174));return i}function cB(i,e){switch(Er(eD,e),Er(JE,i),Er(nf,mI),i=e.nodeType,i){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:q7(null,"");break;default:i=i===8?e.parentNode:e,e=i.namespaceURI||null,i=i.tagName,e=q7(e,i)}Xo(nf),Er(nf,e)}function ew(){Xo(nf),Xo(JE),Xo(eD)}function oee(i){e0(eD.current);var e=e0(nf.current),t=q7(e,i.type);e!==t&&(Er(JE,i),Er(nf,t))}function Hj(i){JE.current===i&&(Xo(nf),Xo(JE))}var xr=Kv(0);function ZM(i){for(var e=i;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&64)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Tg=null,vm=null,of=!1;function Xue(i,e){var t=_d(5,null,null,0);t.elementType="DELETED",t.type="DELETED",t.stateNode=e,t.return=i,t.flags=8,i.lastEffect!==null?(i.lastEffect.nextEffect=t,i.lastEffect=t):i.firstEffect=i.lastEffect=t}function ree(i,e){switch(i.tag){case 5:var t=i.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(i.stateNode=e,!0):!1;case 6:return e=i.pendingProps===""||e.nodeType!==3?null:e,e!==null?(i.stateNode=e,!0):!1;case 13:return!1;default:return!1}}function dB(i){if(of){var e=vm;if(e){var t=e;if(!ree(i,e)){if(e=ry(t.nextSibling),!e||!ree(i,e)){i.flags=i.flags&-1025|2,of=!1,Tg=i;return}Xue(Tg,t)}Tg=i,vm=ry(e.firstChild)}else i.flags=i.flags&-1025|2,of=!1,Tg=i}}function see(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Tg=i}function EN(i){if(i!==Tg)return!1;if(!of)return see(i),of=!0,!1;var e=i.type;if(i.tag!==5||e!=="head"&&e!=="body"&&!oB(e,i.memoizedProps))for(e=vm;e;)Xue(i,e),e=ry(e.nextSibling);if(see(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Tt(317));e:{for(i=i.nextSibling,e=0;i;){if(i.nodeType===8){var t=i.data;if(t==="/$"){if(e===0){vm=ry(i.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}i=i.nextSibling}vm=null}}else vm=Tg?ry(i.stateNode.nextSibling):null;return!0}function D8(){vm=Tg=null,of=!1}var ay=[];function $j(){for(var i=0;ir))throw Error(Tt(301));r+=1,Zs=Da=null,e.updateQueue=null,YL.current=oRe,i=t(n,o)}while(ZL)}if(YL.current=nA,e=Da!==null&&Da.next!==null,tD=0,Zs=Da=zr=null,QM=!1,e)throw Error(Tt(300));return i}function t0(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zs===null?zr.memoizedState=Zs=i:Zs=Zs.next=i,Zs}function Ab(){if(Da===null){var i=zr.alternate;i=i!==null?i.memoizedState:null}else i=Da.next;var e=Zs===null?zr.memoizedState:Zs.next;if(e!==null)Zs=e,Da=i;else{if(i===null)throw Error(Tt(310));Da=i,i={memoizedState:Da.memoizedState,baseState:Da.baseState,baseQueue:Da.baseQueue,queue:Da.queue,next:null},Zs===null?zr.memoizedState=Zs=i:Zs=Zs.next=i}return Zs}function zh(i,e){return typeof e=="function"?e(i):e}function fx(i){var e=Ab(),t=e.queue;if(t===null)throw Error(Tt(311));t.lastRenderedReducer=i;var n=Da,o=n.baseQueue,r=t.pending;if(r!==null){if(o!==null){var s=o.next;o.next=r.next,r.next=s}n.baseQueue=o=r,t.pending=null}if(o!==null){o=o.next,n=n.baseState;var a=s=r=null,l=o;do{var c=l.lane;if((tD&c)===c)a!==null&&(a=a.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),n=l.eagerReducer===i?l.eagerState:i(n,l.action);else{var d={lane:c,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};a===null?(s=a=d,r=n):a=a.next=d,zr.lanes|=c,vI|=c}l=l.next}while(l!==null&&l!==o);a===null?r=n:a.next=s,vd(n,e.memoizedState)||(Iu=!0),e.memoizedState=n,e.baseState=r,e.baseQueue=a,t.lastRenderedState=n}return[e.memoizedState,t.dispatch]}function gx(i){var e=Ab(),t=e.queue;if(t===null)throw Error(Tt(311));t.lastRenderedReducer=i;var n=t.dispatch,o=t.pending,r=e.memoizedState;if(o!==null){t.pending=null;var s=o=o.next;do r=i(r,s.action),s=s.next;while(s!==o);vd(r,e.memoizedState)||(Iu=!0),e.memoizedState=r,e.baseQueue===null&&(e.baseState=r),t.lastRenderedState=r}return[r,n]}function aee(i,e,t){var n=e._getVersion;n=n(e._source);var o=e._workInProgressVersionPrimary;if(o!==null?i=o===n:(i=i.mutableReadLanes,(i=(tD&i)===i)&&(e._workInProgressVersionPrimary=n,ay.push(e))),i)return t(e._source);throw ay.push(e),Error(Tt(350))}function Yue(i,e,t,n){var o=sl;if(o===null)throw Error(Tt(349));var r=e._getVersion,s=r(e._source),a=YL.current,l=a.useState(function(){return aee(o,e,t)}),c=l[1],d=l[0];l=Zs;var u=i.memoizedState,h=u.refs,f=h.getSnapshot,g=u.source;u=u.subscribe;var p=zr;return i.memoizedState={refs:h,source:e,subscribe:n},a.useEffect(function(){h.getSnapshot=t,h.setSnapshot=c;var v=r(e._source);if(!vd(s,v)){v=t(e._source),vd(d,v)||(c(v),v=Vm(p),o.mutableReadLanes|=v&o.pendingLanes),v=o.mutableReadLanes,o.entangledLanes|=v;for(var m=o.entanglements,_=v;0<_;){var y=31-dv(_),w=1<t?98:t,function(){i(!0)}),H0(97<\/script>",i=i.removeChild(i.firstChild)):typeof n.is=="string"?i=s.createElement(t,{is:n.is}):(i=s.createElement(t),t==="select"&&(s=i,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):i=s.createElementNS(i,t),i[mm]=e,i[UM]=n,rhe(i,e,!1,!1),e.stateNode=i,s=X7(t,n),t){case"dialog":Ko("cancel",i),Ko("close",i),o=n;break;case"iframe":case"object":case"embed":Ko("load",i),o=n;break;case"video":case"audio":for(o=0;oCB&&(e.flags|=64,r=!0,mx(n,!1),e.lanes=33554432)}else{if(!r)if(i=ZM(s),i!==null){if(e.flags|=64,r=!0,t=i.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),mx(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!of)return e=e.lastEffect=n.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Ra()-n.renderingStartTime>CB&&t!==1073741824&&(e.flags|=64,r=!0,mx(n,!1),e.lanes=33554432);n.isBackwards?(s.sibling=e.child,e.child=s):(t=n.last,t!==null?t.sibling=s:e.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.lastEffect=e.lastEffect,n.renderingStartTime=Ra(),t.sibling=null,e=xr.current,Er(xr,r?e&1|2:e&1),t):null;case 23:case 24:return Qj(),i!==null&&i.memoizedState!==null!=(e.memoizedState!==null)&&n.mode!=="unstable-defer-without-hiding"&&(e.flags|=4),null}throw Error(Tt(156,e.tag))}function aRe(i){switch(i.tag){case 1:jl(i.type)&&jM();var e=i.flags;return e&4096?(i.flags=e&-4097|64,i):null;case 3:if(ew(),Xo(Ul),Xo(Oa),$j(),e=i.flags,(e&64)!==0)throw Error(Tt(285));return i.flags=e&-4097|64,i;case 5:return Hj(i),null;case 13:return Xo(xr),e=i.flags,e&4096?(i.flags=e&-4097|64,i):null;case 19:return Xo(xr),null;case 4:return ew(),null;case 10:return Wj(i),null;case 23:case 24:return Qj(),null;default:return null}}function Gj(i,e){try{var t="",n=e;do t+=HNe(n),n=n.return;while(n);var o=t}catch(r){o=` +`+o[s].replace(" at new "," at ");while(1<=s&&0<=a);break}}}finally{f8=!1,Error.prepareStackTrace=t}return(i=i?i.displayName||i.name:"")?dL(i):""}function HNe(i){switch(i.tag){case 5:return dL(i.type);case 16:return dL("Lazy");case 13:return dL("Suspense");case 19:return dL("SuspenseList");case 0:case 2:case 15:return i=bN(i.type,!1),i;case 11:return i=bN(i.type.render,!1),i;case 22:return i=bN(i.type._render,!1),i;case 1:return i=bN(i.type,!0),i;default:return""}}function ty(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case am:return"Fragment";case Z_:return"Portal";case zL:return"Profiler";case mj:return"StrictMode";case UL:return"Suspense";case FM:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case _j:return(i.displayName||"Context")+".Consumer";case vj:return(i._context.displayName||"Context")+".Provider";case VO:var e=i.render;return e=e.displayName||e.name||"",i.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case HO:return ty(i.type);case Cj:return ty(i._render);case bj:e=i._payload,i=i._init;try{return ty(i(e))}catch{}}return null}function dv(i){switch(typeof i){case"boolean":case"number":case"object":case"string":case"undefined":return i;default:return""}}function Zde(i){var e=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function $Ne(i){var e=Zde(i)?"checked":"value",t=Object.getOwnPropertyDescriptor(i.constructor.prototype,e),n=""+i[e];if(!i.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var o=t.get,r=t.set;return Object.defineProperty(i,e,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,r.call(this,s)}}),Object.defineProperty(i,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){i._valueTracker=null,delete i[e]}}}}function CN(i){i._valueTracker||(i._valueTracker=$Ne(i))}function Qde(i){if(!i)return!1;var e=i._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return i&&(n=Zde(i)?i.checked?"true":"false":i.value),i=n,i!==t?(e.setValue(i),!0):!1}function BM(i){if(i=i||(typeof document!="undefined"?document:void 0),typeof i=="undefined")return null;try{return i.activeElement||i.body}catch{return i.body}}function $7(i,e){var t=e.checked;return ar({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:i._wrapperState.initialChecked})}function CJ(i,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=dv(e.value!=null?e.value:t),i._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Jde(i,e){e=e.checked,e!=null&&pj(i,"checked",e,!1)}function z7(i,e){Jde(i,e);var t=dv(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&i.value===""||i.value!=t)&&(i.value=""+t):i.value!==""+t&&(i.value=""+t);else if(n==="submit"||n==="reset"){i.removeAttribute("value");return}e.hasOwnProperty("value")?U7(i,e.type,t):e.hasOwnProperty("defaultValue")&&U7(i,e.type,dv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(i.defaultChecked=!!e.defaultChecked)}function yJ(i,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+i._wrapperState.initialValue,t||e===i.value||(i.value=e),i.defaultValue=e}t=i.name,t!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,t!==""&&(i.name=t)}function U7(i,e,t){(e!=="number"||BM(i.ownerDocument)!==i)&&(t==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+t&&(i.defaultValue=""+t))}function zNe(i){var e="";return WO.Children.forEach(i,function(t){t!=null&&(e+=t)}),e}function j7(i,e){return i=ar({children:void 0},e),(e=zNe(e.children))&&(i.children=e),i}function ny(i,e,t,n){if(i=i.options,e){e={};for(var o=0;o=t.length))throw Error(Tt(93));t=t[0]}e=t}e==null&&(e=""),t=e}i._wrapperState={initialValue:dv(t)}}function eue(i,e){var t=dv(e.value),n=dv(e.defaultValue);t!=null&&(t=""+t,t!==i.value&&(i.value=t),e.defaultValue==null&&i.defaultValue!==t&&(i.defaultValue=t)),n!=null&&(i.defaultValue=""+n)}function SJ(i){var e=i.textContent;e===i._wrapperState.initialValue&&e!==""&&e!==null&&(i.value=e)}var q7={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function tue(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function G7(i,e){return i==null||i==="http://www.w3.org/1999/xhtml"?tue(e):i==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var yN,nue=function(i){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(e,t,n,o){MSApp.execUnsafeLocalFunction(function(){return i(e,t,n,o)})}:i}(function(i,e){if(i.namespaceURI!==q7.svg||"innerHTML"in i)i.innerHTML=e;else{for(yN=yN||document.createElement("div"),yN.innerHTML=""+e.valueOf().toString()+"",e=yN.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;e.firstChild;)i.appendChild(e.firstChild)}});function zE(i,e){if(e){var t=i.firstChild;if(t&&t===i.lastChild&&t.nodeType===3){t.nodeValue=e;return}}i.textContent=e}var jL={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},UNe=["Webkit","ms","Moz","O"];Object.keys(jL).forEach(function(i){UNe.forEach(function(e){e=e+i.charAt(0).toUpperCase()+i.substring(1),jL[e]=jL[i]})});function iue(i,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||jL.hasOwnProperty(i)&&jL[i]?(""+e).trim():e+"px"}function oue(i,e){i=i.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,o=iue(t,e[t],n);t==="float"&&(t="cssFloat"),n?i.setProperty(t,o):i[t]=o}}var jNe=ar({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function X7(i,e){if(e){if(jNe[i]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Tt(137,i));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Tt(60));if(!(typeof e.dangerouslySetInnerHTML=="object"&&"__html"in e.dangerouslySetInnerHTML))throw Error(Tt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Tt(62))}}function Y7(i,e){if(i.indexOf("-")===-1)return typeof e.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Sj(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Z7=null,iy=null,oy=null;function xJ(i){if(i=pI(i)){if(typeof Z7!="function")throw Error(Tt(280));var e=i.stateNode;e&&(e=qO(e),Z7(i.stateNode,i.type,e))}}function rue(i){iy?oy?oy.push(i):oy=[i]:iy=i}function sue(){if(iy){var i=iy,e=oy;if(oy=iy=null,xJ(i),e)for(i=0;in?0:1<t;t++)e.push(i);return e}function zO(i,e,t){i.pendingLanes|=e;var n=e-1;i.suspendedLanes&=n,i.pingedLanes&=n,i=i.eventTimes,e=31-uv(e),i[e]=t}var uv=Math.clz32?Math.clz32:a2e,r2e=Math.log,s2e=Math.LN2;function a2e(i){return i===0?32:31-(r2e(i)/s2e|0)|0}var l2e=Vs.unstable_UserBlockingPriority,c2e=Vs.unstable_runWithPriority,LR=!0;function d2e(i,e,t,n){Q_||Lj();var o=Tj,r=Q_;Q_=!0;try{aue(o,i,e,t,n)}finally{(Q_=r)||Ej()}}function u2e(i,e,t,n){c2e(l2e,Tj.bind(null,i,e,t,n))}function Tj(i,e,t,n){if(LR){var o;if((o=(e&4)===0)&&0<$h.length&&-1=qL),AJ=String.fromCharCode(32),PJ=!1;function xue(i,e){switch(i){case"keyup":return A2e.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lue(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var bC=!1;function O2e(i,e){switch(i){case"compositionend":return Lue(e);case"keypress":return e.which!==32?null:(PJ=!0,AJ);case"textInput":return i=e.data,i===AJ&&PJ?null:i;default:return null}}function F2e(i,e){if(bC)return i==="compositionend"||!Pj&&xue(i,e)?(i=wue(),ER=Rj=mm=null,bC=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-i};i=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=WJ(t)}}function Iue(i,e){return i&&e?i===e?!0:i&&i.nodeType===3?!1:e&&e.nodeType===3?Iue(i,e.parentNode):"contains"in i?i.contains(e):i.compareDocumentPosition?!!(i.compareDocumentPosition(e)&16):!1:!1}function HJ(){for(var i=window,e=BM();e instanceof i.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)i=e.contentWindow;else break;e=BM(i.document)}return e}function nB(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e&&(e==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||e==="textarea"||i.contentEditable==="true")}var q2e=tp&&"documentMode"in document&&11>=document.documentMode,CC=null,iB=null,XL=null,oB=!1;function $J(i,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;oB||CC==null||CC!==BM(n)||(n=CC,"selectionStart"in n&&nB(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),XL&&XE(XL,n)||(XL=n,n=$M(iB,"onSelect"),0wC||(i.current=sB[wC],sB[wC]=null,wC--)}function Er(i,e){wC++,sB[wC]=i.current,i.current=e}var hv={},Oa=Kv(hv),Ul=Kv(!1),V0=hv;function Qy(i,e){var t=i.type.contextTypes;if(!t)return hv;var n=i.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var o={},r;for(r in t)o[r]=e[r];return n&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=e,i.__reactInternalMemoizedMaskedChildContext=o),o}function jl(i){return i=i.childContextTypes,i!=null}function jM(){Xo(Ul),Xo(Oa)}function ZJ(i,e,t){if(Oa.current!==hv)throw Error(Tt(168));Er(Oa,e),Er(Ul,t)}function Fue(i,e,t){var n=i.stateNode;if(i=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var o in n)if(!(o in i))throw Error(Tt(108,ty(e)||"Unknown",o));return ar({},t,n)}function kR(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||hv,V0=Oa.current,Er(Oa,i),Er(Ul,Ul.current),!0}function QJ(i,e,t){var n=i.stateNode;if(!n)throw Error(Tt(169));t?(i=Fue(i,e,V0),n.__reactInternalMemoizedMergedChildContext=i,Xo(Ul),Xo(Oa),Er(Oa,i)):Xo(Ul),Er(Ul,t)}var Fj=null,w0=null,Y2e=Vs.unstable_runWithPriority,Bj=Vs.unstable_scheduleCallback,aB=Vs.unstable_cancelCallback,Z2e=Vs.unstable_shouldYield,JJ=Vs.unstable_requestPaint,lB=Vs.unstable_now,Q2e=Vs.unstable_getCurrentPriorityLevel,GO=Vs.unstable_ImmediatePriority,Bue=Vs.unstable_UserBlockingPriority,Wue=Vs.unstable_NormalPriority,Vue=Vs.unstable_LowPriority,Hue=Vs.unstable_IdlePriority,E8={},J2e=JJ!==void 0?JJ:function(){},hg=null,IR=null,D8=!1,eee=lB(),Ra=1e4>eee?lB:function(){return lB()-eee};function Jy(){switch(Q2e()){case GO:return 99;case Bue:return 98;case Wue:return 97;case Vue:return 96;case Hue:return 95;default:throw Error(Tt(332))}}function $ue(i){switch(i){case 99:return GO;case 98:return Bue;case 97:return Wue;case 96:return Vue;case 95:return Hue;default:throw Error(Tt(332))}}function H0(i,e){return i=$ue(i),Y2e(i,e)}function ZE(i,e,t){return i=$ue(i),Bj(i,e,t)}function Ef(){if(IR!==null){var i=IR;IR=null,aB(i)}zue()}function zue(){if(!D8&&hg!==null){D8=!0;var i=0;try{var e=hg;H0(99,function(){for(;iE?(I=D,D=null):I=D.sibling;var k=h(v,D,_[E],y);if(k===null){D===null&&(D=I);break}i&&D&&k.alternate===null&&e(v,D),m=r(k,m,E),L===null?w=k:L.sibling=k,L=k,D=I}if(E===_.length)return t(v,D),w;if(D===null){for(;E<_.length;E++)D=u(v,_[E],y),D!==null&&(m=r(D,m,E),L===null?w=D:L.sibling=D,L=D);return w}for(D=n(v,D);E<_.length;E++)I=f(D,v,E,_[E],y),I!==null&&(i&&I.alternate!==null&&D.delete(I.key===null?E:I.key),m=r(I,m,E),L===null?w=I:L.sibling=I,L=I);return i&&D.forEach(function(R){return e(v,R)}),w}function p(v,m,_,y){var w=sx(_);if(typeof w!="function")throw Error(Tt(150));if(_=w.call(_),_==null)throw Error(Tt(151));for(var L=w=null,D=m,E=m=0,I=null,k=_.next();D!==null&&!k.done;E++,k=_.next()){D.index>E?(I=D,D=null):I=D.sibling;var R=h(v,D,k.value,y);if(R===null){D===null&&(D=I);break}i&&D&&R.alternate===null&&e(v,D),m=r(R,m,E),L===null?w=R:L.sibling=R,L=R,D=I}if(k.done)return t(v,D),w;if(D===null){for(;!k.done;E++,k=_.next())k=u(v,k.value,y),k!==null&&(m=r(k,m,E),L===null?w=k:L.sibling=k,L=k);return w}for(D=n(v,D);!k.done;E++,k=_.next())k=f(D,v,E,k.value,y),k!==null&&(i&&k.alternate!==null&&D.delete(k.key===null?E:k.key),m=r(k,m,E),L===null?w=k:L.sibling=k,L=k);return i&&D.forEach(function(A){return e(v,A)}),w}return function(v,m,_,y){var w=typeof _=="object"&&_!==null&&_.type===am&&_.key===null;w&&(_=_.props.children);var L=typeof _=="object"&&_!==null;if(L)switch(_.$$typeof){case cL:e:{for(L=_.key,w=m;w!==null;){if(w.key===L){switch(w.tag){case 7:if(_.type===am){t(v,w.sibling),m=o(w,_.props.children),m.return=v,v=m;break e}break;default:if(w.elementType===_.type){t(v,w.sibling),m=o(w,_.props),m.ref=hx(v,w,_),m.return=v,v=m;break e}}t(v,w);break}else e(v,w);w=w.sibling}_.type===am?(m=dy(_.props.children,v.mode,y,_.key),m.return=v,v=m):(y=MR(_.type,_.key,_.props,null,v.mode,y),y.ref=hx(v,m,_),y.return=v,v=y)}return s(v);case Z_:e:{for(w=_.key;m!==null;){if(m.key===w)if(m.tag===4&&m.stateNode.containerInfo===_.containerInfo&&m.stateNode.implementation===_.implementation){t(v,m.sibling),m=o(m,_.children||[]),m.return=v,v=m;break e}else{t(v,m);break}else e(v,m);m=m.sibling}m=M8(_,v.mode,y),m.return=v,v=m}return s(v)}if(typeof _=="string"||typeof _=="number")return _=""+_,m!==null&&m.tag===6?(t(v,m.sibling),m=o(m,_),m.return=v,v=m):(t(v,m),m=R8(_,v.mode,y),m.return=v,v=m),s(v);if(xN(_))return g(v,m,_,y);if(sx(_))return p(v,m,_,y);if(L&&LN(v,_),typeof _=="undefined"&&!w)switch(v.tag){case 1:case 22:case 0:case 11:case 15:throw Error(Tt(152,ty(v.type)||"Component"))}return t(v,m)}}var YM=Gue(!0),Xue=Gue(!1),mI={},nf=Kv(mI),JE=Kv(mI),eD=Kv(mI);function e0(i){if(i===mI)throw Error(Tt(174));return i}function dB(i,e){switch(Er(eD,e),Er(JE,i),Er(nf,mI),i=e.nodeType,i){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:G7(null,"");break;default:i=i===8?e.parentNode:e,e=i.namespaceURI||null,i=i.tagName,e=G7(e,i)}Xo(nf),Er(nf,e)}function ew(){Xo(nf),Xo(JE),Xo(eD)}function ree(i){e0(eD.current);var e=e0(nf.current),t=G7(e,i.type);e!==t&&(Er(JE,i),Er(nf,t))}function $j(i){JE.current===i&&(Xo(nf),Xo(JE))}var xr=Kv(0);function ZM(i){for(var e=i;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&64)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Tg=null,_m=null,of=!1;function Yue(i,e){var t=_d(5,null,null,0);t.elementType="DELETED",t.type="DELETED",t.stateNode=e,t.return=i,t.flags=8,i.lastEffect!==null?(i.lastEffect.nextEffect=t,i.lastEffect=t):i.firstEffect=i.lastEffect=t}function see(i,e){switch(i.tag){case 5:var t=i.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(i.stateNode=e,!0):!1;case 6:return e=i.pendingProps===""||e.nodeType!==3?null:e,e!==null?(i.stateNode=e,!0):!1;case 13:return!1;default:return!1}}function uB(i){if(of){var e=_m;if(e){var t=e;if(!see(i,e)){if(e=ry(t.nextSibling),!e||!see(i,e)){i.flags=i.flags&-1025|2,of=!1,Tg=i;return}Yue(Tg,t)}Tg=i,_m=ry(e.firstChild)}else i.flags=i.flags&-1025|2,of=!1,Tg=i}}function aee(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Tg=i}function EN(i){if(i!==Tg)return!1;if(!of)return aee(i),of=!0,!1;var e=i.type;if(i.tag!==5||e!=="head"&&e!=="body"&&!rB(e,i.memoizedProps))for(e=_m;e;)Yue(i,e),e=ry(e.nextSibling);if(aee(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Tt(317));e:{for(i=i.nextSibling,e=0;i;){if(i.nodeType===8){var t=i.data;if(t==="/$"){if(e===0){_m=ry(i.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}i=i.nextSibling}_m=null}}else _m=Tg?ry(i.stateNode.nextSibling):null;return!0}function k8(){_m=Tg=null,of=!1}var ay=[];function zj(){for(var i=0;ir))throw Error(Tt(301));r+=1,Zs=Da=null,e.updateQueue=null,YL.current=oRe,i=t(n,o)}while(ZL)}if(YL.current=nA,e=Da!==null&&Da.next!==null,tD=0,Zs=Da=zr=null,QM=!1,e)throw Error(Tt(300));return i}function t0(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zs===null?zr.memoizedState=Zs=i:Zs=Zs.next=i,Zs}function Ab(){if(Da===null){var i=zr.alternate;i=i!==null?i.memoizedState:null}else i=Da.next;var e=Zs===null?zr.memoizedState:Zs.next;if(e!==null)Zs=e,Da=i;else{if(i===null)throw Error(Tt(310));Da=i,i={memoizedState:Da.memoizedState,baseState:Da.baseState,baseQueue:Da.baseQueue,queue:Da.queue,next:null},Zs===null?zr.memoizedState=Zs=i:Zs=Zs.next=i}return Zs}function zh(i,e){return typeof e=="function"?e(i):e}function fx(i){var e=Ab(),t=e.queue;if(t===null)throw Error(Tt(311));t.lastRenderedReducer=i;var n=Da,o=n.baseQueue,r=t.pending;if(r!==null){if(o!==null){var s=o.next;o.next=r.next,r.next=s}n.baseQueue=o=r,t.pending=null}if(o!==null){o=o.next,n=n.baseState;var a=s=r=null,l=o;do{var c=l.lane;if((tD&c)===c)a!==null&&(a=a.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),n=l.eagerReducer===i?l.eagerState:i(n,l.action);else{var d={lane:c,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};a===null?(s=a=d,r=n):a=a.next=d,zr.lanes|=c,vI|=c}l=l.next}while(l!==null&&l!==o);a===null?r=n:a.next=s,vd(n,e.memoizedState)||(Iu=!0),e.memoizedState=n,e.baseState=r,e.baseQueue=a,t.lastRenderedState=n}return[e.memoizedState,t.dispatch]}function gx(i){var e=Ab(),t=e.queue;if(t===null)throw Error(Tt(311));t.lastRenderedReducer=i;var n=t.dispatch,o=t.pending,r=e.memoizedState;if(o!==null){t.pending=null;var s=o=o.next;do r=i(r,s.action),s=s.next;while(s!==o);vd(r,e.memoizedState)||(Iu=!0),e.memoizedState=r,e.baseQueue===null&&(e.baseState=r),t.lastRenderedState=r}return[r,n]}function lee(i,e,t){var n=e._getVersion;n=n(e._source);var o=e._workInProgressVersionPrimary;if(o!==null?i=o===n:(i=i.mutableReadLanes,(i=(tD&i)===i)&&(e._workInProgressVersionPrimary=n,ay.push(e))),i)return t(e._source);throw ay.push(e),Error(Tt(350))}function Zue(i,e,t,n){var o=sl;if(o===null)throw Error(Tt(349));var r=e._getVersion,s=r(e._source),a=YL.current,l=a.useState(function(){return lee(o,e,t)}),c=l[1],d=l[0];l=Zs;var u=i.memoizedState,h=u.refs,f=h.getSnapshot,g=u.source;u=u.subscribe;var p=zr;return i.memoizedState={refs:h,source:e,subscribe:n},a.useEffect(function(){h.getSnapshot=t,h.setSnapshot=c;var v=r(e._source);if(!vd(s,v)){v=t(e._source),vd(d,v)||(c(v),v=Hm(p),o.mutableReadLanes|=v&o.pendingLanes),v=o.mutableReadLanes,o.entangledLanes|=v;for(var m=o.entanglements,_=v;0<_;){var y=31-uv(_),w=1<t?98:t,function(){i(!0)}),H0(97<\/script>",i=i.removeChild(i.firstChild)):typeof n.is=="string"?i=s.createElement(t,{is:n.is}):(i=s.createElement(t),t==="select"&&(s=i,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):i=s.createElementNS(i,t),i[vm]=e,i[UM]=n,she(i,e,!1,!1),e.stateNode=i,s=Y7(t,n),t){case"dialog":Ko("cancel",i),Ko("close",i),o=n;break;case"iframe":case"object":case"embed":Ko("load",i),o=n;break;case"video":case"audio":for(o=0;oyB&&(e.flags|=64,r=!0,mx(n,!1),e.lanes=33554432)}else{if(!r)if(i=ZM(s),i!==null){if(e.flags|=64,r=!0,t=i.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),mx(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!of)return e=e.lastEffect=n.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Ra()-n.renderingStartTime>yB&&t!==1073741824&&(e.flags|=64,r=!0,mx(n,!1),e.lanes=33554432);n.isBackwards?(s.sibling=e.child,e.child=s):(t=n.last,t!==null?t.sibling=s:e.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.lastEffect=e.lastEffect,n.renderingStartTime=Ra(),t.sibling=null,e=xr.current,Er(xr,r?e&1|2:e&1),t):null;case 23:case 24:return Jj(),i!==null&&i.memoizedState!==null!=(e.memoizedState!==null)&&n.mode!=="unstable-defer-without-hiding"&&(e.flags|=4),null}throw Error(Tt(156,e.tag))}function aRe(i){switch(i.tag){case 1:jl(i.type)&&jM();var e=i.flags;return e&4096?(i.flags=e&-4097|64,i):null;case 3:if(ew(),Xo(Ul),Xo(Oa),zj(),e=i.flags,(e&64)!==0)throw Error(Tt(285));return i.flags=e&-4097|64,i;case 5:return $j(i),null;case 13:return Xo(xr),e=i.flags,e&4096?(i.flags=e&-4097|64,i):null;case 19:return Xo(xr),null;case 4:return ew(),null;case 10:return Vj(i),null;case 23:case 24:return Jj(),null;default:return null}}function Xj(i,e){try{var t="",n=e;do t+=HNe(n),n=n.return;while(n);var o=t}catch(r){o=` Error generating stack: `+r.message+` -`+r.stack}return{value:i,source:e,stack:o}}function pB(i,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var lRe=typeof WeakMap=="function"?WeakMap:Map;function lhe(i,e,t){t=Bm(-1,t),t.tag=3,t.payload={element:null};var n=e.value;return t.callback=function(){oA||(oA=!0,yB=n),pB(i,e)},t}function che(i,e,t){t=Bm(-1,t),t.tag=3;var n=i.type.getDerivedStateFromError;if(typeof n=="function"){var o=e.value;t.payload=function(){return pB(i,e),n(o)}}var r=i.stateNode;return r!==null&&typeof r.componentDidCatch=="function"&&(t.callback=function(){typeof n!="function"&&(Uh===null?Uh=new Set([this]):Uh.add(this),pB(i,e));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),t}var cRe=typeof WeakSet=="function"?WeakSet:Set;function Cee(i){var e=i.ref;if(e!==null)if(typeof e=="function")try{e(null)}catch(t){$m(i,t)}else e.current=null}function dRe(i,e){switch(e.tag){case 0:case 11:case 15:case 22:return;case 1:if(e.flags&256&&i!==null){var t=i.memoizedProps,n=i.memoizedState;i=e.stateNode,e=i.getSnapshotBeforeUpdate(e.elementType===e.type?t:du(e.type,t),n),i.__reactInternalSnapshotBeforeUpdate=e}return;case 3:e.flags&256&&Pj(e.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(Tt(163))}function uRe(i,e,t){switch(t.tag){case 0:case 11:case 15:case 22:if(e=t.updateQueue,e=e!==null?e.lastEffect:null,e!==null){i=e=e.next;do{if((i.tag&3)===3){var n=i.create;i.destroy=n()}i=i.next}while(i!==e)}if(e=t.updateQueue,e=e!==null?e.lastEffect:null,e!==null){i=e=e.next;do{var o=i;n=o.next,o=o.tag,(o&4)!==0&&(o&1)!==0&&(_he(t,i),bRe(t,i)),i=n}while(i!==e)}return;case 1:i=t.stateNode,t.flags&4&&(e===null?i.componentDidMount():(n=t.elementType===t.type?e.memoizedProps:du(t.type,e.memoizedProps),i.componentDidUpdate(n,e.memoizedState,i.__reactInternalSnapshotBeforeUpdate))),e=t.updateQueue,e!==null&&tee(t,e,i);return;case 3:if(e=t.updateQueue,e!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}tee(t,e,i)}return;case 5:i=t.stateNode,e===null&&t.flags&4&&Aue(t.type,t.memoizedProps)&&i.focus();return;case 6:return;case 4:return;case 12:return;case 13:t.memoizedState===null&&(t=t.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&fue(t))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(Tt(163))}function yee(i,e){for(var t=i;;){if(t.tag===5){var n=t.stateNode;if(e)n=n.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none";else{n=t.stateNode;var o=t.memoizedProps.style;o=o!=null&&o.hasOwnProperty("display")?o.display:null,n.style.display=nue("display",o)}}else if(t.tag===6)t.stateNode.nodeValue=e?"":t.memoizedProps;else if((t.tag!==23&&t.tag!==24||t.memoizedState===null||t===i)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break;for(;t.sibling===null;){if(t.return===null||t.return===i)return;t=t.return}t.sibling.return=t.return,t=t.sibling}}function wee(i,e){if(w0&&typeof w0.onCommitFiberUnmount=="function")try{w0.onCommitFiberUnmount(Oj,e)}catch{}switch(e.tag){case 0:case 11:case 14:case 15:case 22:if(i=e.updateQueue,i!==null&&(i=i.lastEffect,i!==null)){var t=i=i.next;do{var n=t,o=n.destroy;if(n=n.tag,o!==void 0)if((n&4)!==0)_he(e,t);else{n=e;try{o()}catch(r){$m(n,r)}}t=t.next}while(t!==i)}break;case 1:if(Cee(e),i=e.stateNode,typeof i.componentWillUnmount=="function")try{i.props=e.memoizedProps,i.state=e.memoizedState,i.componentWillUnmount()}catch(r){$m(e,r)}break;case 5:Cee(e);break;case 4:dhe(i,e)}}function See(i){i.alternate=null,i.child=null,i.dependencies=null,i.firstEffect=null,i.lastEffect=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.return=null,i.updateQueue=null}function xee(i){return i.tag===5||i.tag===3||i.tag===4}function Lee(i){e:{for(var e=i.return;e!==null;){if(xee(e))break e;e=e.return}throw Error(Tt(160))}var t=e;switch(e=t.stateNode,t.tag){case 5:var n=!1;break;case 3:e=e.containerInfo,n=!0;break;case 4:e=e.containerInfo,n=!0;break;default:throw Error(Tt(161))}t.flags&16&&(zE(e,""),t.flags&=-17);e:t:for(t=i;;){for(;t.sibling===null;){if(t.return===null||xee(t.return)){t=null;break e}t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2)){t=t.stateNode;break e}}n?mB(i,t,e):vB(i,t,e)}function mB(i,e,t){var n=i.tag,o=n===5||n===6;if(o)i=o?i.stateNode:i.stateNode.instance,e?t.nodeType===8?t.parentNode.insertBefore(i,e):t.insertBefore(i,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(i,t)):(e=t,e.appendChild(i)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=zM));else if(n!==4&&(i=i.child,i!==null))for(mB(i,e,t),i=i.sibling;i!==null;)mB(i,e,t),i=i.sibling}function vB(i,e,t){var n=i.tag,o=n===5||n===6;if(o)i=o?i.stateNode:i.stateNode.instance,e?t.insertBefore(i,e):t.appendChild(i);else if(n!==4&&(i=i.child,i!==null))for(vB(i,e,t),i=i.sibling;i!==null;)vB(i,e,t),i=i.sibling}function dhe(i,e){for(var t=e,n=!1,o,r;;){if(!n){n=t.return;e:for(;;){if(n===null)throw Error(Tt(160));switch(o=n.stateNode,n.tag){case 5:r=!1;break e;case 3:o=o.containerInfo,r=!0;break e;case 4:o=o.containerInfo,r=!0;break e}n=n.return}n=!0}if(t.tag===5||t.tag===6){e:for(var s=i,a=t,l=a;;)if(wee(s,l),l.child!==null&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}r?(s=o,a=t.stateNode,s.nodeType===8?s.parentNode.removeChild(a):s.removeChild(a)):o.removeChild(t.stateNode)}else if(t.tag===4){if(t.child!==null){o=t.stateNode.containerInfo,r=!0,t.child.return=t,t=t.child;continue}}else if(wee(i,t),t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return,t.tag===4&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function T8(i,e){switch(e.tag){case 0:case 11:case 14:case 15:case 22:var t=e.updateQueue;if(t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do(n.tag&3)===3&&(i=n.destroy,n.destroy=void 0,i!==void 0&&i()),n=n.next;while(n!==t)}return;case 1:return;case 5:if(t=e.stateNode,t!=null){n=e.memoizedProps;var o=i!==null?i.memoizedProps:n;i=e.type;var r=e.updateQueue;if(e.updateQueue=null,r!==null){for(t[UM]=n,i==="input"&&n.type==="radio"&&n.name!=null&&Qde(t,n),X7(i,o),e=X7(i,n),o=0;oo&&(o=s),t&=~r}if(t=o,t=Ra()-t,t=(120>t?120:480>t?480:1080>t?1080:1920>t?1920:3e3>t?3e3:4320>t?4320:1960*fRe(t/1960))-t,10o&&(o=s),t&=~r}if(t=o,t=Ra()-t,t=(120>t?120:480>t?480:1080>t?1080:1920>t?1920:3e3>t?3e3:4320>t?4320:1960*fRe(t/1960))-t,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}Qs!==5&&(Qs=2),l=Gj(l,a),h=s;do{switch(h.tag){case 3:r=l,h.flags|=4096,e&=-e,h.lanes|=e;var L=lhe(h,r,e);eee(h,L);break e;case 1:r=l;var D=h.type,E=h.stateNode;if((h.flags&64)===0&&(typeof D.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Uh===null||!Uh.has(E)))){h.flags|=4096,e&=-e,h.lanes|=e;var I=che(h,r,e);eee(h,I);break e}}h=h.return}while(h!==null)}vhe(t)}catch(k){e=k,bs===t&&t!==null&&(bs=t=t.return);continue}break}while(1)}function phe(){var i=iA.current;return iA.current=nA,i===null?nA:i}function fL(i,e){var t=Zn;Zn|=16;var n=phe();sl===i&&Aa===e||cy(i,e);do try{pRe();break}catch(o){ghe(i,o)}while(1);if(Bj(),Zn=t,iA.current=n,bs!==null)throw Error(Tt(261));return sl=null,Aa=0,Qs}function pRe(){for(;bs!==null;)mhe(bs)}function mRe(){for(;bs!==null&&!Z2e();)mhe(bs)}function mhe(i){var e=bhe(i.alternate,i,$0);i.memoizedProps=i.pendingProps,e===null?vhe(i):bs=e,Xj.current=null}function vhe(i){var e=i;do{var t=e.alternate;if(i=e.return,(e.flags&2048)===0){if(t=sRe(t,e,$0),t!==null){bs=t;return}if(t=e,t.tag!==24&&t.tag!==23||t.memoizedState===null||($0&1073741824)!==0||(t.mode&4)===0){for(var n=0,o=t.child;o!==null;)n|=o.lanes|o.childLanes,o=o.sibling;t.childLanes=n}i!==null&&(i.flags&2048)===0&&(i.firstEffect===null&&(i.firstEffect=e.firstEffect),e.lastEffect!==null&&(i.lastEffect!==null&&(i.lastEffect.nextEffect=e.firstEffect),i.lastEffect=e.lastEffect),1s&&(a=s,s=L,L=a),a=WJ(_,L),r=WJ(_,s),a&&r&&(w.rangeCount!==1||w.anchorNode!==a.node||w.anchorOffset!==a.offset||w.focusNode!==r.node||w.focusOffset!==r.offset)&&(y=y.createRange(),y.setStart(a.node,a.offset),w.removeAllRanges(),L>s?(w.addRange(y),w.extend(r.node,r.offset)):(y.setEnd(r.node,r.offset),w.addRange(y)))))),y=[],w=_;w=w.parentNode;)w.nodeType===1&&y.push({element:w,left:w.scrollLeft,top:w.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_Ra()-Zj?cy(i,0):Yj|=t),Pd(i,e)}function wRe(i,e){var t=i.stateNode;t!==null&&t.delete(e),e=0,e===0&&(e=i.mode,(e&2)===0?e=1:(e&4)===0?e=Jy()===99?1:2:(Sg===0&&(Sg=sS),e=lC(62914560&~Sg),e===0&&(e=4194304))),t=Nc(),i=ZO(i,e),i!==null&&(zO(i,e,t),Pd(i,t))}var bhe;bhe=function(i,e,t){var n=e.lanes;if(i!==null)if(i.memoizedProps!==e.pendingProps||Ul.current)Iu=!0;else if((t&n)!==0)Iu=(i.flags&16384)!==0;else{switch(Iu=!1,e.tag){case 3:fee(e),D8();break;case 5:oee(e);break;case 1:jl(e.type)&&kR(e);break;case 4:cB(e,e.stateNode.containerInfo);break;case 10:n=e.memoizedProps.value;var o=e.type._context;Er(KM,o._currentValue),o._currentValue=n;break;case 13:if(e.memoizedState!==null)return(t&e.child.childLanes)!==0?gee(i,e,t):(Er(xr,xr.current&1),e=Ng(i,e,t),e!==null?e.sibling:null);Er(xr,xr.current&1);break;case 19:if(n=(t&e.childLanes)!==0,(i.flags&64)!==0){if(n)return bee(i,e,t);e.flags|=64}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Er(xr,xr.current),n)break;return null;case 23:case 24:return e.lanes=0,k8(i,e,t)}return Ng(i,e,t)}else Iu=!1;switch(e.lanes=0,e.tag){case 2:if(n=e.type,i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2),i=e.pendingProps,o=Qy(e,Oa.current),sy(e,t),o=Uj(null,e,n,i,o,t),e.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,jl(n)){var r=!0;kR(e)}else r=!1;e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Vj(e);var s=n.getDerivedStateFromProps;typeof s=="function"&&XM(e,n,s,i),o.updater=XO,e.stateNode=o,o._reactInternals=e,lB(e,n,i,t),e=fB(null,e,n,!0,r,t)}else e.tag=0,Tl(null,e,o,t),e=e.child;return e;case 16:o=e.elementType;e:{switch(i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2),i=e.pendingProps,r=o._init,o=r(o._payload),e.type=o,r=e.tag=xRe(o),i=du(o,i),r){case 0:e=hB(null,e,o,i,t);break e;case 1:e=hee(null,e,o,i,t);break e;case 11:e=dee(null,e,o,i,t);break e;case 14:e=uee(null,e,o,du(o.type,i),n,t);break e}throw Error(Tt(306,o,""))}return e;case 0:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:du(n,o),hB(i,e,n,o,t);case 1:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:du(n,o),hee(i,e,n,o,t);case 3:if(fee(e),n=e.updateQueue,i===null||n===null)throw Error(Tt(282));if(n=e.pendingProps,o=e.memoizedState,o=o!==null?o.element:null,Uue(i,e),QE(e,n,null,t),n=e.memoizedState.element,n===o)D8(),e=Ng(i,e,t);else{if(o=e.stateNode,(r=o.hydrate)&&(vm=ry(e.stateNode.containerInfo.firstChild),Tg=e,r=of=!0),r){if(i=o.mutableSourceEagerHydrationData,i!=null)for(o=0;o$L.exports.unstable_runWithPriority($L.exports.unstable_NormalPriority,i):i=>i(),ARe=i=>i;function She(i){const e=x.exports.createContext({[AR]:{v:{current:i},n:{current:-1},l:new Set,u:n=>n()}});var t;return e[RRe]=e.Provider,e.Provider=(t=e.Provider,({value:n,children:o})=>{const r=x.exports.useRef(n),s=x.exports.useRef(0),[a,l]=x.exports.useState(null);a&&(a(n),l(null));const c=x.exports.useRef();if(!c.current){const d=new Set,u=(h,f)=>{zu.exports.unstable_batchedUpdates(()=>{s.current+=1;const g={n:s.current};f!=null&&f.suspense&&(g.n*=-1,g.p=new Promise(p=>{l(()=>v=>{g.v=v,delete g.p,p(v)})})),d.forEach(p=>p(g)),h()})};c.current={[AR]:{v:r,n:s,l:d,u}}}return whe(()=>{r.current=n,s.current+=1,MRe(()=>{c.current[AR].l.forEach(d=>{d({n:s.current,v:n})})})},[n]),x.exports.createElement(t,{value:c.current},o)}),delete e.Consumer,e}function xhe(i,e){const t=x.exports.useContext(i)[AR],{v:{current:n},n:{current:o},l:r}=t,s=e(n),[a,l]=x.exports.useReducer((c,d)=>{if(!d)return[n,s];if("p"in d)throw d.p;if(d.n===o)return Object.is(c[1],s)?c:[n,s];try{if("v"in d){if(Object.is(c[0],d.v))return c;const u=e(d.v);return Object.is(c[1],u)?c:[d.v,u]}}catch{}return[...c]},[n,s]);return Object.is(a[1],s)||l(),whe(()=>(r.add(l),()=>{r.delete(l)}),[r]),a[1]}function Lhe(i){return xhe(i,ARe)}function fa(i){if(typeof i=="string"||typeof i=="number")return""+i;let e="";if(Array.isArray(i))for(let t=0,n;t component higher in the tree to provide a loading indicator or placeholder to display.`)}Qs!==5&&(Qs=2),l=Xj(l,a),h=s;do{switch(h.tag){case 3:r=l,h.flags|=4096,e&=-e,h.lanes|=e;var L=che(h,r,e);tee(h,L);break e;case 1:r=l;var D=h.type,E=h.stateNode;if((h.flags&64)===0&&(typeof D.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Uh===null||!Uh.has(E)))){h.flags|=4096,e&=-e,h.lanes|=e;var I=dhe(h,r,e);tee(h,I);break e}}h=h.return}while(h!==null)}_he(t)}catch(k){e=k,bs===t&&t!==null&&(bs=t=t.return);continue}break}while(1)}function mhe(){var i=iA.current;return iA.current=nA,i===null?nA:i}function fL(i,e){var t=Zn;Zn|=16;var n=mhe();sl===i&&Aa===e||cy(i,e);do try{pRe();break}catch(o){phe(i,o)}while(1);if(Wj(),Zn=t,iA.current=n,bs!==null)throw Error(Tt(261));return sl=null,Aa=0,Qs}function pRe(){for(;bs!==null;)vhe(bs)}function mRe(){for(;bs!==null&&!Z2e();)vhe(bs)}function vhe(i){var e=Che(i.alternate,i,$0);i.memoizedProps=i.pendingProps,e===null?_he(i):bs=e,Yj.current=null}function _he(i){var e=i;do{var t=e.alternate;if(i=e.return,(e.flags&2048)===0){if(t=sRe(t,e,$0),t!==null){bs=t;return}if(t=e,t.tag!==24&&t.tag!==23||t.memoizedState===null||($0&1073741824)!==0||(t.mode&4)===0){for(var n=0,o=t.child;o!==null;)n|=o.lanes|o.childLanes,o=o.sibling;t.childLanes=n}i!==null&&(i.flags&2048)===0&&(i.firstEffect===null&&(i.firstEffect=e.firstEffect),e.lastEffect!==null&&(i.lastEffect!==null&&(i.lastEffect.nextEffect=e.firstEffect),i.lastEffect=e.lastEffect),1s&&(a=s,s=L,L=a),a=VJ(_,L),r=VJ(_,s),a&&r&&(w.rangeCount!==1||w.anchorNode!==a.node||w.anchorOffset!==a.offset||w.focusNode!==r.node||w.focusOffset!==r.offset)&&(y=y.createRange(),y.setStart(a.node,a.offset),w.removeAllRanges(),L>s?(w.addRange(y),w.extend(r.node,r.offset)):(y.setEnd(r.node,r.offset),w.addRange(y)))))),y=[],w=_;w=w.parentNode;)w.nodeType===1&&y.push({element:w,left:w.scrollLeft,top:w.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_Ra()-Qj?cy(i,0):Zj|=t),Pd(i,e)}function wRe(i,e){var t=i.stateNode;t!==null&&t.delete(e),e=0,e===0&&(e=i.mode,(e&2)===0?e=1:(e&4)===0?e=Jy()===99?1:2:(Sg===0&&(Sg=sS),e=lC(62914560&~Sg),e===0&&(e=4194304))),t=Nc(),i=ZO(i,e),i!==null&&(zO(i,e,t),Pd(i,t))}var Che;Che=function(i,e,t){var n=e.lanes;if(i!==null)if(i.memoizedProps!==e.pendingProps||Ul.current)Iu=!0;else if((t&n)!==0)Iu=(i.flags&16384)!==0;else{switch(Iu=!1,e.tag){case 3:gee(e),k8();break;case 5:ree(e);break;case 1:jl(e.type)&&kR(e);break;case 4:dB(e,e.stateNode.containerInfo);break;case 10:n=e.memoizedProps.value;var o=e.type._context;Er(KM,o._currentValue),o._currentValue=n;break;case 13:if(e.memoizedState!==null)return(t&e.child.childLanes)!==0?pee(i,e,t):(Er(xr,xr.current&1),e=Ng(i,e,t),e!==null?e.sibling:null);Er(xr,xr.current&1);break;case 19:if(n=(t&e.childLanes)!==0,(i.flags&64)!==0){if(n)return Cee(i,e,t);e.flags|=64}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Er(xr,xr.current),n)break;return null;case 23:case 24:return e.lanes=0,I8(i,e,t)}return Ng(i,e,t)}else Iu=!1;switch(e.lanes=0,e.tag){case 2:if(n=e.type,i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2),i=e.pendingProps,o=Qy(e,Oa.current),sy(e,t),o=jj(null,e,n,i,o,t),e.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,jl(n)){var r=!0;kR(e)}else r=!1;e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Hj(e);var s=n.getDerivedStateFromProps;typeof s=="function"&&XM(e,n,s,i),o.updater=XO,e.stateNode=o,o._reactInternals=e,cB(e,n,i,t),e=gB(null,e,n,!0,r,t)}else e.tag=0,Tl(null,e,o,t),e=e.child;return e;case 16:o=e.elementType;e:{switch(i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2),i=e.pendingProps,r=o._init,o=r(o._payload),e.type=o,r=e.tag=xRe(o),i=du(o,i),r){case 0:e=fB(null,e,o,i,t);break e;case 1:e=fee(null,e,o,i,t);break e;case 11:e=uee(null,e,o,i,t);break e;case 14:e=hee(null,e,o,du(o.type,i),n,t);break e}throw Error(Tt(306,o,""))}return e;case 0:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:du(n,o),fB(i,e,n,o,t);case 1:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:du(n,o),fee(i,e,n,o,t);case 3:if(gee(e),n=e.updateQueue,i===null||n===null)throw Error(Tt(282));if(n=e.pendingProps,o=e.memoizedState,o=o!==null?o.element:null,jue(i,e),QE(e,n,null,t),n=e.memoizedState.element,n===o)k8(),e=Ng(i,e,t);else{if(o=e.stateNode,(r=o.hydrate)&&(_m=ry(e.stateNode.containerInfo.firstChild),Tg=e,r=of=!0),r){if(i=o.mutableSourceEagerHydrationData,i!=null)for(o=0;o$L.exports.unstable_runWithPriority($L.exports.unstable_NormalPriority,i):i=>i(),ARe=i=>i;function xhe(i){const e=x.exports.createContext({[AR]:{v:{current:i},n:{current:-1},l:new Set,u:n=>n()}});var t;return e[RRe]=e.Provider,e.Provider=(t=e.Provider,({value:n,children:o})=>{const r=x.exports.useRef(n),s=x.exports.useRef(0),[a,l]=x.exports.useState(null);a&&(a(n),l(null));const c=x.exports.useRef();if(!c.current){const d=new Set,u=(h,f)=>{zu.exports.unstable_batchedUpdates(()=>{s.current+=1;const g={n:s.current};f!=null&&f.suspense&&(g.n*=-1,g.p=new Promise(p=>{l(()=>v=>{g.v=v,delete g.p,p(v)})})),d.forEach(p=>p(g)),h()})};c.current={[AR]:{v:r,n:s,l:d,u}}}return She(()=>{r.current=n,s.current+=1,MRe(()=>{c.current[AR].l.forEach(d=>{d({n:s.current,v:n})})})},[n]),x.exports.createElement(t,{value:c.current},o)}),delete e.Consumer,e}function Lhe(i,e){const t=x.exports.useContext(i)[AR],{v:{current:n},n:{current:o},l:r}=t,s=e(n),[a,l]=x.exports.useReducer((c,d)=>{if(!d)return[n,s];if("p"in d)throw d.p;if(d.n===o)return Object.is(c[1],s)?c:[n,s];try{if("v"in d){if(Object.is(c[0],d.v))return c;const u=e(d.v);return Object.is(c[1],u)?c:[d.v,u]}}catch{}return[...c]},[n,s]);return Object.is(a[1],s)||l(),She(()=>(r.add(l),()=>{r.delete(l)}),[r]),a[1]}function Ehe(i){return Lhe(i,ARe)}function fa(i){if(typeof i=="string"||typeof i=="number")return""+i;let e="";if(Array.isArray(i))for(let t=0,n;t component higher in the tree to provide a loading * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var tw=x.exports;function PRe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var ORe=typeof Object.is=="function"?Object.is:PRe,FRe=tw.useState,BRe=tw.useEffect,WRe=tw.useLayoutEffect,VRe=tw.useDebugValue;function HRe(i,e){var t=e(),n=FRe({inst:{value:t,getSnapshot:e}}),o=n[0].inst,r=n[1];return WRe(function(){o.value=t,o.getSnapshot=e,A8(o)&&r({inst:o})},[i,t,e]),BRe(function(){return A8(o)&&r({inst:o}),i(function(){A8(o)&&r({inst:o})})},[i]),VRe(t),t}function A8(i){var e=i.getSnapshot;i=i.value;try{var t=e();return!ORe(i,t)}catch{return!0}}function $Re(i,e){return e()}var zRe=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?$Re:HRe;Ihe.useSyncExternalStore=tw.useSyncExternalStore!==void 0?tw.useSyncExternalStore:zRe;khe.exports=Ihe;/** + */var tw=x.exports;function PRe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var ORe=typeof Object.is=="function"?Object.is:PRe,FRe=tw.useState,BRe=tw.useEffect,WRe=tw.useLayoutEffect,VRe=tw.useDebugValue;function HRe(i,e){var t=e(),n=FRe({inst:{value:t,getSnapshot:e}}),o=n[0].inst,r=n[1];return WRe(function(){o.value=t,o.getSnapshot=e,P8(o)&&r({inst:o})},[i,t,e]),BRe(function(){return P8(o)&&r({inst:o}),i(function(){P8(o)&&r({inst:o})})},[i]),VRe(t),t}function P8(i){var e=i.getSnapshot;i=i.value;try{var t=e();return!ORe(i,t)}catch{return!0}}function $Re(i,e){return e()}var zRe=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?$Re:HRe;The.useSyncExternalStore=tw.useSyncExternalStore!==void 0?tw.useSyncExternalStore:zRe;Ihe.exports=The;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -47,19 +47,19 @@ Add a component higher in the tree to provide a loading * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var JO=x.exports,URe=khe.exports;function jRe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var KRe=typeof Object.is=="function"?Object.is:jRe,qRe=URe.useSyncExternalStore,GRe=JO.useRef,XRe=JO.useEffect,YRe=JO.useMemo,ZRe=JO.useDebugValue;Dhe.useSyncExternalStoreWithSelector=function(i,e,t,n,o){var r=GRe(null);if(r.current===null){var s={hasValue:!1,value:null};r.current=s}else s=r.current;r=YRe(function(){function l(f){if(!c){if(c=!0,d=f,f=n(f),o!==void 0&&s.hasValue){var g=s.value;if(o(g,f))return u=g}return u=f}if(g=u,KRe(d,f))return g;var p=n(f);return o!==void 0&&o(g,p)?g:(d=f,u=p)}var c=!1,d,u,h=t===void 0?null:t;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,t,n,o]);var a=qRe(i,r[0],r[1]);return XRe(function(){s.hasValue=!0,s.value=a},[a]),ZRe(a),a};Ehe.exports=Dhe;var QRe=Ehe.exports;const Iee=i=>{let e;const t=new Set,n=(d,u)=>{const h=typeof d=="function"?d(e):d;if(!Object.is(h,e)){const f=e;e=(u!=null?u:typeof h!="object"||h===null)?h:Object.assign({},e,h),t.forEach(g=>g(e,f))}},o=()=>e,l={setState:n,getState:o,getInitialState:()=>c,subscribe:d=>(t.add(d),()=>t.delete(d)),destroy:()=>{t.clear()}},c=e=i(n,o,l);return l},JRe=i=>i?Iee(i):Iee,{useDebugValue:eMe}=Bt,{useSyncExternalStoreWithSelector:tMe}=QRe,nMe=i=>i;function The(i,e=nMe,t){const n=tMe(i.subscribe,i.getState,i.getServerState||i.getInitialState,e,t);return eMe(n),n}const Tee=(i,e)=>{const t=JRe(i),n=(o,r=e)=>The(t,o,r);return Object.assign(n,t),n},iMe=(i,e)=>i?Tee(i,e):Tee;function Hs(i,e){if(Object.is(i,e))return!0;if(typeof i!="object"||i===null||typeof e!="object"||e===null)return!1;if(i instanceof Map&&e instanceof Map){if(i.size!==e.size)return!1;for(const[n,o]of i)if(!Object.is(o,e.get(n)))return!1;return!0}if(i instanceof Set&&e instanceof Set){if(i.size!==e.size)return!1;for(const n of i)if(!e.has(n))return!1;return!0}const t=Object.keys(i);if(t.length!==Object.keys(e).length)return!1;for(let n=0;n{}};function e4(){for(var i=0,e=arguments.length,t={},n;i=0&&(n=t.slice(o+1),t=t.slice(0,o)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}PR.prototype=e4.prototype={constructor:PR,on:function(i,e){var t=this._,n=rMe(i+"",t),o,r=-1,s=n.length;if(arguments.length<2){for(;++r0)for(var t=new Array(o),n=0,o,r;n=0&&(e=i.slice(0,t))!=="xmlns"&&(i=i.slice(t+1)),Ree.hasOwnProperty(e)?{space:Ree[e],local:i}:i}function aMe(i){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===EB&&e.documentElement.namespaceURI===EB?e.createElement(i):e.createElementNS(t,i)}}function lMe(i){return function(){return this.ownerDocument.createElementNS(i.space,i.local)}}function Nhe(i){var e=t4(i);return(e.local?lMe:aMe)(e)}function cMe(){}function oK(i){return i==null?cMe:function(){return this.querySelector(i)}}function dMe(i){typeof i!="function"&&(i=oK(i));for(var e=this._groups,t=e.length,n=new Array(t),o=0;o=y&&(y=_+1);!(L=v[y])&&++y=0;)(s=n[o])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function PMe(i){i||(i=OMe);function e(u,h){return u&&h?i(u.__data__,h.__data__):!u-!h}for(var t=this._groups,n=t.length,o=new Array(n),r=0;re?1:i>=e?0:NaN}function FMe(){var i=arguments[0];return arguments[0]=this,i.apply(null,arguments),this}function BMe(){return Array.from(this)}function WMe(){for(var i=this._groups,e=0,t=i.length;e1?this.each((e==null?YMe:typeof e=="function"?QMe:ZMe)(i,e,t==null?"":t)):nw(this.node(),i)}function nw(i,e){return i.style.getPropertyValue(e)||Ohe(i).getComputedStyle(i,null).getPropertyValue(e)}function eAe(i){return function(){delete this[i]}}function tAe(i,e){return function(){this[i]=e}}function nAe(i,e){return function(){var t=e.apply(this,arguments);t==null?delete this[i]:this[i]=t}}function iAe(i,e){return arguments.length>1?this.each((e==null?eAe:typeof e=="function"?nAe:tAe)(i,e)):this.node()[i]}function Fhe(i){return i.trim().split(/^|\s+/)}function rK(i){return i.classList||new Bhe(i)}function Bhe(i){this._node=i,this._names=Fhe(i.getAttribute("class")||"")}Bhe.prototype={add:function(i){var e=this._names.indexOf(i);e<0&&(this._names.push(i),this._node.setAttribute("class",this._names.join(" ")))},remove:function(i){var e=this._names.indexOf(i);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(i){return this._names.indexOf(i)>=0}};function Whe(i,e){for(var t=rK(i),n=-1,o=e.length;++n=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function NAe(i){return function(){var e=this.__on;if(!!e){for(var t=0,n=-1,o=e.length,r;t()=>i;function DB(i,{sourceEvent:e,subject:t,target:n,identifier:o,active:r,x:s,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}DB.prototype.on=function(){var i=this._.on.apply(this._,arguments);return i===this._?this:i};function HAe(i){return!i.ctrlKey&&!i.button}function $Ae(){return this.parentNode}function zAe(i,e){return e==null?{x:i.x,y:i.y}:e}function UAe(){return navigator.maxTouchPoints||"ontouchstart"in this}function jAe(){var i=HAe,e=$Ae,t=zAe,n=UAe,o={},r=e4("start","drag","end"),s=0,a,l,c,d,u=0;function h(w){w.on("mousedown.drag",f).filter(n).on("touchstart.drag",v).on("touchmove.drag",m,VAe).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(w,L){if(!(d||!i.call(this,w,L))){var D=y(this,e.call(this,w,L),w,L,"mouse");!D||(bd(w.view).on("mousemove.drag",g,nD).on("mouseup.drag",p,nD),zhe(w.view),P8(w),c=!1,a=w.clientX,l=w.clientY,D("start",w))}}function g(w){if(uy(w),!c){var L=w.clientX-a,D=w.clientY-l;c=L*L+D*D>u}o.mouse("drag",w)}function p(w){bd(w.view).on("mousemove.drag mouseup.drag",null),Uhe(w.view,c),uy(w),o.mouse("end",w)}function v(w,L){if(!!i.call(this,w,L)){var D=w.changedTouches,E=e.call(this,w,L),I=D.length,k,R;for(k=0;k>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?NN(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?NN(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=qAe.exec(i))?new Wl(e[1],e[2],e[3],1):(e=GAe.exec(i))?new Wl(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=XAe.exec(i))?NN(e[1],e[2],e[3],e[4]):(e=YAe.exec(i))?NN(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ZAe.exec(i))?Wee(e[1],e[2]/100,e[3]/100,1):(e=QAe.exec(i))?Wee(e[1],e[2]/100,e[3]/100,e[4]):Mee.hasOwnProperty(i)?Oee(Mee[i]):i==="transparent"?new Wl(NaN,NaN,NaN,0):null}function Oee(i){return new Wl(i>>16&255,i>>8&255,i&255,1)}function NN(i,e,t,n){return n<=0&&(i=e=t=NaN),new Wl(i,e,t,n)}function tPe(i){return i instanceof CI||(i=rD(i)),i?(i=i.rgb(),new Wl(i.r,i.g,i.b,i.opacity)):new Wl}function kB(i,e,t,n){return arguments.length===1?tPe(i):new Wl(i,e,t,n==null?1:n)}function Wl(i,e,t,n){this.r=+i,this.g=+e,this.b=+t,this.opacity=+n}sK(Wl,kB,jhe(CI,{brighter(i){return i=i==null?aA:Math.pow(aA,i),new Wl(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?iD:Math.pow(iD,i),new Wl(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new Wl(S0(this.r),S0(this.g),S0(this.b),lA(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fee,formatHex:Fee,formatHex8:nPe,formatRgb:Bee,toString:Bee}));function Fee(){return`#${n0(this.r)}${n0(this.g)}${n0(this.b)}`}function nPe(){return`#${n0(this.r)}${n0(this.g)}${n0(this.b)}${n0((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bee(){const i=lA(this.opacity);return`${i===1?"rgb(":"rgba("}${S0(this.r)}, ${S0(this.g)}, ${S0(this.b)}${i===1?")":`, ${i})`}`}function lA(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function S0(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function n0(i){return i=S0(i),(i<16?"0":"")+i.toString(16)}function Wee(i,e,t,n){return n<=0?i=e=t=NaN:t<=0||t>=1?i=e=NaN:e<=0&&(i=NaN),new Lu(i,e,t,n)}function Khe(i){if(i instanceof Lu)return new Lu(i.h,i.s,i.l,i.opacity);if(i instanceof CI||(i=rD(i)),!i)return new Lu;if(i instanceof Lu)return i;i=i.rgb();var e=i.r/255,t=i.g/255,n=i.b/255,o=Math.min(e,t,n),r=Math.max(e,t,n),s=NaN,a=r-o,l=(r+o)/2;return a?(e===r?s=(t-n)/a+(t0&&l<1?0:s,new Lu(s,a,l,i.opacity)}function iPe(i,e,t,n){return arguments.length===1?Khe(i):new Lu(i,e,t,n==null?1:n)}function Lu(i,e,t,n){this.h=+i,this.s=+e,this.l=+t,this.opacity=+n}sK(Lu,iPe,jhe(CI,{brighter(i){return i=i==null?aA:Math.pow(aA,i),new Lu(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?iD:Math.pow(iD,i),new Lu(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,e=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,o=2*t-n;return new Wl(O8(i>=240?i-240:i+120,o,n),O8(i,o,n),O8(i<120?i+240:i-120,o,n),this.opacity)},clamp(){return new Lu(Vee(this.h),RN(this.s),RN(this.l),lA(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=lA(this.opacity);return`${i===1?"hsl(":"hsla("}${Vee(this.h)}, ${RN(this.s)*100}%, ${RN(this.l)*100}%${i===1?")":`, ${i})`}`}}));function Vee(i){return i=(i||0)%360,i<0?i+360:i}function RN(i){return Math.max(0,Math.min(1,i||0))}function O8(i,e,t){return(i<60?e+(t-e)*i/60:i<180?t:i<240?e+(t-e)*(240-i)/60:e)*255}var qhe=i=>()=>i;function oPe(i,e){return function(t){return i+t*e}}function rPe(i,e,t){return i=Math.pow(i,t),e=Math.pow(e,t)-i,t=1/t,function(n){return Math.pow(i+n*e,t)}}function sPe(i){return(i=+i)==1?Ghe:function(e,t){return t-e?rPe(e,t,i):qhe(isNaN(e)?t:e)}}function Ghe(i,e){var t=e-i;return t?oPe(i,t):qhe(isNaN(i)?e:i)}var Hee=function i(e){var t=sPe(e);function n(o,r){var s=t((o=kB(o)).r,(r=kB(r)).r),a=t(o.g,r.g),l=t(o.b,r.b),c=Ghe(o.opacity,r.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=l(d),o.opacity=c(d),o+""}}return n.gamma=i,n}(1);function em(i,e){return i=+i,e=+e,function(t){return i*(1-t)+e*t}}var IB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,F8=new RegExp(IB.source,"g");function aPe(i){return function(){return i}}function lPe(i){return function(e){return i(e)+""}}function cPe(i,e){var t=IB.lastIndex=F8.lastIndex=0,n,o,r,s=-1,a=[],l=[];for(i=i+"",e=e+"";(n=IB.exec(i))&&(o=F8.exec(e));)(r=o.index)>t&&(r=e.slice(t,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:em(n,o)})),t=F8.lastIndex;return t180?d+=360:d-c>180&&(c+=360),h.push({i:u.push(o(u)+"rotate(",null,n)-2,x:em(c,d)})):d&&u.push(o(u)+"rotate("+d+n)}function a(c,d,u,h){c!==d?h.push({i:u.push(o(u)+"skewX(",null,n)-2,x:em(c,d)}):d&&u.push(o(u)+"skewX("+d+n)}function l(c,d,u,h,f,g){if(c!==u||d!==h){var p=f.push(o(f)+"scale(",null,",",null,")");g.push({i:p-4,x:em(c,u)},{i:p-2,x:em(d,h)})}else(u!==1||h!==1)&&f.push(o(f)+"scale("+u+","+h+")")}return function(c,d){var u=[],h=[];return c=i(c),d=i(d),r(c.translateX,c.translateY,d.translateX,d.translateY,u,h),s(c.rotate,d.rotate,u,h),a(c.skewX,d.skewX,u,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,u,h),c=d=null,function(f){for(var g=-1,p=h.length,v;++g=0&&i._call.call(void 0,e),i=i._next;--iw}function Uee(){z0=(dA=sD.now())+n4,iw=gL=0;try{bPe()}finally{iw=0,yPe(),z0=0}}function CPe(){var i=sD.now(),e=i-dA;e>Zhe&&(n4-=e,dA=i)}function yPe(){for(var i,e=cA,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),i=e,e=e._next):(t=e._next,e._next=null,e=i?i._next=t:cA=t);pL=i,NB(n)}function NB(i){if(!iw){gL&&(gL=clearTimeout(gL));var e=i-z0;e>24?(i<1/0&&(gL=setTimeout(Uee,i-sD.now()-n4)),_x&&(_x=clearInterval(_x))):(_x||(dA=sD.now(),_x=setInterval(CPe,Zhe)),iw=1,Qhe(Uee))}}function jee(i,e,t){var n=new uA;return e=e==null?0:+e,n.restart(o=>{n.stop(),i(o+e)},e,t),n}var wPe=e4("start","end","cancel","interrupt"),SPe=[],efe=0,Kee=1,RB=2,OR=3,qee=4,MB=5,FR=6;function i4(i,e,t,n,o,r){var s=i.__transition;if(!s)i.__transition={};else if(t in s)return;xPe(i,t,{name:e,index:n,group:o,on:wPe,tween:SPe,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:efe})}function lK(i,e){var t=Ju(i,e);if(t.state>efe)throw new Error("too late; already scheduled");return t}function Df(i,e){var t=Ju(i,e);if(t.state>OR)throw new Error("too late; already running");return t}function Ju(i,e){var t=i.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function xPe(i,e,t){var n=i.__transition,o;n[e]=t,t.timer=Jhe(r,0,t.time);function r(c){t.state=Kee,t.timer.restart(s,t.delay,t.time),t.delay<=c&&s(c-t.delay)}function s(c){var d,u,h,f;if(t.state!==Kee)return l();for(d in n)if(f=n[d],f.name===t.name){if(f.state===OR)return jee(s);f.state===qee?(f.state=FR,f.timer.stop(),f.on.call("interrupt",i,i.__data__,f.index,f.group),delete n[d]):+dRB&&n.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function eOe(i,e,t){var n,o,r=JPe(e)?lK:Df;return function(){var s=r(this,i),a=s.on;a!==n&&(o=(n=a).copy()).on(e,t),s.on=o}}function tOe(i,e){var t=this._id;return arguments.length<2?Ju(this.node(),t).on.on(i):this.each(eOe(t,i,e))}function nOe(i){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==i)return;e&&e.removeChild(this)}}function iOe(){return this.on("end.remove",nOe(this._id))}function oOe(i){var e=this._name,t=this._id;typeof i!="function"&&(i=oK(i));for(var n=this._groups,o=n.length,r=new Array(o),s=0;s()=>i;function IOe(i,{sourceEvent:e,target:t,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function Rg(i,e,t){this.k=i,this.x=e,this.y=t}Rg.prototype={constructor:Rg,scale:function(i){return i===1?this:new Rg(this.k*i,this.x,this.y)},translate:function(i,e){return i===0&e===0?this:new Rg(this.k,this.x+this.k*i,this.y+this.k*e)},apply:function(i){return[i[0]*this.k+this.x,i[1]*this.k+this.y]},applyX:function(i){return i*this.k+this.x},applyY:function(i){return i*this.k+this.y},invert:function(i){return[(i[0]-this.x)/this.k,(i[1]-this.y)/this.k]},invertX:function(i){return(i-this.x)/this.k},invertY:function(i){return(i-this.y)/this.k},rescaleX:function(i){return i.copy().domain(i.range().map(this.invertX,this).map(i.invert,i))},rescaleY:function(i){return i.copy().domain(i.range().map(this.invertY,this).map(i.invert,i))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ug=new Rg(1,0,0);Rg.prototype;function B8(i){i.stopImmediatePropagation()}function bx(i){i.preventDefault(),i.stopImmediatePropagation()}function TOe(i){return(!i.ctrlKey||i.type==="wheel")&&!i.button}function NOe(){var i=this;return i instanceof SVGElement?(i=i.ownerSVGElement||i,i.hasAttribute("viewBox")?(i=i.viewBox.baseVal,[[i.x,i.y],[i.x+i.width,i.y+i.height]]):[[0,0],[i.width.baseVal.value,i.height.baseVal.value]]):[[0,0],[i.clientWidth,i.clientHeight]]}function Gee(){return this.__zoom||Ug}function ROe(i){return-i.deltaY*(i.deltaMode===1?.05:i.deltaMode?1:.002)*(i.ctrlKey?10:1)}function MOe(){return navigator.maxTouchPoints||"ontouchstart"in this}function AOe(i,e,t){var n=i.invertX(e[0][0])-t[0][0],o=i.invertX(e[1][0])-t[1][0],r=i.invertY(e[0][1])-t[0][1],s=i.invertY(e[1][1])-t[1][1];return i.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function ofe(){var i=TOe,e=NOe,t=AOe,n=ROe,o=MOe,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=vPe,c=e4("start","zoom","end"),d,u,h,f=500,g=150,p=0,v=10;function m(M){M.property("__zoom",Gee).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",R).filter(o).on("touchstart.zoom",A).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(M,H,B,F){var $=M.selection?M.selection():M;$.property("__zoom",Gee),M!==$?L(M,H,B,F):$.interrupt().each(function(){D(this,arguments).event(F).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},m.scaleBy=function(M,H,B,F){m.scaleTo(M,function(){var $=this.__zoom.k,z=typeof H=="function"?H.apply(this,arguments):H;return $*z},B,F)},m.scaleTo=function(M,H,B,F){m.transform(M,function(){var $=e.apply(this,arguments),z=this.__zoom,K=B==null?w($):typeof B=="function"?B.apply(this,arguments):B,j=z.invert(K),G=typeof H=="function"?H.apply(this,arguments):H;return t(y(_(z,G),K,j),$,s)},B,F)},m.translateBy=function(M,H,B,F){m.transform(M,function(){return t(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof B=="function"?B.apply(this,arguments):B),e.apply(this,arguments),s)},null,F)},m.translateTo=function(M,H,B,F,$){m.transform(M,function(){var z=e.apply(this,arguments),K=this.__zoom,j=F==null?w(z):typeof F=="function"?F.apply(this,arguments):F;return t(Ug.translate(j[0],j[1]).scale(K.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof B=="function"?-B.apply(this,arguments):-B),z,s)},F,$)};function _(M,H){return H=Math.max(r[0],Math.min(r[1],H)),H===M.k?M:new Rg(H,M.x,M.y)}function y(M,H,B){var F=H[0]-B[0]*M.k,$=H[1]-B[1]*M.k;return F===M.x&&$===M.y?M:new Rg(M.k,F,$)}function w(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function L(M,H,B,F){M.on("start.zoom",function(){D(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(F).end()}).tween("zoom",function(){var $=this,z=arguments,K=D($,z).event(F),j=e.apply($,z),G=B==null?w(j):typeof B=="function"?B.apply($,z):B,X=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),ue=$.__zoom,fe=typeof H=="function"?H.apply($,z):H,pe=l(ue.invert(G).concat(X/ue.k),fe.invert(G).concat(X/fe.k));return function(be){if(be===1)be=fe;else{var Se=pe(be),Fe=X/Se[2];be=new Rg(Fe,G[0]-Se[0]*Fe,G[1]-Se[1]*Fe)}K.zoom(null,be)}})}function D(M,H,B){return!B&&M.__zooming||new E(M,H)}function E(M,H){this.that=M,this.args=H,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,H),this.taps=0}E.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,H){return this.mouse&&M!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var H=bd(this.that).datum();c.call(M,this.that,new IOe(M,{sourceEvent:this.sourceEvent,target:m,type:M,transform:this.that.__zoom,dispatch:c}),H)}};function I(M,...H){if(!i.apply(this,arguments))return;var B=D(this,H).event(M),F=this.__zoom,$=Math.max(r[0],Math.min(r[1],F.k*Math.pow(2,n.apply(this,arguments)))),z=gu(M);if(B.wheel)(B.mouse[0][0]!==z[0]||B.mouse[0][1]!==z[1])&&(B.mouse[1]=F.invert(B.mouse[0]=z)),clearTimeout(B.wheel);else{if(F.k===$)return;B.mouse=[z,F.invert(z)],BR(this),B.start()}bx(M),B.wheel=setTimeout(K,g),B.zoom("mouse",t(y(_(F,$),B.mouse[0],B.mouse[1]),B.extent,s));function K(){B.wheel=null,B.end()}}function k(M,...H){if(h||!i.apply(this,arguments))return;var B=M.currentTarget,F=D(this,H,!0).event(M),$=bd(M.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",X,!0),z=gu(M,B),K=M.clientX,j=M.clientY;zhe(M.view),B8(M),F.mouse=[z,this.__zoom.invert(z)],BR(this),F.start();function G(ue){if(bx(ue),!F.moved){var fe=ue.clientX-K,pe=ue.clientY-j;F.moved=fe*fe+pe*pe>p}F.event(ue).zoom("mouse",t(y(F.that.__zoom,F.mouse[0]=gu(ue,B),F.mouse[1]),F.extent,s))}function X(ue){$.on("mousemove.zoom mouseup.zoom",null),Uhe(ue.view,F.moved),bx(ue),F.event(ue).end()}}function R(M,...H){if(!!i.apply(this,arguments)){var B=this.__zoom,F=gu(M.changedTouches?M.changedTouches[0]:M,this),$=B.invert(F),z=B.k*(M.shiftKey?.5:2),K=t(y(_(B,z),F,$),e.apply(this,H),s);bx(M),a>0?bd(this).transition().duration(a).call(L,K,F,M):bd(this).call(m.transform,K,F,M)}}function A(M,...H){if(!!i.apply(this,arguments)){var B=M.touches,F=B.length,$=D(this,H,M.changedTouches.length===F).event(M),z,K,j,G;for(B8(M),K=0;K{let e;const t=new Set,n=(d,u)=>{const h=typeof d=="function"?d(e):d;if(!Object.is(h,e)){const f=e;e=(u!=null?u:typeof h!="object"||h===null)?h:Object.assign({},e,h),t.forEach(g=>g(e,f))}},o=()=>e,l={setState:n,getState:o,getInitialState:()=>c,subscribe:d=>(t.add(d),()=>t.delete(d)),destroy:()=>{t.clear()}},c=e=i(n,o,l);return l},JRe=i=>i?Tee(i):Tee,{useDebugValue:eMe}=Bt,{useSyncExternalStoreWithSelector:tMe}=QRe,nMe=i=>i;function Nhe(i,e=nMe,t){const n=tMe(i.subscribe,i.getState,i.getServerState||i.getInitialState,e,t);return eMe(n),n}const Nee=(i,e)=>{const t=JRe(i),n=(o,r=e)=>Nhe(t,o,r);return Object.assign(n,t),n},iMe=(i,e)=>i?Nee(i,e):Nee;function Hs(i,e){if(Object.is(i,e))return!0;if(typeof i!="object"||i===null||typeof e!="object"||e===null)return!1;if(i instanceof Map&&e instanceof Map){if(i.size!==e.size)return!1;for(const[n,o]of i)if(!Object.is(o,e.get(n)))return!1;return!0}if(i instanceof Set&&e instanceof Set){if(i.size!==e.size)return!1;for(const n of i)if(!e.has(n))return!1;return!0}const t=Object.keys(i);if(t.length!==Object.keys(e).length)return!1;for(let n=0;n{}};function e4(){for(var i=0,e=arguments.length,t={},n;i=0&&(n=t.slice(o+1),t=t.slice(0,o)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}PR.prototype=e4.prototype={constructor:PR,on:function(i,e){var t=this._,n=rMe(i+"",t),o,r=-1,s=n.length;if(arguments.length<2){for(;++r0)for(var t=new Array(o),n=0,o,r;n=0&&(e=i.slice(0,t))!=="xmlns"&&(i=i.slice(t+1)),Mee.hasOwnProperty(e)?{space:Mee[e],local:i}:i}function aMe(i){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===DB&&e.documentElement.namespaceURI===DB?e.createElement(i):e.createElementNS(t,i)}}function lMe(i){return function(){return this.ownerDocument.createElementNS(i.space,i.local)}}function Rhe(i){var e=t4(i);return(e.local?lMe:aMe)(e)}function cMe(){}function rK(i){return i==null?cMe:function(){return this.querySelector(i)}}function dMe(i){typeof i!="function"&&(i=rK(i));for(var e=this._groups,t=e.length,n=new Array(t),o=0;o=y&&(y=_+1);!(L=v[y])&&++y=0;)(s=n[o])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function PMe(i){i||(i=OMe);function e(u,h){return u&&h?i(u.__data__,h.__data__):!u-!h}for(var t=this._groups,n=t.length,o=new Array(n),r=0;re?1:i>=e?0:NaN}function FMe(){var i=arguments[0];return arguments[0]=this,i.apply(null,arguments),this}function BMe(){return Array.from(this)}function WMe(){for(var i=this._groups,e=0,t=i.length;e1?this.each((e==null?YMe:typeof e=="function"?QMe:ZMe)(i,e,t==null?"":t)):nw(this.node(),i)}function nw(i,e){return i.style.getPropertyValue(e)||Fhe(i).getComputedStyle(i,null).getPropertyValue(e)}function eAe(i){return function(){delete this[i]}}function tAe(i,e){return function(){this[i]=e}}function nAe(i,e){return function(){var t=e.apply(this,arguments);t==null?delete this[i]:this[i]=t}}function iAe(i,e){return arguments.length>1?this.each((e==null?eAe:typeof e=="function"?nAe:tAe)(i,e)):this.node()[i]}function Bhe(i){return i.trim().split(/^|\s+/)}function sK(i){return i.classList||new Whe(i)}function Whe(i){this._node=i,this._names=Bhe(i.getAttribute("class")||"")}Whe.prototype={add:function(i){var e=this._names.indexOf(i);e<0&&(this._names.push(i),this._node.setAttribute("class",this._names.join(" ")))},remove:function(i){var e=this._names.indexOf(i);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(i){return this._names.indexOf(i)>=0}};function Vhe(i,e){for(var t=sK(i),n=-1,o=e.length;++n=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function NAe(i){return function(){var e=this.__on;if(!!e){for(var t=0,n=-1,o=e.length,r;t()=>i;function kB(i,{sourceEvent:e,subject:t,target:n,identifier:o,active:r,x:s,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}kB.prototype.on=function(){var i=this._.on.apply(this._,arguments);return i===this._?this:i};function HAe(i){return!i.ctrlKey&&!i.button}function $Ae(){return this.parentNode}function zAe(i,e){return e==null?{x:i.x,y:i.y}:e}function UAe(){return navigator.maxTouchPoints||"ontouchstart"in this}function jAe(){var i=HAe,e=$Ae,t=zAe,n=UAe,o={},r=e4("start","drag","end"),s=0,a,l,c,d,u=0;function h(w){w.on("mousedown.drag",f).filter(n).on("touchstart.drag",v).on("touchmove.drag",m,VAe).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(w,L){if(!(d||!i.call(this,w,L))){var D=y(this,e.call(this,w,L),w,L,"mouse");!D||(bd(w.view).on("mousemove.drag",g,nD).on("mouseup.drag",p,nD),Uhe(w.view),O8(w),c=!1,a=w.clientX,l=w.clientY,D("start",w))}}function g(w){if(uy(w),!c){var L=w.clientX-a,D=w.clientY-l;c=L*L+D*D>u}o.mouse("drag",w)}function p(w){bd(w.view).on("mousemove.drag mouseup.drag",null),jhe(w.view,c),uy(w),o.mouse("end",w)}function v(w,L){if(!!i.call(this,w,L)){var D=w.changedTouches,E=e.call(this,w,L),I=D.length,k,R;for(k=0;k>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?NN(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?NN(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=qAe.exec(i))?new Wl(e[1],e[2],e[3],1):(e=GAe.exec(i))?new Wl(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=XAe.exec(i))?NN(e[1],e[2],e[3],e[4]):(e=YAe.exec(i))?NN(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ZAe.exec(i))?Vee(e[1],e[2]/100,e[3]/100,1):(e=QAe.exec(i))?Vee(e[1],e[2]/100,e[3]/100,e[4]):Aee.hasOwnProperty(i)?Fee(Aee[i]):i==="transparent"?new Wl(NaN,NaN,NaN,0):null}function Fee(i){return new Wl(i>>16&255,i>>8&255,i&255,1)}function NN(i,e,t,n){return n<=0&&(i=e=t=NaN),new Wl(i,e,t,n)}function tPe(i){return i instanceof CI||(i=rD(i)),i?(i=i.rgb(),new Wl(i.r,i.g,i.b,i.opacity)):new Wl}function IB(i,e,t,n){return arguments.length===1?tPe(i):new Wl(i,e,t,n==null?1:n)}function Wl(i,e,t,n){this.r=+i,this.g=+e,this.b=+t,this.opacity=+n}aK(Wl,IB,Khe(CI,{brighter(i){return i=i==null?aA:Math.pow(aA,i),new Wl(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?iD:Math.pow(iD,i),new Wl(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new Wl(S0(this.r),S0(this.g),S0(this.b),lA(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Bee,formatHex:Bee,formatHex8:nPe,formatRgb:Wee,toString:Wee}));function Bee(){return`#${n0(this.r)}${n0(this.g)}${n0(this.b)}`}function nPe(){return`#${n0(this.r)}${n0(this.g)}${n0(this.b)}${n0((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wee(){const i=lA(this.opacity);return`${i===1?"rgb(":"rgba("}${S0(this.r)}, ${S0(this.g)}, ${S0(this.b)}${i===1?")":`, ${i})`}`}function lA(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function S0(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function n0(i){return i=S0(i),(i<16?"0":"")+i.toString(16)}function Vee(i,e,t,n){return n<=0?i=e=t=NaN:t<=0||t>=1?i=e=NaN:e<=0&&(i=NaN),new Lu(i,e,t,n)}function qhe(i){if(i instanceof Lu)return new Lu(i.h,i.s,i.l,i.opacity);if(i instanceof CI||(i=rD(i)),!i)return new Lu;if(i instanceof Lu)return i;i=i.rgb();var e=i.r/255,t=i.g/255,n=i.b/255,o=Math.min(e,t,n),r=Math.max(e,t,n),s=NaN,a=r-o,l=(r+o)/2;return a?(e===r?s=(t-n)/a+(t0&&l<1?0:s,new Lu(s,a,l,i.opacity)}function iPe(i,e,t,n){return arguments.length===1?qhe(i):new Lu(i,e,t,n==null?1:n)}function Lu(i,e,t,n){this.h=+i,this.s=+e,this.l=+t,this.opacity=+n}aK(Lu,iPe,Khe(CI,{brighter(i){return i=i==null?aA:Math.pow(aA,i),new Lu(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?iD:Math.pow(iD,i),new Lu(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,e=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,o=2*t-n;return new Wl(F8(i>=240?i-240:i+120,o,n),F8(i,o,n),F8(i<120?i+240:i-120,o,n),this.opacity)},clamp(){return new Lu(Hee(this.h),RN(this.s),RN(this.l),lA(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=lA(this.opacity);return`${i===1?"hsl(":"hsla("}${Hee(this.h)}, ${RN(this.s)*100}%, ${RN(this.l)*100}%${i===1?")":`, ${i})`}`}}));function Hee(i){return i=(i||0)%360,i<0?i+360:i}function RN(i){return Math.max(0,Math.min(1,i||0))}function F8(i,e,t){return(i<60?e+(t-e)*i/60:i<180?t:i<240?e+(t-e)*(240-i)/60:e)*255}var Ghe=i=>()=>i;function oPe(i,e){return function(t){return i+t*e}}function rPe(i,e,t){return i=Math.pow(i,t),e=Math.pow(e,t)-i,t=1/t,function(n){return Math.pow(i+n*e,t)}}function sPe(i){return(i=+i)==1?Xhe:function(e,t){return t-e?rPe(e,t,i):Ghe(isNaN(e)?t:e)}}function Xhe(i,e){var t=e-i;return t?oPe(i,t):Ghe(isNaN(i)?e:i)}var $ee=function i(e){var t=sPe(e);function n(o,r){var s=t((o=IB(o)).r,(r=IB(r)).r),a=t(o.g,r.g),l=t(o.b,r.b),c=Xhe(o.opacity,r.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=l(d),o.opacity=c(d),o+""}}return n.gamma=i,n}(1);function tm(i,e){return i=+i,e=+e,function(t){return i*(1-t)+e*t}}var TB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,B8=new RegExp(TB.source,"g");function aPe(i){return function(){return i}}function lPe(i){return function(e){return i(e)+""}}function cPe(i,e){var t=TB.lastIndex=B8.lastIndex=0,n,o,r,s=-1,a=[],l=[];for(i=i+"",e=e+"";(n=TB.exec(i))&&(o=B8.exec(e));)(r=o.index)>t&&(r=e.slice(t,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:tm(n,o)})),t=B8.lastIndex;return t180?d+=360:d-c>180&&(c+=360),h.push({i:u.push(o(u)+"rotate(",null,n)-2,x:tm(c,d)})):d&&u.push(o(u)+"rotate("+d+n)}function a(c,d,u,h){c!==d?h.push({i:u.push(o(u)+"skewX(",null,n)-2,x:tm(c,d)}):d&&u.push(o(u)+"skewX("+d+n)}function l(c,d,u,h,f,g){if(c!==u||d!==h){var p=f.push(o(f)+"scale(",null,",",null,")");g.push({i:p-4,x:tm(c,u)},{i:p-2,x:tm(d,h)})}else(u!==1||h!==1)&&f.push(o(f)+"scale("+u+","+h+")")}return function(c,d){var u=[],h=[];return c=i(c),d=i(d),r(c.translateX,c.translateY,d.translateX,d.translateY,u,h),s(c.rotate,d.rotate,u,h),a(c.skewX,d.skewX,u,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,u,h),c=d=null,function(f){for(var g=-1,p=h.length,v;++g=0&&i._call.call(void 0,e),i=i._next;--iw}function jee(){z0=(dA=sD.now())+n4,iw=gL=0;try{bPe()}finally{iw=0,yPe(),z0=0}}function CPe(){var i=sD.now(),e=i-dA;e>Qhe&&(n4-=e,dA=i)}function yPe(){for(var i,e=cA,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),i=e,e=e._next):(t=e._next,e._next=null,e=i?i._next=t:cA=t);pL=i,RB(n)}function RB(i){if(!iw){gL&&(gL=clearTimeout(gL));var e=i-z0;e>24?(i<1/0&&(gL=setTimeout(jee,i-sD.now()-n4)),_x&&(_x=clearInterval(_x))):(_x||(dA=sD.now(),_x=setInterval(CPe,Qhe)),iw=1,Jhe(jee))}}function Kee(i,e,t){var n=new uA;return e=e==null?0:+e,n.restart(o=>{n.stop(),i(o+e)},e,t),n}var wPe=e4("start","end","cancel","interrupt"),SPe=[],tfe=0,qee=1,MB=2,OR=3,Gee=4,AB=5,FR=6;function i4(i,e,t,n,o,r){var s=i.__transition;if(!s)i.__transition={};else if(t in s)return;xPe(i,t,{name:e,index:n,group:o,on:wPe,tween:SPe,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:tfe})}function cK(i,e){var t=Ju(i,e);if(t.state>tfe)throw new Error("too late; already scheduled");return t}function Df(i,e){var t=Ju(i,e);if(t.state>OR)throw new Error("too late; already running");return t}function Ju(i,e){var t=i.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function xPe(i,e,t){var n=i.__transition,o;n[e]=t,t.timer=efe(r,0,t.time);function r(c){t.state=qee,t.timer.restart(s,t.delay,t.time),t.delay<=c&&s(c-t.delay)}function s(c){var d,u,h,f;if(t.state!==qee)return l();for(d in n)if(f=n[d],f.name===t.name){if(f.state===OR)return Kee(s);f.state===Gee?(f.state=FR,f.timer.stop(),f.on.call("interrupt",i,i.__data__,f.index,f.group),delete n[d]):+dMB&&n.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function eOe(i,e,t){var n,o,r=JPe(e)?cK:Df;return function(){var s=r(this,i),a=s.on;a!==n&&(o=(n=a).copy()).on(e,t),s.on=o}}function tOe(i,e){var t=this._id;return arguments.length<2?Ju(this.node(),t).on.on(i):this.each(eOe(t,i,e))}function nOe(i){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==i)return;e&&e.removeChild(this)}}function iOe(){return this.on("end.remove",nOe(this._id))}function oOe(i){var e=this._name,t=this._id;typeof i!="function"&&(i=rK(i));for(var n=this._groups,o=n.length,r=new Array(o),s=0;s()=>i;function IOe(i,{sourceEvent:e,target:t,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function Rg(i,e,t){this.k=i,this.x=e,this.y=t}Rg.prototype={constructor:Rg,scale:function(i){return i===1?this:new Rg(this.k*i,this.x,this.y)},translate:function(i,e){return i===0&e===0?this:new Rg(this.k,this.x+this.k*i,this.y+this.k*e)},apply:function(i){return[i[0]*this.k+this.x,i[1]*this.k+this.y]},applyX:function(i){return i*this.k+this.x},applyY:function(i){return i*this.k+this.y},invert:function(i){return[(i[0]-this.x)/this.k,(i[1]-this.y)/this.k]},invertX:function(i){return(i-this.x)/this.k},invertY:function(i){return(i-this.y)/this.k},rescaleX:function(i){return i.copy().domain(i.range().map(this.invertX,this).map(i.invert,i))},rescaleY:function(i){return i.copy().domain(i.range().map(this.invertY,this).map(i.invert,i))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ug=new Rg(1,0,0);Rg.prototype;function W8(i){i.stopImmediatePropagation()}function bx(i){i.preventDefault(),i.stopImmediatePropagation()}function TOe(i){return(!i.ctrlKey||i.type==="wheel")&&!i.button}function NOe(){var i=this;return i instanceof SVGElement?(i=i.ownerSVGElement||i,i.hasAttribute("viewBox")?(i=i.viewBox.baseVal,[[i.x,i.y],[i.x+i.width,i.y+i.height]]):[[0,0],[i.width.baseVal.value,i.height.baseVal.value]]):[[0,0],[i.clientWidth,i.clientHeight]]}function Xee(){return this.__zoom||Ug}function ROe(i){return-i.deltaY*(i.deltaMode===1?.05:i.deltaMode?1:.002)*(i.ctrlKey?10:1)}function MOe(){return navigator.maxTouchPoints||"ontouchstart"in this}function AOe(i,e,t){var n=i.invertX(e[0][0])-t[0][0],o=i.invertX(e[1][0])-t[1][0],r=i.invertY(e[0][1])-t[0][1],s=i.invertY(e[1][1])-t[1][1];return i.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function rfe(){var i=TOe,e=NOe,t=AOe,n=ROe,o=MOe,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=vPe,c=e4("start","zoom","end"),d,u,h,f=500,g=150,p=0,v=10;function m(M){M.property("__zoom",Xee).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",R).filter(o).on("touchstart.zoom",A).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(M,H,B,F){var $=M.selection?M.selection():M;$.property("__zoom",Xee),M!==$?L(M,H,B,F):$.interrupt().each(function(){D(this,arguments).event(F).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},m.scaleBy=function(M,H,B,F){m.scaleTo(M,function(){var $=this.__zoom.k,z=typeof H=="function"?H.apply(this,arguments):H;return $*z},B,F)},m.scaleTo=function(M,H,B,F){m.transform(M,function(){var $=e.apply(this,arguments),z=this.__zoom,K=B==null?w($):typeof B=="function"?B.apply(this,arguments):B,j=z.invert(K),G=typeof H=="function"?H.apply(this,arguments):H;return t(y(_(z,G),K,j),$,s)},B,F)},m.translateBy=function(M,H,B,F){m.transform(M,function(){return t(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof B=="function"?B.apply(this,arguments):B),e.apply(this,arguments),s)},null,F)},m.translateTo=function(M,H,B,F,$){m.transform(M,function(){var z=e.apply(this,arguments),K=this.__zoom,j=F==null?w(z):typeof F=="function"?F.apply(this,arguments):F;return t(Ug.translate(j[0],j[1]).scale(K.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof B=="function"?-B.apply(this,arguments):-B),z,s)},F,$)};function _(M,H){return H=Math.max(r[0],Math.min(r[1],H)),H===M.k?M:new Rg(H,M.x,M.y)}function y(M,H,B){var F=H[0]-B[0]*M.k,$=H[1]-B[1]*M.k;return F===M.x&&$===M.y?M:new Rg(M.k,F,$)}function w(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function L(M,H,B,F){M.on("start.zoom",function(){D(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(F).end()}).tween("zoom",function(){var $=this,z=arguments,K=D($,z).event(F),j=e.apply($,z),G=B==null?w(j):typeof B=="function"?B.apply($,z):B,X=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),ue=$.__zoom,fe=typeof H=="function"?H.apply($,z):H,pe=l(ue.invert(G).concat(X/ue.k),fe.invert(G).concat(X/fe.k));return function(be){if(be===1)be=fe;else{var Se=pe(be),Fe=X/Se[2];be=new Rg(Fe,G[0]-Se[0]*Fe,G[1]-Se[1]*Fe)}K.zoom(null,be)}})}function D(M,H,B){return!B&&M.__zooming||new E(M,H)}function E(M,H){this.that=M,this.args=H,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,H),this.taps=0}E.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,H){return this.mouse&&M!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var H=bd(this.that).datum();c.call(M,this.that,new IOe(M,{sourceEvent:this.sourceEvent,target:m,type:M,transform:this.that.__zoom,dispatch:c}),H)}};function I(M,...H){if(!i.apply(this,arguments))return;var B=D(this,H).event(M),F=this.__zoom,$=Math.max(r[0],Math.min(r[1],F.k*Math.pow(2,n.apply(this,arguments)))),z=gu(M);if(B.wheel)(B.mouse[0][0]!==z[0]||B.mouse[0][1]!==z[1])&&(B.mouse[1]=F.invert(B.mouse[0]=z)),clearTimeout(B.wheel);else{if(F.k===$)return;B.mouse=[z,F.invert(z)],BR(this),B.start()}bx(M),B.wheel=setTimeout(K,g),B.zoom("mouse",t(y(_(F,$),B.mouse[0],B.mouse[1]),B.extent,s));function K(){B.wheel=null,B.end()}}function k(M,...H){if(h||!i.apply(this,arguments))return;var B=M.currentTarget,F=D(this,H,!0).event(M),$=bd(M.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",X,!0),z=gu(M,B),K=M.clientX,j=M.clientY;Uhe(M.view),W8(M),F.mouse=[z,this.__zoom.invert(z)],BR(this),F.start();function G(ue){if(bx(ue),!F.moved){var fe=ue.clientX-K,pe=ue.clientY-j;F.moved=fe*fe+pe*pe>p}F.event(ue).zoom("mouse",t(y(F.that.__zoom,F.mouse[0]=gu(ue,B),F.mouse[1]),F.extent,s))}function X(ue){$.on("mousemove.zoom mouseup.zoom",null),jhe(ue.view,F.moved),bx(ue),F.event(ue).end()}}function R(M,...H){if(!!i.apply(this,arguments)){var B=this.__zoom,F=gu(M.changedTouches?M.changedTouches[0]:M,this),$=B.invert(F),z=B.k*(M.shiftKey?.5:2),K=t(y(_(B,z),F,$),e.apply(this,H),s);bx(M),a>0?bd(this).transition().duration(a).call(L,K,F,M):bd(this).call(m.transform,K,F,M)}}function A(M,...H){if(!!i.apply(this,arguments)){var B=M.touches,F=B.length,$=D(this,H,M.changedTouches.length===F).event(M),z,K,j,G;for(W8(M),K=0;K"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:i=>`Node type "${i}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:i=>`The old edge with id=${i} does not exist.`,error009:i=>`Marker type "${i}" doesn't exist.`,error008:(i,e)=>`Couldn't create edge for ${i?"target":"source"} handle id: "${i?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:i=>`Edge type "${i}" not found. Using fallback type "default".`,error012:i=>`Node with id "${i}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},afe=ip.error001();function mo(i,e){const t=x.exports.useContext(r4);if(t===null)throw new Error(afe);return The(t,i,e)}const cs=()=>{const i=x.exports.useContext(r4);if(i===null)throw new Error(afe);return x.exports.useMemo(()=>({getState:i.getState,setState:i.setState,subscribe:i.subscribe,destroy:i.destroy}),[i])},VOe=i=>i.userSelectionActive?"none":"all";function aD({position:i,children:e,className:t,style:n,...o}){const r=mo(VOe),s=`${i}`.split("-");return he("div",{className:fa(["react-flow__panel",t,...s]),style:{...n,pointerEvents:r},...o,children:e})}function HOe({proOptions:i,position:e="bottom-right"}){return i!=null&&i.hideAttribution?null:he(aD,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro",children:he("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const $Oe=({x:i,y:e,label:t,labelStyle:n={},labelShowBg:o=!0,labelBgStyle:r={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const u=x.exports.useRef(null),[h,f]=x.exports.useState({x:0,y:0,width:0,height:0}),g=fa(["react-flow__edge-textwrapper",c]);return x.exports.useEffect(()=>{if(u.current){const p=u.current.getBBox();f({x:p.x,y:p.y,width:p.width,height:p.height})}},[t]),typeof t=="undefined"||!t?null:fn("g",{transform:`translate(${i-h.width/2} ${e-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...d,children:[o&&he("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:r,rx:a,ry:a}),he("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:u,style:n,children:t}),l]})};var zOe=x.exports.memo($Oe);const dK=i=>({width:i.offsetWidth,height:i.offsetHeight}),ow=(i,e=0,t=1)=>Math.min(Math.max(i,e),t),uK=(i={x:0,y:0},e)=>({x:ow(i.x,e[0][0],e[1][0]),y:ow(i.y,e[0][1],e[1][1])}),Yee=(i,e,t)=>it?-ow(Math.abs(i-t),1,50)/50:0,lfe=(i,e)=>{const t=Yee(i.x,35,e.width-35)*20,n=Yee(i.y,35,e.height-35)*20;return[t,n]},cfe=i=>{var e;return((e=i.getRootNode)==null?void 0:e.call(i))||(window==null?void 0:window.document)},dfe=(i,e)=>({x:Math.min(i.x,e.x),y:Math.min(i.y,e.y),x2:Math.max(i.x2,e.x2),y2:Math.max(i.y2,e.y2)}),lD=({x:i,y:e,width:t,height:n})=>({x:i,y:e,x2:i+t,y2:e+n}),ufe=({x:i,y:e,x2:t,y2:n})=>({x:i,y:e,width:t-i,height:n-e}),Zee=i=>({...i.positionAbsolute||{x:0,y:0},width:i.width||0,height:i.height||0}),UOe=(i,e)=>ufe(dfe(lD(i),lD(e))),AB=(i,e)=>{const t=Math.max(0,Math.min(i.x+i.width,e.x+e.width)-Math.max(i.x,e.x)),n=Math.max(0,Math.min(i.y+i.height,e.y+e.height)-Math.max(i.y,e.y));return Math.ceil(t*n)},jOe=i=>yd(i.width)&&yd(i.height)&&yd(i.x)&&yd(i.y),yd=i=>!isNaN(i)&&isFinite(i),ys=Symbol.for("internals"),hfe=["Enter"," ","Escape"],KOe=(i,e)=>{},qOe=i=>"nativeEvent"in i;function PB(i){var o,r;const e=qOe(i)?i.nativeEvent:i,t=((r=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:r[0])||i.target;return["INPUT","SELECT","TEXTAREA"].includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const ffe=i=>"clientX"in i,zm=(i,e)=>{var r,s,a,l;const t=ffe(i),n=t?i.clientX:(r=i.touches)==null?void 0:r[0].clientX,o=t?i.clientY:(s=i.touches)==null?void 0:s[0].clientY;return{x:n-((a=e==null?void 0:e.left)!=null?a:0),y:o-((l=e==null?void 0:e.top)!=null?l:0)}},hA=()=>{var i;return typeof navigator!="undefined"&&((i=navigator==null?void 0:navigator.userAgent)==null?void 0:i.indexOf("Mac"))>=0},wI=({id:i,path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:h,interactionWidth:f=20})=>fn(ks,{children:[he("path",{id:i,style:d,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:u,markerStart:h}),f&&he("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),o&&yd(t)&&yd(n)?he(zOe,{x:t,y:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]});wI.displayName="BaseEdge";function Cx(i,e,t){return t===void 0?t:n=>{const o=e().edges.find(r=>r.id===i);o&&t(n,{...o})}}function gfe({sourceX:i,sourceY:e,targetX:t,targetY:n}){const o=Math.abs(t-i)/2,r=t{const[v,m,_]=mfe({sourceX:i,sourceY:e,sourcePosition:o,targetX:t,targetY:n,targetPosition:r});return he(wI,{path:v,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:h,markerEnd:f,markerStart:g,interactionWidth:p})});hK.displayName="SimpleBezierEdge";const Jee={[mn.Left]:{x:-1,y:0},[mn.Right]:{x:1,y:0},[mn.Top]:{x:0,y:-1},[mn.Bottom]:{x:0,y:1}},GOe=({source:i,sourcePosition:e=mn.Bottom,target:t})=>e===mn.Left||e===mn.Right?i.xMath.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2));function XOe({source:i,sourcePosition:e=mn.Bottom,target:t,targetPosition:n=mn.Top,center:o,offset:r}){const s=Jee[e],a=Jee[n],l={x:i.x+s.x*r,y:i.y+s.y*r},c={x:t.x+a.x*r,y:t.y+a.y*r},d=GOe({source:l,sourcePosition:e,target:c}),u=d.x!==0?"x":"y",h=d[u];let f=[],g,p;const v={x:0,y:0},m={x:0,y:0},[_,y,w,L]=gfe({sourceX:i.x,sourceY:i.y,targetX:t.x,targetY:t.y});if(s[u]*a[u]===-1){g=o.x||_,p=o.y||y;const E=[{x:g,y:l.y},{x:g,y:c.y}],I=[{x:l.x,y:p},{x:c.x,y:p}];s[u]===h?f=u==="x"?E:I:f=u==="x"?I:E}else{const E=[{x:l.x,y:c.y}],I=[{x:c.x,y:l.y}];if(u==="x"?f=s.x===h?I:E:f=s.y===h?E:I,e===n){const N=Math.abs(i[u]-t[u]);if(N<=r){const M=Math.min(r-1,r-N);s[u]===h?v[u]=(l[u]>i[u]?-1:1)*M:m[u]=(c[u]>t[u]?-1:1)*M}}if(e!==n){const N=u==="x"?"y":"x",M=s[u]===a[N],H=l[N]>c[N],B=l[N]=P?(g=(k.x+R.x)/2,p=f[0].y):(g=f[0].x,p=(k.y+R.y)/2)}return[[i,{x:l.x+v.x,y:l.y+v.y},...f,{x:c.x+m.x,y:c.y+m.y},t],g,p,w,L]}function YOe(i,e,t,n){const o=Math.min(ete(i,e)/2,ete(e,t)/2,n),{x:r,y:s}=e;if(i.x===r&&r===t.x||i.y===s&&s===t.y)return`L${r} ${s}`;if(i.y===s){const c=i.x{let y="";return _>0&&_{const[m,_,y]=OB({sourceX:i,sourceY:e,sourcePosition:u,targetX:t,targetY:n,targetPosition:h,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset});return he(wI,{path:m,labelX:_,labelY:y,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:g,interactionWidth:v})});s4.displayName="SmoothStepEdge";const fK=x.exports.memo(i=>{var e;return he(s4,{...i,pathOptions:x.exports.useMemo(()=>{var t;return{borderRadius:0,offset:(t=i.pathOptions)==null?void 0:t.offset}},[(e=i.pathOptions)==null?void 0:e.offset])})});fK.displayName="StepEdge";function ZOe({sourceX:i,sourceY:e,targetX:t,targetY:n}){const[o,r,s,a]=gfe({sourceX:i,sourceY:e,targetX:t,targetY:n});return[`M ${i},${e}L ${t},${n}`,o,r,s,a]}const gK=x.exports.memo(({sourceX:i,sourceY:e,targetX:t,targetY:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:h,interactionWidth:f})=>{const[g,p,v]=ZOe({sourceX:i,sourceY:e,targetX:t,targetY:n});return he(wI,{path:g,labelX:p,labelY:v,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:h,interactionWidth:f})});gK.displayName="StraightEdge";function PN(i,e){return i>=0?.5*i:e*25*Math.sqrt(-i)}function tte({pos:i,x1:e,y1:t,x2:n,y2:o,c:r}){switch(i){case mn.Left:return[e-PN(e-n,r),t];case mn.Right:return[e+PN(n-e,r),t];case mn.Top:return[e,t-PN(t-o,r)];case mn.Bottom:return[e,t+PN(o-t,r)]}}function vfe({sourceX:i,sourceY:e,sourcePosition:t=mn.Bottom,targetX:n,targetY:o,targetPosition:r=mn.Top,curvature:s=.25}){const[a,l]=tte({pos:t,x1:i,y1:e,x2:n,y2:o,c:s}),[c,d]=tte({pos:r,x1:n,y1:o,x2:i,y2:e,c:s}),[u,h,f,g]=pfe({sourceX:i,sourceY:e,targetX:n,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${i},${e} C${a},${l} ${c},${d} ${n},${o}`,u,h,f,g]}const gA=x.exports.memo(({sourceX:i,sourceY:e,targetX:t,targetY:n,sourcePosition:o=mn.Bottom,targetPosition:r=mn.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:h,markerEnd:f,markerStart:g,pathOptions:p,interactionWidth:v})=>{const[m,_,y]=vfe({sourceX:i,sourceY:e,sourcePosition:o,targetX:t,targetY:n,targetPosition:r,curvature:p==null?void 0:p.curvature});return he(wI,{path:m,labelX:_,labelY:y,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:h,markerEnd:f,markerStart:g,interactionWidth:v})});gA.displayName="BezierEdge";const pK=x.exports.createContext(null),QOe=pK.Provider;pK.Consumer;const JOe=()=>x.exports.useContext(pK),FB=i=>"id"in i&&"source"in i&&"target"in i,e4e=({source:i,sourceHandle:e,target:t,targetHandle:n})=>`reactflow__edge-${i}${e||""}-${t}${n||""}`,BB=(i,e)=>typeof i=="undefined"?"":typeof i=="string"?i:`${e?`${e}__`:""}${Object.keys(i).sort().map(n=>`${n}=${i[n]}`).join("&")}`,t4e=(i,e)=>e.some(t=>t.source===i.source&&t.target===i.target&&(t.sourceHandle===i.sourceHandle||!t.sourceHandle&&!i.sourceHandle)&&(t.targetHandle===i.targetHandle||!t.targetHandle&&!i.targetHandle)),_fe=(i,e)=>{if(!i.source||!i.target)return e;let t;return FB(i)?t={...i}:t={...i,id:e4e(i)},t4e(t,e)?e:e.concat(t)},WB=({x:i,y:e},[t,n,o],r,[s,a])=>{const l={x:(i-t)/o,y:(e-n)/o};return r?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},bfe=({x:i,y:e},[t,n,o])=>({x:i*o+t,y:e*o+n}),x0=(i,e=[0,0])=>{var r,s;if(!i)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const t=((r=i.width)!=null?r:0)*e[0],n=((s=i.height)!=null?s:0)*e[1],o={x:i.position.x-t,y:i.position.y-n};return{...o,positionAbsolute:i.positionAbsolute?{x:i.positionAbsolute.x-t,y:i.positionAbsolute.y-n}:o}},a4=(i,e=[0,0])=>{if(i.length===0)return{x:0,y:0,width:0,height:0};const t=i.reduce((n,o)=>{const{x:r,y:s}=x0(o,e).positionAbsolute;return dfe(n,lD({x:r,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ufe(t)},Cfe=(i,e,[t,n,o]=[0,0,1],r=!1,s=!1,a=[0,0])=>{const l={x:(e.x-t)/o,y:(e.y-n)/o,width:e.width/o,height:e.height/o},c=[];return i.forEach(d=>{const{width:u,height:h,selectable:f=!0,hidden:g=!1}=d;if(s&&!f||g)return!1;const{positionAbsolute:p}=x0(d,a),v={x:p.x,y:p.y,width:u||0,height:h||0},m=AB(l,v),_=typeof u=="undefined"||typeof h=="undefined"||u===null||h===null,y=r&&m>0,w=(u||0)*(h||0);(_||y||m>=w||d.dragging)&&c.push(d)}),c},yfe=(i,e)=>{const t=i.map(n=>n.id);return e.filter(n=>t.includes(n.source)||t.includes(n.target))},wfe=(i,e,t,n,o,r=.1)=>{const s=e/(i.width*(1+r)),a=t/(i.height*(1+r)),l=Math.min(s,a),c=ow(l,n,o),d=i.x+i.width/2,u=i.y+i.height/2,h=e/2-d*c,f=t/2-u*c;return{x:h,y:f,zoom:c}},I_=(i,e=0)=>i.transition().duration(e);function nte(i,e,t,n){return(e[t]||[]).reduce((o,r)=>{var s,a,l,c;return`${i.id}-${r.id}-${t}`!==n&&o.push({id:r.id||null,type:t,nodeId:i.id,x:((a=(s=i.positionAbsolute)==null?void 0:s.x)!=null?a:0)+r.x+r.width/2,y:((c=(l=i.positionAbsolute)==null?void 0:l.y)!=null?c:0)+r.y+r.height/2}),o},[])}function n4e(i,e,t,n,o,r){const{x:s,y:a}=zm(i),c=e.elementsFromPoint(s,a).find(g=>g.classList.contains("react-flow__handle"));if(c){const g=c.getAttribute("data-nodeid");if(g){const p=mK(void 0,c),v=c.getAttribute("data-handleid"),m=r({nodeId:g,id:v,type:p});if(m){const _=o.find(y=>y.nodeId===g&&y.type===p&&y.id===v);return{handle:{id:v,type:p,nodeId:g,x:(_==null?void 0:_.x)||t.x,y:(_==null?void 0:_.y)||t.y},validHandleResult:m}}}}let d=[],u=1/0;if(o.forEach(g=>{const p=Math.sqrt((g.x-t.x)**2+(g.y-t.y)**2);if(p<=n){const v=r(g);p<=u&&(pg.isValid),f=d.some(({handle:g})=>g.type==="target");return d.find(({handle:g,validHandleResult:p})=>f?g.type==="target":h?p.isValid:!0)||d[0]}const i4e={source:null,target:null,sourceHandle:null,targetHandle:null},Sfe=()=>({handleDomNode:null,isValid:!1,connection:i4e,endHandle:null});function xfe(i,e,t,n,o,r,s){const a=o==="target",l=s.querySelector(`.react-flow__handle[data-id="${i==null?void 0:i.nodeId}-${i==null?void 0:i.id}-${i==null?void 0:i.type}"]`),c={...Sfe(),handleDomNode:l};if(l){const d=mK(void 0,l),u=l.getAttribute("data-nodeid"),h=l.getAttribute("data-handleid"),f=l.classList.contains("connectable"),g=l.classList.contains("connectableend"),p={source:a?u:t,sourceHandle:a?h:n,target:a?t:u,targetHandle:a?n:h};c.connection=p,f&&g&&(e===U0.Strict?a&&d==="source"||!a&&d==="target":u!==t||h!==n)&&(c.endHandle={nodeId:u,handleId:h,type:d},c.isValid=r(p))}return c}function o4e({nodes:i,nodeId:e,handleId:t,handleType:n}){return i.reduce((o,r)=>{if(r[ys]){const{handleBounds:s}=r[ys];let a=[],l=[];s&&(a=nte(r,s,"source",`${e}-${t}-${n}`),l=nte(r,s,"target",`${e}-${t}-${n}`)),o.push(...a,...l)}return o},[])}function mK(i,e){return i||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function W8(i){i==null||i.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function r4e(i,e){let t=null;return e?t="valid":i&&!e&&(t="invalid"),t}function Lfe({event:i,handleId:e,nodeId:t,onConnect:n,isTarget:o,getState:r,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const d=cfe(i.target),{connectionMode:u,domNode:h,autoPanOnConnect:f,connectionRadius:g,onConnectStart:p,panBy:v,getNodes:m,cancelConnection:_}=r();let y=0,w;const{x:L,y:D}=zm(i),E=d==null?void 0:d.elementFromPoint(L,D),I=mK(l,E),k=h==null?void 0:h.getBoundingClientRect();if(!k||!I)return;let R,A=zm(i,k),P=!1,N=null,M=!1,H=null;const B=o4e({nodes:m(),nodeId:t,handleId:e,handleType:I}),F=()=>{if(!f)return;const[K,j]=lfe(A,k);v({x:K,y:j}),y=requestAnimationFrame(F)};s({connectionPosition:A,connectionStatus:null,connectionNodeId:t,connectionHandleId:e,connectionHandleType:I,connectionStartHandle:{nodeId:t,handleId:e,type:I},connectionEndHandle:null}),p==null||p(i,{nodeId:t,handleId:e,handleType:I});function $(K){const{transform:j}=r();A=zm(K,k);const{handle:G,validHandleResult:X}=n4e(K,d,WB(A,j,!1,[1,1]),g,B,ue=>xfe(ue,u,t,e,o?"target":"source",a,d));if(w=G,P||(F(),P=!0),H=X.handleDomNode,N=X.connection,M=X.isValid,s({connectionPosition:w&&M?bfe({x:w.x,y:w.y},j):A,connectionStatus:r4e(!!w,M),connectionEndHandle:X.endHandle}),!w&&!M&&!H)return W8(R);N.source!==N.target&&H&&(W8(R),R=H,H.classList.add("connecting","react-flow__handle-connecting"),H.classList.toggle("valid",M),H.classList.toggle("react-flow__handle-valid",M))}function z(K){var j,G;(w||H)&&N&&M&&(n==null||n(N)),(G=(j=r()).onConnectEnd)==null||G.call(j,K),l&&(c==null||c(K)),W8(R),_(),cancelAnimationFrame(y),P=!1,M=!1,N=null,H=null,d.removeEventListener("mousemove",$),d.removeEventListener("mouseup",z),d.removeEventListener("touchmove",$),d.removeEventListener("touchend",z)}d.addEventListener("mousemove",$),d.addEventListener("mouseup",z),d.addEventListener("touchmove",$),d.addEventListener("touchend",z)}const ite=()=>!0,s4e=i=>({connectionStartHandle:i.connectionStartHandle,connectOnClick:i.connectOnClick,noPanClassName:i.noPanClassName}),a4e=(i,e,t)=>n=>{const{connectionStartHandle:o,connectionEndHandle:r,connectionClickStartHandle:s}=n;return{connecting:(o==null?void 0:o.nodeId)===i&&(o==null?void 0:o.handleId)===e&&(o==null?void 0:o.type)===t||(r==null?void 0:r.nodeId)===i&&(r==null?void 0:r.handleId)===e&&(r==null?void 0:r.type)===t,clickConnecting:(s==null?void 0:s.nodeId)===i&&(s==null?void 0:s.handleId)===e&&(s==null?void 0:s.type)===t}},Efe=x.exports.forwardRef(({type:i="source",position:e=mn.Top,isValidConnection:t,isConnectable:n=!0,isConnectableStart:o=!0,isConnectableEnd:r=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:u,...h},f)=>{var k,R;const g=s||null,p=i==="target",v=cs(),m=JOe(),{connectOnClick:_,noPanClassName:y}=mo(s4e,Hs),{connecting:w,clickConnecting:L}=mo(a4e(m,g,i),Hs);m||(R=(k=v.getState()).onError)==null||R.call(k,"010",ip.error010());const D=A=>{const{defaultEdgeOptions:P,onConnect:N,hasDefaultEdges:M}=v.getState(),H={...P,...A};if(M){const{edges:B,setEdges:F}=v.getState();F(_fe(H,B))}N==null||N(H),a==null||a(H)},E=A=>{if(!m)return;const P=ffe(A);o&&(P&&A.button===0||!P)&&Lfe({event:A,handleId:g,nodeId:m,onConnect:D,isTarget:p,getState:v.getState,setState:v.setState,isValidConnection:t||v.getState().isValidConnection||ite}),P?d==null||d(A):u==null||u(A)},I=A=>{const{onClickConnectStart:P,onClickConnectEnd:N,connectionClickStartHandle:M,connectionMode:H,isValidConnection:B}=v.getState();if(!m||!M&&!o)return;if(!M){P==null||P(A,{nodeId:m,handleId:g,handleType:i}),v.setState({connectionClickStartHandle:{nodeId:m,type:i,handleId:g}});return}const F=cfe(A.target),$=t||B||ite,{connection:z,isValid:K}=xfe({nodeId:m,id:g,type:i},H,M.nodeId,M.handleId||null,M.type,$,F);K&&D(z),N==null||N(A),v.setState({connectionClickStartHandle:null})};return he("div",{"data-handleid":g,"data-nodeid":m,"data-handlepos":e,"data-id":`${m}-${g}-${i}`,className:fa(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",y,c,{source:!p,target:p,connectable:n,connectablestart:o,connectableend:r,connecting:L,connectionindicator:n&&(o&&!w||r&&w)}]),onMouseDown:E,onTouchStart:E,onClick:_?I:void 0,ref:f,...h,children:l})});Efe.displayName="Handle";var dD=x.exports.memo(Efe);const Dfe=({data:i,isConnectable:e,targetPosition:t=mn.Top,sourcePosition:n=mn.Bottom})=>fn(ks,{children:[he(dD,{type:"target",position:t,isConnectable:e}),i==null?void 0:i.label,he(dD,{type:"source",position:n,isConnectable:e})]});Dfe.displayName="DefaultNode";var VB=x.exports.memo(Dfe);const kfe=({data:i,isConnectable:e,sourcePosition:t=mn.Bottom})=>fn(ks,{children:[i==null?void 0:i.label,he(dD,{type:"source",position:t,isConnectable:e})]});kfe.displayName="InputNode";var Ife=x.exports.memo(kfe);const Tfe=({data:i,isConnectable:e,targetPosition:t=mn.Top})=>fn(ks,{children:[he(dD,{type:"target",position:t,isConnectable:e}),i==null?void 0:i.label]});Tfe.displayName="OutputNode";var Nfe=x.exports.memo(Tfe);const vK=()=>null;vK.displayName="GroupNode";const l4e=i=>({selectedNodes:i.getNodes().filter(e=>e.selected),selectedEdges:i.edges.filter(e=>e.selected)}),ON=i=>i.id;function c4e(i,e){return Hs(i.selectedNodes.map(ON),e.selectedNodes.map(ON))&&Hs(i.selectedEdges.map(ON),e.selectedEdges.map(ON))}const Rfe=x.exports.memo(({onSelectionChange:i})=>{const e=cs(),{selectedNodes:t,selectedEdges:n}=mo(l4e,c4e);return x.exports.useEffect(()=>{const o={nodes:t,edges:n};i==null||i(o),e.getState().onSelectionChange.forEach(r=>r(o))},[t,n,i]),null});Rfe.displayName="SelectionListener";const d4e=i=>!!i.onSelectionChange;function u4e({onSelectionChange:i}){const e=mo(d4e);return i||e?he(Rfe,{onSelectionChange:i}):null}const h4e=i=>({setNodes:i.setNodes,setEdges:i.setEdges,setDefaultNodesAndEdges:i.setDefaultNodesAndEdges,setMinZoom:i.setMinZoom,setMaxZoom:i.setMaxZoom,setTranslateExtent:i.setTranslateExtent,setNodeExtent:i.setNodeExtent,reset:i.reset});function S1(i,e){x.exports.useEffect(()=>{typeof i!="undefined"&&e(i)},[i])}function _i(i,e,t){x.exports.useEffect(()=>{typeof e!="undefined"&&t({[i]:e})},[e])}const f4e=({nodes:i,edges:e,defaultNodes:t,defaultEdges:n,onConnect:o,onConnectStart:r,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:u,edgesFocusable:h,edgesUpdatable:f,elevateNodesOnSelect:g,minZoom:p,maxZoom:v,nodeExtent:m,onNodesChange:_,onEdgesChange:y,elementsSelectable:w,connectionMode:L,snapGrid:D,snapToGrid:E,translateExtent:I,connectOnClick:k,defaultEdgeOptions:R,fitView:A,fitViewOptions:P,onNodesDelete:N,onEdgesDelete:M,onNodeDrag:H,onNodeDragStart:B,onNodeDragStop:F,onSelectionDrag:$,onSelectionDragStart:z,onSelectionDragStop:K,noPanClassName:j,nodeOrigin:G,rfId:X,autoPanOnConnect:ue,autoPanOnNodeDrag:fe,onError:pe,connectionRadius:be,isValidConnection:Se,nodeDragThreshold:Fe})=>{const{setNodes:De,setEdges:ce,setDefaultNodesAndEdges:Pe,setMinZoom:Oe,setMaxZoom:xe,setTranslateExtent:Ee,setNodeExtent:tt,reset:nt}=mo(h4e,Hs),Qe=cs();return x.exports.useEffect(()=>{const Ge=n==null?void 0:n.map(re=>({...re,...R}));return Pe(t,Ge),()=>{nt()}},[]),_i("defaultEdgeOptions",R,Qe.setState),_i("connectionMode",L,Qe.setState),_i("onConnect",o,Qe.setState),_i("onConnectStart",r,Qe.setState),_i("onConnectEnd",s,Qe.setState),_i("onClickConnectStart",a,Qe.setState),_i("onClickConnectEnd",l,Qe.setState),_i("nodesDraggable",c,Qe.setState),_i("nodesConnectable",d,Qe.setState),_i("nodesFocusable",u,Qe.setState),_i("edgesFocusable",h,Qe.setState),_i("edgesUpdatable",f,Qe.setState),_i("elementsSelectable",w,Qe.setState),_i("elevateNodesOnSelect",g,Qe.setState),_i("snapToGrid",E,Qe.setState),_i("snapGrid",D,Qe.setState),_i("onNodesChange",_,Qe.setState),_i("onEdgesChange",y,Qe.setState),_i("connectOnClick",k,Qe.setState),_i("fitViewOnInit",A,Qe.setState),_i("fitViewOnInitOptions",P,Qe.setState),_i("onNodesDelete",N,Qe.setState),_i("onEdgesDelete",M,Qe.setState),_i("onNodeDrag",H,Qe.setState),_i("onNodeDragStart",B,Qe.setState),_i("onNodeDragStop",F,Qe.setState),_i("onSelectionDrag",$,Qe.setState),_i("onSelectionDragStart",z,Qe.setState),_i("onSelectionDragStop",K,Qe.setState),_i("noPanClassName",j,Qe.setState),_i("nodeOrigin",G,Qe.setState),_i("rfId",X,Qe.setState),_i("autoPanOnConnect",ue,Qe.setState),_i("autoPanOnNodeDrag",fe,Qe.setState),_i("onError",pe,Qe.setState),_i("connectionRadius",be,Qe.setState),_i("isValidConnection",Se,Qe.setState),_i("nodeDragThreshold",Fe,Qe.setState),S1(i,De),S1(e,ce),S1(p,Oe),S1(v,xe),S1(I,Ee),S1(m,tt),null},ote={display:"none"},g4e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Mfe="react-flow__node-desc",Afe="react-flow__edge-desc",p4e="react-flow__aria-live",m4e=i=>i.ariaLiveMessage;function v4e({rfId:i}){const e=mo(m4e);return he("div",{id:`${p4e}-${i}`,"aria-live":"assertive","aria-atomic":"true",style:g4e,children:e})}function _4e({rfId:i,disableKeyboardA11y:e}){return fn(ks,{children:[fn("div",{id:`${Mfe}-${i}`,style:ote,children:["Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),he("div",{id:`${Afe}-${i}`,style:ote,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!e&&he(v4e,{rfId:i})]})}var uD=(i=null,e={actInsideInputWithModifier:!0})=>{const[t,n]=x.exports.useState(!1),o=x.exports.useRef(!1),r=x.exports.useRef(new Set([])),[s,a]=x.exports.useMemo(()=>{if(i!==null){const c=(Array.isArray(i)?i:[i]).filter(u=>typeof u=="string").map(u=>u.split("+")),d=c.reduce((u,h)=>u.concat(...h),[]);return[c,d]}return[[],[]]},[i]);return x.exports.useEffect(()=>{const l=typeof document!="undefined"?document:null,c=(e==null?void 0:e.target)||l;if(i!==null){const d=f=>{if(o.current=f.ctrlKey||f.metaKey||f.shiftKey,(!o.current||o.current&&!e.actInsideInputWithModifier)&&PB(f))return!1;const p=ste(f.code,a);r.current.add(f[p]),rte(s,r.current,!1)&&(f.preventDefault(),n(!0))},u=f=>{if((!o.current||o.current&&!e.actInsideInputWithModifier)&&PB(f))return!1;const p=ste(f.code,a);rte(s,r.current,!0)?(n(!1),r.current.clear()):r.current.delete(f[p]),f.key==="Meta"&&r.current.clear(),o.current=!1},h=()=>{r.current.clear(),n(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",u),window.addEventListener("blur",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",u),window.removeEventListener("blur",h)}}},[i,n]),t};function rte(i,e,t){return i.filter(n=>t||n.length===e.size).some(n=>n.every(o=>e.has(o)))}function ste(i,e){return e.includes(i)?"code":"key"}function Pfe(i,e,t,n){var s,a,l,c,d,u,h,f;if(!i.parentNode)return t;const o=e.get(i.parentNode),r=x0(o,n);return Pfe(o,e,{x:((s=t.x)!=null?s:0)+r.x,y:((a=t.y)!=null?a:0)+r.y,z:((c=(l=o[ys])==null?void 0:l.z)!=null?c:0)>((d=t.z)!=null?d:0)?(h=(u=o[ys])==null?void 0:u.z)!=null?h:0:(f=t.z)!=null?f:0},n)}function Ofe(i,e,t){i.forEach(n=>{var o,r;if(n.parentNode&&!i.has(n.parentNode))throw new Error(`Parent node ${n.parentNode} not found`);if(n.parentNode||(t==null?void 0:t[n.id])){const{x:s,y:a,z:l}=Pfe(n,i,{...n.position,z:(r=(o=n[ys])==null?void 0:o.z)!=null?r:0},e);n.positionAbsolute={x:s,y:a},n[ys].z=l,t!=null&&t[n.id]&&(n[ys].isParent=!0)}})}function V8(i,e,t,n){const o=new Map,r={},s=n?1e3:0;return i.forEach(a=>{var u;const l=(yd(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=e.get(a.id),d={width:c==null?void 0:c.width,height:c==null?void 0:c.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(d.parentNode=a.parentNode,r[a.parentNode]=!0),Object.defineProperty(d,ys,{enumerable:!1,value:{handleBounds:(u=c==null?void 0:c[ys])==null?void 0:u.handleBounds,z:l}}),o.set(a.id,d)}),Ofe(o,t,r),o}function Ffe(i,e={}){var g,p,v;const{getNodes:t,width:n,height:o,minZoom:r,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:u}=i(),h=e.initial&&!c&&d;if(a&&l&&(h||!e.initial)){const m=t().filter(y=>{var L;const w=e.includeHiddenNodes?y.width&&y.height:!y.hidden;return(L=e.nodes)!=null&&L.length?w&&e.nodes.some(D=>D.id===y.id):w}),_=m.every(y=>y.width&&y.height);if(m.length>0&&_){const y=a4(m,u),{x:w,y:L,zoom:D}=wfe(y,n,o,(g=e.minZoom)!=null?g:r,(p=e.maxZoom)!=null?p:s,(v=e.padding)!=null?v:.1),E=Ug.translate(w,L).scale(D);return typeof e.duration=="number"&&e.duration>0?a.transform(I_(l,e.duration),E):a.transform(l,E),!0}}return!1}function b4e(i,e){return i.forEach(t=>{const n=e.get(t.id);n&&e.set(n.id,{...n,[ys]:n[ys],selected:t.selected})}),new Map(e)}function C4e(i,e){return e.map(t=>{const n=i.find(o=>o.id===t.id);return n&&(t.selected=n.selected),t})}function FN({changedNodes:i,changedEdges:e,get:t,set:n}){const{nodeInternals:o,edges:r,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=t();i!=null&&i.length&&(l&&n({nodeInternals:b4e(i,o)}),s==null||s(i)),e!=null&&e.length&&(c&&n({edges:C4e(e,r)}),a==null||a(e))}const x1=()=>{},y4e={zoomIn:x1,zoomOut:x1,zoomTo:x1,getZoom:()=>1,setViewport:x1,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:x1,fitBounds:x1,project:i=>i,screenToFlowPosition:i=>i,flowToScreenPosition:i=>i,viewportInitialized:!1},w4e=i=>({d3Zoom:i.d3Zoom,d3Selection:i.d3Selection}),S4e=()=>{const i=cs(),{d3Zoom:e,d3Selection:t}=mo(w4e,Hs);return x.exports.useMemo(()=>t&&e?{zoomIn:o=>e.scaleBy(I_(t,o==null?void 0:o.duration),1.2),zoomOut:o=>e.scaleBy(I_(t,o==null?void 0:o.duration),1/1.2),zoomTo:(o,r)=>e.scaleTo(I_(t,r==null?void 0:r.duration),o),getZoom:()=>i.getState().transform[2],setViewport:(o,r)=>{var d,u,h;const[s,a,l]=i.getState().transform,c=Ug.translate((d=o.x)!=null?d:s,(u=o.y)!=null?u:a).scale((h=o.zoom)!=null?h:l);e.transform(I_(t,r==null?void 0:r.duration),c)},getViewport:()=>{const[o,r,s]=i.getState().transform;return{x:o,y:r,zoom:s}},fitView:o=>Ffe(i.getState,o),setCenter:(o,r,s)=>{const{width:a,height:l,maxZoom:c}=i.getState(),d=typeof(s==null?void 0:s.zoom)!="undefined"?s.zoom:c,u=a/2-o*d,h=l/2-r*d,f=Ug.translate(u,h).scale(d);e.transform(I_(t,s==null?void 0:s.duration),f)},fitBounds:(o,r)=>{var g;const{width:s,height:a,minZoom:l,maxZoom:c}=i.getState(),{x:d,y:u,zoom:h}=wfe(o,s,a,l,c,(g=r==null?void 0:r.padding)!=null?g:.1),f=Ug.translate(d,u).scale(h);e.transform(I_(t,r==null?void 0:r.duration),f)},project:o=>{const{transform:r,snapToGrid:s,snapGrid:a}=i.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),WB(o,r,s,a)},screenToFlowPosition:o=>{const{transform:r,snapToGrid:s,snapGrid:a,domNode:l}=i.getState();if(!l)return o;const{x:c,y:d}=l.getBoundingClientRect(),u={x:o.x-c,y:o.y-d};return WB(u,r,s,a)},flowToScreenPosition:o=>{const{transform:r,domNode:s}=i.getState();if(!s)return o;const{x:a,y:l}=s.getBoundingClientRect(),c=bfe(o,r);return{x:c.x+a,y:c.y+l}},viewportInitialized:!0}:y4e,[e,t])};function _K(){const i=S4e(),e=cs(),t=x.exports.useCallback(()=>e.getState().getNodes().map(p=>({...p})),[]),n=x.exports.useCallback(p=>e.getState().nodeInternals.get(p),[]),o=x.exports.useCallback(()=>{const{edges:p=[]}=e.getState();return p.map(v=>({...v}))},[]),r=x.exports.useCallback(p=>{const{edges:v=[]}=e.getState();return v.find(m=>m.id===p)},[]),s=x.exports.useCallback(p=>{const{getNodes:v,setNodes:m,hasDefaultNodes:_,onNodesChange:y}=e.getState(),w=v(),L=typeof p=="function"?p(w):p;if(_)m(L);else if(y){const D=L.length===0?w.map(E=>({type:"remove",id:E.id})):L.map(E=>({item:E,type:"reset"}));y(D)}},[]),a=x.exports.useCallback(p=>{const{edges:v=[],setEdges:m,hasDefaultEdges:_,onEdgesChange:y}=e.getState(),w=typeof p=="function"?p(v):p;if(_)m(w);else if(y){const L=w.length===0?v.map(D=>({type:"remove",id:D.id})):w.map(D=>({item:D,type:"reset"}));y(L)}},[]),l=x.exports.useCallback(p=>{const v=Array.isArray(p)?p:[p],{getNodes:m,setNodes:_,hasDefaultNodes:y,onNodesChange:w}=e.getState();if(y){const D=[...m(),...v];_(D)}else if(w){const L=v.map(D=>({item:D,type:"add"}));w(L)}},[]),c=x.exports.useCallback(p=>{const v=Array.isArray(p)?p:[p],{edges:m=[],setEdges:_,hasDefaultEdges:y,onEdgesChange:w}=e.getState();if(y)_([...m,...v]);else if(w){const L=v.map(D=>({item:D,type:"add"}));w(L)}},[]),d=x.exports.useCallback(()=>{const{getNodes:p,edges:v=[],transform:m}=e.getState(),[_,y,w]=m;return{nodes:p().map(L=>({...L})),edges:v.map(L=>({...L})),viewport:{x:_,y,zoom:w}}},[]),u=x.exports.useCallback(({nodes:p,edges:v})=>{const{nodeInternals:m,getNodes:_,edges:y,hasDefaultNodes:w,hasDefaultEdges:L,onNodesDelete:D,onEdgesDelete:E,onNodesChange:I,onEdgesChange:k}=e.getState(),R=(p||[]).map(H=>H.id),A=(v||[]).map(H=>H.id),P=_().reduce((H,B)=>{const F=!R.includes(B.id)&&B.parentNode&&H.find(z=>z.id===B.parentNode);return(typeof B.deletable=="boolean"?B.deletable:!0)&&(R.includes(B.id)||F)&&H.push(B),H},[]),N=y.filter(H=>typeof H.deletable=="boolean"?H.deletable:!0),M=N.filter(H=>A.includes(H.id));if(P||M){const H=yfe(P,N),B=[...M,...H],F=B.reduce(($,z)=>($.includes(z.id)||$.push(z.id),$),[]);if((L||w)&&(L&&e.setState({edges:y.filter($=>!F.includes($.id))}),w&&(P.forEach($=>{m.delete($.id)}),e.setState({nodeInternals:new Map(m)}))),F.length>0&&(E==null||E(B),k&&k(F.map($=>({id:$,type:"remove"})))),P.length>0&&(D==null||D(P),I)){const $=P.map(z=>({id:z.id,type:"remove"}));I($)}}},[]),h=x.exports.useCallback(p=>{const v=jOe(p),m=v?null:e.getState().nodeInternals.get(p.id);return!v&&!m?[null,null,v]:[v?p:Zee(m),m,v]},[]),f=x.exports.useCallback((p,v=!0,m)=>{const[_,y,w]=h(p);return _?(m||e.getState().getNodes()).filter(L=>{if(!w&&(L.id===y.id||!L.positionAbsolute))return!1;const D=Zee(L),E=AB(D,_);return v&&E>0||E>=_.width*_.height}):[]},[]),g=x.exports.useCallback((p,v,m=!0)=>{const[_]=h(p);if(!_)return!1;const y=AB(_,v);return m&&y>0||y>=_.width*_.height},[]);return x.exports.useMemo(()=>({...i,getNodes:t,getNode:n,getEdges:o,getEdge:r,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:u,getIntersectingNodes:f,isNodeIntersecting:g}),[i,t,n,o,r,s,a,l,c,d,u,f,g])}const x4e={actInsideInputWithModifier:!1};var L4e=({deleteKeyCode:i,multiSelectionKeyCode:e})=>{const t=cs(),{deleteElements:n}=_K(),o=uD(i,x4e),r=uD(e);x.exports.useEffect(()=>{if(o){const{edges:s,getNodes:a}=t.getState(),l=a().filter(d=>d.selected),c=s.filter(d=>d.selected);n({nodes:l,edges:c}),t.setState({nodesSelectionActive:!1})}},[o]),x.exports.useEffect(()=>{t.setState({multiSelectionActive:r})},[r])};function E4e(i){const e=cs();x.exports.useEffect(()=>{let t;const n=()=>{var r,s;if(!i.current)return;const o=dK(i.current);(o.height===0||o.width===0)&&((s=(r=e.getState()).onError)==null||s.call(r,"004",ip.error004())),e.setState({width:o.width||500,height:o.height||500})};return n(),window.addEventListener("resize",n),i.current&&(t=new ResizeObserver(()=>n()),t.observe(i.current)),()=>{window.removeEventListener("resize",n),t&&i.current&&t.unobserve(i.current)}},[])}const bK={position:"absolute",width:"100%",height:"100%",top:0,left:0},D4e=(i,e)=>i.x!==e.x||i.y!==e.y||i.zoom!==e.k,BN=i=>({x:i.x,y:i.y,zoom:i.k}),L1=(i,e)=>i.target.closest(`.${e}`),ate=(i,e)=>e===2&&Array.isArray(i)&&i.includes(2),lte=i=>{const e=i.ctrlKey&&hA()?10:1;return-i.deltaY*(i.deltaMode===1?.05:i.deltaMode?1:.002)*e},k4e=i=>({d3Zoom:i.d3Zoom,d3Selection:i.d3Selection,d3ZoomHandler:i.d3ZoomHandler,userSelectionActive:i.userSelectionActive}),I4e=({onMove:i,onMoveStart:e,onMoveEnd:t,onPaneContextMenu:n,zoomOnScroll:o=!0,zoomOnPinch:r=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=i0.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:u=!0,defaultViewport:h,translateExtent:f,minZoom:g,maxZoom:p,zoomActivationKeyCode:v,preventScrolling:m=!0,children:_,noWheelClassName:y,noPanClassName:w})=>{const L=x.exports.useRef(),D=cs(),E=x.exports.useRef(!1),I=x.exports.useRef(!1),k=x.exports.useRef(null),R=x.exports.useRef({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:P,d3ZoomHandler:N,userSelectionActive:M}=mo(k4e,Hs),H=uD(v),B=x.exports.useRef(0),F=x.exports.useRef(!1),$=x.exports.useRef();return E4e(k),x.exports.useEffect(()=>{if(k.current){const z=k.current.getBoundingClientRect(),K=ofe().scaleExtent([g,p]).translateExtent(f),j=bd(k.current).call(K),G=Ug.translate(h.x,h.y).scale(ow(h.zoom,g,p)),X=[[0,0],[z.width,z.height]],ue=K.constrain()(G,X,f);K.transform(j,ue),K.wheelDelta(lte),D.setState({d3Zoom:K,d3Selection:j,d3ZoomHandler:j.on("wheel.zoom"),transform:[ue.x,ue.y,ue.k],domNode:k.current.closest(".react-flow")})}},[]),x.exports.useEffect(()=>{P&&A&&(s&&!H&&!M?P.on("wheel.zoom",z=>{if(L1(z,y))return!1;z.preventDefault(),z.stopImmediatePropagation();const K=P.property("__zoom").k||1,j=hA();if(z.ctrlKey&&r&&j){const Fe=gu(z),De=lte(z),ce=K*Math.pow(2,De);A.scaleTo(P,ce,Fe,z);return}const G=z.deltaMode===1?20:1;let X=l===i0.Vertical?0:z.deltaX*G,ue=l===i0.Horizontal?0:z.deltaY*G;!j&&z.shiftKey&&l!==i0.Vertical&&(X=z.deltaY*G,ue=0),A.translateBy(P,-(X/K)*a,-(ue/K)*a,{internal:!0});const fe=BN(P.property("__zoom")),{onViewportChangeStart:pe,onViewportChange:be,onViewportChangeEnd:Se}=D.getState();clearTimeout($.current),F.current||(F.current=!0,e==null||e(z,fe),pe==null||pe(fe)),F.current&&(i==null||i(z,fe),be==null||be(fe),$.current=setTimeout(()=>{t==null||t(z,fe),Se==null||Se(fe),F.current=!1},150))},{passive:!1}):typeof N!="undefined"&&P.on("wheel.zoom",function(z,K){if(!m||L1(z,y))return null;z.preventDefault(),N.call(this,z,K)},{passive:!1}))},[M,s,l,P,A,N,H,r,m,y,e,i,t]),x.exports.useEffect(()=>{A&&A.on("start",z=>{var G,X;if(!z.sourceEvent||z.sourceEvent.internal)return null;B.current=(G=z.sourceEvent)==null?void 0:G.button;const{onViewportChangeStart:K}=D.getState(),j=BN(z.transform);E.current=!0,R.current=j,((X=z.sourceEvent)==null?void 0:X.type)==="mousedown"&&D.setState({paneDragging:!0}),K==null||K(j),e==null||e(z.sourceEvent,j)})},[A,e]),x.exports.useEffect(()=>{A&&(M&&!E.current?A.on("zoom",null):M||A.on("zoom",z=>{var j,G;const{onViewportChange:K}=D.getState();if(D.setState({transform:[z.transform.x,z.transform.y,z.transform.k]}),I.current=!!(n&&ate(u,(j=B.current)!=null?j:0)),(i||K)&&!((G=z.sourceEvent)!=null&&G.internal)){const X=BN(z.transform);K==null||K(X),i==null||i(z.sourceEvent,X)}}))},[M,A,i,u,n]),x.exports.useEffect(()=>{A&&A.on("end",z=>{var j;if(!z.sourceEvent||z.sourceEvent.internal)return null;const{onViewportChangeEnd:K}=D.getState();if(E.current=!1,D.setState({paneDragging:!1}),n&&ate(u,(j=B.current)!=null?j:0)&&!I.current&&n(z.sourceEvent),I.current=!1,(t||K)&&D4e(R.current,z.transform)){const G=BN(z.transform);R.current=G,clearTimeout(L.current),L.current=setTimeout(()=>{K==null||K(G),t==null||t(z.sourceEvent,G)},s?150:0)}})},[A,s,u,t,n]),x.exports.useEffect(()=>{A&&A.filter(z=>{const K=H||o,j=r&&z.ctrlKey;if((u===!0||Array.isArray(u)&&u.includes(1))&&z.button===1&&z.type==="mousedown"&&(L1(z,"react-flow__node")||L1(z,"react-flow__edge")))return!0;if(!u&&!K&&!s&&!c&&!r||M||!c&&z.type==="dblclick"||L1(z,y)&&z.type==="wheel"||L1(z,w)&&(z.type!=="wheel"||s&&z.type==="wheel"&&!H)||!r&&z.ctrlKey&&z.type==="wheel"||!K&&!s&&!j&&z.type==="wheel"||!u&&(z.type==="mousedown"||z.type==="touchstart")||Array.isArray(u)&&!u.includes(z.button)&&(z.type==="mousedown"||z.type==="touchstart"))return!1;const G=Array.isArray(u)&&u.includes(z.button)||!z.button||z.button<=1;return(!z.ctrlKey||z.type==="wheel")&&G})},[M,A,o,r,s,c,u,d,H]),he("div",{className:"react-flow__renderer",ref:k,style:bK,children:_})},T4e=i=>({userSelectionActive:i.userSelectionActive,userSelectionRect:i.userSelectionRect});function N4e(){const{userSelectionActive:i,userSelectionRect:e}=mo(T4e,Hs);return i&&e?he("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function cte(i,e){var n,o;const t=i.find(r=>r.id===e.parentNode);if(t){const r=e.position.x+e.width-t.width,s=e.position.y+e.height-t.height;if(r>0||s>0||e.position.x<0||e.position.y<0){if(t.style={...t.style},t.style.width=(n=t.style.width)!=null?n:t.width,t.style.height=(o=t.style.height)!=null?o:t.height,r>0&&(t.style.width+=r),s>0&&(t.style.height+=s),e.position.x<0){const a=Math.abs(e.position.x);t.position.x=t.position.x-a,t.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);t.position.y=t.position.y-a,t.style.height+=a,e.position.y=0}t.width=t.style.width,t.height=t.style.height}}}function Bfe(i,e){if(i.some(n=>n.type==="reset"))return i.filter(n=>n.type==="reset").map(n=>n.item);const t=i.filter(n=>n.type==="add").map(n=>n.item);return e.reduce((n,o)=>{const r=i.filter(a=>a.id===o.id);if(r.length===0)return n.push(o),n;const s={...o};for(const a of r)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position!="undefined"&&(s.position=a.position),typeof a.positionAbsolute!="undefined"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging!="undefined"&&(s.dragging=a.dragging),s.expandParent&&cte(n,s);break}case"dimensions":{typeof a.dimensions!="undefined"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle!="undefined"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&cte(n,s);break}case"remove":return n}return n.push(s),n},t)}function Wfe(i,e){return Bfe(i,e)}function R4e(i,e){return Bfe(i,e)}const tm=(i,e)=>({id:i,type:"select",selected:e});function xC(i,e){return i.reduce((t,n)=>{const o=e.includes(n.id);return!n.selected&&o?(n.selected=!0,t.push(tm(n.id,!0))):n.selected&&!o&&(n.selected=!1,t.push(tm(n.id,!1))),t},[])}const H8=(i,e)=>t=>{t.target===e.current&&(i==null||i(t))},M4e=i=>({userSelectionActive:i.userSelectionActive,elementsSelectable:i.elementsSelectable,dragging:i.paneDragging}),Vfe=x.exports.memo(({isSelecting:i,selectionMode:e=cD.Full,panOnDrag:t,onSelectionStart:n,onSelectionEnd:o,onPaneClick:r,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:u})=>{const h=x.exports.useRef(null),f=cs(),g=x.exports.useRef(0),p=x.exports.useRef(0),v=x.exports.useRef(),{userSelectionActive:m,elementsSelectable:_,dragging:y}=mo(M4e,Hs),w=()=>{f.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,p.current=0},L=N=>{r==null||r(N),f.getState().resetSelectedElements(),f.setState({nodesSelectionActive:!1})},D=N=>{if(Array.isArray(t)&&(t==null?void 0:t.includes(2))){N.preventDefault();return}s==null||s(N)},E=a?N=>a(N):void 0,I=N=>{const{resetSelectedElements:M,domNode:H}=f.getState();if(v.current=H==null?void 0:H.getBoundingClientRect(),!_||!i||N.button!==0||N.target!==h.current||!v.current)return;const{x:B,y:F}=zm(N,v.current);M(),f.setState({userSelectionRect:{width:0,height:0,startX:B,startY:F,x:B,y:F}}),n==null||n(N)},k=N=>{var De,ce;const{userSelectionRect:M,nodeInternals:H,edges:B,transform:F,onNodesChange:$,onEdgesChange:z,nodeOrigin:K,getNodes:j}=f.getState();if(!i||!v.current||!M)return;f.setState({userSelectionActive:!0,nodesSelectionActive:!1});const G=zm(N,v.current),X=(De=M.startX)!=null?De:0,ue=(ce=M.startY)!=null?ce:0,fe={...M,x:G.xPe.id),Fe=be.map(Pe=>Pe.id);if(g.current!==Fe.length){g.current=Fe.length;const Pe=xC(pe,Fe);Pe.length&&($==null||$(Pe))}if(p.current!==Se.length){p.current=Se.length;const Pe=xC(B,Se);Pe.length&&(z==null||z(Pe))}f.setState({userSelectionRect:fe})},R=N=>{if(N.button!==0)return;const{userSelectionRect:M}=f.getState();!m&&M&&N.target===h.current&&(L==null||L(N)),f.setState({nodesSelectionActive:g.current>0}),w(),o==null||o(N)},A=N=>{m&&(f.setState({nodesSelectionActive:g.current>0}),o==null||o(N)),w()},P=_&&(i||m);return fn("div",{className:fa(["react-flow__pane",{dragging:y,selection:i}]),onClick:P?void 0:H8(L,h),onContextMenu:H8(D,h),onWheel:H8(E,h),onMouseEnter:P?void 0:l,onMouseDown:P?I:void 0,onMouseMove:P?k:c,onMouseUp:P?R:void 0,onMouseLeave:P?A:d,ref:h,style:bK,children:[u,he(N4e,{})]})});Vfe.displayName="Pane";function Hfe(i,e){if(!i.parentNode)return!1;const t=e.get(i.parentNode);return t?t.selected?!0:Hfe(t,e):!1}function dte(i,e,t){let n=i;do{if(n!=null&&n.matches(e))return!0;if(n===t.current)return!1;n=n.parentElement}while(n);return!1}function A4e(i,e,t,n){return Array.from(i.values()).filter(o=>(o.selected||o.id===n)&&(!o.parentNode||!Hfe(o,i))&&(o.draggable||e&&typeof o.draggable=="undefined")).map(o=>{var r,s,a,l;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:t.x-((s=(r=o.positionAbsolute)==null?void 0:r.x)!=null?s:0),y:t.y-((l=(a=o.positionAbsolute)==null?void 0:a.y)!=null?l:0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height,expandParent:o.expandParent}})}function P4e(i,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(i.width||0),e[1][1]-(i.height||0)]]}function $fe(i,e,t,n,o=[0,0],r){const s=P4e(i,i.extent||n);let a=s;if(i.extent==="parent"&&!i.expandParent)if(i.parentNode&&i.width&&i.height){const d=t.get(i.parentNode),{x:u,y:h}=x0(d,o).positionAbsolute;a=d&&yd(u)&&yd(h)&&yd(d.width)&&yd(d.height)?[[u+i.width*o[0],h+i.height*o[1]],[u+d.width-i.width+i.width*o[0],h+d.height-i.height+i.height*o[1]]]:a}else r==null||r("005",ip.error005()),a=s;else if(i.extent&&i.parentNode&&i.extent!=="parent"){const d=t.get(i.parentNode),{x:u,y:h}=x0(d,o).positionAbsolute;a=[[i.extent[0][0]+u,i.extent[0][1]+h],[i.extent[1][0]+u,i.extent[1][1]+h]]}let l={x:0,y:0};if(i.parentNode){const d=t.get(i.parentNode);l=x0(d,o).positionAbsolute}const c=a&&a!=="parent"?uK(e,a):e;return{position:{x:c.x-l.x,y:c.y-l.y},positionAbsolute:c}}function $8({nodeId:i,dragItems:e,nodeInternals:t}){const n=e.map(o=>({...t.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[i?n.find(o=>o.id===i):n[0],n]}const ute=(i,e,t,n)=>{const o=e.querySelectorAll(i);if(!o||!o.length)return null;const r=Array.from(o),s=e.getBoundingClientRect(),a={x:s.width*n[0],y:s.height*n[1]};return r.map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/t,y:(c.top-s.top-a.y)/t,...dK(l)}})};function yx(i,e,t){return t===void 0?t:n=>{const o=e().nodeInternals.get(i);o&&t(n,{...o})}}function HB({id:i,store:e,unselect:t=!1,nodeRef:n}){const{addSelectedNodes:o,unselectNodesAndEdges:r,multiSelectionActive:s,nodeInternals:a,onError:l}=e.getState(),c=a.get(i);if(!c){l==null||l("012",ip.error012(i));return}e.setState({nodesSelectionActive:!1}),c.selected?(t||c.selected&&s)&&(r({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=n==null?void 0:n.current)==null?void 0:d.blur()})):o([i])}function O4e(){const i=cs();return x.exports.useCallback(({sourceEvent:t})=>{const{transform:n,snapGrid:o,snapToGrid:r}=i.getState(),s=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY,l={x:(s-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:r?o[0]*Math.round(l.x/o[0]):l.x,ySnapped:r?o[1]*Math.round(l.y/o[1]):l.y,...l}},[])}function z8(i){return(e,t,n)=>i==null?void 0:i(e,n)}function zfe({nodeRef:i,disabled:e=!1,noDragClassName:t,handleSelector:n,nodeId:o,isSelectable:r,selectNodesOnDrag:s}){const a=cs(),[l,c]=x.exports.useState(!1),d=x.exports.useRef([]),u=x.exports.useRef({x:null,y:null}),h=x.exports.useRef(0),f=x.exports.useRef(null),g=x.exports.useRef({x:0,y:0}),p=x.exports.useRef(null),v=x.exports.useRef(!1),m=x.exports.useRef(!1),_=O4e();return x.exports.useEffect(()=>{if(i!=null&&i.current){const y=bd(i.current),w=({x:E,y:I})=>{const{nodeInternals:k,onNodeDrag:R,onSelectionDrag:A,updateNodePositions:P,nodeExtent:N,snapGrid:M,snapToGrid:H,nodeOrigin:B,onError:F}=a.getState();u.current={x:E,y:I};let $=!1,z={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&N){const j=a4(d.current,B);z=lD(j)}if(d.current=d.current.map(j=>{var fe,pe;const G={x:E-j.distance.x,y:I-j.distance.y};H&&(G.x=M[0]*Math.round(G.x/M[0]),G.y=M[1]*Math.round(G.y/M[1]));const X=[[N[0][0],N[0][1]],[N[1][0],N[1][1]]];d.current.length>1&&N&&!j.extent&&(X[0][0]=j.positionAbsolute.x-z.x+N[0][0],X[1][0]=j.positionAbsolute.x+((fe=j.width)!=null?fe:0)-z.x2+N[1][0],X[0][1]=j.positionAbsolute.y-z.y+N[0][1],X[1][1]=j.positionAbsolute.y+((pe=j.height)!=null?pe:0)-z.y2+N[1][1]);const ue=$fe(j,G,k,X,B,F);return $=$||j.position.x!==ue.position.x||j.position.y!==ue.position.y,j.position=ue.position,j.positionAbsolute=ue.positionAbsolute,j}),!$)return;P(d.current,!0,!0),c(!0);const K=o?R:z8(A);if(K&&p.current){const[j,G]=$8({nodeId:o,dragItems:d.current,nodeInternals:k});K(p.current,j,G)}},L=()=>{var k,R;if(!f.current)return;const[E,I]=lfe(g.current,f.current);if(E!==0||I!==0){const{transform:A,panBy:P}=a.getState();u.current.x=((k=u.current.x)!=null?k:0)-E/A[2],u.current.y=((R=u.current.y)!=null?R:0)-I/A[2],P({x:E,y:I})&&w(u.current)}h.current=requestAnimationFrame(L)},D=E=>{var B;const{nodeInternals:I,multiSelectionActive:k,nodesDraggable:R,unselectNodesAndEdges:A,onNodeDragStart:P,onSelectionDragStart:N}=a.getState();m.current=!0;const M=o?P:z8(N);(!s||!r)&&!k&&o&&((B=I.get(o))!=null&&B.selected||A()),o&&r&&s&&HB({id:o,store:a,nodeRef:i});const H=_(E);if(u.current=H,d.current=A4e(I,R,H,o),M&&d.current){const[F,$]=$8({nodeId:o,dragItems:d.current,nodeInternals:I});M(E.sourceEvent,F,$)}};if(e)y.on(".drag",null);else{const E=jAe().on("start",I=>{const{domNode:k,nodeDragThreshold:R}=a.getState();R===0&&D(I);const A=_(I);u.current=A,f.current=(k==null?void 0:k.getBoundingClientRect())||null,g.current=zm(I.sourceEvent,f.current)}).on("drag",I=>{var P,N,M,H;const k=_(I),{autoPanOnNodeDrag:R,nodeDragThreshold:A}=a.getState();if(!v.current&&m.current&&R&&(v.current=!0,L()),!m.current){const B=k.xSnapped-((N=(P=u==null?void 0:u.current)==null?void 0:P.x)!=null?N:0),F=k.ySnapped-((H=(M=u==null?void 0:u.current)==null?void 0:M.y)!=null?H:0);Math.sqrt(B*B+F*F)>A&&D(I)}(u.current.x!==k.xSnapped||u.current.y!==k.ySnapped)&&d.current&&m.current&&(p.current=I.sourceEvent,g.current=zm(I.sourceEvent,f.current),w(k))}).on("end",I=>{if(!!m.current&&(c(!1),v.current=!1,m.current=!1,cancelAnimationFrame(h.current),d.current)){const{updateNodePositions:k,nodeInternals:R,onNodeDragStop:A,onSelectionDragStop:P}=a.getState(),N=o?A:z8(P);if(k(d.current,!1,!1),N){const[M,H]=$8({nodeId:o,dragItems:d.current,nodeInternals:R});N(I.sourceEvent,M,H)}}}).filter(I=>{const k=I.target;return!I.button&&(!t||!dte(k,`.${t}`,i))&&(!n||dte(k,n,i))});return y.call(E),()=>{y.on(".drag",null)}}}},[i,e,t,n,r,a,o,s,_]),l}function Ufe(){const i=cs();return x.exports.useCallback(t=>{const{nodeInternals:n,nodeExtent:o,updateNodePositions:r,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=i.getState(),u=s().filter(_=>_.selected&&(_.draggable||d&&typeof _.draggable=="undefined")),h=a?l[0]:5,f=a?l[1]:5,g=t.isShiftPressed?4:1,p=t.x*h*g,v=t.y*f*g,m=u.map(_=>{if(_.positionAbsolute){const y={x:_.positionAbsolute.x+p,y:_.positionAbsolute.y+v};a&&(y.x=l[0]*Math.round(y.x/l[0]),y.y=l[1]*Math.round(y.y/l[1]));const{positionAbsolute:w,position:L}=$fe(_,y,n,o,void 0,c);_.position=L,_.positionAbsolute=w}return _});r(m,!0,!1)},[])}const fy={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var wx=i=>{const e=({id:t,type:n,data:o,xPos:r,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:u,onMouseMove:h,onMouseLeave:f,onContextMenu:g,onDoubleClick:p,style:v,className:m,isDraggable:_,isSelectable:y,isConnectable:w,isFocusable:L,selectNodesOnDrag:D,sourcePosition:E,targetPosition:I,hidden:k,resizeObserver:R,dragHandle:A,zIndex:P,isParent:N,noDragClassName:M,noPanClassName:H,initialized:B,disableKeyboardA11y:F,ariaLabel:$,rfId:z})=>{const K=cs(),j=x.exports.useRef(null),G=x.exports.useRef(E),X=x.exports.useRef(I),ue=x.exports.useRef(n),fe=y||_||d||u||h||f,pe=Ufe(),be=yx(t,K.getState,u),Se=yx(t,K.getState,h),Fe=yx(t,K.getState,f),De=yx(t,K.getState,g),ce=yx(t,K.getState,p),Pe=Ee=>{const{nodeDragThreshold:tt}=K.getState();if(y&&(!D||!_||tt>0)&&HB({id:t,store:K,nodeRef:j}),d){const nt=K.getState().nodeInternals.get(t);nt&&d(Ee,{...nt})}},Oe=Ee=>{if(!PB(Ee))if(hfe.includes(Ee.key)&&y){const tt=Ee.key==="Escape";HB({id:t,store:K,unselect:tt,nodeRef:j})}else!F&&_&&c&&Object.prototype.hasOwnProperty.call(fy,Ee.key)&&(K.setState({ariaLiveMessage:`Moved selected node ${Ee.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~r}, y: ${~~s}`}),pe({x:fy[Ee.key].x,y:fy[Ee.key].y,isShiftPressed:Ee.shiftKey}))};x.exports.useEffect(()=>{if(j.current&&!k){const Ee=j.current;return R==null||R.observe(Ee),()=>R==null?void 0:R.unobserve(Ee)}},[k]),x.exports.useEffect(()=>{const Ee=ue.current!==n,tt=G.current!==E,nt=X.current!==I;j.current&&(Ee||tt||nt)&&(Ee&&(ue.current=n),tt&&(G.current=E),nt&&(X.current=I),K.getState().updateNodeDimensions([{id:t,nodeElement:j.current,forceUpdate:!0}]))},[t,n,E,I]);const xe=zfe({nodeRef:j,disabled:k||!_,noDragClassName:M,handleSelector:A,nodeId:t,isSelectable:y,selectNodesOnDrag:D});return k?null:he("div",{className:fa(["react-flow__node",`react-flow__node-${n}`,{[H]:_},m,{selected:c,selectable:y,parent:N,dragging:xe}]),ref:j,style:{zIndex:P,transform:`translate(${a}px,${l}px)`,pointerEvents:fe?"all":"none",visibility:B?"visible":"hidden",...v},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:be,onMouseMove:Se,onMouseLeave:Fe,onContextMenu:De,onClick:Pe,onDoubleClick:ce,onKeyDown:L?Oe:void 0,tabIndex:L?0:void 0,role:L?"button":void 0,"aria-describedby":F?void 0:`${Mfe}-${z}`,"aria-label":$,children:he(QOe,{value:t,children:he(i,{id:t,data:o,type:n,xPos:r,yPos:s,selected:c,isConnectable:w,sourcePosition:E,targetPosition:I,dragging:xe,dragHandle:A,zIndex:P})})})};return e.displayName="NodeWrapper",x.exports.memo(e)};const F4e=i=>{const e=i.getNodes().filter(t=>t.selected);return{...a4(e,i.nodeOrigin),transformString:`translate(${i.transform[0]}px,${i.transform[1]}px) scale(${i.transform[2]})`,userSelectionActive:i.userSelectionActive}};function B4e({onSelectionContextMenu:i,noPanClassName:e,disableKeyboardA11y:t}){const n=cs(),{width:o,height:r,x:s,y:a,transformString:l,userSelectionActive:c}=mo(F4e,Hs),d=Ufe(),u=x.exports.useRef(null);if(x.exports.useEffect(()=>{var g;t||(g=u.current)==null||g.focus({preventScroll:!0})},[t]),zfe({nodeRef:u}),c||!o||!r)return null;const h=i?g=>{const p=n.getState().getNodes().filter(v=>v.selected);i(g,p)}:void 0,f=g=>{Object.prototype.hasOwnProperty.call(fy,g.key)&&d({x:fy[g.key].x,y:fy[g.key].y,isShiftPressed:g.shiftKey})};return he("div",{className:fa(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:he("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:f,style:{width:o,height:r,top:a,left:s}})})}var W4e=x.exports.memo(B4e);const V4e=i=>i.nodesSelectionActive,jfe=({children:i,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:n,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:u,selectionOnDrag:h,selectionMode:f,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:v,panActivationKeyCode:m,zoomActivationKeyCode:_,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:L,panOnScroll:D,panOnScrollSpeed:E,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:R,defaultViewport:A,translateExtent:P,minZoom:N,maxZoom:M,preventScrolling:H,onSelectionContextMenu:B,noWheelClassName:F,noPanClassName:$,disableKeyboardA11y:z})=>{const K=mo(V4e),j=uD(u),G=uD(m),X=G||R,ue=G||D,fe=j||h&&X!==!0;return L4e({deleteKeyCode:a,multiSelectionKeyCode:v}),he(I4e,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:r,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:L,panOnScroll:ue,panOnScrollSpeed:E,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:!j&&X,defaultViewport:A,translateExtent:P,minZoom:N,maxZoom:M,zoomActivationKeyCode:_,preventScrolling:H,noWheelClassName:F,noPanClassName:$,children:fn(Vfe,{onSelectionStart:g,onSelectionEnd:p,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:n,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:s,panOnDrag:X,isSelecting:!!fe,selectionMode:f,children:[i,K&&he(W4e,{onSelectionContextMenu:B,noPanClassName:$,disableKeyboardA11y:z})]})})};jfe.displayName="FlowRenderer";var H4e=x.exports.memo(jfe);function $4e(i){return mo(x.exports.useCallback(t=>i?Cfe(t.nodeInternals,{x:0,y:0,width:t.width,height:t.height},t.transform,!0):t.getNodes(),[i]))}function z4e(i){const e={input:wx(i.input||Ife),default:wx(i.default||VB),output:wx(i.output||Nfe),group:wx(i.group||vK)},t={},n=Object.keys(i).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,r)=>(o[r]=wx(i[r]||VB),o),t);return{...e,...n}}const U4e=({x:i,y:e,width:t,height:n,origin:o})=>!t||!n?{x:i,y:e}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:i,y:e}:{x:i-t*o[0],y:e-n*o[1]},j4e=i=>({nodesDraggable:i.nodesDraggable,nodesConnectable:i.nodesConnectable,nodesFocusable:i.nodesFocusable,elementsSelectable:i.elementsSelectable,updateNodeDimensions:i.updateNodeDimensions,onError:i.onError}),Kfe=i=>{const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,updateNodeDimensions:r,onError:s}=mo(j4e,Hs),a=$4e(i.onlyRenderVisibleElements),l=x.exports.useRef(),c=x.exports.useMemo(()=>{if(typeof ResizeObserver=="undefined")return null;const d=new ResizeObserver(u=>{const h=u.map(f=>({id:f.target.getAttribute("data-id"),nodeElement:f.target,forceUpdate:!0}));r(h)});return l.current=d,d},[]);return x.exports.useEffect(()=>()=>{var d;(d=l==null?void 0:l.current)==null||d.disconnect()},[]),he("div",{className:"react-flow__nodes",style:bK,children:a.map(d=>{var L,D,E,I,k,R,A;let u=d.type||"default";i.nodeTypes[u]||(s==null||s("003",ip.error003(u)),u="default");const h=i.nodeTypes[u]||i.nodeTypes.default,f=!!(d.draggable||e&&typeof d.draggable=="undefined"),g=!!(d.selectable||o&&typeof d.selectable=="undefined"),p=!!(d.connectable||t&&typeof d.connectable=="undefined"),v=!!(d.focusable||n&&typeof d.focusable=="undefined"),m=i.nodeExtent?uK(d.positionAbsolute,i.nodeExtent):d.positionAbsolute,_=(L=m==null?void 0:m.x)!=null?L:0,y=(D=m==null?void 0:m.y)!=null?D:0,w=U4e({x:_,y,width:(E=d.width)!=null?E:0,height:(I=d.height)!=null?I:0,origin:i.nodeOrigin});return he(h,{id:d.id,className:d.className,style:d.style,type:u,data:d.data,sourcePosition:d.sourcePosition||mn.Bottom,targetPosition:d.targetPosition||mn.Top,hidden:d.hidden,xPos:_,yPos:y,xPosOrigin:w.x,yPosOrigin:w.y,selectNodesOnDrag:i.selectNodesOnDrag,onClick:i.onNodeClick,onMouseEnter:i.onNodeMouseEnter,onMouseMove:i.onNodeMouseMove,onMouseLeave:i.onNodeMouseLeave,onContextMenu:i.onNodeContextMenu,onDoubleClick:i.onNodeDoubleClick,selected:!!d.selected,isDraggable:f,isSelectable:g,isConnectable:p,isFocusable:v,resizeObserver:c,dragHandle:d.dragHandle,zIndex:(R=(k=d[ys])==null?void 0:k.z)!=null?R:0,isParent:!!((A=d[ys])!=null&&A.isParent),noDragClassName:i.noDragClassName,noPanClassName:i.noPanClassName,initialized:!!d.width&&!!d.height,rfId:i.rfId,disableKeyboardA11y:i.disableKeyboardA11y,ariaLabel:d.ariaLabel},d.id)})})};Kfe.displayName="NodeRenderer";var K4e=x.exports.memo(Kfe);const q4e=(i,e,t)=>t===mn.Left?i-e:t===mn.Right?i+e:i,G4e=(i,e,t)=>t===mn.Top?i-e:t===mn.Bottom?i+e:i,hte="react-flow__edgeupdater",fte=({position:i,centerX:e,centerY:t,radius:n=10,onMouseDown:o,onMouseEnter:r,onMouseOut:s,type:a})=>he("circle",{onMouseDown:o,onMouseEnter:r,onMouseOut:s,className:fa([hte,`${hte}-${a}`]),cx:q4e(e,n,i),cy:G4e(t,n,i),r:n,stroke:"transparent",fill:"transparent"}),X4e=()=>!0;var E1=i=>{const e=({id:t,className:n,type:o,data:r,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,style:v,source:m,target:_,sourceX:y,sourceY:w,targetX:L,targetY:D,sourcePosition:E,targetPosition:I,elementsSelectable:k,hidden:R,sourceHandleId:A,targetHandleId:P,onContextMenu:N,onMouseEnter:M,onMouseMove:H,onMouseLeave:B,edgeUpdaterRadius:F,onEdgeUpdate:$,onEdgeUpdateStart:z,onEdgeUpdateEnd:K,markerEnd:j,markerStart:G,rfId:X,ariaLabel:ue,isFocusable:fe,isUpdatable:pe,pathOptions:be,interactionWidth:Se})=>{const Fe=x.exports.useRef(null),[De,ce]=x.exports.useState(!1),[Pe,Oe]=x.exports.useState(!1),xe=cs(),Ee=x.exports.useMemo(()=>`url(#${BB(G,X)})`,[G,X]),tt=x.exports.useMemo(()=>`url(#${BB(j,X)})`,[j,X]);if(R)return null;const nt=We=>{var Lt;const{edges:je,addSelectedEdges:mt,unselectNodesAndEdges:Dt,multiSelectionActive:At}=xe.getState(),Je=je.find(Ot=>Ot.id===t);!Je||(k&&(xe.setState({nodesSelectionActive:!1}),Je.selected&&At?(Dt({nodes:[],edges:[Je]}),(Lt=Fe.current)==null||Lt.blur()):mt([t])),s&&s(We,Je))},Qe=Cx(t,xe.getState,a),Ge=Cx(t,xe.getState,N),re=Cx(t,xe.getState,M),ie=Cx(t,xe.getState,H),se=Cx(t,xe.getState,B),U=(We,je)=>{if(We.button!==0)return;const{edges:mt,isValidConnection:Dt}=xe.getState(),At=je?_:m,Je=(je?P:A)||null,Lt=je?"target":"source",Ot=Dt||X4e,Vn=je,Et=mt.find(cn=>cn.id===t);Oe(!0),z==null||z(We,Et,Lt);const tn=cn=>{Oe(!1),K==null||K(cn,Et,Lt)};Lfe({event:We,handleId:Je,nodeId:At,onConnect:cn=>$==null?void 0:$(Et,cn),isTarget:Vn,getState:xe.getState,setState:xe.setState,isValidConnection:Ot,edgeUpdaterType:Lt,onEdgeUpdateEnd:tn})},Y=We=>U(We,!0),oe=We=>U(We,!1),te=()=>ce(!0),ye=()=>ce(!1),Le=!k&&!s,Te=We=>{var je;if(hfe.includes(We.key)&&k){const{unselectNodesAndEdges:mt,addSelectedEdges:Dt,edges:At}=xe.getState();We.key==="Escape"?((je=Fe.current)==null||je.blur(),mt({edges:[At.find(Lt=>Lt.id===t)]})):Dt([t])}};return fn("g",{className:fa(["react-flow__edge",`react-flow__edge-${o}`,n,{selected:l,animated:c,inactive:Le,updating:De}]),onClick:nt,onDoubleClick:Qe,onContextMenu:Ge,onMouseEnter:re,onMouseMove:ie,onMouseLeave:se,onKeyDown:fe?Te:void 0,tabIndex:fe?0:void 0,role:fe?"button":"img","data-testid":`rf__edge-${t}`,"aria-label":ue===null?void 0:ue||`Edge from ${m} to ${_}`,"aria-describedby":fe?`${Afe}-${X}`:void 0,ref:Fe,children:[!Pe&&he(i,{id:t,source:m,target:_,selected:l,animated:c,label:d,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,data:r,style:v,sourceX:y,sourceY:w,targetX:L,targetY:D,sourcePosition:E,targetPosition:I,sourceHandleId:A,targetHandleId:P,markerStart:Ee,markerEnd:tt,pathOptions:be,interactionWidth:Se}),pe&&fn(ks,{children:[(pe==="source"||pe===!0)&&he(fte,{position:E,centerX:y,centerY:w,radius:F,onMouseDown:Y,onMouseEnter:te,onMouseOut:ye,type:"source"}),(pe==="target"||pe===!0)&&he(fte,{position:I,centerX:L,centerY:D,radius:F,onMouseDown:oe,onMouseEnter:te,onMouseOut:ye,type:"target"})]})]})};return e.displayName="EdgeWrapper",x.exports.memo(e)};function Y4e(i){const e={default:E1(i.default||gA),straight:E1(i.bezier||gK),step:E1(i.step||fK),smoothstep:E1(i.step||s4),simplebezier:E1(i.simplebezier||hK)},t={},n=Object.keys(i).filter(o=>!["default","bezier"].includes(o)).reduce((o,r)=>(o[r]=E1(i[r]||gA),o),t);return{...e,...n}}function gte(i,e,t=null){const n=((t==null?void 0:t.x)||0)+e.x,o=((t==null?void 0:t.y)||0)+e.y,r=(t==null?void 0:t.width)||e.width,s=(t==null?void 0:t.height)||e.height;switch(i){case mn.Top:return{x:n+r/2,y:o};case mn.Right:return{x:n+r,y:o+s/2};case mn.Bottom:return{x:n+r/2,y:o+s};case mn.Left:return{x:n,y:o+s/2}}}function pte(i,e){return i?i.length===1||!e?i[0]:e&&i.find(t=>t.id===e)||null:null}const Z4e=(i,e,t,n,o,r)=>{const s=gte(t,i,e),a=gte(r,n,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function Q4e({sourcePos:i,targetPos:e,sourceWidth:t,sourceHeight:n,targetWidth:o,targetHeight:r,width:s,height:a,transform:l}){const c={x:Math.min(i.x,e.x),y:Math.min(i.y,e.y),x2:Math.max(i.x+t,e.x+o),y2:Math.max(i.y+n,e.y+r)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=lD({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),u=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),h=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(u*h)>0}function mte(i){var n,o,r,s,a;const e=((n=i==null?void 0:i[ys])==null?void 0:n.handleBounds)||null,t=e&&(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&typeof((o=i==null?void 0:i.positionAbsolute)==null?void 0:o.x)!="undefined"&&typeof((r=i==null?void 0:i.positionAbsolute)==null?void 0:r.y)!="undefined";return[{x:((s=i==null?void 0:i.positionAbsolute)==null?void 0:s.x)||0,y:((a=i==null?void 0:i.positionAbsolute)==null?void 0:a.y)||0,width:(i==null?void 0:i.width)||0,height:(i==null?void 0:i.height)||0},e,!!t]}const J4e=[{level:0,isMaxLevel:!0,edges:[]}];function e5e(i,e,t=!1){let n=-1;const o=i.reduce((s,a)=>{var d,u;const l=yd(a.zIndex);let c=l?a.zIndex:0;if(t){const h=e.get(a.target),f=e.get(a.source),g=a.selected||(h==null?void 0:h.selected)||(f==null?void 0:f.selected),p=Math.max(((d=f==null?void 0:f[ys])==null?void 0:d.z)||0,((u=h==null?void 0:h[ys])==null?void 0:u.z)||0,1e3);c=(l?a.zIndex:0)+(g?p:0)}return s[c]?s[c].push(a):s[c]=[a],n=c>n?c:n,s},{}),r=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===n}});return r.length===0?J4e:r}function t5e(i,e,t){const n=mo(x.exports.useCallback(o=>i?o.edges.filter(r=>{const s=e.get(r.source),a=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&Q4e({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[i,e]));return e5e(n,e,t)}const n5e=({color:i="none",strokeWidth:e=1})=>he("polyline",{style:{stroke:i,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),i5e=({color:i="none",strokeWidth:e=1})=>he("polyline",{style:{stroke:i,fill:i,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),vte={[fA.Arrow]:n5e,[fA.ArrowClosed]:i5e};function o5e(i){const e=cs();return x.exports.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(vte,i)?vte[i]:((r=(o=e.getState()).onError)==null||r.call(o,"009",ip.error009(i)),null)},[i])}const r5e=({id:i,type:e,color:t,width:n=12.5,height:o=12.5,markerUnits:r="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=o5e(e);return l?he("marker",{className:"react-flow__arrowhead",id:i,markerWidth:`${n}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:a,refX:"0",refY:"0",children:he(l,{color:t,strokeWidth:s})}):null},s5e=({defaultColor:i,rfId:e})=>t=>{const n=[];return t.edges.reduce((o,r)=>([r.markerStart,r.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=BB(s,e);n.includes(a)||(o.push({id:a,color:s.color||i,...s}),n.push(a))}}),o),[]).sort((o,r)=>o.id.localeCompare(r.id))},qfe=({defaultColor:i,rfId:e})=>{const t=mo(x.exports.useCallback(s5e({defaultColor:i,rfId:e}),[i,e]),(n,o)=>!(n.length!==o.length||n.some((r,s)=>r.id!==o[s].id)));return he("defs",{children:t.map(n=>he(r5e,{id:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient},n.id))})};qfe.displayName="MarkerDefinitions";var a5e=x.exports.memo(qfe);const l5e=i=>({nodesConnectable:i.nodesConnectable,edgesFocusable:i.edgesFocusable,edgesUpdatable:i.edgesUpdatable,elementsSelectable:i.elementsSelectable,width:i.width,height:i.height,connectionMode:i.connectionMode,nodeInternals:i.nodeInternals,onError:i.onError}),Gfe=({defaultMarkerColor:i,onlyRenderVisibleElements:e,elevateEdgesOnSelect:t,rfId:n,edgeTypes:o,noPanClassName:r,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:u,edgeUpdaterRadius:h,onEdgeDoubleClick:f,onEdgeUpdateStart:g,onEdgeUpdateEnd:p,children:v})=>{const{edgesFocusable:m,edgesUpdatable:_,elementsSelectable:y,width:w,height:L,connectionMode:D,nodeInternals:E,onError:I}=mo(l5e,Hs),k=t5e(e,E,t);return w?fn(ks,{children:[k.map(({level:R,edges:A,isMaxLevel:P})=>fn("svg",{style:{zIndex:R},width:w,height:L,className:"react-flow__edges react-flow__container",children:[P&&he(a5e,{defaultColor:i,rfId:n}),he("g",{children:A.map(N=>{var Oe,xe;const[M,H,B]=mte(E.get(N.source)),[F,$,z]=mte(E.get(N.target));if(!B||!z)return null;let K=N.type||"default";o[K]||(I==null||I("011",ip.error011(K)),K="default");const j=o[K]||o.default,G=D===U0.Strict?$.target:((Oe=$.target)!=null?Oe:[]).concat((xe=$.source)!=null?xe:[]),X=pte(H.source,N.sourceHandle),ue=pte(G,N.targetHandle),fe=(X==null?void 0:X.position)||mn.Bottom,pe=(ue==null?void 0:ue.position)||mn.Top,be=!!(N.focusable||m&&typeof N.focusable=="undefined"),Se=typeof s!="undefined"&&(N.updatable||_&&typeof N.updatable=="undefined");if(!X||!ue)return I==null||I("008",ip.error008(X,N)),null;const{sourceX:Fe,sourceY:De,targetX:ce,targetY:Pe}=Z4e(M,X,fe,F,ue,pe);return he(j,{id:N.id,className:fa([N.className,r]),type:K,data:N.data,selected:!!N.selected,animated:!!N.animated,hidden:!!N.hidden,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,style:N.style,source:N.source,target:N.target,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerEnd:N.markerEnd,markerStart:N.markerStart,sourceX:Fe,sourceY:De,targetX:ce,targetY:Pe,sourcePosition:fe,targetPosition:pe,elementsSelectable:y,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:u,edgeUpdaterRadius:h,onEdgeDoubleClick:f,onEdgeUpdateStart:g,onEdgeUpdateEnd:p,rfId:n,ariaLabel:N.ariaLabel,isFocusable:be,isUpdatable:Se,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth},N.id)})})]},R)),v]}):null};Gfe.displayName="EdgeRenderer";var c5e=x.exports.memo(Gfe);const d5e=i=>`translate(${i.transform[0]}px,${i.transform[1]}px) scale(${i.transform[2]})`;function u5e({children:i}){const e=mo(d5e);return he("div",{className:"react-flow__viewport react-flow__container",style:{transform:e},children:i})}function h5e(i){const e=_K(),t=x.exports.useRef(!1);x.exports.useEffect(()=>{!t.current&&e.viewportInitialized&&i&&(setTimeout(()=>i(e),1),t.current=!0)},[i,e.viewportInitialized])}const f5e={[mn.Left]:mn.Right,[mn.Right]:mn.Left,[mn.Top]:mn.Bottom,[mn.Bottom]:mn.Top},Xfe=({nodeId:i,handleType:e,style:t,type:n=am.Bezier,CustomComponent:o,connectionStatus:r})=>{var D,E,I,k,R,A,P;const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:d}=mo(x.exports.useCallback(N=>({fromNode:N.nodeInternals.get(i),handleId:N.connectionHandleId,toX:(N.connectionPosition.x-N.transform[0])/N.transform[2],toY:(N.connectionPosition.y-N.transform[1])/N.transform[2],connectionMode:N.connectionMode}),[i]),Hs),u=(D=s==null?void 0:s[ys])==null?void 0:D.handleBounds;let h=u==null?void 0:u[e];if(d===U0.Loose&&(h=h||(u==null?void 0:u[e==="source"?"target":"source"])),!s||!h)return null;const f=a?h.find(N=>N.id===a):h[0],g=f?f.x+f.width/2:((E=s.width)!=null?E:0)/2,p=f?f.y+f.height/2:(I=s.height)!=null?I:0,v=((R=(k=s.positionAbsolute)==null?void 0:k.x)!=null?R:0)+g,m=((P=(A=s.positionAbsolute)==null?void 0:A.y)!=null?P:0)+p,_=f==null?void 0:f.position,y=_?f5e[_]:null;if(!_||!y)return null;if(o)return he(o,{connectionLineType:n,connectionLineStyle:t,fromNode:s,fromHandle:f,fromX:v,fromY:m,toX:l,toY:c,fromPosition:_,toPosition:y,connectionStatus:r});let w="";const L={sourceX:v,sourceY:m,sourcePosition:_,targetX:l,targetY:c,targetPosition:y};return n===am.Bezier?[w]=vfe(L):n===am.Step?[w]=OB({...L,borderRadius:0}):n===am.SmoothStep?[w]=OB(L):n===am.SimpleBezier?[w]=mfe(L):w=`M${v},${m} ${l},${c}`,he("path",{d:w,fill:"none",className:"react-flow__connection-path",style:t})};Xfe.displayName="ConnectionLine";const g5e=i=>({nodeId:i.connectionNodeId,handleType:i.connectionHandleType,nodesConnectable:i.nodesConnectable,connectionStatus:i.connectionStatus,width:i.width,height:i.height});function p5e({containerStyle:i,style:e,type:t,component:n}){const{nodeId:o,handleType:r,nodesConnectable:s,width:a,height:l,connectionStatus:c}=mo(g5e,Hs);return!(o&&r&&a&&s)?null:he("svg",{style:i,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:he("g",{className:fa(["react-flow__connection",c]),children:he(Xfe,{nodeId:o,handleType:r,style:e,type:t,CustomComponent:n,connectionStatus:c})})})}function _te(i,e){return x.exports.useRef(null),cs(),x.exports.useMemo(()=>e(i),[i])}const Yfe=({nodeTypes:i,edgeTypes:e,onMove:t,onMoveStart:n,onMoveEnd:o,onInit:r,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:h,onNodeContextMenu:f,onSelectionContextMenu:g,onSelectionStart:p,onSelectionEnd:v,connectionLineType:m,connectionLineStyle:_,connectionLineComponent:y,connectionLineContainerStyle:w,selectionKeyCode:L,selectionOnDrag:D,selectionMode:E,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:R,deleteKeyCode:A,onlyRenderVisibleElements:P,elementsSelectable:N,selectNodesOnDrag:M,defaultViewport:H,translateExtent:B,minZoom:F,maxZoom:$,preventScrolling:z,defaultMarkerColor:K,zoomOnScroll:j,zoomOnPinch:G,panOnScroll:X,panOnScrollSpeed:ue,panOnScrollMode:fe,zoomOnDoubleClick:pe,panOnDrag:be,onPaneClick:Se,onPaneMouseEnter:Fe,onPaneMouseMove:De,onPaneMouseLeave:ce,onPaneScroll:Pe,onPaneContextMenu:Oe,onEdgeUpdate:xe,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:Qe,edgeUpdaterRadius:Ge,onEdgeUpdateStart:re,onEdgeUpdateEnd:ie,noDragClassName:se,noWheelClassName:U,noPanClassName:Y,elevateEdgesOnSelect:oe,disableKeyboardA11y:te,nodeOrigin:ye,nodeExtent:Le,rfId:Te})=>{const We=_te(i,z4e),je=_te(e,Y4e);return h5e(r),he(H4e,{onPaneClick:Se,onPaneMouseEnter:Fe,onPaneMouseMove:De,onPaneMouseLeave:ce,onPaneContextMenu:Oe,onPaneScroll:Pe,deleteKeyCode:A,selectionKeyCode:L,selectionOnDrag:D,selectionMode:E,onSelectionStart:p,onSelectionEnd:v,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:R,elementsSelectable:N,onMove:t,onMoveStart:n,onMoveEnd:o,zoomOnScroll:j,zoomOnPinch:G,zoomOnDoubleClick:pe,panOnScroll:X,panOnScrollSpeed:ue,panOnScrollMode:fe,panOnDrag:be,defaultViewport:H,translateExtent:B,minZoom:F,maxZoom:$,onSelectionContextMenu:g,preventScrolling:z,noDragClassName:se,noWheelClassName:U,noPanClassName:Y,disableKeyboardA11y:te,children:fn(u5e,{children:[he(c5e,{edgeTypes:je,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:xe,onlyRenderVisibleElements:P,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:Qe,onEdgeUpdateStart:re,onEdgeUpdateEnd:ie,edgeUpdaterRadius:Ge,defaultMarkerColor:K,noPanClassName:Y,elevateEdgesOnSelect:!!oe,disableKeyboardA11y:te,rfId:Te,children:he(p5e,{style:_,type:m,component:y,containerStyle:w})}),he("div",{className:"react-flow__edgelabel-renderer"}),he(K4e,{nodeTypes:We,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:h,onNodeContextMenu:f,selectNodesOnDrag:M,onlyRenderVisibleElements:P,noPanClassName:Y,noDragClassName:se,disableKeyboardA11y:te,nodeOrigin:ye,nodeExtent:Le,rfId:Te})]})})};Yfe.displayName="GraphView";var m5e=x.exports.memo(Yfe);const $B=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Pp={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:$B,nodeExtent:$B,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:U0.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:KOe,isValidConnection:void 0},v5e=()=>iMe((i,e)=>({...Pp,setNodes:t=>{const{nodeInternals:n,nodeOrigin:o,elevateNodesOnSelect:r}=e();i({nodeInternals:V8(t,n,o,r)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:t=>{const{defaultEdgeOptions:n={}}=e();i({edges:t.map(o=>({...n,...o}))})},setDefaultNodesAndEdges:(t,n)=>{const o=typeof t!="undefined",r=typeof n!="undefined",s=o?V8(t,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;i({nodeInternals:s,edges:r?n:[],hasDefaultNodes:o,hasDefaultEdges:r})},updateNodeDimensions:t=>{const{onNodesChange:n,nodeInternals:o,fitViewOnInit:r,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=e(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const u=window.getComputedStyle(d),{m22:h}=new window.DOMMatrixReadOnly(u.transform),f=t.reduce((p,v)=>{const m=o.get(v.id);if(m){const _=dK(v.nodeElement);!!(_.width&&_.height&&(m.width!==_.width||m.height!==_.height||v.forceUpdate))&&(o.set(m.id,{...m,[ys]:{...m[ys],handleBounds:{source:ute(".source",v.nodeElement,h,c),target:ute(".target",v.nodeElement,h,c)}},..._}),p.push({id:m.id,type:"dimensions",dimensions:_}))}return p},[]);Ofe(o,c);const g=s||r&&!s&&Ffe(e,{initial:!0,...a});i({nodeInternals:new Map(o),fitViewOnInitDone:g}),(f==null?void 0:f.length)>0&&(n==null||n(f))},updateNodePositions:(t,n=!0,o=!1)=>{const{triggerNodeChanges:r}=e(),s=t.map(a=>{const l={id:a.id,type:"position",dragging:o};return n&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});r(s)},triggerNodeChanges:t=>{const{onNodesChange:n,nodeInternals:o,hasDefaultNodes:r,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=e();if(t!=null&&t.length){if(r){const c=Wfe(t,a()),d=V8(c,o,s,l);i({nodeInternals:d})}n==null||n(t)}},addSelectedNodes:t=>{const{multiSelectionActive:n,edges:o,getNodes:r}=e();let s,a=null;n?s=t.map(l=>tm(l,!0)):(s=xC(r(),t),a=xC(o,[])),FN({changedNodes:s,changedEdges:a,get:e,set:i})},addSelectedEdges:t=>{const{multiSelectionActive:n,edges:o,getNodes:r}=e();let s,a=null;n?s=t.map(l=>tm(l,!0)):(s=xC(o,t),a=xC(r(),[])),FN({changedNodes:a,changedEdges:s,get:e,set:i})},unselectNodesAndEdges:({nodes:t,edges:n}={})=>{const{edges:o,getNodes:r}=e(),s=t||r(),a=n||o,l=s.map(d=>(d.selected=!1,tm(d.id,!1))),c=a.map(d=>tm(d.id,!1));FN({changedNodes:l,changedEdges:c,get:e,set:i})},setMinZoom:t=>{const{d3Zoom:n,maxZoom:o}=e();n==null||n.scaleExtent([t,o]),i({minZoom:t})},setMaxZoom:t=>{const{d3Zoom:n,minZoom:o}=e();n==null||n.scaleExtent([o,t]),i({maxZoom:t})},setTranslateExtent:t=>{var n;(n=e().d3Zoom)==null||n.translateExtent(t),i({translateExtent:t})},resetSelectedElements:()=>{const{edges:t,getNodes:n}=e(),r=n().filter(a=>a.selected).map(a=>tm(a.id,!1)),s=t.filter(a=>a.selected).map(a=>tm(a.id,!1));FN({changedNodes:r,changedEdges:s,get:e,set:i})},setNodeExtent:t=>{const{nodeInternals:n}=e();n.forEach(o=>{o.positionAbsolute=uK(o.position,t)}),i({nodeExtent:t,nodeInternals:new Map(n)})},panBy:t=>{const{transform:n,width:o,height:r,d3Zoom:s,d3Selection:a,translateExtent:l}=e();if(!s||!a||!t.x&&!t.y)return!1;const c=Ug.translate(n[0]+t.x,n[1]+t.y).scale(n[2]),d=[[0,0],[o,r]],u=s==null?void 0:s.constrain()(c,d,l);return s.transform(a,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>i({connectionNodeId:Pp.connectionNodeId,connectionHandleId:Pp.connectionHandleId,connectionHandleType:Pp.connectionHandleType,connectionStatus:Pp.connectionStatus,connectionStartHandle:Pp.connectionStartHandle,connectionEndHandle:Pp.connectionEndHandle}),reset:()=>i({...Pp})}),Object.is),CK=({children:i})=>{const e=x.exports.useRef(null);return e.current||(e.current=v5e()),he(WOe,{value:e.current,children:i})};CK.displayName="ReactFlowProvider";const Zfe=({children:i})=>x.exports.useContext(r4)?he(ks,{children:i}):he(CK,{children:i});Zfe.displayName="ReactFlowWrapper";const _5e={input:Ife,default:VB,output:Nfe,group:vK},b5e={default:gA,straight:gK,step:fK,smoothstep:s4,simplebezier:hK},C5e=[0,0],y5e=[15,15],w5e={x:0,y:0,zoom:1},S5e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Qfe=x.exports.forwardRef(({nodes:i,edges:e,defaultNodes:t,defaultEdges:n,className:o,nodeTypes:r=_5e,edgeTypes:s=b5e,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:u,onMoveEnd:h,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:v,onClickConnectEnd:m,onNodeMouseEnter:_,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:D,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:k,onNodesDelete:R,onEdgesDelete:A,onSelectionChange:P,onSelectionDragStart:N,onSelectionDrag:M,onSelectionDragStop:H,onSelectionContextMenu:B,onSelectionStart:F,onSelectionEnd:$,connectionMode:z=U0.Strict,connectionLineType:K=am.Bezier,connectionLineStyle:j,connectionLineComponent:G,connectionLineContainerStyle:X,deleteKeyCode:ue="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:pe=!1,selectionMode:be=cD.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:Fe=hA()?"Meta":"Control",zoomActivationKeyCode:De=hA()?"Meta":"Control",snapToGrid:ce=!1,snapGrid:Pe=y5e,onlyRenderVisibleElements:Oe=!1,selectNodesOnDrag:xe=!0,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:nt,nodeOrigin:Qe=C5e,edgesFocusable:Ge,edgesUpdatable:re,elementsSelectable:ie,defaultViewport:se=w5e,minZoom:U=.5,maxZoom:Y=2,translateExtent:oe=$B,preventScrolling:te=!0,nodeExtent:ye,defaultMarkerColor:Le="#b1b1b7",zoomOnScroll:Te=!0,zoomOnPinch:We=!0,panOnScroll:je=!1,panOnScrollSpeed:mt=.5,panOnScrollMode:Dt=i0.Free,zoomOnDoubleClick:At=!0,panOnDrag:Je=!0,onPaneClick:Lt,onPaneMouseEnter:Ot,onPaneMouseMove:Vn,onPaneMouseLeave:Et,onPaneScroll:tn,onPaneContextMenu:di,children:cn,onEdgeUpdate:Gn,onEdgeContextMenu:bn,onEdgeDoubleClick:Pt,onEdgeMouseEnter:qt,onEdgeMouseMove:Nt,onEdgeMouseLeave:jt,onEdgeUpdateStart:Gt,onEdgeUpdateEnd:It,edgeUpdaterRadius:Ft=10,onNodesChange:Ct,onEdgesChange:Zt,noDragClassName:wn="nodrag",noWheelClassName:Dn="nowheel",noPanClassName:Xn="nopan",fitView:jn=!1,fitViewOptions:Zi,connectOnClick:an=!0,attributionPosition:Xt,proOptions:oi,defaultEdgeOptions:Ze,elevateNodesOnSelect:de=!0,elevateEdgesOnSelect:Ve=!1,disableKeyboardA11y:ot=!1,autoPanOnConnect:Sn=!0,autoPanOnNodeDrag:$n=!0,connectionRadius:Ci=20,isValidConnection:An,onError:lo,style:Qo,id:zo,nodeDragThreshold:oc,...Yc},Gr)=>{const Ua=zo||"1";return he("div",{...Yc,style:{...Qo,...S5e},ref:Gr,className:fa(["react-flow",o]),"data-testid":"rf__wrapper",id:zo,children:fn(Zfe,{children:[he(m5e,{onInit:c,onMove:d,onMoveStart:u,onMoveEnd:h,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:_,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:D,nodeTypes:r,edgeTypes:s,connectionLineType:K,connectionLineStyle:j,connectionLineComponent:G,connectionLineContainerStyle:X,selectionKeyCode:fe,selectionOnDrag:pe,selectionMode:be,deleteKeyCode:ue,multiSelectionKeyCode:Fe,panActivationKeyCode:Se,zoomActivationKeyCode:De,onlyRenderVisibleElements:Oe,selectNodesOnDrag:xe,defaultViewport:se,translateExtent:oe,minZoom:U,maxZoom:Y,preventScrolling:te,zoomOnScroll:Te,zoomOnPinch:We,zoomOnDoubleClick:At,panOnScroll:je,panOnScrollSpeed:mt,panOnScrollMode:Dt,panOnDrag:Je,onPaneClick:Lt,onPaneMouseEnter:Ot,onPaneMouseMove:Vn,onPaneMouseLeave:Et,onPaneScroll:tn,onPaneContextMenu:di,onSelectionContextMenu:B,onSelectionStart:F,onSelectionEnd:$,onEdgeUpdate:Gn,onEdgeContextMenu:bn,onEdgeDoubleClick:Pt,onEdgeMouseEnter:qt,onEdgeMouseMove:Nt,onEdgeMouseLeave:jt,onEdgeUpdateStart:Gt,onEdgeUpdateEnd:It,edgeUpdaterRadius:Ft,defaultMarkerColor:Le,noDragClassName:wn,noWheelClassName:Dn,noPanClassName:Xn,elevateEdgesOnSelect:Ve,rfId:Ua,disableKeyboardA11y:ot,nodeOrigin:Qe,nodeExtent:ye}),he(f4e,{nodes:i,edges:e,defaultNodes:t,defaultEdges:n,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:v,onClickConnectEnd:m,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:nt,edgesFocusable:Ge,edgesUpdatable:re,elementsSelectable:ie,elevateNodesOnSelect:de,minZoom:U,maxZoom:Y,nodeExtent:ye,onNodesChange:Ct,onEdgesChange:Zt,snapToGrid:ce,snapGrid:Pe,connectionMode:z,translateExtent:oe,connectOnClick:an,defaultEdgeOptions:Ze,fitView:jn,fitViewOptions:Zi,onNodesDelete:R,onEdgesDelete:A,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:k,onSelectionDrag:M,onSelectionDragStart:N,onSelectionDragStop:H,noPanClassName:Xn,nodeOrigin:Qe,rfId:Ua,autoPanOnConnect:Sn,autoPanOnNodeDrag:$n,onError:lo,connectionRadius:Ci,isValidConnection:An,nodeDragThreshold:oc}),he(u4e,{onSelectionChange:P}),cn,he(HOe,{proOptions:oi,position:Xt}),he(_4e,{rfId:Ua,disableKeyboardA11y:ot})]})})});Qfe.displayName="ReactFlow";function x5e(){const i=cs();return x.exports.useCallback(e=>{const{domNode:t,updateNodeDimensions:n}=i.getState(),r=(Array.isArray(e)?e:[e]).reduce((s,a)=>{const l=t==null?void 0:t.querySelector(`.react-flow__node[data-id="${a}"]`);return l&&s.push({id:a,nodeElement:l,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>n(r))},[])}const Jfe=({id:i,x:e,y:t,width:n,height:o,style:r,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:d,shapeRendering:u,onClick:h,selected:f})=>{const{background:g,backgroundColor:p}=r||{},v=s||g||p;return he("rect",{className:fa(["react-flow__minimap-node",{selected:f},c]),x:e,y:t,rx:d,ry:d,width:n,height:o,fill:v,stroke:a,strokeWidth:l,shapeRendering:u,onClick:h?m=>h(m,i):void 0})};Jfe.displayName="MiniMapNode";var L5e=x.exports.memo(Jfe);const E5e=i=>i.nodeOrigin,D5e=i=>i.getNodes().filter(e=>!e.hidden&&e.width&&e.height),U8=i=>i instanceof Function?i:()=>i;function k5e({nodeStrokeColor:i="transparent",nodeColor:e="#e2e2e2",nodeClassName:t="",nodeBorderRadius:n=5,nodeStrokeWidth:o=2,nodeComponent:r=L5e,onClick:s}){const a=mo(D5e,Hs),l=mo(E5e),c=U8(e),d=U8(i),u=U8(t),h=typeof window=="undefined"||!!window.chrome?"crispEdges":"geometricPrecision";return he(ks,{children:a.map(f=>{const{x:g,y:p}=x0(f,l).positionAbsolute;return he(r,{x:g,y:p,width:f.width,height:f.height,style:f.style,selected:f.selected,className:u(f),color:c(f),borderRadius:n,strokeColor:d(f),strokeWidth:o,shapeRendering:h,onClick:s,id:f.id},f.id)})})}var I5e=x.exports.memo(k5e);const T5e=200,N5e=150,R5e=i=>{const e=i.getNodes(),t={x:-i.transform[0]/i.transform[2],y:-i.transform[1]/i.transform[2],width:i.width/i.transform[2],height:i.height/i.transform[2]};return{viewBB:t,boundingRect:e.length>0?UOe(a4(e,i.nodeOrigin),t):t,rfId:i.rfId}},M5e="react-flow__minimap-desc";function ege({style:i,className:e,nodeStrokeColor:t="transparent",nodeColor:n="#e2e2e2",nodeClassName:o="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:a,maskColor:l="rgb(240, 240, 240, 0.6)",maskStrokeColor:c="none",maskStrokeWidth:d=1,position:u="bottom-right",onClick:h,onNodeClick:f,pannable:g=!1,zoomable:p=!1,ariaLabel:v="React Flow mini map",inversePan:m=!1,zoomStep:_=10,offsetScale:y=5}){var fe,pe;const w=cs(),L=x.exports.useRef(null),{boundingRect:D,viewBB:E,rfId:I}=mo(R5e,Hs),k=(fe=i==null?void 0:i.width)!=null?fe:T5e,R=(pe=i==null?void 0:i.height)!=null?pe:N5e,A=D.width/k,P=D.height/R,N=Math.max(A,P),M=N*k,H=N*R,B=y*N,F=D.x-(M-D.width)/2-B,$=D.y-(H-D.height)/2-B,z=M+B*2,K=H+B*2,j=`${M5e}-${I}`,G=x.exports.useRef(0);G.current=N,x.exports.useEffect(()=>{if(L.current){const be=bd(L.current),Se=ce=>{const{transform:Pe,d3Selection:Oe,d3Zoom:xe}=w.getState();if(ce.sourceEvent.type!=="wheel"||!Oe||!xe)return;const Ee=-ce.sourceEvent.deltaY*(ce.sourceEvent.deltaMode===1?.05:ce.sourceEvent.deltaMode?1:.002)*_,tt=Pe[2]*Math.pow(2,Ee);xe.scaleTo(Oe,tt)},Fe=ce=>{const{transform:Pe,d3Selection:Oe,d3Zoom:xe,translateExtent:Ee,width:tt,height:nt}=w.getState();if(ce.sourceEvent.type!=="mousemove"||!Oe||!xe)return;const Qe=G.current*Math.max(1,Pe[2])*(m?-1:1),Ge={x:Pe[0]-ce.sourceEvent.movementX*Qe,y:Pe[1]-ce.sourceEvent.movementY*Qe},re=[[0,0],[tt,nt]],ie=Ug.translate(Ge.x,Ge.y).scale(Pe[2]),se=xe.constrain()(ie,re,Ee);xe.transform(Oe,se)},De=ofe().on("zoom",g?Fe:null).on("zoom.wheel",p?Se:null);return be.call(De),()=>{be.on("zoom",null)}}},[g,p,m,_]);const X=h?be=>{const Se=gu(be);h(be,{x:Se[0],y:Se[1]})}:void 0,ue=f?(be,Se)=>{const Fe=w.getState().nodeInternals.get(Se);f(be,Fe)}:void 0;return he(aD,{position:u,style:i,className:fa(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:fn("svg",{width:k,height:R,viewBox:`${F} ${$} ${z} ${K}`,role:"img","aria-labelledby":j,ref:L,onClick:X,children:[v&&he("title",{id:j,children:v}),he(I5e,{onClick:ue,nodeColor:n,nodeStrokeColor:t,nodeBorderRadius:r,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:a}),he("path",{className:"react-flow__minimap-mask",d:`M${F-B},${$-B}h${z+B*2}v${K+B*2}h${-z-B*2}z - M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fill:l,fillRule:"evenodd",stroke:c,strokeWidth:d,pointerEvents:"none"})]})})}ege.displayName="MiniMap";var A5e=x.exports.memo(ege);function P5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:he("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function O5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:he("path",{d:"M0 0h32v4.2H0z"})})}function F5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:he("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function B5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:he("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function W5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:he("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}const mL=({children:i,className:e,...t})=>he("button",{type:"button",className:fa(["react-flow__controls-button",e]),...t,children:i});mL.displayName="ControlButton";const V5e=i=>({isInteractive:i.nodesDraggable||i.nodesConnectable||i.elementsSelectable,minZoomReached:i.transform[2]<=i.minZoom,maxZoomReached:i.transform[2]>=i.maxZoom}),tge=({style:i,showZoom:e=!0,showFitView:t=!0,showInteractive:n=!0,fitViewOptions:o,onZoomIn:r,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:d,position:u="bottom-left"})=>{const h=cs(),[f,g]=x.exports.useState(!1),{isInteractive:p,minZoomReached:v,maxZoomReached:m}=mo(V5e,Hs),{zoomIn:_,zoomOut:y,fitView:w}=_K();if(x.exports.useEffect(()=>{g(!0)},[]),!f)return null;const L=()=>{_(),r==null||r()},D=()=>{y(),s==null||s()},E=()=>{w(o),a==null||a()},I=()=>{h.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),l==null||l(!p)};return fn(aD,{className:fa(["react-flow__controls",c]),position:u,style:i,"data-testid":"rf__controls",children:[e&&fn(ks,{children:[he(mL,{onClick:L,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m,children:he(P5e,{})}),he(mL,{onClick:D,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:v,children:he(O5e,{})})]}),t&&he(mL,{className:"react-flow__controls-fitview",onClick:E,title:"fit view","aria-label":"fit view",children:he(F5e,{})}),n&&he(mL,{className:"react-flow__controls-interactive",onClick:I,title:"toggle interactivity","aria-label":"toggle interactivity",children:p?he(W5e,{}):he(B5e,{})}),d]})};tge.displayName="Controls";var H5e=x.exports.memo(tge),kd;(function(i){i.Lines="lines",i.Dots="dots",i.Cross="cross"})(kd||(kd={}));function $5e({color:i,dimensions:e,lineWidth:t}){return he("path",{stroke:i,strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function z5e({color:i,radius:e}){return he("circle",{cx:e,cy:e,r:e,fill:i})}const U5e={[kd.Dots]:"#91919a",[kd.Lines]:"#eee",[kd.Cross]:"#e2e2e2"},j5e={[kd.Dots]:1,[kd.Lines]:1,[kd.Cross]:6},K5e=i=>({transform:i.transform,patternId:`pattern-${i.rfId}`});function nge({id:i,variant:e=kd.Dots,gap:t=20,size:n,lineWidth:o=1,offset:r=2,color:s,style:a,className:l}){const c=x.exports.useRef(null),{transform:d,patternId:u}=mo(K5e,Hs),h=s||U5e[e],f=n||j5e[e],g=e===kd.Dots,p=e===kd.Cross,v=Array.isArray(t)?t:[t,t],m=[v[0]*d[2]||1,v[1]*d[2]||1],_=f*d[2],y=p?[_,_]:m,w=g?[_/r,_/r]:[y[0]/r,y[1]/r];return fn("svg",{className:fa(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background",children:[he("pattern",{id:u+i,x:d[0]%m[0],y:d[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${w[0]},-${w[1]})`,children:g?he(z5e,{color:h,radius:_/r}):he($5e,{dimensions:y,color:h,lineWidth:o})}),he("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${u+i})`})]})}nge.displayName="Background";var q5e=x.exports.memo(nge);let WN;const G5e=new Uint8Array(16);function X5e(){if(!WN&&(WN=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!WN))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return WN(G5e)}const Ks=[];for(let i=0;i<256;++i)Ks.push((i+256).toString(16).slice(1));function Y5e(i,e=0){return Ks[i[e+0]]+Ks[i[e+1]]+Ks[i[e+2]]+Ks[i[e+3]]+"-"+Ks[i[e+4]]+Ks[i[e+5]]+"-"+Ks[i[e+6]]+Ks[i[e+7]]+"-"+Ks[i[e+8]]+Ks[i[e+9]]+"-"+Ks[i[e+10]]+Ks[i[e+11]]+Ks[i[e+12]]+Ks[i[e+13]]+Ks[i[e+14]]+Ks[i[e+15]]}const Z5e=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var bte={randomUUID:Z5e};function SI(i,e,t){if(bte.randomUUID&&!e&&!i)return bte.randomUUID();i=i||{};const n=i.random||(i.rng||X5e)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let o=0;o<16;++o)e[t+o]=n[o];return e}return Y5e(n)}class xI{constructor(e){bt(this,"id");bt(this,"name");bt(this,"children",[]);bt(this,"nodes",[]);bt(this,"edges",[]);bt(this,"parentLayerId");bt(this,"relativeNodeId");bt(this,"relativeOperatorType");this.id=SI(),this.name=e}}function wc(i,e){if(i.id===e)return i;for(const t of i.children){const n=wc(t,e);if(n)return n}}function Q5e(i){var o;const e=[i];let t=e.pop();const n=[];for(;t;)n.push(t),(o=t==null?void 0:t.children)!=null&&o.length&&e.push(...t.children),t=e.pop();return n.reverse(),n}var J5e=function(i){return function(e,t){var n=x.exports.useRef(!1);i(function(){return function(){n.current=!1}},[]),i(function(){if(!n.current)n.current=!0;else return e()},t)}},eFe=function(i){return typeof i=="function"},tFe=!1,nFe=tFe;function T_(i){nFe&&(eFe(i)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof i)));var e=x.exports.useRef(i);e.current=x.exports.useMemo(function(){return i},[i]);var t=x.exports.useRef();return t.current||(t.current=function(){for(var n=[],o=0;o0},i.prototype.connect_=function(){!zB||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),cFe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!zB||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?"":t,o=lFe.some(function(r){return!!~n.indexOf(r)});o&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),oge=function(i,e){for(var t=0,n=Object.keys(e);t0},i}(),sge=typeof WeakMap!="undefined"?new WeakMap:new ige,age=function(){function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=dFe.getInstance(),n=new CFe(e,t,this);sge.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){age.prototype[i]=function(){var e;return(e=sge.get(this))[i].apply(e,arguments)}});var yFe=function(){return typeof mA.ResizeObserver!="undefined"?mA.ResizeObserver:age}();function lge(){return`$flow_${SI()}`}function wFe(i,e){return i.target===e.target&&i.targetHandle===e.targetHandle}function SFe(i,e){return i.source===e.source&&i.sourceHandle===e.sourceHandle}async function xFe(i){return await new Promise(e=>setTimeout(e,i))}var cge={exports:{}};/*! + */var POe=x.exports,sfe=60103;yI.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var Yee=Symbol.for;sfe=Yee("react.element"),yI.Fragment=Yee("react.fragment")}var OOe=POe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,FOe=Object.prototype.hasOwnProperty,BOe={key:!0,ref:!0,__self:!0,__source:!0};function afe(i,e,t){var n,o={},r=null,s=null;t!==void 0&&(r=""+t),e.key!==void 0&&(r=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)FOe.call(e,n)&&!BOe.hasOwnProperty(n)&&(o[n]=e[n]);if(i&&i.defaultProps)for(n in e=i.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:sfe,type:i,key:r,ref:s,props:o,_owner:OOe.current}}yI.jsx=afe;yI.jsxs=afe;o4.exports=yI;const he=o4.exports.jsx,fn=o4.exports.jsxs,ks=o4.exports.Fragment,r4=x.exports.createContext(null),WOe=r4.Provider,ip={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:i=>`Node type "${i}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:i=>`The old edge with id=${i} does not exist.`,error009:i=>`Marker type "${i}" doesn't exist.`,error008:(i,e)=>`Couldn't create edge for ${i?"target":"source"} handle id: "${i?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:i=>`Edge type "${i}" not found. Using fallback type "default".`,error012:i=>`Node with id "${i}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},lfe=ip.error001();function mo(i,e){const t=x.exports.useContext(r4);if(t===null)throw new Error(lfe);return Nhe(t,i,e)}const cs=()=>{const i=x.exports.useContext(r4);if(i===null)throw new Error(lfe);return x.exports.useMemo(()=>({getState:i.getState,setState:i.setState,subscribe:i.subscribe,destroy:i.destroy}),[i])},VOe=i=>i.userSelectionActive?"none":"all";function aD({position:i,children:e,className:t,style:n,...o}){const r=mo(VOe),s=`${i}`.split("-");return he("div",{className:fa(["react-flow__panel",t,...s]),style:{...n,pointerEvents:r},...o,children:e})}function HOe({proOptions:i,position:e="bottom-right"}){return i!=null&&i.hideAttribution?null:he(aD,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro",children:he("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const $Oe=({x:i,y:e,label:t,labelStyle:n={},labelShowBg:o=!0,labelBgStyle:r={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const u=x.exports.useRef(null),[h,f]=x.exports.useState({x:0,y:0,width:0,height:0}),g=fa(["react-flow__edge-textwrapper",c]);return x.exports.useEffect(()=>{if(u.current){const p=u.current.getBBox();f({x:p.x,y:p.y,width:p.width,height:p.height})}},[t]),typeof t=="undefined"||!t?null:fn("g",{transform:`translate(${i-h.width/2} ${e-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...d,children:[o&&he("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:r,rx:a,ry:a}),he("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:u,style:n,children:t}),l]})};var zOe=x.exports.memo($Oe);const uK=i=>({width:i.offsetWidth,height:i.offsetHeight}),ow=(i,e=0,t=1)=>Math.min(Math.max(i,e),t),hK=(i={x:0,y:0},e)=>({x:ow(i.x,e[0][0],e[1][0]),y:ow(i.y,e[0][1],e[1][1])}),Zee=(i,e,t)=>it?-ow(Math.abs(i-t),1,50)/50:0,cfe=(i,e)=>{const t=Zee(i.x,35,e.width-35)*20,n=Zee(i.y,35,e.height-35)*20;return[t,n]},dfe=i=>{var e;return((e=i.getRootNode)==null?void 0:e.call(i))||(window==null?void 0:window.document)},ufe=(i,e)=>({x:Math.min(i.x,e.x),y:Math.min(i.y,e.y),x2:Math.max(i.x2,e.x2),y2:Math.max(i.y2,e.y2)}),lD=({x:i,y:e,width:t,height:n})=>({x:i,y:e,x2:i+t,y2:e+n}),hfe=({x:i,y:e,x2:t,y2:n})=>({x:i,y:e,width:t-i,height:n-e}),Qee=i=>({...i.positionAbsolute||{x:0,y:0},width:i.width||0,height:i.height||0}),UOe=(i,e)=>hfe(ufe(lD(i),lD(e))),PB=(i,e)=>{const t=Math.max(0,Math.min(i.x+i.width,e.x+e.width)-Math.max(i.x,e.x)),n=Math.max(0,Math.min(i.y+i.height,e.y+e.height)-Math.max(i.y,e.y));return Math.ceil(t*n)},jOe=i=>yd(i.width)&&yd(i.height)&&yd(i.x)&&yd(i.y),yd=i=>!isNaN(i)&&isFinite(i),ys=Symbol.for("internals"),ffe=["Enter"," ","Escape"],KOe=(i,e)=>{},qOe=i=>"nativeEvent"in i;function OB(i){var o,r;const e=qOe(i)?i.nativeEvent:i,t=((r=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:r[0])||i.target;return["INPUT","SELECT","TEXTAREA"].includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const gfe=i=>"clientX"in i,Um=(i,e)=>{var r,s,a,l;const t=gfe(i),n=t?i.clientX:(r=i.touches)==null?void 0:r[0].clientX,o=t?i.clientY:(s=i.touches)==null?void 0:s[0].clientY;return{x:n-((a=e==null?void 0:e.left)!=null?a:0),y:o-((l=e==null?void 0:e.top)!=null?l:0)}},hA=()=>{var i;return typeof navigator!="undefined"&&((i=navigator==null?void 0:navigator.userAgent)==null?void 0:i.indexOf("Mac"))>=0},wI=({id:i,path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:h,interactionWidth:f=20})=>fn(ks,{children:[he("path",{id:i,style:d,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:u,markerStart:h}),f&&he("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),o&&yd(t)&&yd(n)?he(zOe,{x:t,y:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]});wI.displayName="BaseEdge";function Cx(i,e,t){return t===void 0?t:n=>{const o=e().edges.find(r=>r.id===i);o&&t(n,{...o})}}function pfe({sourceX:i,sourceY:e,targetX:t,targetY:n}){const o=Math.abs(t-i)/2,r=t{const[v,m,_]=vfe({sourceX:i,sourceY:e,sourcePosition:o,targetX:t,targetY:n,targetPosition:r});return he(wI,{path:v,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:h,markerEnd:f,markerStart:g,interactionWidth:p})});fK.displayName="SimpleBezierEdge";const ete={[mn.Left]:{x:-1,y:0},[mn.Right]:{x:1,y:0},[mn.Top]:{x:0,y:-1},[mn.Bottom]:{x:0,y:1}},GOe=({source:i,sourcePosition:e=mn.Bottom,target:t})=>e===mn.Left||e===mn.Right?i.xMath.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2));function XOe({source:i,sourcePosition:e=mn.Bottom,target:t,targetPosition:n=mn.Top,center:o,offset:r}){const s=ete[e],a=ete[n],l={x:i.x+s.x*r,y:i.y+s.y*r},c={x:t.x+a.x*r,y:t.y+a.y*r},d=GOe({source:l,sourcePosition:e,target:c}),u=d.x!==0?"x":"y",h=d[u];let f=[],g,p;const v={x:0,y:0},m={x:0,y:0},[_,y,w,L]=pfe({sourceX:i.x,sourceY:i.y,targetX:t.x,targetY:t.y});if(s[u]*a[u]===-1){g=o.x||_,p=o.y||y;const E=[{x:g,y:l.y},{x:g,y:c.y}],I=[{x:l.x,y:p},{x:c.x,y:p}];s[u]===h?f=u==="x"?E:I:f=u==="x"?I:E}else{const E=[{x:l.x,y:c.y}],I=[{x:c.x,y:l.y}];if(u==="x"?f=s.x===h?I:E:f=s.y===h?E:I,e===n){const N=Math.abs(i[u]-t[u]);if(N<=r){const M=Math.min(r-1,r-N);s[u]===h?v[u]=(l[u]>i[u]?-1:1)*M:m[u]=(c[u]>t[u]?-1:1)*M}}if(e!==n){const N=u==="x"?"y":"x",M=s[u]===a[N],H=l[N]>c[N],B=l[N]=P?(g=(k.x+R.x)/2,p=f[0].y):(g=f[0].x,p=(k.y+R.y)/2)}return[[i,{x:l.x+v.x,y:l.y+v.y},...f,{x:c.x+m.x,y:c.y+m.y},t],g,p,w,L]}function YOe(i,e,t,n){const o=Math.min(tte(i,e)/2,tte(e,t)/2,n),{x:r,y:s}=e;if(i.x===r&&r===t.x||i.y===s&&s===t.y)return`L${r} ${s}`;if(i.y===s){const c=i.x{let y="";return _>0&&_{const[m,_,y]=FB({sourceX:i,sourceY:e,sourcePosition:u,targetX:t,targetY:n,targetPosition:h,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset});return he(wI,{path:m,labelX:_,labelY:y,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:g,interactionWidth:v})});s4.displayName="SmoothStepEdge";const gK=x.exports.memo(i=>{var e;return he(s4,{...i,pathOptions:x.exports.useMemo(()=>{var t;return{borderRadius:0,offset:(t=i.pathOptions)==null?void 0:t.offset}},[(e=i.pathOptions)==null?void 0:e.offset])})});gK.displayName="StepEdge";function ZOe({sourceX:i,sourceY:e,targetX:t,targetY:n}){const[o,r,s,a]=pfe({sourceX:i,sourceY:e,targetX:t,targetY:n});return[`M ${i},${e}L ${t},${n}`,o,r,s,a]}const pK=x.exports.memo(({sourceX:i,sourceY:e,targetX:t,targetY:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:h,interactionWidth:f})=>{const[g,p,v]=ZOe({sourceX:i,sourceY:e,targetX:t,targetY:n});return he(wI,{path:g,labelX:p,labelY:v,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:h,interactionWidth:f})});pK.displayName="StraightEdge";function PN(i,e){return i>=0?.5*i:e*25*Math.sqrt(-i)}function nte({pos:i,x1:e,y1:t,x2:n,y2:o,c:r}){switch(i){case mn.Left:return[e-PN(e-n,r),t];case mn.Right:return[e+PN(n-e,r),t];case mn.Top:return[e,t-PN(t-o,r)];case mn.Bottom:return[e,t+PN(o-t,r)]}}function _fe({sourceX:i,sourceY:e,sourcePosition:t=mn.Bottom,targetX:n,targetY:o,targetPosition:r=mn.Top,curvature:s=.25}){const[a,l]=nte({pos:t,x1:i,y1:e,x2:n,y2:o,c:s}),[c,d]=nte({pos:r,x1:n,y1:o,x2:i,y2:e,c:s}),[u,h,f,g]=mfe({sourceX:i,sourceY:e,targetX:n,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${i},${e} C${a},${l} ${c},${d} ${n},${o}`,u,h,f,g]}const gA=x.exports.memo(({sourceX:i,sourceY:e,targetX:t,targetY:n,sourcePosition:o=mn.Bottom,targetPosition:r=mn.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:h,markerEnd:f,markerStart:g,pathOptions:p,interactionWidth:v})=>{const[m,_,y]=_fe({sourceX:i,sourceY:e,sourcePosition:o,targetX:t,targetY:n,targetPosition:r,curvature:p==null?void 0:p.curvature});return he(wI,{path:m,labelX:_,labelY:y,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:h,markerEnd:f,markerStart:g,interactionWidth:v})});gA.displayName="BezierEdge";const mK=x.exports.createContext(null),QOe=mK.Provider;mK.Consumer;const JOe=()=>x.exports.useContext(mK),BB=i=>"id"in i&&"source"in i&&"target"in i,e4e=({source:i,sourceHandle:e,target:t,targetHandle:n})=>`reactflow__edge-${i}${e||""}-${t}${n||""}`,WB=(i,e)=>typeof i=="undefined"?"":typeof i=="string"?i:`${e?`${e}__`:""}${Object.keys(i).sort().map(n=>`${n}=${i[n]}`).join("&")}`,t4e=(i,e)=>e.some(t=>t.source===i.source&&t.target===i.target&&(t.sourceHandle===i.sourceHandle||!t.sourceHandle&&!i.sourceHandle)&&(t.targetHandle===i.targetHandle||!t.targetHandle&&!i.targetHandle)),bfe=(i,e)=>{if(!i.source||!i.target)return e;let t;return BB(i)?t={...i}:t={...i,id:e4e(i)},t4e(t,e)?e:e.concat(t)},VB=({x:i,y:e},[t,n,o],r,[s,a])=>{const l={x:(i-t)/o,y:(e-n)/o};return r?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},Cfe=({x:i,y:e},[t,n,o])=>({x:i*o+t,y:e*o+n}),x0=(i,e=[0,0])=>{var r,s;if(!i)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const t=((r=i.width)!=null?r:0)*e[0],n=((s=i.height)!=null?s:0)*e[1],o={x:i.position.x-t,y:i.position.y-n};return{...o,positionAbsolute:i.positionAbsolute?{x:i.positionAbsolute.x-t,y:i.positionAbsolute.y-n}:o}},a4=(i,e=[0,0])=>{if(i.length===0)return{x:0,y:0,width:0,height:0};const t=i.reduce((n,o)=>{const{x:r,y:s}=x0(o,e).positionAbsolute;return ufe(n,lD({x:r,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return hfe(t)},yfe=(i,e,[t,n,o]=[0,0,1],r=!1,s=!1,a=[0,0])=>{const l={x:(e.x-t)/o,y:(e.y-n)/o,width:e.width/o,height:e.height/o},c=[];return i.forEach(d=>{const{width:u,height:h,selectable:f=!0,hidden:g=!1}=d;if(s&&!f||g)return!1;const{positionAbsolute:p}=x0(d,a),v={x:p.x,y:p.y,width:u||0,height:h||0},m=PB(l,v),_=typeof u=="undefined"||typeof h=="undefined"||u===null||h===null,y=r&&m>0,w=(u||0)*(h||0);(_||y||m>=w||d.dragging)&&c.push(d)}),c},wfe=(i,e)=>{const t=i.map(n=>n.id);return e.filter(n=>t.includes(n.source)||t.includes(n.target))},Sfe=(i,e,t,n,o,r=.1)=>{const s=e/(i.width*(1+r)),a=t/(i.height*(1+r)),l=Math.min(s,a),c=ow(l,n,o),d=i.x+i.width/2,u=i.y+i.height/2,h=e/2-d*c,f=t/2-u*c;return{x:h,y:f,zoom:c}},I_=(i,e=0)=>i.transition().duration(e);function ite(i,e,t,n){return(e[t]||[]).reduce((o,r)=>{var s,a,l,c;return`${i.id}-${r.id}-${t}`!==n&&o.push({id:r.id||null,type:t,nodeId:i.id,x:((a=(s=i.positionAbsolute)==null?void 0:s.x)!=null?a:0)+r.x+r.width/2,y:((c=(l=i.positionAbsolute)==null?void 0:l.y)!=null?c:0)+r.y+r.height/2}),o},[])}function n4e(i,e,t,n,o,r){const{x:s,y:a}=Um(i),c=e.elementsFromPoint(s,a).find(g=>g.classList.contains("react-flow__handle"));if(c){const g=c.getAttribute("data-nodeid");if(g){const p=vK(void 0,c),v=c.getAttribute("data-handleid"),m=r({nodeId:g,id:v,type:p});if(m){const _=o.find(y=>y.nodeId===g&&y.type===p&&y.id===v);return{handle:{id:v,type:p,nodeId:g,x:(_==null?void 0:_.x)||t.x,y:(_==null?void 0:_.y)||t.y},validHandleResult:m}}}}let d=[],u=1/0;if(o.forEach(g=>{const p=Math.sqrt((g.x-t.x)**2+(g.y-t.y)**2);if(p<=n){const v=r(g);p<=u&&(pg.isValid),f=d.some(({handle:g})=>g.type==="target");return d.find(({handle:g,validHandleResult:p})=>f?g.type==="target":h?p.isValid:!0)||d[0]}const i4e={source:null,target:null,sourceHandle:null,targetHandle:null},xfe=()=>({handleDomNode:null,isValid:!1,connection:i4e,endHandle:null});function Lfe(i,e,t,n,o,r,s){const a=o==="target",l=s.querySelector(`.react-flow__handle[data-id="${i==null?void 0:i.nodeId}-${i==null?void 0:i.id}-${i==null?void 0:i.type}"]`),c={...xfe(),handleDomNode:l};if(l){const d=vK(void 0,l),u=l.getAttribute("data-nodeid"),h=l.getAttribute("data-handleid"),f=l.classList.contains("connectable"),g=l.classList.contains("connectableend"),p={source:a?u:t,sourceHandle:a?h:n,target:a?t:u,targetHandle:a?n:h};c.connection=p,f&&g&&(e===U0.Strict?a&&d==="source"||!a&&d==="target":u!==t||h!==n)&&(c.endHandle={nodeId:u,handleId:h,type:d},c.isValid=r(p))}return c}function o4e({nodes:i,nodeId:e,handleId:t,handleType:n}){return i.reduce((o,r)=>{if(r[ys]){const{handleBounds:s}=r[ys];let a=[],l=[];s&&(a=ite(r,s,"source",`${e}-${t}-${n}`),l=ite(r,s,"target",`${e}-${t}-${n}`)),o.push(...a,...l)}return o},[])}function vK(i,e){return i||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function V8(i){i==null||i.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function r4e(i,e){let t=null;return e?t="valid":i&&!e&&(t="invalid"),t}function Efe({event:i,handleId:e,nodeId:t,onConnect:n,isTarget:o,getState:r,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const d=dfe(i.target),{connectionMode:u,domNode:h,autoPanOnConnect:f,connectionRadius:g,onConnectStart:p,panBy:v,getNodes:m,cancelConnection:_}=r();let y=0,w;const{x:L,y:D}=Um(i),E=d==null?void 0:d.elementFromPoint(L,D),I=vK(l,E),k=h==null?void 0:h.getBoundingClientRect();if(!k||!I)return;let R,A=Um(i,k),P=!1,N=null,M=!1,H=null;const B=o4e({nodes:m(),nodeId:t,handleId:e,handleType:I}),F=()=>{if(!f)return;const[K,j]=cfe(A,k);v({x:K,y:j}),y=requestAnimationFrame(F)};s({connectionPosition:A,connectionStatus:null,connectionNodeId:t,connectionHandleId:e,connectionHandleType:I,connectionStartHandle:{nodeId:t,handleId:e,type:I},connectionEndHandle:null}),p==null||p(i,{nodeId:t,handleId:e,handleType:I});function $(K){const{transform:j}=r();A=Um(K,k);const{handle:G,validHandleResult:X}=n4e(K,d,VB(A,j,!1,[1,1]),g,B,ue=>Lfe(ue,u,t,e,o?"target":"source",a,d));if(w=G,P||(F(),P=!0),H=X.handleDomNode,N=X.connection,M=X.isValid,s({connectionPosition:w&&M?Cfe({x:w.x,y:w.y},j):A,connectionStatus:r4e(!!w,M),connectionEndHandle:X.endHandle}),!w&&!M&&!H)return V8(R);N.source!==N.target&&H&&(V8(R),R=H,H.classList.add("connecting","react-flow__handle-connecting"),H.classList.toggle("valid",M),H.classList.toggle("react-flow__handle-valid",M))}function z(K){var j,G;(w||H)&&N&&M&&(n==null||n(N)),(G=(j=r()).onConnectEnd)==null||G.call(j,K),l&&(c==null||c(K)),V8(R),_(),cancelAnimationFrame(y),P=!1,M=!1,N=null,H=null,d.removeEventListener("mousemove",$),d.removeEventListener("mouseup",z),d.removeEventListener("touchmove",$),d.removeEventListener("touchend",z)}d.addEventListener("mousemove",$),d.addEventListener("mouseup",z),d.addEventListener("touchmove",$),d.addEventListener("touchend",z)}const ote=()=>!0,s4e=i=>({connectionStartHandle:i.connectionStartHandle,connectOnClick:i.connectOnClick,noPanClassName:i.noPanClassName}),a4e=(i,e,t)=>n=>{const{connectionStartHandle:o,connectionEndHandle:r,connectionClickStartHandle:s}=n;return{connecting:(o==null?void 0:o.nodeId)===i&&(o==null?void 0:o.handleId)===e&&(o==null?void 0:o.type)===t||(r==null?void 0:r.nodeId)===i&&(r==null?void 0:r.handleId)===e&&(r==null?void 0:r.type)===t,clickConnecting:(s==null?void 0:s.nodeId)===i&&(s==null?void 0:s.handleId)===e&&(s==null?void 0:s.type)===t}},Dfe=x.exports.forwardRef(({type:i="source",position:e=mn.Top,isValidConnection:t,isConnectable:n=!0,isConnectableStart:o=!0,isConnectableEnd:r=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:u,...h},f)=>{var k,R;const g=s||null,p=i==="target",v=cs(),m=JOe(),{connectOnClick:_,noPanClassName:y}=mo(s4e,Hs),{connecting:w,clickConnecting:L}=mo(a4e(m,g,i),Hs);m||(R=(k=v.getState()).onError)==null||R.call(k,"010",ip.error010());const D=A=>{const{defaultEdgeOptions:P,onConnect:N,hasDefaultEdges:M}=v.getState(),H={...P,...A};if(M){const{edges:B,setEdges:F}=v.getState();F(bfe(H,B))}N==null||N(H),a==null||a(H)},E=A=>{if(!m)return;const P=gfe(A);o&&(P&&A.button===0||!P)&&Efe({event:A,handleId:g,nodeId:m,onConnect:D,isTarget:p,getState:v.getState,setState:v.setState,isValidConnection:t||v.getState().isValidConnection||ote}),P?d==null||d(A):u==null||u(A)},I=A=>{const{onClickConnectStart:P,onClickConnectEnd:N,connectionClickStartHandle:M,connectionMode:H,isValidConnection:B}=v.getState();if(!m||!M&&!o)return;if(!M){P==null||P(A,{nodeId:m,handleId:g,handleType:i}),v.setState({connectionClickStartHandle:{nodeId:m,type:i,handleId:g}});return}const F=dfe(A.target),$=t||B||ote,{connection:z,isValid:K}=Lfe({nodeId:m,id:g,type:i},H,M.nodeId,M.handleId||null,M.type,$,F);K&&D(z),N==null||N(A),v.setState({connectionClickStartHandle:null})};return he("div",{"data-handleid":g,"data-nodeid":m,"data-handlepos":e,"data-id":`${m}-${g}-${i}`,className:fa(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",y,c,{source:!p,target:p,connectable:n,connectablestart:o,connectableend:r,connecting:L,connectionindicator:n&&(o&&!w||r&&w)}]),onMouseDown:E,onTouchStart:E,onClick:_?I:void 0,ref:f,...h,children:l})});Dfe.displayName="Handle";var dD=x.exports.memo(Dfe);const kfe=({data:i,isConnectable:e,targetPosition:t=mn.Top,sourcePosition:n=mn.Bottom})=>fn(ks,{children:[he(dD,{type:"target",position:t,isConnectable:e}),i==null?void 0:i.label,he(dD,{type:"source",position:n,isConnectable:e})]});kfe.displayName="DefaultNode";var HB=x.exports.memo(kfe);const Ife=({data:i,isConnectable:e,sourcePosition:t=mn.Bottom})=>fn(ks,{children:[i==null?void 0:i.label,he(dD,{type:"source",position:t,isConnectable:e})]});Ife.displayName="InputNode";var Tfe=x.exports.memo(Ife);const Nfe=({data:i,isConnectable:e,targetPosition:t=mn.Top})=>fn(ks,{children:[he(dD,{type:"target",position:t,isConnectable:e}),i==null?void 0:i.label]});Nfe.displayName="OutputNode";var Rfe=x.exports.memo(Nfe);const _K=()=>null;_K.displayName="GroupNode";const l4e=i=>({selectedNodes:i.getNodes().filter(e=>e.selected),selectedEdges:i.edges.filter(e=>e.selected)}),ON=i=>i.id;function c4e(i,e){return Hs(i.selectedNodes.map(ON),e.selectedNodes.map(ON))&&Hs(i.selectedEdges.map(ON),e.selectedEdges.map(ON))}const Mfe=x.exports.memo(({onSelectionChange:i})=>{const e=cs(),{selectedNodes:t,selectedEdges:n}=mo(l4e,c4e);return x.exports.useEffect(()=>{const o={nodes:t,edges:n};i==null||i(o),e.getState().onSelectionChange.forEach(r=>r(o))},[t,n,i]),null});Mfe.displayName="SelectionListener";const d4e=i=>!!i.onSelectionChange;function u4e({onSelectionChange:i}){const e=mo(d4e);return i||e?he(Mfe,{onSelectionChange:i}):null}const h4e=i=>({setNodes:i.setNodes,setEdges:i.setEdges,setDefaultNodesAndEdges:i.setDefaultNodesAndEdges,setMinZoom:i.setMinZoom,setMaxZoom:i.setMaxZoom,setTranslateExtent:i.setTranslateExtent,setNodeExtent:i.setNodeExtent,reset:i.reset});function S1(i,e){x.exports.useEffect(()=>{typeof i!="undefined"&&e(i)},[i])}function _i(i,e,t){x.exports.useEffect(()=>{typeof e!="undefined"&&t({[i]:e})},[e])}const f4e=({nodes:i,edges:e,defaultNodes:t,defaultEdges:n,onConnect:o,onConnectStart:r,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:u,edgesFocusable:h,edgesUpdatable:f,elevateNodesOnSelect:g,minZoom:p,maxZoom:v,nodeExtent:m,onNodesChange:_,onEdgesChange:y,elementsSelectable:w,connectionMode:L,snapGrid:D,snapToGrid:E,translateExtent:I,connectOnClick:k,defaultEdgeOptions:R,fitView:A,fitViewOptions:P,onNodesDelete:N,onEdgesDelete:M,onNodeDrag:H,onNodeDragStart:B,onNodeDragStop:F,onSelectionDrag:$,onSelectionDragStart:z,onSelectionDragStop:K,noPanClassName:j,nodeOrigin:G,rfId:X,autoPanOnConnect:ue,autoPanOnNodeDrag:fe,onError:pe,connectionRadius:be,isValidConnection:Se,nodeDragThreshold:Fe})=>{const{setNodes:De,setEdges:ce,setDefaultNodesAndEdges:Pe,setMinZoom:Oe,setMaxZoom:xe,setTranslateExtent:Ee,setNodeExtent:tt,reset:nt}=mo(h4e,Hs),Qe=cs();return x.exports.useEffect(()=>{const Ge=n==null?void 0:n.map(re=>({...re,...R}));return Pe(t,Ge),()=>{nt()}},[]),_i("defaultEdgeOptions",R,Qe.setState),_i("connectionMode",L,Qe.setState),_i("onConnect",o,Qe.setState),_i("onConnectStart",r,Qe.setState),_i("onConnectEnd",s,Qe.setState),_i("onClickConnectStart",a,Qe.setState),_i("onClickConnectEnd",l,Qe.setState),_i("nodesDraggable",c,Qe.setState),_i("nodesConnectable",d,Qe.setState),_i("nodesFocusable",u,Qe.setState),_i("edgesFocusable",h,Qe.setState),_i("edgesUpdatable",f,Qe.setState),_i("elementsSelectable",w,Qe.setState),_i("elevateNodesOnSelect",g,Qe.setState),_i("snapToGrid",E,Qe.setState),_i("snapGrid",D,Qe.setState),_i("onNodesChange",_,Qe.setState),_i("onEdgesChange",y,Qe.setState),_i("connectOnClick",k,Qe.setState),_i("fitViewOnInit",A,Qe.setState),_i("fitViewOnInitOptions",P,Qe.setState),_i("onNodesDelete",N,Qe.setState),_i("onEdgesDelete",M,Qe.setState),_i("onNodeDrag",H,Qe.setState),_i("onNodeDragStart",B,Qe.setState),_i("onNodeDragStop",F,Qe.setState),_i("onSelectionDrag",$,Qe.setState),_i("onSelectionDragStart",z,Qe.setState),_i("onSelectionDragStop",K,Qe.setState),_i("noPanClassName",j,Qe.setState),_i("nodeOrigin",G,Qe.setState),_i("rfId",X,Qe.setState),_i("autoPanOnConnect",ue,Qe.setState),_i("autoPanOnNodeDrag",fe,Qe.setState),_i("onError",pe,Qe.setState),_i("connectionRadius",be,Qe.setState),_i("isValidConnection",Se,Qe.setState),_i("nodeDragThreshold",Fe,Qe.setState),S1(i,De),S1(e,ce),S1(p,Oe),S1(v,xe),S1(I,Ee),S1(m,tt),null},rte={display:"none"},g4e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Afe="react-flow__node-desc",Pfe="react-flow__edge-desc",p4e="react-flow__aria-live",m4e=i=>i.ariaLiveMessage;function v4e({rfId:i}){const e=mo(m4e);return he("div",{id:`${p4e}-${i}`,"aria-live":"assertive","aria-atomic":"true",style:g4e,children:e})}function _4e({rfId:i,disableKeyboardA11y:e}){return fn(ks,{children:[fn("div",{id:`${Afe}-${i}`,style:rte,children:["Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),he("div",{id:`${Pfe}-${i}`,style:rte,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!e&&he(v4e,{rfId:i})]})}var uD=(i=null,e={actInsideInputWithModifier:!0})=>{const[t,n]=x.exports.useState(!1),o=x.exports.useRef(!1),r=x.exports.useRef(new Set([])),[s,a]=x.exports.useMemo(()=>{if(i!==null){const c=(Array.isArray(i)?i:[i]).filter(u=>typeof u=="string").map(u=>u.split("+")),d=c.reduce((u,h)=>u.concat(...h),[]);return[c,d]}return[[],[]]},[i]);return x.exports.useEffect(()=>{const l=typeof document!="undefined"?document:null,c=(e==null?void 0:e.target)||l;if(i!==null){const d=f=>{if(o.current=f.ctrlKey||f.metaKey||f.shiftKey,(!o.current||o.current&&!e.actInsideInputWithModifier)&&OB(f))return!1;const p=ate(f.code,a);r.current.add(f[p]),ste(s,r.current,!1)&&(f.preventDefault(),n(!0))},u=f=>{if((!o.current||o.current&&!e.actInsideInputWithModifier)&&OB(f))return!1;const p=ate(f.code,a);ste(s,r.current,!0)?(n(!1),r.current.clear()):r.current.delete(f[p]),f.key==="Meta"&&r.current.clear(),o.current=!1},h=()=>{r.current.clear(),n(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",u),window.addEventListener("blur",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",u),window.removeEventListener("blur",h)}}},[i,n]),t};function ste(i,e,t){return i.filter(n=>t||n.length===e.size).some(n=>n.every(o=>e.has(o)))}function ate(i,e){return e.includes(i)?"code":"key"}function Ofe(i,e,t,n){var s,a,l,c,d,u,h,f;if(!i.parentNode)return t;const o=e.get(i.parentNode),r=x0(o,n);return Ofe(o,e,{x:((s=t.x)!=null?s:0)+r.x,y:((a=t.y)!=null?a:0)+r.y,z:((c=(l=o[ys])==null?void 0:l.z)!=null?c:0)>((d=t.z)!=null?d:0)?(h=(u=o[ys])==null?void 0:u.z)!=null?h:0:(f=t.z)!=null?f:0},n)}function Ffe(i,e,t){i.forEach(n=>{var o,r;if(n.parentNode&&!i.has(n.parentNode))throw new Error(`Parent node ${n.parentNode} not found`);if(n.parentNode||(t==null?void 0:t[n.id])){const{x:s,y:a,z:l}=Ofe(n,i,{...n.position,z:(r=(o=n[ys])==null?void 0:o.z)!=null?r:0},e);n.positionAbsolute={x:s,y:a},n[ys].z=l,t!=null&&t[n.id]&&(n[ys].isParent=!0)}})}function H8(i,e,t,n){const o=new Map,r={},s=n?1e3:0;return i.forEach(a=>{var u;const l=(yd(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=e.get(a.id),d={width:c==null?void 0:c.width,height:c==null?void 0:c.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(d.parentNode=a.parentNode,r[a.parentNode]=!0),Object.defineProperty(d,ys,{enumerable:!1,value:{handleBounds:(u=c==null?void 0:c[ys])==null?void 0:u.handleBounds,z:l}}),o.set(a.id,d)}),Ffe(o,t,r),o}function Bfe(i,e={}){var g,p,v;const{getNodes:t,width:n,height:o,minZoom:r,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:u}=i(),h=e.initial&&!c&&d;if(a&&l&&(h||!e.initial)){const m=t().filter(y=>{var L;const w=e.includeHiddenNodes?y.width&&y.height:!y.hidden;return(L=e.nodes)!=null&&L.length?w&&e.nodes.some(D=>D.id===y.id):w}),_=m.every(y=>y.width&&y.height);if(m.length>0&&_){const y=a4(m,u),{x:w,y:L,zoom:D}=Sfe(y,n,o,(g=e.minZoom)!=null?g:r,(p=e.maxZoom)!=null?p:s,(v=e.padding)!=null?v:.1),E=Ug.translate(w,L).scale(D);return typeof e.duration=="number"&&e.duration>0?a.transform(I_(l,e.duration),E):a.transform(l,E),!0}}return!1}function b4e(i,e){return i.forEach(t=>{const n=e.get(t.id);n&&e.set(n.id,{...n,[ys]:n[ys],selected:t.selected})}),new Map(e)}function C4e(i,e){return e.map(t=>{const n=i.find(o=>o.id===t.id);return n&&(t.selected=n.selected),t})}function FN({changedNodes:i,changedEdges:e,get:t,set:n}){const{nodeInternals:o,edges:r,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=t();i!=null&&i.length&&(l&&n({nodeInternals:b4e(i,o)}),s==null||s(i)),e!=null&&e.length&&(c&&n({edges:C4e(e,r)}),a==null||a(e))}const x1=()=>{},y4e={zoomIn:x1,zoomOut:x1,zoomTo:x1,getZoom:()=>1,setViewport:x1,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:x1,fitBounds:x1,project:i=>i,screenToFlowPosition:i=>i,flowToScreenPosition:i=>i,viewportInitialized:!1},w4e=i=>({d3Zoom:i.d3Zoom,d3Selection:i.d3Selection}),S4e=()=>{const i=cs(),{d3Zoom:e,d3Selection:t}=mo(w4e,Hs);return x.exports.useMemo(()=>t&&e?{zoomIn:o=>e.scaleBy(I_(t,o==null?void 0:o.duration),1.2),zoomOut:o=>e.scaleBy(I_(t,o==null?void 0:o.duration),1/1.2),zoomTo:(o,r)=>e.scaleTo(I_(t,r==null?void 0:r.duration),o),getZoom:()=>i.getState().transform[2],setViewport:(o,r)=>{var d,u,h;const[s,a,l]=i.getState().transform,c=Ug.translate((d=o.x)!=null?d:s,(u=o.y)!=null?u:a).scale((h=o.zoom)!=null?h:l);e.transform(I_(t,r==null?void 0:r.duration),c)},getViewport:()=>{const[o,r,s]=i.getState().transform;return{x:o,y:r,zoom:s}},fitView:o=>Bfe(i.getState,o),setCenter:(o,r,s)=>{const{width:a,height:l,maxZoom:c}=i.getState(),d=typeof(s==null?void 0:s.zoom)!="undefined"?s.zoom:c,u=a/2-o*d,h=l/2-r*d,f=Ug.translate(u,h).scale(d);e.transform(I_(t,s==null?void 0:s.duration),f)},fitBounds:(o,r)=>{var g;const{width:s,height:a,minZoom:l,maxZoom:c}=i.getState(),{x:d,y:u,zoom:h}=Sfe(o,s,a,l,c,(g=r==null?void 0:r.padding)!=null?g:.1),f=Ug.translate(d,u).scale(h);e.transform(I_(t,r==null?void 0:r.duration),f)},project:o=>{const{transform:r,snapToGrid:s,snapGrid:a}=i.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),VB(o,r,s,a)},screenToFlowPosition:o=>{const{transform:r,snapToGrid:s,snapGrid:a,domNode:l}=i.getState();if(!l)return o;const{x:c,y:d}=l.getBoundingClientRect(),u={x:o.x-c,y:o.y-d};return VB(u,r,s,a)},flowToScreenPosition:o=>{const{transform:r,domNode:s}=i.getState();if(!s)return o;const{x:a,y:l}=s.getBoundingClientRect(),c=Cfe(o,r);return{x:c.x+a,y:c.y+l}},viewportInitialized:!0}:y4e,[e,t])};function bK(){const i=S4e(),e=cs(),t=x.exports.useCallback(()=>e.getState().getNodes().map(p=>({...p})),[]),n=x.exports.useCallback(p=>e.getState().nodeInternals.get(p),[]),o=x.exports.useCallback(()=>{const{edges:p=[]}=e.getState();return p.map(v=>({...v}))},[]),r=x.exports.useCallback(p=>{const{edges:v=[]}=e.getState();return v.find(m=>m.id===p)},[]),s=x.exports.useCallback(p=>{const{getNodes:v,setNodes:m,hasDefaultNodes:_,onNodesChange:y}=e.getState(),w=v(),L=typeof p=="function"?p(w):p;if(_)m(L);else if(y){const D=L.length===0?w.map(E=>({type:"remove",id:E.id})):L.map(E=>({item:E,type:"reset"}));y(D)}},[]),a=x.exports.useCallback(p=>{const{edges:v=[],setEdges:m,hasDefaultEdges:_,onEdgesChange:y}=e.getState(),w=typeof p=="function"?p(v):p;if(_)m(w);else if(y){const L=w.length===0?v.map(D=>({type:"remove",id:D.id})):w.map(D=>({item:D,type:"reset"}));y(L)}},[]),l=x.exports.useCallback(p=>{const v=Array.isArray(p)?p:[p],{getNodes:m,setNodes:_,hasDefaultNodes:y,onNodesChange:w}=e.getState();if(y){const D=[...m(),...v];_(D)}else if(w){const L=v.map(D=>({item:D,type:"add"}));w(L)}},[]),c=x.exports.useCallback(p=>{const v=Array.isArray(p)?p:[p],{edges:m=[],setEdges:_,hasDefaultEdges:y,onEdgesChange:w}=e.getState();if(y)_([...m,...v]);else if(w){const L=v.map(D=>({item:D,type:"add"}));w(L)}},[]),d=x.exports.useCallback(()=>{const{getNodes:p,edges:v=[],transform:m}=e.getState(),[_,y,w]=m;return{nodes:p().map(L=>({...L})),edges:v.map(L=>({...L})),viewport:{x:_,y,zoom:w}}},[]),u=x.exports.useCallback(({nodes:p,edges:v})=>{const{nodeInternals:m,getNodes:_,edges:y,hasDefaultNodes:w,hasDefaultEdges:L,onNodesDelete:D,onEdgesDelete:E,onNodesChange:I,onEdgesChange:k}=e.getState(),R=(p||[]).map(H=>H.id),A=(v||[]).map(H=>H.id),P=_().reduce((H,B)=>{const F=!R.includes(B.id)&&B.parentNode&&H.find(z=>z.id===B.parentNode);return(typeof B.deletable=="boolean"?B.deletable:!0)&&(R.includes(B.id)||F)&&H.push(B),H},[]),N=y.filter(H=>typeof H.deletable=="boolean"?H.deletable:!0),M=N.filter(H=>A.includes(H.id));if(P||M){const H=wfe(P,N),B=[...M,...H],F=B.reduce(($,z)=>($.includes(z.id)||$.push(z.id),$),[]);if((L||w)&&(L&&e.setState({edges:y.filter($=>!F.includes($.id))}),w&&(P.forEach($=>{m.delete($.id)}),e.setState({nodeInternals:new Map(m)}))),F.length>0&&(E==null||E(B),k&&k(F.map($=>({id:$,type:"remove"})))),P.length>0&&(D==null||D(P),I)){const $=P.map(z=>({id:z.id,type:"remove"}));I($)}}},[]),h=x.exports.useCallback(p=>{const v=jOe(p),m=v?null:e.getState().nodeInternals.get(p.id);return!v&&!m?[null,null,v]:[v?p:Qee(m),m,v]},[]),f=x.exports.useCallback((p,v=!0,m)=>{const[_,y,w]=h(p);return _?(m||e.getState().getNodes()).filter(L=>{if(!w&&(L.id===y.id||!L.positionAbsolute))return!1;const D=Qee(L),E=PB(D,_);return v&&E>0||E>=_.width*_.height}):[]},[]),g=x.exports.useCallback((p,v,m=!0)=>{const[_]=h(p);if(!_)return!1;const y=PB(_,v);return m&&y>0||y>=_.width*_.height},[]);return x.exports.useMemo(()=>({...i,getNodes:t,getNode:n,getEdges:o,getEdge:r,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:u,getIntersectingNodes:f,isNodeIntersecting:g}),[i,t,n,o,r,s,a,l,c,d,u,f,g])}const x4e={actInsideInputWithModifier:!1};var L4e=({deleteKeyCode:i,multiSelectionKeyCode:e})=>{const t=cs(),{deleteElements:n}=bK(),o=uD(i,x4e),r=uD(e);x.exports.useEffect(()=>{if(o){const{edges:s,getNodes:a}=t.getState(),l=a().filter(d=>d.selected),c=s.filter(d=>d.selected);n({nodes:l,edges:c}),t.setState({nodesSelectionActive:!1})}},[o]),x.exports.useEffect(()=>{t.setState({multiSelectionActive:r})},[r])};function E4e(i){const e=cs();x.exports.useEffect(()=>{let t;const n=()=>{var r,s;if(!i.current)return;const o=uK(i.current);(o.height===0||o.width===0)&&((s=(r=e.getState()).onError)==null||s.call(r,"004",ip.error004())),e.setState({width:o.width||500,height:o.height||500})};return n(),window.addEventListener("resize",n),i.current&&(t=new ResizeObserver(()=>n()),t.observe(i.current)),()=>{window.removeEventListener("resize",n),t&&i.current&&t.unobserve(i.current)}},[])}const CK={position:"absolute",width:"100%",height:"100%",top:0,left:0},D4e=(i,e)=>i.x!==e.x||i.y!==e.y||i.zoom!==e.k,BN=i=>({x:i.x,y:i.y,zoom:i.k}),L1=(i,e)=>i.target.closest(`.${e}`),lte=(i,e)=>e===2&&Array.isArray(i)&&i.includes(2),cte=i=>{const e=i.ctrlKey&&hA()?10:1;return-i.deltaY*(i.deltaMode===1?.05:i.deltaMode?1:.002)*e},k4e=i=>({d3Zoom:i.d3Zoom,d3Selection:i.d3Selection,d3ZoomHandler:i.d3ZoomHandler,userSelectionActive:i.userSelectionActive}),I4e=({onMove:i,onMoveStart:e,onMoveEnd:t,onPaneContextMenu:n,zoomOnScroll:o=!0,zoomOnPinch:r=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=i0.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:u=!0,defaultViewport:h,translateExtent:f,minZoom:g,maxZoom:p,zoomActivationKeyCode:v,preventScrolling:m=!0,children:_,noWheelClassName:y,noPanClassName:w})=>{const L=x.exports.useRef(),D=cs(),E=x.exports.useRef(!1),I=x.exports.useRef(!1),k=x.exports.useRef(null),R=x.exports.useRef({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:P,d3ZoomHandler:N,userSelectionActive:M}=mo(k4e,Hs),H=uD(v),B=x.exports.useRef(0),F=x.exports.useRef(!1),$=x.exports.useRef();return E4e(k),x.exports.useEffect(()=>{if(k.current){const z=k.current.getBoundingClientRect(),K=rfe().scaleExtent([g,p]).translateExtent(f),j=bd(k.current).call(K),G=Ug.translate(h.x,h.y).scale(ow(h.zoom,g,p)),X=[[0,0],[z.width,z.height]],ue=K.constrain()(G,X,f);K.transform(j,ue),K.wheelDelta(cte),D.setState({d3Zoom:K,d3Selection:j,d3ZoomHandler:j.on("wheel.zoom"),transform:[ue.x,ue.y,ue.k],domNode:k.current.closest(".react-flow")})}},[]),x.exports.useEffect(()=>{P&&A&&(s&&!H&&!M?P.on("wheel.zoom",z=>{if(L1(z,y))return!1;z.preventDefault(),z.stopImmediatePropagation();const K=P.property("__zoom").k||1,j=hA();if(z.ctrlKey&&r&&j){const Fe=gu(z),De=cte(z),ce=K*Math.pow(2,De);A.scaleTo(P,ce,Fe,z);return}const G=z.deltaMode===1?20:1;let X=l===i0.Vertical?0:z.deltaX*G,ue=l===i0.Horizontal?0:z.deltaY*G;!j&&z.shiftKey&&l!==i0.Vertical&&(X=z.deltaY*G,ue=0),A.translateBy(P,-(X/K)*a,-(ue/K)*a,{internal:!0});const fe=BN(P.property("__zoom")),{onViewportChangeStart:pe,onViewportChange:be,onViewportChangeEnd:Se}=D.getState();clearTimeout($.current),F.current||(F.current=!0,e==null||e(z,fe),pe==null||pe(fe)),F.current&&(i==null||i(z,fe),be==null||be(fe),$.current=setTimeout(()=>{t==null||t(z,fe),Se==null||Se(fe),F.current=!1},150))},{passive:!1}):typeof N!="undefined"&&P.on("wheel.zoom",function(z,K){if(!m||L1(z,y))return null;z.preventDefault(),N.call(this,z,K)},{passive:!1}))},[M,s,l,P,A,N,H,r,m,y,e,i,t]),x.exports.useEffect(()=>{A&&A.on("start",z=>{var G,X;if(!z.sourceEvent||z.sourceEvent.internal)return null;B.current=(G=z.sourceEvent)==null?void 0:G.button;const{onViewportChangeStart:K}=D.getState(),j=BN(z.transform);E.current=!0,R.current=j,((X=z.sourceEvent)==null?void 0:X.type)==="mousedown"&&D.setState({paneDragging:!0}),K==null||K(j),e==null||e(z.sourceEvent,j)})},[A,e]),x.exports.useEffect(()=>{A&&(M&&!E.current?A.on("zoom",null):M||A.on("zoom",z=>{var j,G;const{onViewportChange:K}=D.getState();if(D.setState({transform:[z.transform.x,z.transform.y,z.transform.k]}),I.current=!!(n&<e(u,(j=B.current)!=null?j:0)),(i||K)&&!((G=z.sourceEvent)!=null&&G.internal)){const X=BN(z.transform);K==null||K(X),i==null||i(z.sourceEvent,X)}}))},[M,A,i,u,n]),x.exports.useEffect(()=>{A&&A.on("end",z=>{var j;if(!z.sourceEvent||z.sourceEvent.internal)return null;const{onViewportChangeEnd:K}=D.getState();if(E.current=!1,D.setState({paneDragging:!1}),n&<e(u,(j=B.current)!=null?j:0)&&!I.current&&n(z.sourceEvent),I.current=!1,(t||K)&&D4e(R.current,z.transform)){const G=BN(z.transform);R.current=G,clearTimeout(L.current),L.current=setTimeout(()=>{K==null||K(G),t==null||t(z.sourceEvent,G)},s?150:0)}})},[A,s,u,t,n]),x.exports.useEffect(()=>{A&&A.filter(z=>{const K=H||o,j=r&&z.ctrlKey;if((u===!0||Array.isArray(u)&&u.includes(1))&&z.button===1&&z.type==="mousedown"&&(L1(z,"react-flow__node")||L1(z,"react-flow__edge")))return!0;if(!u&&!K&&!s&&!c&&!r||M||!c&&z.type==="dblclick"||L1(z,y)&&z.type==="wheel"||L1(z,w)&&(z.type!=="wheel"||s&&z.type==="wheel"&&!H)||!r&&z.ctrlKey&&z.type==="wheel"||!K&&!s&&!j&&z.type==="wheel"||!u&&(z.type==="mousedown"||z.type==="touchstart")||Array.isArray(u)&&!u.includes(z.button)&&(z.type==="mousedown"||z.type==="touchstart"))return!1;const G=Array.isArray(u)&&u.includes(z.button)||!z.button||z.button<=1;return(!z.ctrlKey||z.type==="wheel")&&G})},[M,A,o,r,s,c,u,d,H]),he("div",{className:"react-flow__renderer",ref:k,style:CK,children:_})},T4e=i=>({userSelectionActive:i.userSelectionActive,userSelectionRect:i.userSelectionRect});function N4e(){const{userSelectionActive:i,userSelectionRect:e}=mo(T4e,Hs);return i&&e?he("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function dte(i,e){var n,o;const t=i.find(r=>r.id===e.parentNode);if(t){const r=e.position.x+e.width-t.width,s=e.position.y+e.height-t.height;if(r>0||s>0||e.position.x<0||e.position.y<0){if(t.style={...t.style},t.style.width=(n=t.style.width)!=null?n:t.width,t.style.height=(o=t.style.height)!=null?o:t.height,r>0&&(t.style.width+=r),s>0&&(t.style.height+=s),e.position.x<0){const a=Math.abs(e.position.x);t.position.x=t.position.x-a,t.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);t.position.y=t.position.y-a,t.style.height+=a,e.position.y=0}t.width=t.style.width,t.height=t.style.height}}}function Wfe(i,e){if(i.some(n=>n.type==="reset"))return i.filter(n=>n.type==="reset").map(n=>n.item);const t=i.filter(n=>n.type==="add").map(n=>n.item);return e.reduce((n,o)=>{const r=i.filter(a=>a.id===o.id);if(r.length===0)return n.push(o),n;const s={...o};for(const a of r)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position!="undefined"&&(s.position=a.position),typeof a.positionAbsolute!="undefined"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging!="undefined"&&(s.dragging=a.dragging),s.expandParent&&dte(n,s);break}case"dimensions":{typeof a.dimensions!="undefined"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle!="undefined"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&dte(n,s);break}case"remove":return n}return n.push(s),n},t)}function Vfe(i,e){return Wfe(i,e)}function R4e(i,e){return Wfe(i,e)}const nm=(i,e)=>({id:i,type:"select",selected:e});function xC(i,e){return i.reduce((t,n)=>{const o=e.includes(n.id);return!n.selected&&o?(n.selected=!0,t.push(nm(n.id,!0))):n.selected&&!o&&(n.selected=!1,t.push(nm(n.id,!1))),t},[])}const $8=(i,e)=>t=>{t.target===e.current&&(i==null||i(t))},M4e=i=>({userSelectionActive:i.userSelectionActive,elementsSelectable:i.elementsSelectable,dragging:i.paneDragging}),Hfe=x.exports.memo(({isSelecting:i,selectionMode:e=cD.Full,panOnDrag:t,onSelectionStart:n,onSelectionEnd:o,onPaneClick:r,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:u})=>{const h=x.exports.useRef(null),f=cs(),g=x.exports.useRef(0),p=x.exports.useRef(0),v=x.exports.useRef(),{userSelectionActive:m,elementsSelectable:_,dragging:y}=mo(M4e,Hs),w=()=>{f.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,p.current=0},L=N=>{r==null||r(N),f.getState().resetSelectedElements(),f.setState({nodesSelectionActive:!1})},D=N=>{if(Array.isArray(t)&&(t==null?void 0:t.includes(2))){N.preventDefault();return}s==null||s(N)},E=a?N=>a(N):void 0,I=N=>{const{resetSelectedElements:M,domNode:H}=f.getState();if(v.current=H==null?void 0:H.getBoundingClientRect(),!_||!i||N.button!==0||N.target!==h.current||!v.current)return;const{x:B,y:F}=Um(N,v.current);M(),f.setState({userSelectionRect:{width:0,height:0,startX:B,startY:F,x:B,y:F}}),n==null||n(N)},k=N=>{var De,ce;const{userSelectionRect:M,nodeInternals:H,edges:B,transform:F,onNodesChange:$,onEdgesChange:z,nodeOrigin:K,getNodes:j}=f.getState();if(!i||!v.current||!M)return;f.setState({userSelectionActive:!0,nodesSelectionActive:!1});const G=Um(N,v.current),X=(De=M.startX)!=null?De:0,ue=(ce=M.startY)!=null?ce:0,fe={...M,x:G.xPe.id),Fe=be.map(Pe=>Pe.id);if(g.current!==Fe.length){g.current=Fe.length;const Pe=xC(pe,Fe);Pe.length&&($==null||$(Pe))}if(p.current!==Se.length){p.current=Se.length;const Pe=xC(B,Se);Pe.length&&(z==null||z(Pe))}f.setState({userSelectionRect:fe})},R=N=>{if(N.button!==0)return;const{userSelectionRect:M}=f.getState();!m&&M&&N.target===h.current&&(L==null||L(N)),f.setState({nodesSelectionActive:g.current>0}),w(),o==null||o(N)},A=N=>{m&&(f.setState({nodesSelectionActive:g.current>0}),o==null||o(N)),w()},P=_&&(i||m);return fn("div",{className:fa(["react-flow__pane",{dragging:y,selection:i}]),onClick:P?void 0:$8(L,h),onContextMenu:$8(D,h),onWheel:$8(E,h),onMouseEnter:P?void 0:l,onMouseDown:P?I:void 0,onMouseMove:P?k:c,onMouseUp:P?R:void 0,onMouseLeave:P?A:d,ref:h,style:CK,children:[u,he(N4e,{})]})});Hfe.displayName="Pane";function $fe(i,e){if(!i.parentNode)return!1;const t=e.get(i.parentNode);return t?t.selected?!0:$fe(t,e):!1}function ute(i,e,t){let n=i;do{if(n!=null&&n.matches(e))return!0;if(n===t.current)return!1;n=n.parentElement}while(n);return!1}function A4e(i,e,t,n){return Array.from(i.values()).filter(o=>(o.selected||o.id===n)&&(!o.parentNode||!$fe(o,i))&&(o.draggable||e&&typeof o.draggable=="undefined")).map(o=>{var r,s,a,l;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:t.x-((s=(r=o.positionAbsolute)==null?void 0:r.x)!=null?s:0),y:t.y-((l=(a=o.positionAbsolute)==null?void 0:a.y)!=null?l:0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height,expandParent:o.expandParent}})}function P4e(i,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(i.width||0),e[1][1]-(i.height||0)]]}function zfe(i,e,t,n,o=[0,0],r){const s=P4e(i,i.extent||n);let a=s;if(i.extent==="parent"&&!i.expandParent)if(i.parentNode&&i.width&&i.height){const d=t.get(i.parentNode),{x:u,y:h}=x0(d,o).positionAbsolute;a=d&&yd(u)&&yd(h)&&yd(d.width)&&yd(d.height)?[[u+i.width*o[0],h+i.height*o[1]],[u+d.width-i.width+i.width*o[0],h+d.height-i.height+i.height*o[1]]]:a}else r==null||r("005",ip.error005()),a=s;else if(i.extent&&i.parentNode&&i.extent!=="parent"){const d=t.get(i.parentNode),{x:u,y:h}=x0(d,o).positionAbsolute;a=[[i.extent[0][0]+u,i.extent[0][1]+h],[i.extent[1][0]+u,i.extent[1][1]+h]]}let l={x:0,y:0};if(i.parentNode){const d=t.get(i.parentNode);l=x0(d,o).positionAbsolute}const c=a&&a!=="parent"?hK(e,a):e;return{position:{x:c.x-l.x,y:c.y-l.y},positionAbsolute:c}}function z8({nodeId:i,dragItems:e,nodeInternals:t}){const n=e.map(o=>({...t.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[i?n.find(o=>o.id===i):n[0],n]}const hte=(i,e,t,n)=>{const o=e.querySelectorAll(i);if(!o||!o.length)return null;const r=Array.from(o),s=e.getBoundingClientRect(),a={x:s.width*n[0],y:s.height*n[1]};return r.map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/t,y:(c.top-s.top-a.y)/t,...uK(l)}})};function yx(i,e,t){return t===void 0?t:n=>{const o=e().nodeInternals.get(i);o&&t(n,{...o})}}function $B({id:i,store:e,unselect:t=!1,nodeRef:n}){const{addSelectedNodes:o,unselectNodesAndEdges:r,multiSelectionActive:s,nodeInternals:a,onError:l}=e.getState(),c=a.get(i);if(!c){l==null||l("012",ip.error012(i));return}e.setState({nodesSelectionActive:!1}),c.selected?(t||c.selected&&s)&&(r({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=n==null?void 0:n.current)==null?void 0:d.blur()})):o([i])}function O4e(){const i=cs();return x.exports.useCallback(({sourceEvent:t})=>{const{transform:n,snapGrid:o,snapToGrid:r}=i.getState(),s=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY,l={x:(s-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:r?o[0]*Math.round(l.x/o[0]):l.x,ySnapped:r?o[1]*Math.round(l.y/o[1]):l.y,...l}},[])}function U8(i){return(e,t,n)=>i==null?void 0:i(e,n)}function Ufe({nodeRef:i,disabled:e=!1,noDragClassName:t,handleSelector:n,nodeId:o,isSelectable:r,selectNodesOnDrag:s}){const a=cs(),[l,c]=x.exports.useState(!1),d=x.exports.useRef([]),u=x.exports.useRef({x:null,y:null}),h=x.exports.useRef(0),f=x.exports.useRef(null),g=x.exports.useRef({x:0,y:0}),p=x.exports.useRef(null),v=x.exports.useRef(!1),m=x.exports.useRef(!1),_=O4e();return x.exports.useEffect(()=>{if(i!=null&&i.current){const y=bd(i.current),w=({x:E,y:I})=>{const{nodeInternals:k,onNodeDrag:R,onSelectionDrag:A,updateNodePositions:P,nodeExtent:N,snapGrid:M,snapToGrid:H,nodeOrigin:B,onError:F}=a.getState();u.current={x:E,y:I};let $=!1,z={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&N){const j=a4(d.current,B);z=lD(j)}if(d.current=d.current.map(j=>{var fe,pe;const G={x:E-j.distance.x,y:I-j.distance.y};H&&(G.x=M[0]*Math.round(G.x/M[0]),G.y=M[1]*Math.round(G.y/M[1]));const X=[[N[0][0],N[0][1]],[N[1][0],N[1][1]]];d.current.length>1&&N&&!j.extent&&(X[0][0]=j.positionAbsolute.x-z.x+N[0][0],X[1][0]=j.positionAbsolute.x+((fe=j.width)!=null?fe:0)-z.x2+N[1][0],X[0][1]=j.positionAbsolute.y-z.y+N[0][1],X[1][1]=j.positionAbsolute.y+((pe=j.height)!=null?pe:0)-z.y2+N[1][1]);const ue=zfe(j,G,k,X,B,F);return $=$||j.position.x!==ue.position.x||j.position.y!==ue.position.y,j.position=ue.position,j.positionAbsolute=ue.positionAbsolute,j}),!$)return;P(d.current,!0,!0),c(!0);const K=o?R:U8(A);if(K&&p.current){const[j,G]=z8({nodeId:o,dragItems:d.current,nodeInternals:k});K(p.current,j,G)}},L=()=>{var k,R;if(!f.current)return;const[E,I]=cfe(g.current,f.current);if(E!==0||I!==0){const{transform:A,panBy:P}=a.getState();u.current.x=((k=u.current.x)!=null?k:0)-E/A[2],u.current.y=((R=u.current.y)!=null?R:0)-I/A[2],P({x:E,y:I})&&w(u.current)}h.current=requestAnimationFrame(L)},D=E=>{var B;const{nodeInternals:I,multiSelectionActive:k,nodesDraggable:R,unselectNodesAndEdges:A,onNodeDragStart:P,onSelectionDragStart:N}=a.getState();m.current=!0;const M=o?P:U8(N);(!s||!r)&&!k&&o&&((B=I.get(o))!=null&&B.selected||A()),o&&r&&s&&$B({id:o,store:a,nodeRef:i});const H=_(E);if(u.current=H,d.current=A4e(I,R,H,o),M&&d.current){const[F,$]=z8({nodeId:o,dragItems:d.current,nodeInternals:I});M(E.sourceEvent,F,$)}};if(e)y.on(".drag",null);else{const E=jAe().on("start",I=>{const{domNode:k,nodeDragThreshold:R}=a.getState();R===0&&D(I);const A=_(I);u.current=A,f.current=(k==null?void 0:k.getBoundingClientRect())||null,g.current=Um(I.sourceEvent,f.current)}).on("drag",I=>{var P,N,M,H;const k=_(I),{autoPanOnNodeDrag:R,nodeDragThreshold:A}=a.getState();if(!v.current&&m.current&&R&&(v.current=!0,L()),!m.current){const B=k.xSnapped-((N=(P=u==null?void 0:u.current)==null?void 0:P.x)!=null?N:0),F=k.ySnapped-((H=(M=u==null?void 0:u.current)==null?void 0:M.y)!=null?H:0);Math.sqrt(B*B+F*F)>A&&D(I)}(u.current.x!==k.xSnapped||u.current.y!==k.ySnapped)&&d.current&&m.current&&(p.current=I.sourceEvent,g.current=Um(I.sourceEvent,f.current),w(k))}).on("end",I=>{if(!!m.current&&(c(!1),v.current=!1,m.current=!1,cancelAnimationFrame(h.current),d.current)){const{updateNodePositions:k,nodeInternals:R,onNodeDragStop:A,onSelectionDragStop:P}=a.getState(),N=o?A:U8(P);if(k(d.current,!1,!1),N){const[M,H]=z8({nodeId:o,dragItems:d.current,nodeInternals:R});N(I.sourceEvent,M,H)}}}).filter(I=>{const k=I.target;return!I.button&&(!t||!ute(k,`.${t}`,i))&&(!n||ute(k,n,i))});return y.call(E),()=>{y.on(".drag",null)}}}},[i,e,t,n,r,a,o,s,_]),l}function jfe(){const i=cs();return x.exports.useCallback(t=>{const{nodeInternals:n,nodeExtent:o,updateNodePositions:r,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=i.getState(),u=s().filter(_=>_.selected&&(_.draggable||d&&typeof _.draggable=="undefined")),h=a?l[0]:5,f=a?l[1]:5,g=t.isShiftPressed?4:1,p=t.x*h*g,v=t.y*f*g,m=u.map(_=>{if(_.positionAbsolute){const y={x:_.positionAbsolute.x+p,y:_.positionAbsolute.y+v};a&&(y.x=l[0]*Math.round(y.x/l[0]),y.y=l[1]*Math.round(y.y/l[1]));const{positionAbsolute:w,position:L}=zfe(_,y,n,o,void 0,c);_.position=L,_.positionAbsolute=w}return _});r(m,!0,!1)},[])}const fy={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var wx=i=>{const e=({id:t,type:n,data:o,xPos:r,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:u,onMouseMove:h,onMouseLeave:f,onContextMenu:g,onDoubleClick:p,style:v,className:m,isDraggable:_,isSelectable:y,isConnectable:w,isFocusable:L,selectNodesOnDrag:D,sourcePosition:E,targetPosition:I,hidden:k,resizeObserver:R,dragHandle:A,zIndex:P,isParent:N,noDragClassName:M,noPanClassName:H,initialized:B,disableKeyboardA11y:F,ariaLabel:$,rfId:z})=>{const K=cs(),j=x.exports.useRef(null),G=x.exports.useRef(E),X=x.exports.useRef(I),ue=x.exports.useRef(n),fe=y||_||d||u||h||f,pe=jfe(),be=yx(t,K.getState,u),Se=yx(t,K.getState,h),Fe=yx(t,K.getState,f),De=yx(t,K.getState,g),ce=yx(t,K.getState,p),Pe=Ee=>{const{nodeDragThreshold:tt}=K.getState();if(y&&(!D||!_||tt>0)&&$B({id:t,store:K,nodeRef:j}),d){const nt=K.getState().nodeInternals.get(t);nt&&d(Ee,{...nt})}},Oe=Ee=>{if(!OB(Ee))if(ffe.includes(Ee.key)&&y){const tt=Ee.key==="Escape";$B({id:t,store:K,unselect:tt,nodeRef:j})}else!F&&_&&c&&Object.prototype.hasOwnProperty.call(fy,Ee.key)&&(K.setState({ariaLiveMessage:`Moved selected node ${Ee.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~r}, y: ${~~s}`}),pe({x:fy[Ee.key].x,y:fy[Ee.key].y,isShiftPressed:Ee.shiftKey}))};x.exports.useEffect(()=>{if(j.current&&!k){const Ee=j.current;return R==null||R.observe(Ee),()=>R==null?void 0:R.unobserve(Ee)}},[k]),x.exports.useEffect(()=>{const Ee=ue.current!==n,tt=G.current!==E,nt=X.current!==I;j.current&&(Ee||tt||nt)&&(Ee&&(ue.current=n),tt&&(G.current=E),nt&&(X.current=I),K.getState().updateNodeDimensions([{id:t,nodeElement:j.current,forceUpdate:!0}]))},[t,n,E,I]);const xe=Ufe({nodeRef:j,disabled:k||!_,noDragClassName:M,handleSelector:A,nodeId:t,isSelectable:y,selectNodesOnDrag:D});return k?null:he("div",{className:fa(["react-flow__node",`react-flow__node-${n}`,{[H]:_},m,{selected:c,selectable:y,parent:N,dragging:xe}]),ref:j,style:{zIndex:P,transform:`translate(${a}px,${l}px)`,pointerEvents:fe?"all":"none",visibility:B?"visible":"hidden",...v},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:be,onMouseMove:Se,onMouseLeave:Fe,onContextMenu:De,onClick:Pe,onDoubleClick:ce,onKeyDown:L?Oe:void 0,tabIndex:L?0:void 0,role:L?"button":void 0,"aria-describedby":F?void 0:`${Afe}-${z}`,"aria-label":$,children:he(QOe,{value:t,children:he(i,{id:t,data:o,type:n,xPos:r,yPos:s,selected:c,isConnectable:w,sourcePosition:E,targetPosition:I,dragging:xe,dragHandle:A,zIndex:P})})})};return e.displayName="NodeWrapper",x.exports.memo(e)};const F4e=i=>{const e=i.getNodes().filter(t=>t.selected);return{...a4(e,i.nodeOrigin),transformString:`translate(${i.transform[0]}px,${i.transform[1]}px) scale(${i.transform[2]})`,userSelectionActive:i.userSelectionActive}};function B4e({onSelectionContextMenu:i,noPanClassName:e,disableKeyboardA11y:t}){const n=cs(),{width:o,height:r,x:s,y:a,transformString:l,userSelectionActive:c}=mo(F4e,Hs),d=jfe(),u=x.exports.useRef(null);if(x.exports.useEffect(()=>{var g;t||(g=u.current)==null||g.focus({preventScroll:!0})},[t]),Ufe({nodeRef:u}),c||!o||!r)return null;const h=i?g=>{const p=n.getState().getNodes().filter(v=>v.selected);i(g,p)}:void 0,f=g=>{Object.prototype.hasOwnProperty.call(fy,g.key)&&d({x:fy[g.key].x,y:fy[g.key].y,isShiftPressed:g.shiftKey})};return he("div",{className:fa(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:he("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:f,style:{width:o,height:r,top:a,left:s}})})}var W4e=x.exports.memo(B4e);const V4e=i=>i.nodesSelectionActive,Kfe=({children:i,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:n,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:u,selectionOnDrag:h,selectionMode:f,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:v,panActivationKeyCode:m,zoomActivationKeyCode:_,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:L,panOnScroll:D,panOnScrollSpeed:E,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:R,defaultViewport:A,translateExtent:P,minZoom:N,maxZoom:M,preventScrolling:H,onSelectionContextMenu:B,noWheelClassName:F,noPanClassName:$,disableKeyboardA11y:z})=>{const K=mo(V4e),j=uD(u),G=uD(m),X=G||R,ue=G||D,fe=j||h&&X!==!0;return L4e({deleteKeyCode:a,multiSelectionKeyCode:v}),he(I4e,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:r,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:L,panOnScroll:ue,panOnScrollSpeed:E,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:!j&&X,defaultViewport:A,translateExtent:P,minZoom:N,maxZoom:M,zoomActivationKeyCode:_,preventScrolling:H,noWheelClassName:F,noPanClassName:$,children:fn(Hfe,{onSelectionStart:g,onSelectionEnd:p,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:n,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:s,panOnDrag:X,isSelecting:!!fe,selectionMode:f,children:[i,K&&he(W4e,{onSelectionContextMenu:B,noPanClassName:$,disableKeyboardA11y:z})]})})};Kfe.displayName="FlowRenderer";var H4e=x.exports.memo(Kfe);function $4e(i){return mo(x.exports.useCallback(t=>i?yfe(t.nodeInternals,{x:0,y:0,width:t.width,height:t.height},t.transform,!0):t.getNodes(),[i]))}function z4e(i){const e={input:wx(i.input||Tfe),default:wx(i.default||HB),output:wx(i.output||Rfe),group:wx(i.group||_K)},t={},n=Object.keys(i).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,r)=>(o[r]=wx(i[r]||HB),o),t);return{...e,...n}}const U4e=({x:i,y:e,width:t,height:n,origin:o})=>!t||!n?{x:i,y:e}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:i,y:e}:{x:i-t*o[0],y:e-n*o[1]},j4e=i=>({nodesDraggable:i.nodesDraggable,nodesConnectable:i.nodesConnectable,nodesFocusable:i.nodesFocusable,elementsSelectable:i.elementsSelectable,updateNodeDimensions:i.updateNodeDimensions,onError:i.onError}),qfe=i=>{const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,updateNodeDimensions:r,onError:s}=mo(j4e,Hs),a=$4e(i.onlyRenderVisibleElements),l=x.exports.useRef(),c=x.exports.useMemo(()=>{if(typeof ResizeObserver=="undefined")return null;const d=new ResizeObserver(u=>{const h=u.map(f=>({id:f.target.getAttribute("data-id"),nodeElement:f.target,forceUpdate:!0}));r(h)});return l.current=d,d},[]);return x.exports.useEffect(()=>()=>{var d;(d=l==null?void 0:l.current)==null||d.disconnect()},[]),he("div",{className:"react-flow__nodes",style:CK,children:a.map(d=>{var L,D,E,I,k,R,A;let u=d.type||"default";i.nodeTypes[u]||(s==null||s("003",ip.error003(u)),u="default");const h=i.nodeTypes[u]||i.nodeTypes.default,f=!!(d.draggable||e&&typeof d.draggable=="undefined"),g=!!(d.selectable||o&&typeof d.selectable=="undefined"),p=!!(d.connectable||t&&typeof d.connectable=="undefined"),v=!!(d.focusable||n&&typeof d.focusable=="undefined"),m=i.nodeExtent?hK(d.positionAbsolute,i.nodeExtent):d.positionAbsolute,_=(L=m==null?void 0:m.x)!=null?L:0,y=(D=m==null?void 0:m.y)!=null?D:0,w=U4e({x:_,y,width:(E=d.width)!=null?E:0,height:(I=d.height)!=null?I:0,origin:i.nodeOrigin});return he(h,{id:d.id,className:d.className,style:d.style,type:u,data:d.data,sourcePosition:d.sourcePosition||mn.Bottom,targetPosition:d.targetPosition||mn.Top,hidden:d.hidden,xPos:_,yPos:y,xPosOrigin:w.x,yPosOrigin:w.y,selectNodesOnDrag:i.selectNodesOnDrag,onClick:i.onNodeClick,onMouseEnter:i.onNodeMouseEnter,onMouseMove:i.onNodeMouseMove,onMouseLeave:i.onNodeMouseLeave,onContextMenu:i.onNodeContextMenu,onDoubleClick:i.onNodeDoubleClick,selected:!!d.selected,isDraggable:f,isSelectable:g,isConnectable:p,isFocusable:v,resizeObserver:c,dragHandle:d.dragHandle,zIndex:(R=(k=d[ys])==null?void 0:k.z)!=null?R:0,isParent:!!((A=d[ys])!=null&&A.isParent),noDragClassName:i.noDragClassName,noPanClassName:i.noPanClassName,initialized:!!d.width&&!!d.height,rfId:i.rfId,disableKeyboardA11y:i.disableKeyboardA11y,ariaLabel:d.ariaLabel},d.id)})})};qfe.displayName="NodeRenderer";var K4e=x.exports.memo(qfe);const q4e=(i,e,t)=>t===mn.Left?i-e:t===mn.Right?i+e:i,G4e=(i,e,t)=>t===mn.Top?i-e:t===mn.Bottom?i+e:i,fte="react-flow__edgeupdater",gte=({position:i,centerX:e,centerY:t,radius:n=10,onMouseDown:o,onMouseEnter:r,onMouseOut:s,type:a})=>he("circle",{onMouseDown:o,onMouseEnter:r,onMouseOut:s,className:fa([fte,`${fte}-${a}`]),cx:q4e(e,n,i),cy:G4e(t,n,i),r:n,stroke:"transparent",fill:"transparent"}),X4e=()=>!0;var E1=i=>{const e=({id:t,className:n,type:o,data:r,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,style:v,source:m,target:_,sourceX:y,sourceY:w,targetX:L,targetY:D,sourcePosition:E,targetPosition:I,elementsSelectable:k,hidden:R,sourceHandleId:A,targetHandleId:P,onContextMenu:N,onMouseEnter:M,onMouseMove:H,onMouseLeave:B,edgeUpdaterRadius:F,onEdgeUpdate:$,onEdgeUpdateStart:z,onEdgeUpdateEnd:K,markerEnd:j,markerStart:G,rfId:X,ariaLabel:ue,isFocusable:fe,isUpdatable:pe,pathOptions:be,interactionWidth:Se})=>{const Fe=x.exports.useRef(null),[De,ce]=x.exports.useState(!1),[Pe,Oe]=x.exports.useState(!1),xe=cs(),Ee=x.exports.useMemo(()=>`url(#${WB(G,X)})`,[G,X]),tt=x.exports.useMemo(()=>`url(#${WB(j,X)})`,[j,X]);if(R)return null;const nt=We=>{var Lt;const{edges:je,addSelectedEdges:mt,unselectNodesAndEdges:Dt,multiSelectionActive:At}=xe.getState(),Je=je.find(Ot=>Ot.id===t);!Je||(k&&(xe.setState({nodesSelectionActive:!1}),Je.selected&&At?(Dt({nodes:[],edges:[Je]}),(Lt=Fe.current)==null||Lt.blur()):mt([t])),s&&s(We,Je))},Qe=Cx(t,xe.getState,a),Ge=Cx(t,xe.getState,N),re=Cx(t,xe.getState,M),ie=Cx(t,xe.getState,H),se=Cx(t,xe.getState,B),U=(We,je)=>{if(We.button!==0)return;const{edges:mt,isValidConnection:Dt}=xe.getState(),At=je?_:m,Je=(je?P:A)||null,Lt=je?"target":"source",Ot=Dt||X4e,Vn=je,Et=mt.find(cn=>cn.id===t);Oe(!0),z==null||z(We,Et,Lt);const tn=cn=>{Oe(!1),K==null||K(cn,Et,Lt)};Efe({event:We,handleId:Je,nodeId:At,onConnect:cn=>$==null?void 0:$(Et,cn),isTarget:Vn,getState:xe.getState,setState:xe.setState,isValidConnection:Ot,edgeUpdaterType:Lt,onEdgeUpdateEnd:tn})},Y=We=>U(We,!0),oe=We=>U(We,!1),te=()=>ce(!0),ye=()=>ce(!1),Le=!k&&!s,Te=We=>{var je;if(ffe.includes(We.key)&&k){const{unselectNodesAndEdges:mt,addSelectedEdges:Dt,edges:At}=xe.getState();We.key==="Escape"?((je=Fe.current)==null||je.blur(),mt({edges:[At.find(Lt=>Lt.id===t)]})):Dt([t])}};return fn("g",{className:fa(["react-flow__edge",`react-flow__edge-${o}`,n,{selected:l,animated:c,inactive:Le,updating:De}]),onClick:nt,onDoubleClick:Qe,onContextMenu:Ge,onMouseEnter:re,onMouseMove:ie,onMouseLeave:se,onKeyDown:fe?Te:void 0,tabIndex:fe?0:void 0,role:fe?"button":"img","data-testid":`rf__edge-${t}`,"aria-label":ue===null?void 0:ue||`Edge from ${m} to ${_}`,"aria-describedby":fe?`${Pfe}-${X}`:void 0,ref:Fe,children:[!Pe&&he(i,{id:t,source:m,target:_,selected:l,animated:c,label:d,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,data:r,style:v,sourceX:y,sourceY:w,targetX:L,targetY:D,sourcePosition:E,targetPosition:I,sourceHandleId:A,targetHandleId:P,markerStart:Ee,markerEnd:tt,pathOptions:be,interactionWidth:Se}),pe&&fn(ks,{children:[(pe==="source"||pe===!0)&&he(gte,{position:E,centerX:y,centerY:w,radius:F,onMouseDown:Y,onMouseEnter:te,onMouseOut:ye,type:"source"}),(pe==="target"||pe===!0)&&he(gte,{position:I,centerX:L,centerY:D,radius:F,onMouseDown:oe,onMouseEnter:te,onMouseOut:ye,type:"target"})]})]})};return e.displayName="EdgeWrapper",x.exports.memo(e)};function Y4e(i){const e={default:E1(i.default||gA),straight:E1(i.bezier||pK),step:E1(i.step||gK),smoothstep:E1(i.step||s4),simplebezier:E1(i.simplebezier||fK)},t={},n=Object.keys(i).filter(o=>!["default","bezier"].includes(o)).reduce((o,r)=>(o[r]=E1(i[r]||gA),o),t);return{...e,...n}}function pte(i,e,t=null){const n=((t==null?void 0:t.x)||0)+e.x,o=((t==null?void 0:t.y)||0)+e.y,r=(t==null?void 0:t.width)||e.width,s=(t==null?void 0:t.height)||e.height;switch(i){case mn.Top:return{x:n+r/2,y:o};case mn.Right:return{x:n+r,y:o+s/2};case mn.Bottom:return{x:n+r/2,y:o+s};case mn.Left:return{x:n,y:o+s/2}}}function mte(i,e){return i?i.length===1||!e?i[0]:e&&i.find(t=>t.id===e)||null:null}const Z4e=(i,e,t,n,o,r)=>{const s=pte(t,i,e),a=pte(r,n,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function Q4e({sourcePos:i,targetPos:e,sourceWidth:t,sourceHeight:n,targetWidth:o,targetHeight:r,width:s,height:a,transform:l}){const c={x:Math.min(i.x,e.x),y:Math.min(i.y,e.y),x2:Math.max(i.x+t,e.x+o),y2:Math.max(i.y+n,e.y+r)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=lD({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),u=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),h=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(u*h)>0}function vte(i){var n,o,r,s,a;const e=((n=i==null?void 0:i[ys])==null?void 0:n.handleBounds)||null,t=e&&(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&typeof((o=i==null?void 0:i.positionAbsolute)==null?void 0:o.x)!="undefined"&&typeof((r=i==null?void 0:i.positionAbsolute)==null?void 0:r.y)!="undefined";return[{x:((s=i==null?void 0:i.positionAbsolute)==null?void 0:s.x)||0,y:((a=i==null?void 0:i.positionAbsolute)==null?void 0:a.y)||0,width:(i==null?void 0:i.width)||0,height:(i==null?void 0:i.height)||0},e,!!t]}const J4e=[{level:0,isMaxLevel:!0,edges:[]}];function e5e(i,e,t=!1){let n=-1;const o=i.reduce((s,a)=>{var d,u;const l=yd(a.zIndex);let c=l?a.zIndex:0;if(t){const h=e.get(a.target),f=e.get(a.source),g=a.selected||(h==null?void 0:h.selected)||(f==null?void 0:f.selected),p=Math.max(((d=f==null?void 0:f[ys])==null?void 0:d.z)||0,((u=h==null?void 0:h[ys])==null?void 0:u.z)||0,1e3);c=(l?a.zIndex:0)+(g?p:0)}return s[c]?s[c].push(a):s[c]=[a],n=c>n?c:n,s},{}),r=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===n}});return r.length===0?J4e:r}function t5e(i,e,t){const n=mo(x.exports.useCallback(o=>i?o.edges.filter(r=>{const s=e.get(r.source),a=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&Q4e({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[i,e]));return e5e(n,e,t)}const n5e=({color:i="none",strokeWidth:e=1})=>he("polyline",{style:{stroke:i,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),i5e=({color:i="none",strokeWidth:e=1})=>he("polyline",{style:{stroke:i,fill:i,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),_te={[fA.Arrow]:n5e,[fA.ArrowClosed]:i5e};function o5e(i){const e=cs();return x.exports.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(_te,i)?_te[i]:((r=(o=e.getState()).onError)==null||r.call(o,"009",ip.error009(i)),null)},[i])}const r5e=({id:i,type:e,color:t,width:n=12.5,height:o=12.5,markerUnits:r="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=o5e(e);return l?he("marker",{className:"react-flow__arrowhead",id:i,markerWidth:`${n}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:a,refX:"0",refY:"0",children:he(l,{color:t,strokeWidth:s})}):null},s5e=({defaultColor:i,rfId:e})=>t=>{const n=[];return t.edges.reduce((o,r)=>([r.markerStart,r.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=WB(s,e);n.includes(a)||(o.push({id:a,color:s.color||i,...s}),n.push(a))}}),o),[]).sort((o,r)=>o.id.localeCompare(r.id))},Gfe=({defaultColor:i,rfId:e})=>{const t=mo(x.exports.useCallback(s5e({defaultColor:i,rfId:e}),[i,e]),(n,o)=>!(n.length!==o.length||n.some((r,s)=>r.id!==o[s].id)));return he("defs",{children:t.map(n=>he(r5e,{id:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient},n.id))})};Gfe.displayName="MarkerDefinitions";var a5e=x.exports.memo(Gfe);const l5e=i=>({nodesConnectable:i.nodesConnectable,edgesFocusable:i.edgesFocusable,edgesUpdatable:i.edgesUpdatable,elementsSelectable:i.elementsSelectable,width:i.width,height:i.height,connectionMode:i.connectionMode,nodeInternals:i.nodeInternals,onError:i.onError}),Xfe=({defaultMarkerColor:i,onlyRenderVisibleElements:e,elevateEdgesOnSelect:t,rfId:n,edgeTypes:o,noPanClassName:r,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:u,edgeUpdaterRadius:h,onEdgeDoubleClick:f,onEdgeUpdateStart:g,onEdgeUpdateEnd:p,children:v})=>{const{edgesFocusable:m,edgesUpdatable:_,elementsSelectable:y,width:w,height:L,connectionMode:D,nodeInternals:E,onError:I}=mo(l5e,Hs),k=t5e(e,E,t);return w?fn(ks,{children:[k.map(({level:R,edges:A,isMaxLevel:P})=>fn("svg",{style:{zIndex:R},width:w,height:L,className:"react-flow__edges react-flow__container",children:[P&&he(a5e,{defaultColor:i,rfId:n}),he("g",{children:A.map(N=>{var Oe,xe;const[M,H,B]=vte(E.get(N.source)),[F,$,z]=vte(E.get(N.target));if(!B||!z)return null;let K=N.type||"default";o[K]||(I==null||I("011",ip.error011(K)),K="default");const j=o[K]||o.default,G=D===U0.Strict?$.target:((Oe=$.target)!=null?Oe:[]).concat((xe=$.source)!=null?xe:[]),X=mte(H.source,N.sourceHandle),ue=mte(G,N.targetHandle),fe=(X==null?void 0:X.position)||mn.Bottom,pe=(ue==null?void 0:ue.position)||mn.Top,be=!!(N.focusable||m&&typeof N.focusable=="undefined"),Se=typeof s!="undefined"&&(N.updatable||_&&typeof N.updatable=="undefined");if(!X||!ue)return I==null||I("008",ip.error008(X,N)),null;const{sourceX:Fe,sourceY:De,targetX:ce,targetY:Pe}=Z4e(M,X,fe,F,ue,pe);return he(j,{id:N.id,className:fa([N.className,r]),type:K,data:N.data,selected:!!N.selected,animated:!!N.animated,hidden:!!N.hidden,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,style:N.style,source:N.source,target:N.target,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerEnd:N.markerEnd,markerStart:N.markerStart,sourceX:Fe,sourceY:De,targetX:ce,targetY:Pe,sourcePosition:fe,targetPosition:pe,elementsSelectable:y,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:u,edgeUpdaterRadius:h,onEdgeDoubleClick:f,onEdgeUpdateStart:g,onEdgeUpdateEnd:p,rfId:n,ariaLabel:N.ariaLabel,isFocusable:be,isUpdatable:Se,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth},N.id)})})]},R)),v]}):null};Xfe.displayName="EdgeRenderer";var c5e=x.exports.memo(Xfe);const d5e=i=>`translate(${i.transform[0]}px,${i.transform[1]}px) scale(${i.transform[2]})`;function u5e({children:i}){const e=mo(d5e);return he("div",{className:"react-flow__viewport react-flow__container",style:{transform:e},children:i})}function h5e(i){const e=bK(),t=x.exports.useRef(!1);x.exports.useEffect(()=>{!t.current&&e.viewportInitialized&&i&&(setTimeout(()=>i(e),1),t.current=!0)},[i,e.viewportInitialized])}const f5e={[mn.Left]:mn.Right,[mn.Right]:mn.Left,[mn.Top]:mn.Bottom,[mn.Bottom]:mn.Top},Yfe=({nodeId:i,handleType:e,style:t,type:n=lm.Bezier,CustomComponent:o,connectionStatus:r})=>{var D,E,I,k,R,A,P;const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:d}=mo(x.exports.useCallback(N=>({fromNode:N.nodeInternals.get(i),handleId:N.connectionHandleId,toX:(N.connectionPosition.x-N.transform[0])/N.transform[2],toY:(N.connectionPosition.y-N.transform[1])/N.transform[2],connectionMode:N.connectionMode}),[i]),Hs),u=(D=s==null?void 0:s[ys])==null?void 0:D.handleBounds;let h=u==null?void 0:u[e];if(d===U0.Loose&&(h=h||(u==null?void 0:u[e==="source"?"target":"source"])),!s||!h)return null;const f=a?h.find(N=>N.id===a):h[0],g=f?f.x+f.width/2:((E=s.width)!=null?E:0)/2,p=f?f.y+f.height/2:(I=s.height)!=null?I:0,v=((R=(k=s.positionAbsolute)==null?void 0:k.x)!=null?R:0)+g,m=((P=(A=s.positionAbsolute)==null?void 0:A.y)!=null?P:0)+p,_=f==null?void 0:f.position,y=_?f5e[_]:null;if(!_||!y)return null;if(o)return he(o,{connectionLineType:n,connectionLineStyle:t,fromNode:s,fromHandle:f,fromX:v,fromY:m,toX:l,toY:c,fromPosition:_,toPosition:y,connectionStatus:r});let w="";const L={sourceX:v,sourceY:m,sourcePosition:_,targetX:l,targetY:c,targetPosition:y};return n===lm.Bezier?[w]=_fe(L):n===lm.Step?[w]=FB({...L,borderRadius:0}):n===lm.SmoothStep?[w]=FB(L):n===lm.SimpleBezier?[w]=vfe(L):w=`M${v},${m} ${l},${c}`,he("path",{d:w,fill:"none",className:"react-flow__connection-path",style:t})};Yfe.displayName="ConnectionLine";const g5e=i=>({nodeId:i.connectionNodeId,handleType:i.connectionHandleType,nodesConnectable:i.nodesConnectable,connectionStatus:i.connectionStatus,width:i.width,height:i.height});function p5e({containerStyle:i,style:e,type:t,component:n}){const{nodeId:o,handleType:r,nodesConnectable:s,width:a,height:l,connectionStatus:c}=mo(g5e,Hs);return!(o&&r&&a&&s)?null:he("svg",{style:i,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:he("g",{className:fa(["react-flow__connection",c]),children:he(Yfe,{nodeId:o,handleType:r,style:e,type:t,CustomComponent:n,connectionStatus:c})})})}function bte(i,e){return x.exports.useRef(null),cs(),x.exports.useMemo(()=>e(i),[i])}const Zfe=({nodeTypes:i,edgeTypes:e,onMove:t,onMoveStart:n,onMoveEnd:o,onInit:r,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:h,onNodeContextMenu:f,onSelectionContextMenu:g,onSelectionStart:p,onSelectionEnd:v,connectionLineType:m,connectionLineStyle:_,connectionLineComponent:y,connectionLineContainerStyle:w,selectionKeyCode:L,selectionOnDrag:D,selectionMode:E,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:R,deleteKeyCode:A,onlyRenderVisibleElements:P,elementsSelectable:N,selectNodesOnDrag:M,defaultViewport:H,translateExtent:B,minZoom:F,maxZoom:$,preventScrolling:z,defaultMarkerColor:K,zoomOnScroll:j,zoomOnPinch:G,panOnScroll:X,panOnScrollSpeed:ue,panOnScrollMode:fe,zoomOnDoubleClick:pe,panOnDrag:be,onPaneClick:Se,onPaneMouseEnter:Fe,onPaneMouseMove:De,onPaneMouseLeave:ce,onPaneScroll:Pe,onPaneContextMenu:Oe,onEdgeUpdate:xe,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:Qe,edgeUpdaterRadius:Ge,onEdgeUpdateStart:re,onEdgeUpdateEnd:ie,noDragClassName:se,noWheelClassName:U,noPanClassName:Y,elevateEdgesOnSelect:oe,disableKeyboardA11y:te,nodeOrigin:ye,nodeExtent:Le,rfId:Te})=>{const We=bte(i,z4e),je=bte(e,Y4e);return h5e(r),he(H4e,{onPaneClick:Se,onPaneMouseEnter:Fe,onPaneMouseMove:De,onPaneMouseLeave:ce,onPaneContextMenu:Oe,onPaneScroll:Pe,deleteKeyCode:A,selectionKeyCode:L,selectionOnDrag:D,selectionMode:E,onSelectionStart:p,onSelectionEnd:v,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:R,elementsSelectable:N,onMove:t,onMoveStart:n,onMoveEnd:o,zoomOnScroll:j,zoomOnPinch:G,zoomOnDoubleClick:pe,panOnScroll:X,panOnScrollSpeed:ue,panOnScrollMode:fe,panOnDrag:be,defaultViewport:H,translateExtent:B,minZoom:F,maxZoom:$,onSelectionContextMenu:g,preventScrolling:z,noDragClassName:se,noWheelClassName:U,noPanClassName:Y,disableKeyboardA11y:te,children:fn(u5e,{children:[he(c5e,{edgeTypes:je,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:xe,onlyRenderVisibleElements:P,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:Qe,onEdgeUpdateStart:re,onEdgeUpdateEnd:ie,edgeUpdaterRadius:Ge,defaultMarkerColor:K,noPanClassName:Y,elevateEdgesOnSelect:!!oe,disableKeyboardA11y:te,rfId:Te,children:he(p5e,{style:_,type:m,component:y,containerStyle:w})}),he("div",{className:"react-flow__edgelabel-renderer"}),he(K4e,{nodeTypes:We,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:h,onNodeContextMenu:f,selectNodesOnDrag:M,onlyRenderVisibleElements:P,noPanClassName:Y,noDragClassName:se,disableKeyboardA11y:te,nodeOrigin:ye,nodeExtent:Le,rfId:Te})]})})};Zfe.displayName="GraphView";var m5e=x.exports.memo(Zfe);const zB=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Op={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:zB,nodeExtent:zB,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:U0.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:KOe,isValidConnection:void 0},v5e=()=>iMe((i,e)=>({...Op,setNodes:t=>{const{nodeInternals:n,nodeOrigin:o,elevateNodesOnSelect:r}=e();i({nodeInternals:H8(t,n,o,r)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:t=>{const{defaultEdgeOptions:n={}}=e();i({edges:t.map(o=>({...n,...o}))})},setDefaultNodesAndEdges:(t,n)=>{const o=typeof t!="undefined",r=typeof n!="undefined",s=o?H8(t,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;i({nodeInternals:s,edges:r?n:[],hasDefaultNodes:o,hasDefaultEdges:r})},updateNodeDimensions:t=>{const{onNodesChange:n,nodeInternals:o,fitViewOnInit:r,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=e(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const u=window.getComputedStyle(d),{m22:h}=new window.DOMMatrixReadOnly(u.transform),f=t.reduce((p,v)=>{const m=o.get(v.id);if(m){const _=uK(v.nodeElement);!!(_.width&&_.height&&(m.width!==_.width||m.height!==_.height||v.forceUpdate))&&(o.set(m.id,{...m,[ys]:{...m[ys],handleBounds:{source:hte(".source",v.nodeElement,h,c),target:hte(".target",v.nodeElement,h,c)}},..._}),p.push({id:m.id,type:"dimensions",dimensions:_}))}return p},[]);Ffe(o,c);const g=s||r&&!s&&Bfe(e,{initial:!0,...a});i({nodeInternals:new Map(o),fitViewOnInitDone:g}),(f==null?void 0:f.length)>0&&(n==null||n(f))},updateNodePositions:(t,n=!0,o=!1)=>{const{triggerNodeChanges:r}=e(),s=t.map(a=>{const l={id:a.id,type:"position",dragging:o};return n&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});r(s)},triggerNodeChanges:t=>{const{onNodesChange:n,nodeInternals:o,hasDefaultNodes:r,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=e();if(t!=null&&t.length){if(r){const c=Vfe(t,a()),d=H8(c,o,s,l);i({nodeInternals:d})}n==null||n(t)}},addSelectedNodes:t=>{const{multiSelectionActive:n,edges:o,getNodes:r}=e();let s,a=null;n?s=t.map(l=>nm(l,!0)):(s=xC(r(),t),a=xC(o,[])),FN({changedNodes:s,changedEdges:a,get:e,set:i})},addSelectedEdges:t=>{const{multiSelectionActive:n,edges:o,getNodes:r}=e();let s,a=null;n?s=t.map(l=>nm(l,!0)):(s=xC(o,t),a=xC(r(),[])),FN({changedNodes:a,changedEdges:s,get:e,set:i})},unselectNodesAndEdges:({nodes:t,edges:n}={})=>{const{edges:o,getNodes:r}=e(),s=t||r(),a=n||o,l=s.map(d=>(d.selected=!1,nm(d.id,!1))),c=a.map(d=>nm(d.id,!1));FN({changedNodes:l,changedEdges:c,get:e,set:i})},setMinZoom:t=>{const{d3Zoom:n,maxZoom:o}=e();n==null||n.scaleExtent([t,o]),i({minZoom:t})},setMaxZoom:t=>{const{d3Zoom:n,minZoom:o}=e();n==null||n.scaleExtent([o,t]),i({maxZoom:t})},setTranslateExtent:t=>{var n;(n=e().d3Zoom)==null||n.translateExtent(t),i({translateExtent:t})},resetSelectedElements:()=>{const{edges:t,getNodes:n}=e(),r=n().filter(a=>a.selected).map(a=>nm(a.id,!1)),s=t.filter(a=>a.selected).map(a=>nm(a.id,!1));FN({changedNodes:r,changedEdges:s,get:e,set:i})},setNodeExtent:t=>{const{nodeInternals:n}=e();n.forEach(o=>{o.positionAbsolute=hK(o.position,t)}),i({nodeExtent:t,nodeInternals:new Map(n)})},panBy:t=>{const{transform:n,width:o,height:r,d3Zoom:s,d3Selection:a,translateExtent:l}=e();if(!s||!a||!t.x&&!t.y)return!1;const c=Ug.translate(n[0]+t.x,n[1]+t.y).scale(n[2]),d=[[0,0],[o,r]],u=s==null?void 0:s.constrain()(c,d,l);return s.transform(a,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>i({connectionNodeId:Op.connectionNodeId,connectionHandleId:Op.connectionHandleId,connectionHandleType:Op.connectionHandleType,connectionStatus:Op.connectionStatus,connectionStartHandle:Op.connectionStartHandle,connectionEndHandle:Op.connectionEndHandle}),reset:()=>i({...Op})}),Object.is),yK=({children:i})=>{const e=x.exports.useRef(null);return e.current||(e.current=v5e()),he(WOe,{value:e.current,children:i})};yK.displayName="ReactFlowProvider";const Qfe=({children:i})=>x.exports.useContext(r4)?he(ks,{children:i}):he(yK,{children:i});Qfe.displayName="ReactFlowWrapper";const _5e={input:Tfe,default:HB,output:Rfe,group:_K},b5e={default:gA,straight:pK,step:gK,smoothstep:s4,simplebezier:fK},C5e=[0,0],y5e=[15,15],w5e={x:0,y:0,zoom:1},S5e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Jfe=x.exports.forwardRef(({nodes:i,edges:e,defaultNodes:t,defaultEdges:n,className:o,nodeTypes:r=_5e,edgeTypes:s=b5e,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:u,onMoveEnd:h,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:v,onClickConnectEnd:m,onNodeMouseEnter:_,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:D,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:k,onNodesDelete:R,onEdgesDelete:A,onSelectionChange:P,onSelectionDragStart:N,onSelectionDrag:M,onSelectionDragStop:H,onSelectionContextMenu:B,onSelectionStart:F,onSelectionEnd:$,connectionMode:z=U0.Strict,connectionLineType:K=lm.Bezier,connectionLineStyle:j,connectionLineComponent:G,connectionLineContainerStyle:X,deleteKeyCode:ue="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:pe=!1,selectionMode:be=cD.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:Fe=hA()?"Meta":"Control",zoomActivationKeyCode:De=hA()?"Meta":"Control",snapToGrid:ce=!1,snapGrid:Pe=y5e,onlyRenderVisibleElements:Oe=!1,selectNodesOnDrag:xe=!0,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:nt,nodeOrigin:Qe=C5e,edgesFocusable:Ge,edgesUpdatable:re,elementsSelectable:ie,defaultViewport:se=w5e,minZoom:U=.5,maxZoom:Y=2,translateExtent:oe=zB,preventScrolling:te=!0,nodeExtent:ye,defaultMarkerColor:Le="#b1b1b7",zoomOnScroll:Te=!0,zoomOnPinch:We=!0,panOnScroll:je=!1,panOnScrollSpeed:mt=.5,panOnScrollMode:Dt=i0.Free,zoomOnDoubleClick:At=!0,panOnDrag:Je=!0,onPaneClick:Lt,onPaneMouseEnter:Ot,onPaneMouseMove:Vn,onPaneMouseLeave:Et,onPaneScroll:tn,onPaneContextMenu:di,children:cn,onEdgeUpdate:Gn,onEdgeContextMenu:bn,onEdgeDoubleClick:Pt,onEdgeMouseEnter:qt,onEdgeMouseMove:Nt,onEdgeMouseLeave:jt,onEdgeUpdateStart:Gt,onEdgeUpdateEnd:It,edgeUpdaterRadius:Ft=10,onNodesChange:Ct,onEdgesChange:Zt,noDragClassName:wn="nodrag",noWheelClassName:Dn="nowheel",noPanClassName:Xn="nopan",fitView:jn=!1,fitViewOptions:Zi,connectOnClick:an=!0,attributionPosition:Xt,proOptions:oi,defaultEdgeOptions:Ze,elevateNodesOnSelect:de=!0,elevateEdgesOnSelect:Ve=!1,disableKeyboardA11y:ot=!1,autoPanOnConnect:Sn=!0,autoPanOnNodeDrag:$n=!0,connectionRadius:Ci=20,isValidConnection:An,onError:lo,style:Qo,id:zo,nodeDragThreshold:oc,...Yc},Gr)=>{const Ua=zo||"1";return he("div",{...Yc,style:{...Qo,...S5e},ref:Gr,className:fa(["react-flow",o]),"data-testid":"rf__wrapper",id:zo,children:fn(Qfe,{children:[he(m5e,{onInit:c,onMove:d,onMoveStart:u,onMoveEnd:h,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:_,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:D,nodeTypes:r,edgeTypes:s,connectionLineType:K,connectionLineStyle:j,connectionLineComponent:G,connectionLineContainerStyle:X,selectionKeyCode:fe,selectionOnDrag:pe,selectionMode:be,deleteKeyCode:ue,multiSelectionKeyCode:Fe,panActivationKeyCode:Se,zoomActivationKeyCode:De,onlyRenderVisibleElements:Oe,selectNodesOnDrag:xe,defaultViewport:se,translateExtent:oe,minZoom:U,maxZoom:Y,preventScrolling:te,zoomOnScroll:Te,zoomOnPinch:We,zoomOnDoubleClick:At,panOnScroll:je,panOnScrollSpeed:mt,panOnScrollMode:Dt,panOnDrag:Je,onPaneClick:Lt,onPaneMouseEnter:Ot,onPaneMouseMove:Vn,onPaneMouseLeave:Et,onPaneScroll:tn,onPaneContextMenu:di,onSelectionContextMenu:B,onSelectionStart:F,onSelectionEnd:$,onEdgeUpdate:Gn,onEdgeContextMenu:bn,onEdgeDoubleClick:Pt,onEdgeMouseEnter:qt,onEdgeMouseMove:Nt,onEdgeMouseLeave:jt,onEdgeUpdateStart:Gt,onEdgeUpdateEnd:It,edgeUpdaterRadius:Ft,defaultMarkerColor:Le,noDragClassName:wn,noWheelClassName:Dn,noPanClassName:Xn,elevateEdgesOnSelect:Ve,rfId:Ua,disableKeyboardA11y:ot,nodeOrigin:Qe,nodeExtent:ye}),he(f4e,{nodes:i,edges:e,defaultNodes:t,defaultEdges:n,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:v,onClickConnectEnd:m,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:nt,edgesFocusable:Ge,edgesUpdatable:re,elementsSelectable:ie,elevateNodesOnSelect:de,minZoom:U,maxZoom:Y,nodeExtent:ye,onNodesChange:Ct,onEdgesChange:Zt,snapToGrid:ce,snapGrid:Pe,connectionMode:z,translateExtent:oe,connectOnClick:an,defaultEdgeOptions:Ze,fitView:jn,fitViewOptions:Zi,onNodesDelete:R,onEdgesDelete:A,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:k,onSelectionDrag:M,onSelectionDragStart:N,onSelectionDragStop:H,noPanClassName:Xn,nodeOrigin:Qe,rfId:Ua,autoPanOnConnect:Sn,autoPanOnNodeDrag:$n,onError:lo,connectionRadius:Ci,isValidConnection:An,nodeDragThreshold:oc}),he(u4e,{onSelectionChange:P}),cn,he(HOe,{proOptions:oi,position:Xt}),he(_4e,{rfId:Ua,disableKeyboardA11y:ot})]})})});Jfe.displayName="ReactFlow";function x5e(){const i=cs();return x.exports.useCallback(e=>{const{domNode:t,updateNodeDimensions:n}=i.getState(),r=(Array.isArray(e)?e:[e]).reduce((s,a)=>{const l=t==null?void 0:t.querySelector(`.react-flow__node[data-id="${a}"]`);return l&&s.push({id:a,nodeElement:l,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>n(r))},[])}const ege=({id:i,x:e,y:t,width:n,height:o,style:r,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:d,shapeRendering:u,onClick:h,selected:f})=>{const{background:g,backgroundColor:p}=r||{},v=s||g||p;return he("rect",{className:fa(["react-flow__minimap-node",{selected:f},c]),x:e,y:t,rx:d,ry:d,width:n,height:o,fill:v,stroke:a,strokeWidth:l,shapeRendering:u,onClick:h?m=>h(m,i):void 0})};ege.displayName="MiniMapNode";var L5e=x.exports.memo(ege);const E5e=i=>i.nodeOrigin,D5e=i=>i.getNodes().filter(e=>!e.hidden&&e.width&&e.height),j8=i=>i instanceof Function?i:()=>i;function k5e({nodeStrokeColor:i="transparent",nodeColor:e="#e2e2e2",nodeClassName:t="",nodeBorderRadius:n=5,nodeStrokeWidth:o=2,nodeComponent:r=L5e,onClick:s}){const a=mo(D5e,Hs),l=mo(E5e),c=j8(e),d=j8(i),u=j8(t),h=typeof window=="undefined"||!!window.chrome?"crispEdges":"geometricPrecision";return he(ks,{children:a.map(f=>{const{x:g,y:p}=x0(f,l).positionAbsolute;return he(r,{x:g,y:p,width:f.width,height:f.height,style:f.style,selected:f.selected,className:u(f),color:c(f),borderRadius:n,strokeColor:d(f),strokeWidth:o,shapeRendering:h,onClick:s,id:f.id},f.id)})})}var I5e=x.exports.memo(k5e);const T5e=200,N5e=150,R5e=i=>{const e=i.getNodes(),t={x:-i.transform[0]/i.transform[2],y:-i.transform[1]/i.transform[2],width:i.width/i.transform[2],height:i.height/i.transform[2]};return{viewBB:t,boundingRect:e.length>0?UOe(a4(e,i.nodeOrigin),t):t,rfId:i.rfId}},M5e="react-flow__minimap-desc";function tge({style:i,className:e,nodeStrokeColor:t="transparent",nodeColor:n="#e2e2e2",nodeClassName:o="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:a,maskColor:l="rgb(240, 240, 240, 0.6)",maskStrokeColor:c="none",maskStrokeWidth:d=1,position:u="bottom-right",onClick:h,onNodeClick:f,pannable:g=!1,zoomable:p=!1,ariaLabel:v="React Flow mini map",inversePan:m=!1,zoomStep:_=10,offsetScale:y=5}){var fe,pe;const w=cs(),L=x.exports.useRef(null),{boundingRect:D,viewBB:E,rfId:I}=mo(R5e,Hs),k=(fe=i==null?void 0:i.width)!=null?fe:T5e,R=(pe=i==null?void 0:i.height)!=null?pe:N5e,A=D.width/k,P=D.height/R,N=Math.max(A,P),M=N*k,H=N*R,B=y*N,F=D.x-(M-D.width)/2-B,$=D.y-(H-D.height)/2-B,z=M+B*2,K=H+B*2,j=`${M5e}-${I}`,G=x.exports.useRef(0);G.current=N,x.exports.useEffect(()=>{if(L.current){const be=bd(L.current),Se=ce=>{const{transform:Pe,d3Selection:Oe,d3Zoom:xe}=w.getState();if(ce.sourceEvent.type!=="wheel"||!Oe||!xe)return;const Ee=-ce.sourceEvent.deltaY*(ce.sourceEvent.deltaMode===1?.05:ce.sourceEvent.deltaMode?1:.002)*_,tt=Pe[2]*Math.pow(2,Ee);xe.scaleTo(Oe,tt)},Fe=ce=>{const{transform:Pe,d3Selection:Oe,d3Zoom:xe,translateExtent:Ee,width:tt,height:nt}=w.getState();if(ce.sourceEvent.type!=="mousemove"||!Oe||!xe)return;const Qe=G.current*Math.max(1,Pe[2])*(m?-1:1),Ge={x:Pe[0]-ce.sourceEvent.movementX*Qe,y:Pe[1]-ce.sourceEvent.movementY*Qe},re=[[0,0],[tt,nt]],ie=Ug.translate(Ge.x,Ge.y).scale(Pe[2]),se=xe.constrain()(ie,re,Ee);xe.transform(Oe,se)},De=rfe().on("zoom",g?Fe:null).on("zoom.wheel",p?Se:null);return be.call(De),()=>{be.on("zoom",null)}}},[g,p,m,_]);const X=h?be=>{const Se=gu(be);h(be,{x:Se[0],y:Se[1]})}:void 0,ue=f?(be,Se)=>{const Fe=w.getState().nodeInternals.get(Se);f(be,Fe)}:void 0;return he(aD,{position:u,style:i,className:fa(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:fn("svg",{width:k,height:R,viewBox:`${F} ${$} ${z} ${K}`,role:"img","aria-labelledby":j,ref:L,onClick:X,children:[v&&he("title",{id:j,children:v}),he(I5e,{onClick:ue,nodeColor:n,nodeStrokeColor:t,nodeBorderRadius:r,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:a}),he("path",{className:"react-flow__minimap-mask",d:`M${F-B},${$-B}h${z+B*2}v${K+B*2}h${-z-B*2}z + M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fill:l,fillRule:"evenodd",stroke:c,strokeWidth:d,pointerEvents:"none"})]})})}tge.displayName="MiniMap";var A5e=x.exports.memo(tge);function P5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:he("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function O5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:he("path",{d:"M0 0h32v4.2H0z"})})}function F5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:he("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function B5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:he("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function W5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:he("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}const mL=({children:i,className:e,...t})=>he("button",{type:"button",className:fa(["react-flow__controls-button",e]),...t,children:i});mL.displayName="ControlButton";const V5e=i=>({isInteractive:i.nodesDraggable||i.nodesConnectable||i.elementsSelectable,minZoomReached:i.transform[2]<=i.minZoom,maxZoomReached:i.transform[2]>=i.maxZoom}),nge=({style:i,showZoom:e=!0,showFitView:t=!0,showInteractive:n=!0,fitViewOptions:o,onZoomIn:r,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:d,position:u="bottom-left"})=>{const h=cs(),[f,g]=x.exports.useState(!1),{isInteractive:p,minZoomReached:v,maxZoomReached:m}=mo(V5e,Hs),{zoomIn:_,zoomOut:y,fitView:w}=bK();if(x.exports.useEffect(()=>{g(!0)},[]),!f)return null;const L=()=>{_(),r==null||r()},D=()=>{y(),s==null||s()},E=()=>{w(o),a==null||a()},I=()=>{h.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),l==null||l(!p)};return fn(aD,{className:fa(["react-flow__controls",c]),position:u,style:i,"data-testid":"rf__controls",children:[e&&fn(ks,{children:[he(mL,{onClick:L,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m,children:he(P5e,{})}),he(mL,{onClick:D,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:v,children:he(O5e,{})})]}),t&&he(mL,{className:"react-flow__controls-fitview",onClick:E,title:"fit view","aria-label":"fit view",children:he(F5e,{})}),n&&he(mL,{className:"react-flow__controls-interactive",onClick:I,title:"toggle interactivity","aria-label":"toggle interactivity",children:p?he(W5e,{}):he(B5e,{})}),d]})};nge.displayName="Controls";var H5e=x.exports.memo(nge),kd;(function(i){i.Lines="lines",i.Dots="dots",i.Cross="cross"})(kd||(kd={}));function $5e({color:i,dimensions:e,lineWidth:t}){return he("path",{stroke:i,strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function z5e({color:i,radius:e}){return he("circle",{cx:e,cy:e,r:e,fill:i})}const U5e={[kd.Dots]:"#91919a",[kd.Lines]:"#eee",[kd.Cross]:"#e2e2e2"},j5e={[kd.Dots]:1,[kd.Lines]:1,[kd.Cross]:6},K5e=i=>({transform:i.transform,patternId:`pattern-${i.rfId}`});function ige({id:i,variant:e=kd.Dots,gap:t=20,size:n,lineWidth:o=1,offset:r=2,color:s,style:a,className:l}){const c=x.exports.useRef(null),{transform:d,patternId:u}=mo(K5e,Hs),h=s||U5e[e],f=n||j5e[e],g=e===kd.Dots,p=e===kd.Cross,v=Array.isArray(t)?t:[t,t],m=[v[0]*d[2]||1,v[1]*d[2]||1],_=f*d[2],y=p?[_,_]:m,w=g?[_/r,_/r]:[y[0]/r,y[1]/r];return fn("svg",{className:fa(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background",children:[he("pattern",{id:u+i,x:d[0]%m[0],y:d[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${w[0]},-${w[1]})`,children:g?he(z5e,{color:h,radius:_/r}):he($5e,{dimensions:y,color:h,lineWidth:o})}),he("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${u+i})`})]})}ige.displayName="Background";var q5e=x.exports.memo(ige);let WN;const G5e=new Uint8Array(16);function X5e(){if(!WN&&(WN=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!WN))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return WN(G5e)}const Ks=[];for(let i=0;i<256;++i)Ks.push((i+256).toString(16).slice(1));function Y5e(i,e=0){return Ks[i[e+0]]+Ks[i[e+1]]+Ks[i[e+2]]+Ks[i[e+3]]+"-"+Ks[i[e+4]]+Ks[i[e+5]]+"-"+Ks[i[e+6]]+Ks[i[e+7]]+"-"+Ks[i[e+8]]+Ks[i[e+9]]+"-"+Ks[i[e+10]]+Ks[i[e+11]]+Ks[i[e+12]]+Ks[i[e+13]]+Ks[i[e+14]]+Ks[i[e+15]]}const Z5e=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var Cte={randomUUID:Z5e};function SI(i,e,t){if(Cte.randomUUID&&!e&&!i)return Cte.randomUUID();i=i||{};const n=i.random||(i.rng||X5e)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let o=0;o<16;++o)e[t+o]=n[o];return e}return Y5e(n)}class xI{constructor(e){bt(this,"id");bt(this,"name");bt(this,"children",[]);bt(this,"nodes",[]);bt(this,"edges",[]);bt(this,"parentLayerId");bt(this,"relativeNodeId");bt(this,"relativeOperatorType");this.id=SI(),this.name=e}}function wc(i,e){if(i.id===e)return i;for(const t of i.children){const n=wc(t,e);if(n)return n}}function Q5e(i){var o;const e=[i];let t=e.pop();const n=[];for(;t;)n.push(t),(o=t==null?void 0:t.children)!=null&&o.length&&e.push(...t.children),t=e.pop();return n.reverse(),n}var J5e=function(i){return function(e,t){var n=x.exports.useRef(!1);i(function(){return function(){n.current=!1}},[]),i(function(){if(!n.current)n.current=!0;else return e()},t)}},eFe=function(i){return typeof i=="function"},tFe=!1,nFe=tFe;function T_(i){nFe&&(eFe(i)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof i)));var e=x.exports.useRef(i);e.current=x.exports.useMemo(function(){return i},[i]);var t=x.exports.useRef();return t.current||(t.current=function(){for(var n=[],o=0;o0},i.prototype.connect_=function(){!UB||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),cFe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!UB||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?"":t,o=lFe.some(function(r){return!!~n.indexOf(r)});o&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),rge=function(i,e){for(var t=0,n=Object.keys(e);t0},i}(),age=typeof WeakMap!="undefined"?new WeakMap:new oge,lge=function(){function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=dFe.getInstance(),n=new CFe(e,t,this);age.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){lge.prototype[i]=function(){var e;return(e=age.get(this))[i].apply(e,arguments)}});var yFe=function(){return typeof mA.ResizeObserver!="undefined"?mA.ResizeObserver:lge}();function cge(){return`$flow_${SI()}`}function wFe(i,e){return i.target===e.target&&i.targetHandle===e.targetHandle}function SFe(i,e){return i.source===e.source&&i.sourceHandle===e.sourceHandle}async function xFe(i){return await new Promise(e=>setTimeout(e,i))}var dge={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var r="",s=0;s component higher in the tree to provide a loading * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var wK=Symbol.for("react.element"),SK=Symbol.for("react.portal"),c4=Symbol.for("react.fragment"),d4=Symbol.for("react.strict_mode"),u4=Symbol.for("react.profiler"),h4=Symbol.for("react.provider"),f4=Symbol.for("react.context"),LFe=Symbol.for("react.server_context"),g4=Symbol.for("react.forward_ref"),p4=Symbol.for("react.suspense"),m4=Symbol.for("react.suspense_list"),v4=Symbol.for("react.memo"),_4=Symbol.for("react.lazy"),EFe=Symbol.for("react.offscreen"),dge;dge=Symbol.for("react.module.reference");function $d(i){if(typeof i=="object"&&i!==null){var e=i.$$typeof;switch(e){case wK:switch(i=i.type,i){case c4:case u4:case d4:case p4:case m4:return i;default:switch(i=i&&i.$$typeof,i){case LFe:case f4:case g4:case _4:case v4:case h4:return i;default:return e}}case SK:return e}}}vo.ContextConsumer=f4;vo.ContextProvider=h4;vo.Element=wK;vo.ForwardRef=g4;vo.Fragment=c4;vo.Lazy=_4;vo.Memo=v4;vo.Portal=SK;vo.Profiler=u4;vo.StrictMode=d4;vo.Suspense=p4;vo.SuspenseList=m4;vo.isAsyncMode=function(){return!1};vo.isConcurrentMode=function(){return!1};vo.isContextConsumer=function(i){return $d(i)===f4};vo.isContextProvider=function(i){return $d(i)===h4};vo.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===wK};vo.isForwardRef=function(i){return $d(i)===g4};vo.isFragment=function(i){return $d(i)===c4};vo.isLazy=function(i){return $d(i)===_4};vo.isMemo=function(i){return $d(i)===v4};vo.isPortal=function(i){return $d(i)===SK};vo.isProfiler=function(i){return $d(i)===u4};vo.isStrictMode=function(i){return $d(i)===d4};vo.isSuspense=function(i){return $d(i)===p4};vo.isSuspenseList=function(i){return $d(i)===m4};vo.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===c4||i===u4||i===d4||i===p4||i===m4||i===EFe||typeof i=="object"&&i!==null&&(i.$$typeof===_4||i.$$typeof===v4||i.$$typeof===h4||i.$$typeof===f4||i.$$typeof===g4||i.$$typeof===dge||i.getModuleId!==void 0)};vo.typeOf=$d;yK.exports=vo;function op(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return Bt.Children.forEach(i,function(n){n==null&&!e.keepEmpty||(Array.isArray(n)?t=t.concat(op(n)):yK.exports.isFragment(n)&&n.props?t=t.concat(op(n.props.children,e)):t.push(n))}),t}var UB={},DFe=function(e){};function kFe(i,e){}function IFe(i,e){}function TFe(){UB={}}function uge(i,e,t){!e&&!UB[t]&&(i(!1,t),UB[t]=!0)}function rr(i,e){uge(kFe,i,e)}function NFe(i,e){uge(IFe,i,e)}rr.preMessage=DFe;rr.resetWarned=TFe;rr.noteOnce=NFe;function qn(i){return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qn(i)}function RFe(i,e){if(qn(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(qn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function hge(i){var e=RFe(i,"string");return qn(e)=="symbol"?e:String(e)}function me(i,e,t){return e=hge(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function yte(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),t.push.apply(t,n)}return t}function Ce(i){for(var e=1;ei.length)&&(e=i.length);for(var t=0,n=new Array(e);t1&&arguments[1]!==void 0?arguments[1]:1;Ste+=1;var n=Ste;function o(r){if(r===0)vge(n),e();else{var s=pge(function(){o(r-1)});DK.set(n,s)}}return o(t),n};Xi.cancel=function(i){var e=DK.get(i);return vge(i),mge(e)};function _ge(i){if(Array.isArray(i))return i}function UFe(i,e){var t=i==null?null:typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,o,r,s,a=[],l=!0,c=!1;try{if(r=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function bge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(i,e){return _ge(i)||UFe(i,e)||EK(i,e)||bge()}function bA(i){for(var e=0,t,n=0,o=i.length;o>=4;++n,o-=4)t=i.charCodeAt(n)&255|(i.charCodeAt(++n)&255)<<8|(i.charCodeAt(++n)&255)<<16|(i.charCodeAt(++n)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(i.charCodeAt(n+2)&255)<<16;case 2:e^=(i.charCodeAt(n+1)&255)<<8;case 1:e^=i.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Fa(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function GB(i,e){if(!i)return!1;if(i.contains)return i.contains(e);for(var t=e;t;){if(t===i)return!0;t=t.parentNode}return!1}var xte="data-rc-order",Lte="data-rc-priority",jFe="rc-util-key",XB=new Map;function Cge(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):jFe}function C4(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function KFe(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function yge(i){return Array.from((XB.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function wge(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Fa())return null;var t=e.csp,n=e.prepend,o=e.priority,r=o===void 0?0:o,s=KFe(n),a=s==="prependQueue",l=document.createElement("style");l.setAttribute(xte,s),a&&r&&l.setAttribute(Lte,"".concat(r)),t!=null&&t.nonce&&(l.nonce=t==null?void 0:t.nonce),l.innerHTML=i;var c=C4(e),d=c.firstChild;if(n){if(a){var u=yge(c).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(xte)))return!1;var f=Number(h.getAttribute(Lte)||0);return r>=f});if(u.length)return c.insertBefore(l,u[u.length-1].nextSibling),l}c.insertBefore(l,d)}else c.appendChild(l);return l}function Sge(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=C4(e);return yge(t).find(function(n){return n.getAttribute(Cge(e))===i})}function hD(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=Sge(i,e);if(t){var n=C4(e);n.removeChild(t)}}function qFe(i,e){var t=XB.get(i);if(!t||!GB(document,t)){var n=wge("",e),o=n.parentNode;XB.set(i,o),i.removeChild(n)}}function pv(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=C4(t);qFe(n,t);var o=Sge(e,t);if(o){var r,s;if((r=t.csp)!==null&&r!==void 0&&r.nonce&&o.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;o.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return o.innerHTML!==i&&(o.innerHTML=i),o}var l=wge(i,t);return l.setAttribute(Cge(t),e),l}function GFe(i,e){if(i==null)return{};var t={},n=Object.keys(i),o,r;for(r=0;r=0)&&(t[o]=i[o]);return t}function Hn(i,e){if(i==null)return{};var t=GFe(i,e),n,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(i,n)||(t[n]=i[n]))}return t}function y4(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function o(r,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=n.has(r);if(rr(!l,"Warning: There may be circular references"),l)return!1;if(r===s)return!0;if(t&&a>1)return!1;n.add(r);var c=a+1;if(Array.isArray(r)){if(!Array.isArray(s)||r.length!==s.length)return!1;for(var d=0;d1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l;s=(l=s)===null||l===void 0||(l=l.map)===null||l===void 0?void 0:l.get(a)}}),(n=s)!==null&&n!==void 0&&n.value&&r&&(s.value[1]=this.cacheCallTimes++),(o=s)===null||o===void 0?void 0:o.value}},{key:"get",value:function(t){var n;return(n=this.internalGet(t,!0))===null||n===void 0?void 0:n[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,n){var o=this;if(!this.has(t)){if(this.size()+1>i.MAX_CACHE_SIZE+i.MAX_CACHE_OFFSET){var r=this.keys.reduce(function(c,d){var u=Ne(c,2),h=u[1];return o.internalGet(d)[1]0,void 0),Ete+=1}return pa(i,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(n,o){return o(t,n)},void 0)}}]),i}(),j8=new kK;function ZB(i){var e=Array.isArray(i)?i:[i];return j8.has(e)||j8.set(e,new xge(e)),j8.get(e)}var e3e=new WeakMap,K8={};function t3e(i,e){for(var t=e3e,n=0;n3&&arguments[3]!==void 0?arguments[3]:{},r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(r)return i;var s=Ce(Ce({},o),{},(n={},me(n,sw,e),me(n,Au,t),n)),a=Object.keys(s).map(function(l){var c=s[l];return c?"".concat(l,'="').concat(c,'"'):null}).filter(function(l){return l}).join(" ");return"")}var Ege=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(t?"".concat(t,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},o3e=function(e,t,n){return Object.keys(e).length?".".concat(t).concat(n!=null&&n.scope?".".concat(n.scope):"","{").concat(Object.entries(e).map(function(o){var r=Ne(o,2),s=r[0],a=r[1];return"".concat(s,":").concat(a,";")}).join(""),"}"):""},Dge=function(e,t,n){var o={},r={};return Object.entries(e).forEach(function(s){var a,l,c=Ne(s,2),d=c[0],u=c[1];if(n!=null&&(a=n.preserve)!==null&&a!==void 0&&a[d])r[d]=u;else if((typeof u=="string"||typeof u=="number")&&!(n!=null&&(l=n.ignore)!==null&&l!==void 0&&l[d])){var h,f=Ege(d,n==null?void 0:n.prefix);o[f]=typeof u=="number"&&!(n!=null&&(h=n.unitless)!==null&&h!==void 0&&h[d])?"".concat(u,"px"):String(u),r[d]="var(".concat(f,")")}}),[r,o3e(o,t,{scope:n==null?void 0:n.scope})]},Ite=Fa()?x.exports.useLayoutEffect:x.exports.useEffect,go=function(e,t){var n=x.exports.useRef(!0);Ite(function(){return e(n.current)},t),Ite(function(){return n.current=!1,function(){n.current=!0}},[])},JB=function(e,t){go(function(n){if(!n)return e()},t)},r3e=Ce({},fI),Tte=r3e.useInsertionEffect,s3e=function(e,t,n){x.exports.useMemo(e,n),go(function(){return t(!0)},n)},a3e=Tte?function(i,e,t){return Tte(function(){return i(),e()},t)}:s3e,l3e=a3e,c3e=Ce({},fI),d3e=c3e.useInsertionEffect,u3e=function(e){var t=[],n=!1;function o(r){n||t.push(r)}return x.exports.useEffect(function(){return n=!1,function(){n=!0,t.length&&t.forEach(function(r){return r()})}},e),o},h3e=function(){return function(e){e()}},f3e=typeof d3e!="undefined"?u3e:h3e,g3e=f3e;function IK(i,e,t,n,o){var r=x.exports.useContext(w4),s=r.cache,a=[i].concat(_t(e)),l=YB(a),c=g3e([l]),d=function(g){s.opUpdate(l,function(p){var v=p||[void 0,void 0],m=Ne(v,2),_=m[0],y=_===void 0?0:_,w=m[1],L=w,D=L||t(),E=[y,D];return g?g(E):E})};x.exports.useMemo(function(){d()},[l]);var u=s.opGet(l),h=u[1];return l3e(function(){o==null||o(h)},function(f){return d(function(g){var p=Ne(g,2),v=p[0],m=p[1];return f&&v===0&&(o==null||o(h)),[v+1,m]}),function(){s.opUpdate(l,function(g){var p=g||[],v=Ne(p,2),m=v[0],_=m===void 0?0:m,y=v[1],w=_-1;return w===0?(c(function(){(f||!s.opGet(l))&&(n==null||n(y,!1))}),null):[_-1,y]})}},[l]),h}var p3e={},m3e="css",V_=new Map;function v3e(i){V_.set(i,(V_.get(i)||0)+1)}function _3e(i,e){if(typeof document!="undefined"){var t=document.querySelectorAll("style[".concat(sw,'="').concat(i,'"]'));t.forEach(function(n){if(n[bm]===e){var o;(o=n.parentNode)===null||o===void 0||o.removeChild(n)}})}}var b3e=0;function C3e(i,e){V_.set(i,(V_.get(i)||0)-1);var t=Array.from(V_.keys()),n=t.filter(function(o){var r=V_.get(o)||0;return r<=0});t.length-n.length>b3e&&n.forEach(function(o){_3e(o,e),V_.delete(o)})}var y3e=function(e,t,n,o){var r=n.getDerivativeToken(e),s=Ce(Ce({},r),t);return o&&(s=o(s)),s},kge="token";function w3e(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=x.exports.useContext(w4),o=n.cache.instanceId,r=n.container,s=t.salt,a=s===void 0?"":s,l=t.override,c=l===void 0?p3e:l,d=t.formatToken,u=t.getComputedToken,h=t.cssVar,f=t3e(function(){return Object.assign.apply(Object,[{}].concat(_t(e)))},e),g=nE(f),p=nE(c),v=h?nE(h):"",m=IK(kge,[a,i.id,g,p,v],function(){var _,y=u?u(f,c,i):y3e(f,c,i,d),w=Ce({},y),L="";if(h){var D=Dge(y,h.key,{prefix:h.prefix,ignore:h.ignore,unitless:h.unitless,preserve:h.preserve}),E=Ne(D,2);y=E[0],L=E[1]}var I=kte(y,a);y._tokenKey=I,w._tokenKey=kte(w,a);var k=(_=h==null?void 0:h.key)!==null&&_!==void 0?_:I;y._themeKey=k,v3e(k);var R="".concat(m3e,"-").concat(bA(I));return y._hashId=R,[y,R,w,L,(h==null?void 0:h.key)||""]},function(_){C3e(_[0]._themeKey,o)},function(_){var y=Ne(_,4),w=y[0],L=y[3];if(h&&L){var D=pv(L,bA("css-variables-".concat(w._themeKey)),{mark:Au,prepend:"queue",attachTo:r,priority:-999});D[bm]=o,D.setAttribute(sw,w._themeKey)}});return m}var S3e=function(e,t,n){var o=Ne(e,5),r=o[2],s=o[3],a=o[4],l=n||{},c=l.plain;if(!s)return null;var d=r._tokenKey,u=-999,h={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},f=CA(s,a,d,h,c);return[u,d,f]},x3e={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ige="comm",Tge="rule",Nge="decl",L3e="@import",E3e="@keyframes",D3e="@layer",Rge=Math.abs,TK=String.fromCharCode;function Mge(i){return i.trim()}function WR(i,e,t){return i.replace(e,t)}function k3e(i,e,t){return i.indexOf(e,t)}function fD(i,e){return i.charCodeAt(e)|0}function gD(i,e,t){return i.slice(e,t)}function fg(i){return i.length}function I3e(i){return i.length}function VN(i,e){return e.push(i),i}var S4=1,aw=1,Age=0,Od=0,es=0,cS="";function NK(i,e,t,n,o,r,s,a){return{value:i,root:e,parent:t,type:n,props:o,children:r,line:S4,column:aw,length:s,return:"",siblings:a}}function T3e(){return es}function N3e(){return es=Od>0?fD(cS,--Od):0,aw--,es===10&&(aw=1,S4--),es}function Pu(){return es=Od2||eW(es)>3?"":" "}function P3e(i,e){for(;--e&&Pu()&&!(es<48||es>102||es>57&&es<65||es>70&&es<97););return x4(i,VR()+(e<6&&L0()==32&&Pu()==32))}function tW(i){for(;Pu();)switch(es){case i:return Od;case 34:case 39:i!==34&&i!==39&&tW(es);break;case 40:i===41&&tW(i);break;case 92:Pu();break}return Od}function O3e(i,e){for(;Pu()&&i+es!==47+10;)if(i+es===42+42&&L0()===47)break;return"/*"+x4(e,Od-1)+"*"+TK(i===47?i:Pu())}function F3e(i){for(;!eW(L0());)Pu();return x4(i,Od)}function B3e(i){return M3e(HR("",null,null,null,[""],i=R3e(i),0,[0],i))}function HR(i,e,t,n,o,r,s,a,l){for(var c=0,d=0,u=s,h=0,f=0,g=0,p=1,v=1,m=1,_=0,y="",w=o,L=r,D=n,E=y;v;)switch(g=_,_=Pu()){case 40:if(g!=108&&fD(E,u-1)==58){k3e(E+=WR(G8(_),"&","&\f"),"&\f",Rge(c?a[c-1]:0))!=-1&&(m=-1);break}case 34:case 39:case 91:E+=G8(_);break;case 9:case 10:case 13:case 32:E+=A3e(g);break;case 92:E+=P3e(VR()-1,7);continue;case 47:switch(L0()){case 42:case 47:VN(W3e(O3e(Pu(),VR()),e,t,l),l);break;default:E+="/"}break;case 123*p:a[c++]=fg(E)*m;case 125*p:case 59:case 0:switch(_){case 0:case 125:v=0;case 59+d:m==-1&&(E=WR(E,/\f/g,"")),f>0&&fg(E)-u&&VN(f>32?Rte(E+";",n,t,u-1,l):Rte(WR(E," ","")+";",n,t,u-2,l),l);break;case 59:E+=";";default:if(VN(D=Nte(E,e,t,c,d,o,a,y,w=[],L=[],u,r),r),_===123)if(d===0)HR(E,e,D,D,w,r,u,a,L);else switch(h===99&&fD(E,3)===110?100:h){case 100:case 108:case 109:case 115:HR(i,D,D,n&&VN(Nte(i,D,D,0,0,o,a,y,o,w=[],u,L),L),o,L,u,a,n?w:L);break;default:HR(E,D,D,D,[""],L,0,a,L)}}c=d=f=0,p=m=1,y=E="",u=s;break;case 58:u=1+fg(E),f=g;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&N3e()==125)continue}switch(E+=TK(_),_*p){case 38:m=d>0?1:(E+="\f",-1);break;case 44:a[c++]=(fg(E)-1)*m,m=1;break;case 64:L0()===45&&(E+=G8(Pu())),h=L0(),d=u=fg(y=E+=F3e(VR())),_++;break;case 45:g===45&&fg(E)==2&&(p=0)}}return r}function Nte(i,e,t,n,o,r,s,a,l,c,d,u){for(var h=o-1,f=o===0?r:[""],g=I3e(f),p=0,v=0,m=0;p0?f[_]+" "+y:WR(y,/&\f/g,f[_])))&&(l[m++]=w);return NK(i,e,t,o===0?Tge:a,l,c,d,u)}function W3e(i,e,t,n){return NK(i,e,t,Ige,TK(T3e()),gD(i,2,-2),0,n)}function Rte(i,e,t,n,o){return NK(i,e,t,Nge,gD(i,0,n),gD(i,n+1,-1),n,o)}function nW(i,e){for(var t="",n=0;n1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},o=n.root,r=n.injectHash,s=n.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,d=t.transformers,u=d===void 0?[]:d;t.linters;var h="",f={};function g(y){var w=y.getName(a);if(!f[w]){var L=i(y.style,t,{root:!1,parentSelectors:s}),D=Ne(L,1),E=D[0];f[w]="@keyframes ".concat(y.getName(a)).concat(E)}}function p(y){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(L){Array.isArray(L)?p(L,w):L&&w.push(L)}),w}var v=p(Array.isArray(e)?e:[e]);if(v.forEach(function(y){var w=typeof y=="string"&&!o?{}:y;if(typeof w=="string")h+="".concat(w,` -`);else if(w._keyframe)g(w);else{var L=u.reduce(function(D,E){var I;return(E==null||(I=E.visit)===null||I===void 0?void 0:I.call(E,D))||D},w);Object.keys(L).forEach(function(D){var E=L[D];if(qn(E)==="object"&&E&&(D!=="animationName"||!E._keyframe)&&!j3e(E)){var I=!1,k=D.trim(),R=!1;(o||r)&&a?k.startsWith("@")?I=!0:k=K3e(D,a,c):o&&!a&&(k==="&"||k==="")&&(k="",R=!0);var A=i(E,t,{root:R,injectHash:I,parentSelectors:[].concat(_t(s),[k])}),P=Ne(A,2),N=P[0],M=P[1];f=Ce(Ce({},f),M),h+="".concat(k).concat(N)}else{let F=function($,z){var K=$.replace(/[A-Z]/g,function(G){return"-".concat(G.toLowerCase())}),j=z;!x3e[$]&&typeof j=="number"&&j!==0&&(j="".concat(j,"px")),$==="animationName"&&z!==null&&z!==void 0&&z._keyframe&&(g(z),j=z.getName(a)),h+="".concat(K,":").concat(j,";")};var H,B=(H=E==null?void 0:E.value)!==null&&H!==void 0?H:E;qn(E)==="object"&&E!==null&&E!==void 0&&E[Fge]&&Array.isArray(B)?B.forEach(function($){F(D,$)}):F(D,B)}})}}),!o)h="{".concat(h,"}");else if(l&&i3e()){var m=l.split(","),_=m[m.length-1].trim();h="@layer ".concat(_," {").concat(h,"}"),m.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function Bge(i,e){return bA("".concat(i.join("%")).concat(e))}function G3e(){return null}var Wge="style";function oW(i,e){var t=i.token,n=i.path,o=i.hashId,r=i.layer,s=i.nonce,a=i.clientOnly,l=i.order,c=l===void 0?0:l,d=x.exports.useContext(w4),u=d.autoClear;d.mock;var h=d.defaultCache,f=d.hashPriority,g=d.container,p=d.ssrInline,v=d.transformers,m=d.linters,_=d.cache,y=t._tokenKey,w=[y].concat(_t(n)),L=QB,D=IK(Wge,w,function(){var A=w.join("|");if($3e(A)){var P=z3e(A),N=Ne(P,2),M=N[0],H=N[1];if(M)return[M,y,H,{},a,c]}var B=e(),F=q3e(B,{hashId:o,hashPriority:f,layer:r,path:n.join("-"),transformers:v,linters:m}),$=Ne(F,2),z=$[0],K=$[1],j=iW(z),G=Bge(w,j);return[j,y,G,K,a,c]},function(A,P){var N=Ne(A,3),M=N[2];(P||u)&&QB&&hD(M,{mark:Au})},function(A){var P=Ne(A,4),N=P[0];P[1];var M=P[2],H=P[3];if(L&&N!==Pge){var B={mark:Au,prepend:"queue",attachTo:g,priority:c},F=typeof s=="function"?s():s;F&&(B.csp={nonce:F});var $=pv(N,M,B);$[bm]=_.instanceId,$.setAttribute(sw,y),Object.keys(H).forEach(function(z){pv(iW(H[z]),"_effect-".concat(z),B)})}}),E=Ne(D,3),I=E[0],k=E[1],R=E[2];return function(A){var P;if(!p||L||!h)P=x.exports.createElement(G3e,null);else{var N;P=x.exports.createElement("style",yt({},(N={},me(N,sw,k),me(N,Au,R),N),{dangerouslySetInnerHTML:{__html:I}}))}return x.exports.createElement(x.exports.Fragment,null,P,A)}}var X3e=function(e,t,n){var o=Ne(e,6),r=o[0],s=o[1],a=o[2],l=o[3],c=o[4],d=o[5],u=n||{},h=u.plain;if(c)return null;var f=r,g={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)};return f=CA(r,s,a,g,h),l&&Object.keys(l).forEach(function(p){if(!t[p]){t[p]=!0;var v=iW(l[p]);f+=CA(v,s,"_effect-".concat(p),g,h)}}),[d,a,f]},Vge="cssVar",Y3e=function(e,t){var n=e.key,o=e.prefix,r=e.unitless,s=e.ignore,a=e.token,l=e.scope,c=l===void 0?"":l,d=x.exports.useContext(w4),u=d.cache.instanceId,h=d.container,f=a._tokenKey,g=[].concat(_t(e.path),[n,c,f]),p=IK(Vge,g,function(){var v=t(),m=Dge(v,n,{prefix:o,unitless:r,ignore:s,scope:c}),_=Ne(m,2),y=_[0],w=_[1],L=Bge(g,w);return[y,w,L,n]},function(v){var m=Ne(v,3),_=m[2];QB&&hD(_,{mark:Au})},function(v){var m=Ne(v,3),_=m[1],y=m[2];if(!!_){var w=pv(_,y,{mark:Au,prepend:"queue",attachTo:h,priority:-999});w[bm]=u,w.setAttribute(sw,n)}});return p},Z3e=function(e,t,n){var o=Ne(e,4),r=o[1],s=o[2],a=o[3],l=n||{},c=l.plain;if(!r)return null;var d=-999,u={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},h=CA(r,a,s,u,c);return[d,s,h]},Sx;Sx={},me(Sx,Wge,X3e),me(Sx,kge,S3e),me(Sx,Vge,Z3e);var ji=function(){function i(e,t){ga(this,i),me(this,"name",void 0),me(this,"style",void 0),me(this,"_keyframe",!0),this.name=e,this.style=t}return pa(i,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),i}();function D1(i){return i.notSplit=!0,i}D1(["borderTop","borderBottom"]),D1(["borderTop"]),D1(["borderBottom"]),D1(["borderLeft","borderRight"]),D1(["borderLeft"]),D1(["borderRight"]);var Q3e=x.exports.createContext({}),RK=Q3e;function Hge(i){return _ge(i)||gge(i)||EK(i)||bge()}function jh(i,e){for(var t=i,n=0;n3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&n&&t===void 0&&!jh(i,e.slice(0,-1))?i:$ge(i,e,t,n)}function J3e(i){return qn(i)==="object"&&i!==null&&Object.getPrototypeOf(i)===Object.prototype}function Ate(i){return Array.isArray(i)?[]:{}}var e8e=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function LC(){for(var i=arguments.length,e=new Array(i),t=0;t{const i=()=>{};return i.deprecated=t8e,i};var zge=x.exports.createContext(void 0),i8e={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},o8e={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};const r8e={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};var Uge=r8e;const s8e={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},o8e),timePickerLocale:Object.assign({},Uge)};var Pte=s8e;const hc="${label} is not a valid ${type}",a8e={locale:"en",Pagination:i8e,DatePicker:Pte,TimePicker:Uge,Calendar:Pte,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:hc,method:hc,array:hc,object:hc,number:hc,date:hc,boolean:hc,integer:hc,float:hc,regexp:hc,email:hc,url:hc,hex:hc},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty"}};var mv=a8e;let $R=Object.assign({},mv.Modal),zR=[];const Ote=()=>zR.reduce((i,e)=>Object.assign(Object.assign({},i),e),mv.Modal);function l8e(i){if(i){const e=Object.assign({},i);return zR.push(e),$R=Ote(),()=>{zR=zR.filter(t=>t!==e),$R=Ote()}}$R=Object.assign({},mv.Modal)}function jge(){return $R}const c8e=x.exports.createContext(void 0);var MK=c8e;const d8e=(i,e)=>{const t=x.exports.useContext(MK),n=x.exports.useMemo(()=>{var r;const s=e||mv[i],a=(r=t==null?void 0:t[i])!==null&&r!==void 0?r:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[i,e,t]),o=x.exports.useMemo(()=>{const r=t==null?void 0:t.locale;return(t==null?void 0:t.exist)&&!r?mv.locale:r},[t]);return[n,o]};var EI=d8e;const u8e="internalMark",h8e=i=>{const{locale:e={},children:t,_ANT_MARK__:n}=i;x.exports.useEffect(()=>l8e(e&&e.Modal),[e]);const o=x.exports.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return x.exports.createElement(MK.Provider,{value:o},t)};var f8e=h8e;function aa(i,e){g8e(i)&&(i="100%");var t=p8e(i);return i=e===360?i:Math.min(e,Math.max(0,parseFloat(i))),t&&(i=parseInt(String(i*e),10)/100),Math.abs(i-e)<1e-6?1:(e===360?i=(i<0?i%e+e:i%e)/parseFloat(String(e)):i=i%e/parseFloat(String(e)),i)}function HN(i){return Math.min(1,Math.max(0,i))}function g8e(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function p8e(i){return typeof i=="string"&&i.indexOf("%")!==-1}function Kge(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function $N(i){return i<=1?"".concat(Number(i)*100,"%"):i}function o0(i){return i.length===1?"0"+i:String(i)}function m8e(i,e,t){return{r:aa(i,255)*255,g:aa(e,255)*255,b:aa(t,255)*255}}function Fte(i,e,t){i=aa(i,255),e=aa(e,255),t=aa(t,255);var n=Math.max(i,e,t),o=Math.min(i,e,t),r=0,s=0,a=(n+o)/2;if(n===o)s=0,r=0;else{var l=n-o;switch(s=a>.5?l/(2-n-o):l/(n+o),n){case i:r=(e-t)/l+(e1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function v8e(i,e,t){var n,o,r;if(i=aa(i,360),e=aa(e,100),t=aa(t,100),e===0)o=t,r=t,n=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;n=X8(a,s,i+1/3),o=X8(a,s,i),r=X8(a,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function rW(i,e,t){i=aa(i,255),e=aa(e,255),t=aa(t,255);var n=Math.max(i,e,t),o=Math.min(i,e,t),r=0,s=n,a=n-o,l=n===0?0:a/n;if(n===o)r=0;else{switch(n){case i:r=(e-t)/a+(e>16,g:(i&65280)>>8,b:i&255}}var aW={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function cC(i){var e={r:0,g:0,b:0},t=1,n=null,o=null,r=null,s=!1,a=!1;return typeof i=="string"&&(i=x8e(i)),typeof i=="object"&&(Kf(i.r)&&Kf(i.g)&&Kf(i.b)?(e=m8e(i.r,i.g,i.b),s=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):Kf(i.h)&&Kf(i.s)&&Kf(i.v)?(n=$N(i.s),o=$N(i.v),e=_8e(i.h,n,o),s=!0,a="hsv"):Kf(i.h)&&Kf(i.s)&&Kf(i.l)&&(n=$N(i.s),r=$N(i.l),e=v8e(i.h,n,r),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=Kge(t),{ok:s,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var w8e="[-\\+]?\\d+%?",S8e="[-\\+]?\\d*\\.\\d+%?",Cm="(?:".concat(S8e,")|(?:").concat(w8e,")"),Y8="[\\s|\\(]+(".concat(Cm,")[,|\\s]+(").concat(Cm,")[,|\\s]+(").concat(Cm,")\\s*\\)?"),Z8="[\\s|\\(]+(".concat(Cm,")[,|\\s]+(").concat(Cm,")[,|\\s]+(").concat(Cm,")[,|\\s]+(").concat(Cm,")\\s*\\)?"),ou={CSS_UNIT:new RegExp(Cm),rgb:new RegExp("rgb"+Y8),rgba:new RegExp("rgba"+Z8),hsl:new RegExp("hsl"+Y8),hsla:new RegExp("hsla"+Z8),hsv:new RegExp("hsv"+Y8),hsva:new RegExp("hsva"+Z8),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function x8e(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(aW[i])i=aW[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=ou.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=ou.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ou.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=ou.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ou.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=ou.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ou.hex8.exec(i),t?{r:mc(t[1]),g:mc(t[2]),b:mc(t[3]),a:Bte(t[4]),format:e?"name":"hex8"}:(t=ou.hex6.exec(i),t?{r:mc(t[1]),g:mc(t[2]),b:mc(t[3]),format:e?"name":"hex"}:(t=ou.hex4.exec(i),t?{r:mc(t[1]+t[1]),g:mc(t[2]+t[2]),b:mc(t[3]+t[3]),a:Bte(t[4]+t[4]),format:e?"name":"hex8"}:(t=ou.hex3.exec(i),t?{r:mc(t[1]+t[1]),g:mc(t[2]+t[2]),b:mc(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Kf(i){return Boolean(ou.CSS_UNIT.exec(String(i)))}var na=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=y8e(e)),this.originalInput=e;var o=cC(e);this.originalInput=e,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:o.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,o,r=e.r/255,s=e.g/255,a=e.b/255;return r<=.03928?t=r/12.92:t=Math.pow((r+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*o},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=Kge(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=rW(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=rW(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=Fte(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=Fte(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),sW(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),b8e(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(aa(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(aa(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+sW(this.r,this.g,this.b,!1),t=0,n=Object.entries(aW);t=0,r=!t&&o&&(e.startsWith("hex")||e==="name");return r?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=HN(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=HN(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=HN(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=HN(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),o=new i(e).toRgb(),r=t/100,s={r:(o.r-n.r)*r+n.r,g:(o.g-n.g)*r+n.g,b:(o.b-n.b)*r+n.b,a:(o.a-n.a)*r+n.a};return new i(s)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),o=360/t,r=[this];for(n.h=(n.h-(o*e>>1)+720)%360;--e;)n.h=(n.h+o)%360,r.push(new i(n));return r},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,o=t.s,r=t.v,s=[],a=1/e;e--;)s.push(new i({h:n,s:o,v:r})),r=(r+a)%1;return s},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),o=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/o,g:(t.g*t.a+n.g*n.a*(1-t.a))/o,b:(t.b*t.a+n.b*n.a*(1-t.a))/o,a:o})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,o=[this],r=360/e,s=1;s=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-zN*e:Math.round(i.h)+zN*e:n=t?Math.round(i.h)+zN*e:Math.round(i.h)-zN*e,n<0?n+=360:n>=360&&(n-=360),n}function $te(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-Wte*e:e===Gge?n=i.s+Wte:n=i.s+L8e*e,n>1&&(n=1),t&&e===qge&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function zte(i,e,t){var n;return t?n=i.v+E8e*e:n=i.v-D8e*e,n>1&&(n=1),Number(n.toFixed(2))}function j0(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=cC(i),o=qge;o>0;o-=1){var r=Vte(n),s=UN(cC({h:Hte(r,o,!0),s:$te(r,o,!0),v:zte(r,o,!0)}));t.push(s)}t.push(UN(n));for(var a=1;a<=Gge;a+=1){var l=Vte(n),c=UN(cC({h:Hte(l,a),s:$te(l,a),v:zte(l,a)}));t.push(c)}return e.theme==="dark"?k8e.map(function(d){var u=d.index,h=d.opacity,f=UN(I8e(cC(e.backgroundColor||"#141414"),cC(t[u]),h*100));return f}):t}var Q8={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},UR={},J8={};Object.keys(Q8).forEach(function(i){UR[i]=j0(Q8[i]),UR[i].primary=UR[i][5],J8[i]=j0(Q8[i],{theme:"dark",backgroundColor:"#141414"}),J8[i].primary=J8[i][5]});var T8e=UR.blue;const N8e=i=>{const{controlHeight:e}=i;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};var R8e=N8e;function M8e(i){const{sizeUnit:e,sizeStep:t}=i;return{sizeXXL:e*(t+8),sizeXL:e*(t+4),sizeLG:e*(t+2),sizeMD:e*(t+1),sizeMS:e*t,size:e*t,sizeSM:e*(t-1),sizeXS:e*(t-2),sizeXXS:e*(t-3)}}const Xge={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},A8e=Object.assign(Object.assign({},Xge),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + */var SK=Symbol.for("react.element"),xK=Symbol.for("react.portal"),c4=Symbol.for("react.fragment"),d4=Symbol.for("react.strict_mode"),u4=Symbol.for("react.profiler"),h4=Symbol.for("react.provider"),f4=Symbol.for("react.context"),LFe=Symbol.for("react.server_context"),g4=Symbol.for("react.forward_ref"),p4=Symbol.for("react.suspense"),m4=Symbol.for("react.suspense_list"),v4=Symbol.for("react.memo"),_4=Symbol.for("react.lazy"),EFe=Symbol.for("react.offscreen"),uge;uge=Symbol.for("react.module.reference");function $d(i){if(typeof i=="object"&&i!==null){var e=i.$$typeof;switch(e){case SK:switch(i=i.type,i){case c4:case u4:case d4:case p4:case m4:return i;default:switch(i=i&&i.$$typeof,i){case LFe:case f4:case g4:case _4:case v4:case h4:return i;default:return e}}case xK:return e}}}vo.ContextConsumer=f4;vo.ContextProvider=h4;vo.Element=SK;vo.ForwardRef=g4;vo.Fragment=c4;vo.Lazy=_4;vo.Memo=v4;vo.Portal=xK;vo.Profiler=u4;vo.StrictMode=d4;vo.Suspense=p4;vo.SuspenseList=m4;vo.isAsyncMode=function(){return!1};vo.isConcurrentMode=function(){return!1};vo.isContextConsumer=function(i){return $d(i)===f4};vo.isContextProvider=function(i){return $d(i)===h4};vo.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===SK};vo.isForwardRef=function(i){return $d(i)===g4};vo.isFragment=function(i){return $d(i)===c4};vo.isLazy=function(i){return $d(i)===_4};vo.isMemo=function(i){return $d(i)===v4};vo.isPortal=function(i){return $d(i)===xK};vo.isProfiler=function(i){return $d(i)===u4};vo.isStrictMode=function(i){return $d(i)===d4};vo.isSuspense=function(i){return $d(i)===p4};vo.isSuspenseList=function(i){return $d(i)===m4};vo.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===c4||i===u4||i===d4||i===p4||i===m4||i===EFe||typeof i=="object"&&i!==null&&(i.$$typeof===_4||i.$$typeof===v4||i.$$typeof===h4||i.$$typeof===f4||i.$$typeof===g4||i.$$typeof===uge||i.getModuleId!==void 0)};vo.typeOf=$d;wK.exports=vo;function op(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return Bt.Children.forEach(i,function(n){n==null&&!e.keepEmpty||(Array.isArray(n)?t=t.concat(op(n)):wK.exports.isFragment(n)&&n.props?t=t.concat(op(n.props.children,e)):t.push(n))}),t}var jB={},DFe=function(e){};function kFe(i,e){}function IFe(i,e){}function TFe(){jB={}}function hge(i,e,t){!e&&!jB[t]&&(i(!1,t),jB[t]=!0)}function rr(i,e){hge(kFe,i,e)}function NFe(i,e){hge(IFe,i,e)}rr.preMessage=DFe;rr.resetWarned=TFe;rr.noteOnce=NFe;function qn(i){return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qn(i)}function RFe(i,e){if(qn(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(qn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function fge(i){var e=RFe(i,"string");return qn(e)=="symbol"?e:String(e)}function me(i,e,t){return e=fge(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function wte(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),t.push.apply(t,n)}return t}function Ce(i){for(var e=1;ei.length)&&(e=i.length);for(var t=0,n=new Array(e);t1&&arguments[1]!==void 0?arguments[1]:1;xte+=1;var n=xte;function o(r){if(r===0)_ge(n),e();else{var s=mge(function(){o(r-1)});kK.set(n,s)}}return o(t),n};Xi.cancel=function(i){var e=kK.get(i);return _ge(i),vge(e)};function bge(i){if(Array.isArray(i))return i}function UFe(i,e){var t=i==null?null:typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,o,r,s,a=[],l=!0,c=!1;try{if(r=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function Cge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(i,e){return bge(i)||UFe(i,e)||DK(i,e)||Cge()}function bA(i){for(var e=0,t,n=0,o=i.length;o>=4;++n,o-=4)t=i.charCodeAt(n)&255|(i.charCodeAt(++n)&255)<<8|(i.charCodeAt(++n)&255)<<16|(i.charCodeAt(++n)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(i.charCodeAt(n+2)&255)<<16;case 2:e^=(i.charCodeAt(n+1)&255)<<8;case 1:e^=i.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Fa(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function XB(i,e){if(!i)return!1;if(i.contains)return i.contains(e);for(var t=e;t;){if(t===i)return!0;t=t.parentNode}return!1}var Lte="data-rc-order",Ete="data-rc-priority",jFe="rc-util-key",YB=new Map;function yge(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):jFe}function C4(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function KFe(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function wge(i){return Array.from((YB.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function Sge(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Fa())return null;var t=e.csp,n=e.prepend,o=e.priority,r=o===void 0?0:o,s=KFe(n),a=s==="prependQueue",l=document.createElement("style");l.setAttribute(Lte,s),a&&r&&l.setAttribute(Ete,"".concat(r)),t!=null&&t.nonce&&(l.nonce=t==null?void 0:t.nonce),l.innerHTML=i;var c=C4(e),d=c.firstChild;if(n){if(a){var u=wge(c).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(Lte)))return!1;var f=Number(h.getAttribute(Ete)||0);return r>=f});if(u.length)return c.insertBefore(l,u[u.length-1].nextSibling),l}c.insertBefore(l,d)}else c.appendChild(l);return l}function xge(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=C4(e);return wge(t).find(function(n){return n.getAttribute(yge(e))===i})}function hD(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=xge(i,e);if(t){var n=C4(e);n.removeChild(t)}}function qFe(i,e){var t=YB.get(i);if(!t||!XB(document,t)){var n=Sge("",e),o=n.parentNode;YB.set(i,o),i.removeChild(n)}}function mv(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=C4(t);qFe(n,t);var o=xge(e,t);if(o){var r,s;if((r=t.csp)!==null&&r!==void 0&&r.nonce&&o.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;o.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return o.innerHTML!==i&&(o.innerHTML=i),o}var l=Sge(i,t);return l.setAttribute(yge(t),e),l}function GFe(i,e){if(i==null)return{};var t={},n=Object.keys(i),o,r;for(r=0;r=0)&&(t[o]=i[o]);return t}function Hn(i,e){if(i==null)return{};var t=GFe(i,e),n,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(i,n)||(t[n]=i[n]))}return t}function y4(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function o(r,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=n.has(r);if(rr(!l,"Warning: There may be circular references"),l)return!1;if(r===s)return!0;if(t&&a>1)return!1;n.add(r);var c=a+1;if(Array.isArray(r)){if(!Array.isArray(s)||r.length!==s.length)return!1;for(var d=0;d1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l;s=(l=s)===null||l===void 0||(l=l.map)===null||l===void 0?void 0:l.get(a)}}),(n=s)!==null&&n!==void 0&&n.value&&r&&(s.value[1]=this.cacheCallTimes++),(o=s)===null||o===void 0?void 0:o.value}},{key:"get",value:function(t){var n;return(n=this.internalGet(t,!0))===null||n===void 0?void 0:n[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,n){var o=this;if(!this.has(t)){if(this.size()+1>i.MAX_CACHE_SIZE+i.MAX_CACHE_OFFSET){var r=this.keys.reduce(function(c,d){var u=Ne(c,2),h=u[1];return o.internalGet(d)[1]0,void 0),Dte+=1}return pa(i,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(n,o){return o(t,n)},void 0)}}]),i}(),K8=new IK;function QB(i){var e=Array.isArray(i)?i:[i];return K8.has(e)||K8.set(e,new Lge(e)),K8.get(e)}var e3e=new WeakMap,q8={};function t3e(i,e){for(var t=e3e,n=0;n3&&arguments[3]!==void 0?arguments[3]:{},r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(r)return i;var s=Ce(Ce({},o),{},(n={},me(n,sw,e),me(n,Au,t),n)),a=Object.keys(s).map(function(l){var c=s[l];return c?"".concat(l,'="').concat(c,'"'):null}).filter(function(l){return l}).join(" ");return"")}var Dge=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(t?"".concat(t,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},o3e=function(e,t,n){return Object.keys(e).length?".".concat(t).concat(n!=null&&n.scope?".".concat(n.scope):"","{").concat(Object.entries(e).map(function(o){var r=Ne(o,2),s=r[0],a=r[1];return"".concat(s,":").concat(a,";")}).join(""),"}"):""},kge=function(e,t,n){var o={},r={};return Object.entries(e).forEach(function(s){var a,l,c=Ne(s,2),d=c[0],u=c[1];if(n!=null&&(a=n.preserve)!==null&&a!==void 0&&a[d])r[d]=u;else if((typeof u=="string"||typeof u=="number")&&!(n!=null&&(l=n.ignore)!==null&&l!==void 0&&l[d])){var h,f=Dge(d,n==null?void 0:n.prefix);o[f]=typeof u=="number"&&!(n!=null&&(h=n.unitless)!==null&&h!==void 0&&h[d])?"".concat(u,"px"):String(u),r[d]="var(".concat(f,")")}}),[r,o3e(o,t,{scope:n==null?void 0:n.scope})]},Tte=Fa()?x.exports.useLayoutEffect:x.exports.useEffect,go=function(e,t){var n=x.exports.useRef(!0);Tte(function(){return e(n.current)},t),Tte(function(){return n.current=!1,function(){n.current=!0}},[])},eW=function(e,t){go(function(n){if(!n)return e()},t)},r3e=Ce({},fI),Nte=r3e.useInsertionEffect,s3e=function(e,t,n){x.exports.useMemo(e,n),go(function(){return t(!0)},n)},a3e=Nte?function(i,e,t){return Nte(function(){return i(),e()},t)}:s3e,l3e=a3e,c3e=Ce({},fI),d3e=c3e.useInsertionEffect,u3e=function(e){var t=[],n=!1;function o(r){n||t.push(r)}return x.exports.useEffect(function(){return n=!1,function(){n=!0,t.length&&t.forEach(function(r){return r()})}},e),o},h3e=function(){return function(e){e()}},f3e=typeof d3e!="undefined"?u3e:h3e,g3e=f3e;function TK(i,e,t,n,o){var r=x.exports.useContext(w4),s=r.cache,a=[i].concat(_t(e)),l=ZB(a),c=g3e([l]),d=function(g){s.opUpdate(l,function(p){var v=p||[void 0,void 0],m=Ne(v,2),_=m[0],y=_===void 0?0:_,w=m[1],L=w,D=L||t(),E=[y,D];return g?g(E):E})};x.exports.useMemo(function(){d()},[l]);var u=s.opGet(l),h=u[1];return l3e(function(){o==null||o(h)},function(f){return d(function(g){var p=Ne(g,2),v=p[0],m=p[1];return f&&v===0&&(o==null||o(h)),[v+1,m]}),function(){s.opUpdate(l,function(g){var p=g||[],v=Ne(p,2),m=v[0],_=m===void 0?0:m,y=v[1],w=_-1;return w===0?(c(function(){(f||!s.opGet(l))&&(n==null||n(y,!1))}),null):[_-1,y]})}},[l]),h}var p3e={},m3e="css",V_=new Map;function v3e(i){V_.set(i,(V_.get(i)||0)+1)}function _3e(i,e){if(typeof document!="undefined"){var t=document.querySelectorAll("style[".concat(sw,'="').concat(i,'"]'));t.forEach(function(n){if(n[Cm]===e){var o;(o=n.parentNode)===null||o===void 0||o.removeChild(n)}})}}var b3e=0;function C3e(i,e){V_.set(i,(V_.get(i)||0)-1);var t=Array.from(V_.keys()),n=t.filter(function(o){var r=V_.get(o)||0;return r<=0});t.length-n.length>b3e&&n.forEach(function(o){_3e(o,e),V_.delete(o)})}var y3e=function(e,t,n,o){var r=n.getDerivativeToken(e),s=Ce(Ce({},r),t);return o&&(s=o(s)),s},Ige="token";function w3e(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=x.exports.useContext(w4),o=n.cache.instanceId,r=n.container,s=t.salt,a=s===void 0?"":s,l=t.override,c=l===void 0?p3e:l,d=t.formatToken,u=t.getComputedToken,h=t.cssVar,f=t3e(function(){return Object.assign.apply(Object,[{}].concat(_t(e)))},e),g=nE(f),p=nE(c),v=h?nE(h):"",m=TK(Ige,[a,i.id,g,p,v],function(){var _,y=u?u(f,c,i):y3e(f,c,i,d),w=Ce({},y),L="";if(h){var D=kge(y,h.key,{prefix:h.prefix,ignore:h.ignore,unitless:h.unitless,preserve:h.preserve}),E=Ne(D,2);y=E[0],L=E[1]}var I=Ite(y,a);y._tokenKey=I,w._tokenKey=Ite(w,a);var k=(_=h==null?void 0:h.key)!==null&&_!==void 0?_:I;y._themeKey=k,v3e(k);var R="".concat(m3e,"-").concat(bA(I));return y._hashId=R,[y,R,w,L,(h==null?void 0:h.key)||""]},function(_){C3e(_[0]._themeKey,o)},function(_){var y=Ne(_,4),w=y[0],L=y[3];if(h&&L){var D=mv(L,bA("css-variables-".concat(w._themeKey)),{mark:Au,prepend:"queue",attachTo:r,priority:-999});D[Cm]=o,D.setAttribute(sw,w._themeKey)}});return m}var S3e=function(e,t,n){var o=Ne(e,5),r=o[2],s=o[3],a=o[4],l=n||{},c=l.plain;if(!s)return null;var d=r._tokenKey,u=-999,h={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},f=CA(s,a,d,h,c);return[u,d,f]},x3e={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Tge="comm",Nge="rule",Rge="decl",L3e="@import",E3e="@keyframes",D3e="@layer",Mge=Math.abs,NK=String.fromCharCode;function Age(i){return i.trim()}function WR(i,e,t){return i.replace(e,t)}function k3e(i,e,t){return i.indexOf(e,t)}function fD(i,e){return i.charCodeAt(e)|0}function gD(i,e,t){return i.slice(e,t)}function fg(i){return i.length}function I3e(i){return i.length}function VN(i,e){return e.push(i),i}var S4=1,aw=1,Pge=0,Od=0,es=0,cS="";function RK(i,e,t,n,o,r,s,a){return{value:i,root:e,parent:t,type:n,props:o,children:r,line:S4,column:aw,length:s,return:"",siblings:a}}function T3e(){return es}function N3e(){return es=Od>0?fD(cS,--Od):0,aw--,es===10&&(aw=1,S4--),es}function Pu(){return es=Od2||tW(es)>3?"":" "}function P3e(i,e){for(;--e&&Pu()&&!(es<48||es>102||es>57&&es<65||es>70&&es<97););return x4(i,VR()+(e<6&&L0()==32&&Pu()==32))}function nW(i){for(;Pu();)switch(es){case i:return Od;case 34:case 39:i!==34&&i!==39&&nW(es);break;case 40:i===41&&nW(i);break;case 92:Pu();break}return Od}function O3e(i,e){for(;Pu()&&i+es!==47+10;)if(i+es===42+42&&L0()===47)break;return"/*"+x4(e,Od-1)+"*"+NK(i===47?i:Pu())}function F3e(i){for(;!tW(L0());)Pu();return x4(i,Od)}function B3e(i){return M3e(HR("",null,null,null,[""],i=R3e(i),0,[0],i))}function HR(i,e,t,n,o,r,s,a,l){for(var c=0,d=0,u=s,h=0,f=0,g=0,p=1,v=1,m=1,_=0,y="",w=o,L=r,D=n,E=y;v;)switch(g=_,_=Pu()){case 40:if(g!=108&&fD(E,u-1)==58){k3e(E+=WR(X8(_),"&","&\f"),"&\f",Mge(c?a[c-1]:0))!=-1&&(m=-1);break}case 34:case 39:case 91:E+=X8(_);break;case 9:case 10:case 13:case 32:E+=A3e(g);break;case 92:E+=P3e(VR()-1,7);continue;case 47:switch(L0()){case 42:case 47:VN(W3e(O3e(Pu(),VR()),e,t,l),l);break;default:E+="/"}break;case 123*p:a[c++]=fg(E)*m;case 125*p:case 59:case 0:switch(_){case 0:case 125:v=0;case 59+d:m==-1&&(E=WR(E,/\f/g,"")),f>0&&fg(E)-u&&VN(f>32?Mte(E+";",n,t,u-1,l):Mte(WR(E," ","")+";",n,t,u-2,l),l);break;case 59:E+=";";default:if(VN(D=Rte(E,e,t,c,d,o,a,y,w=[],L=[],u,r),r),_===123)if(d===0)HR(E,e,D,D,w,r,u,a,L);else switch(h===99&&fD(E,3)===110?100:h){case 100:case 108:case 109:case 115:HR(i,D,D,n&&VN(Rte(i,D,D,0,0,o,a,y,o,w=[],u,L),L),o,L,u,a,n?w:L);break;default:HR(E,D,D,D,[""],L,0,a,L)}}c=d=f=0,p=m=1,y=E="",u=s;break;case 58:u=1+fg(E),f=g;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&N3e()==125)continue}switch(E+=NK(_),_*p){case 38:m=d>0?1:(E+="\f",-1);break;case 44:a[c++]=(fg(E)-1)*m,m=1;break;case 64:L0()===45&&(E+=X8(Pu())),h=L0(),d=u=fg(y=E+=F3e(VR())),_++;break;case 45:g===45&&fg(E)==2&&(p=0)}}return r}function Rte(i,e,t,n,o,r,s,a,l,c,d,u){for(var h=o-1,f=o===0?r:[""],g=I3e(f),p=0,v=0,m=0;p0?f[_]+" "+y:WR(y,/&\f/g,f[_])))&&(l[m++]=w);return RK(i,e,t,o===0?Nge:a,l,c,d,u)}function W3e(i,e,t,n){return RK(i,e,t,Tge,NK(T3e()),gD(i,2,-2),0,n)}function Mte(i,e,t,n,o){return RK(i,e,t,Rge,gD(i,0,n),gD(i,n+1,-1),n,o)}function iW(i,e){for(var t="",n=0;n1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},o=n.root,r=n.injectHash,s=n.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,d=t.transformers,u=d===void 0?[]:d;t.linters;var h="",f={};function g(y){var w=y.getName(a);if(!f[w]){var L=i(y.style,t,{root:!1,parentSelectors:s}),D=Ne(L,1),E=D[0];f[w]="@keyframes ".concat(y.getName(a)).concat(E)}}function p(y){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(L){Array.isArray(L)?p(L,w):L&&w.push(L)}),w}var v=p(Array.isArray(e)?e:[e]);if(v.forEach(function(y){var w=typeof y=="string"&&!o?{}:y;if(typeof w=="string")h+="".concat(w,` +`);else if(w._keyframe)g(w);else{var L=u.reduce(function(D,E){var I;return(E==null||(I=E.visit)===null||I===void 0?void 0:I.call(E,D))||D},w);Object.keys(L).forEach(function(D){var E=L[D];if(qn(E)==="object"&&E&&(D!=="animationName"||!E._keyframe)&&!j3e(E)){var I=!1,k=D.trim(),R=!1;(o||r)&&a?k.startsWith("@")?I=!0:k=K3e(D,a,c):o&&!a&&(k==="&"||k==="")&&(k="",R=!0);var A=i(E,t,{root:R,injectHash:I,parentSelectors:[].concat(_t(s),[k])}),P=Ne(A,2),N=P[0],M=P[1];f=Ce(Ce({},f),M),h+="".concat(k).concat(N)}else{let F=function($,z){var K=$.replace(/[A-Z]/g,function(G){return"-".concat(G.toLowerCase())}),j=z;!x3e[$]&&typeof j=="number"&&j!==0&&(j="".concat(j,"px")),$==="animationName"&&z!==null&&z!==void 0&&z._keyframe&&(g(z),j=z.getName(a)),h+="".concat(K,":").concat(j,";")};var H,B=(H=E==null?void 0:E.value)!==null&&H!==void 0?H:E;qn(E)==="object"&&E!==null&&E!==void 0&&E[Bge]&&Array.isArray(B)?B.forEach(function($){F(D,$)}):F(D,B)}})}}),!o)h="{".concat(h,"}");else if(l&&i3e()){var m=l.split(","),_=m[m.length-1].trim();h="@layer ".concat(_," {").concat(h,"}"),m.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function Wge(i,e){return bA("".concat(i.join("%")).concat(e))}function G3e(){return null}var Vge="style";function rW(i,e){var t=i.token,n=i.path,o=i.hashId,r=i.layer,s=i.nonce,a=i.clientOnly,l=i.order,c=l===void 0?0:l,d=x.exports.useContext(w4),u=d.autoClear;d.mock;var h=d.defaultCache,f=d.hashPriority,g=d.container,p=d.ssrInline,v=d.transformers,m=d.linters,_=d.cache,y=t._tokenKey,w=[y].concat(_t(n)),L=JB,D=TK(Vge,w,function(){var A=w.join("|");if($3e(A)){var P=z3e(A),N=Ne(P,2),M=N[0],H=N[1];if(M)return[M,y,H,{},a,c]}var B=e(),F=q3e(B,{hashId:o,hashPriority:f,layer:r,path:n.join("-"),transformers:v,linters:m}),$=Ne(F,2),z=$[0],K=$[1],j=oW(z),G=Wge(w,j);return[j,y,G,K,a,c]},function(A,P){var N=Ne(A,3),M=N[2];(P||u)&&JB&&hD(M,{mark:Au})},function(A){var P=Ne(A,4),N=P[0];P[1];var M=P[2],H=P[3];if(L&&N!==Oge){var B={mark:Au,prepend:"queue",attachTo:g,priority:c},F=typeof s=="function"?s():s;F&&(B.csp={nonce:F});var $=mv(N,M,B);$[Cm]=_.instanceId,$.setAttribute(sw,y),Object.keys(H).forEach(function(z){mv(oW(H[z]),"_effect-".concat(z),B)})}}),E=Ne(D,3),I=E[0],k=E[1],R=E[2];return function(A){var P;if(!p||L||!h)P=x.exports.createElement(G3e,null);else{var N;P=x.exports.createElement("style",yt({},(N={},me(N,sw,k),me(N,Au,R),N),{dangerouslySetInnerHTML:{__html:I}}))}return x.exports.createElement(x.exports.Fragment,null,P,A)}}var X3e=function(e,t,n){var o=Ne(e,6),r=o[0],s=o[1],a=o[2],l=o[3],c=o[4],d=o[5],u=n||{},h=u.plain;if(c)return null;var f=r,g={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)};return f=CA(r,s,a,g,h),l&&Object.keys(l).forEach(function(p){if(!t[p]){t[p]=!0;var v=oW(l[p]);f+=CA(v,s,"_effect-".concat(p),g,h)}}),[d,a,f]},Hge="cssVar",Y3e=function(e,t){var n=e.key,o=e.prefix,r=e.unitless,s=e.ignore,a=e.token,l=e.scope,c=l===void 0?"":l,d=x.exports.useContext(w4),u=d.cache.instanceId,h=d.container,f=a._tokenKey,g=[].concat(_t(e.path),[n,c,f]),p=TK(Hge,g,function(){var v=t(),m=kge(v,n,{prefix:o,unitless:r,ignore:s,scope:c}),_=Ne(m,2),y=_[0],w=_[1],L=Wge(g,w);return[y,w,L,n]},function(v){var m=Ne(v,3),_=m[2];JB&&hD(_,{mark:Au})},function(v){var m=Ne(v,3),_=m[1],y=m[2];if(!!_){var w=mv(_,y,{mark:Au,prepend:"queue",attachTo:h,priority:-999});w[Cm]=u,w.setAttribute(sw,n)}});return p},Z3e=function(e,t,n){var o=Ne(e,4),r=o[1],s=o[2],a=o[3],l=n||{},c=l.plain;if(!r)return null;var d=-999,u={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},h=CA(r,a,s,u,c);return[d,s,h]},Sx;Sx={},me(Sx,Vge,X3e),me(Sx,Ige,S3e),me(Sx,Hge,Z3e);var ji=function(){function i(e,t){ga(this,i),me(this,"name",void 0),me(this,"style",void 0),me(this,"_keyframe",!0),this.name=e,this.style=t}return pa(i,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),i}();function D1(i){return i.notSplit=!0,i}D1(["borderTop","borderBottom"]),D1(["borderTop"]),D1(["borderBottom"]),D1(["borderLeft","borderRight"]),D1(["borderLeft"]),D1(["borderRight"]);var Q3e=x.exports.createContext({}),MK=Q3e;function $ge(i){return bge(i)||pge(i)||DK(i)||Cge()}function jh(i,e){for(var t=i,n=0;n3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&n&&t===void 0&&!jh(i,e.slice(0,-1))?i:zge(i,e,t,n)}function J3e(i){return qn(i)==="object"&&i!==null&&Object.getPrototypeOf(i)===Object.prototype}function Pte(i){return Array.isArray(i)?[]:{}}var e8e=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function LC(){for(var i=arguments.length,e=new Array(i),t=0;t{const i=()=>{};return i.deprecated=t8e,i};var Uge=x.exports.createContext(void 0),i8e={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},o8e={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};const r8e={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};var jge=r8e;const s8e={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},o8e),timePickerLocale:Object.assign({},jge)};var Ote=s8e;const hc="${label} is not a valid ${type}",a8e={locale:"en",Pagination:i8e,DatePicker:Ote,TimePicker:jge,Calendar:Ote,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:hc,method:hc,array:hc,object:hc,number:hc,date:hc,boolean:hc,integer:hc,float:hc,regexp:hc,email:hc,url:hc,hex:hc},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty"}};var vv=a8e;let $R=Object.assign({},vv.Modal),zR=[];const Fte=()=>zR.reduce((i,e)=>Object.assign(Object.assign({},i),e),vv.Modal);function l8e(i){if(i){const e=Object.assign({},i);return zR.push(e),$R=Fte(),()=>{zR=zR.filter(t=>t!==e),$R=Fte()}}$R=Object.assign({},vv.Modal)}function Kge(){return $R}const c8e=x.exports.createContext(void 0);var AK=c8e;const d8e=(i,e)=>{const t=x.exports.useContext(AK),n=x.exports.useMemo(()=>{var r;const s=e||vv[i],a=(r=t==null?void 0:t[i])!==null&&r!==void 0?r:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[i,e,t]),o=x.exports.useMemo(()=>{const r=t==null?void 0:t.locale;return(t==null?void 0:t.exist)&&!r?vv.locale:r},[t]);return[n,o]};var EI=d8e;const u8e="internalMark",h8e=i=>{const{locale:e={},children:t,_ANT_MARK__:n}=i;x.exports.useEffect(()=>l8e(e&&e.Modal),[e]);const o=x.exports.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return x.exports.createElement(AK.Provider,{value:o},t)};var f8e=h8e;function aa(i,e){g8e(i)&&(i="100%");var t=p8e(i);return i=e===360?i:Math.min(e,Math.max(0,parseFloat(i))),t&&(i=parseInt(String(i*e),10)/100),Math.abs(i-e)<1e-6?1:(e===360?i=(i<0?i%e+e:i%e)/parseFloat(String(e)):i=i%e/parseFloat(String(e)),i)}function HN(i){return Math.min(1,Math.max(0,i))}function g8e(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function p8e(i){return typeof i=="string"&&i.indexOf("%")!==-1}function qge(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function $N(i){return i<=1?"".concat(Number(i)*100,"%"):i}function o0(i){return i.length===1?"0"+i:String(i)}function m8e(i,e,t){return{r:aa(i,255)*255,g:aa(e,255)*255,b:aa(t,255)*255}}function Bte(i,e,t){i=aa(i,255),e=aa(e,255),t=aa(t,255);var n=Math.max(i,e,t),o=Math.min(i,e,t),r=0,s=0,a=(n+o)/2;if(n===o)s=0,r=0;else{var l=n-o;switch(s=a>.5?l/(2-n-o):l/(n+o),n){case i:r=(e-t)/l+(e1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function v8e(i,e,t){var n,o,r;if(i=aa(i,360),e=aa(e,100),t=aa(t,100),e===0)o=t,r=t,n=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;n=Y8(a,s,i+1/3),o=Y8(a,s,i),r=Y8(a,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function sW(i,e,t){i=aa(i,255),e=aa(e,255),t=aa(t,255);var n=Math.max(i,e,t),o=Math.min(i,e,t),r=0,s=n,a=n-o,l=n===0?0:a/n;if(n===o)r=0;else{switch(n){case i:r=(e-t)/a+(e>16,g:(i&65280)>>8,b:i&255}}var lW={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function cC(i){var e={r:0,g:0,b:0},t=1,n=null,o=null,r=null,s=!1,a=!1;return typeof i=="string"&&(i=x8e(i)),typeof i=="object"&&(Kf(i.r)&&Kf(i.g)&&Kf(i.b)?(e=m8e(i.r,i.g,i.b),s=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):Kf(i.h)&&Kf(i.s)&&Kf(i.v)?(n=$N(i.s),o=$N(i.v),e=_8e(i.h,n,o),s=!0,a="hsv"):Kf(i.h)&&Kf(i.s)&&Kf(i.l)&&(n=$N(i.s),r=$N(i.l),e=v8e(i.h,n,r),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=qge(t),{ok:s,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var w8e="[-\\+]?\\d+%?",S8e="[-\\+]?\\d*\\.\\d+%?",ym="(?:".concat(S8e,")|(?:").concat(w8e,")"),Z8="[\\s|\\(]+(".concat(ym,")[,|\\s]+(").concat(ym,")[,|\\s]+(").concat(ym,")\\s*\\)?"),Q8="[\\s|\\(]+(".concat(ym,")[,|\\s]+(").concat(ym,")[,|\\s]+(").concat(ym,")[,|\\s]+(").concat(ym,")\\s*\\)?"),ou={CSS_UNIT:new RegExp(ym),rgb:new RegExp("rgb"+Z8),rgba:new RegExp("rgba"+Q8),hsl:new RegExp("hsl"+Z8),hsla:new RegExp("hsla"+Q8),hsv:new RegExp("hsv"+Z8),hsva:new RegExp("hsva"+Q8),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function x8e(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(lW[i])i=lW[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=ou.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=ou.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ou.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=ou.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ou.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=ou.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ou.hex8.exec(i),t?{r:mc(t[1]),g:mc(t[2]),b:mc(t[3]),a:Wte(t[4]),format:e?"name":"hex8"}:(t=ou.hex6.exec(i),t?{r:mc(t[1]),g:mc(t[2]),b:mc(t[3]),format:e?"name":"hex"}:(t=ou.hex4.exec(i),t?{r:mc(t[1]+t[1]),g:mc(t[2]+t[2]),b:mc(t[3]+t[3]),a:Wte(t[4]+t[4]),format:e?"name":"hex8"}:(t=ou.hex3.exec(i),t?{r:mc(t[1]+t[1]),g:mc(t[2]+t[2]),b:mc(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Kf(i){return Boolean(ou.CSS_UNIT.exec(String(i)))}var na=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=y8e(e)),this.originalInput=e;var o=cC(e);this.originalInput=e,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:o.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,o,r=e.r/255,s=e.g/255,a=e.b/255;return r<=.03928?t=r/12.92:t=Math.pow((r+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*o},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=qge(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=sW(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=sW(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=Bte(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=Bte(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),aW(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),b8e(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(aa(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(aa(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+aW(this.r,this.g,this.b,!1),t=0,n=Object.entries(lW);t=0,r=!t&&o&&(e.startsWith("hex")||e==="name");return r?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=HN(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=HN(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=HN(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=HN(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),o=new i(e).toRgb(),r=t/100,s={r:(o.r-n.r)*r+n.r,g:(o.g-n.g)*r+n.g,b:(o.b-n.b)*r+n.b,a:(o.a-n.a)*r+n.a};return new i(s)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),o=360/t,r=[this];for(n.h=(n.h-(o*e>>1)+720)%360;--e;)n.h=(n.h+o)%360,r.push(new i(n));return r},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,o=t.s,r=t.v,s=[],a=1/e;e--;)s.push(new i({h:n,s:o,v:r})),r=(r+a)%1;return s},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),o=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/o,g:(t.g*t.a+n.g*n.a*(1-t.a))/o,b:(t.b*t.a+n.b*n.a*(1-t.a))/o,a:o})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,o=[this],r=360/e,s=1;s=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-zN*e:Math.round(i.h)+zN*e:n=t?Math.round(i.h)+zN*e:Math.round(i.h)-zN*e,n<0?n+=360:n>=360&&(n-=360),n}function zte(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-Vte*e:e===Xge?n=i.s+Vte:n=i.s+L8e*e,n>1&&(n=1),t&&e===Gge&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function Ute(i,e,t){var n;return t?n=i.v+E8e*e:n=i.v-D8e*e,n>1&&(n=1),Number(n.toFixed(2))}function j0(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=cC(i),o=Gge;o>0;o-=1){var r=Hte(n),s=UN(cC({h:$te(r,o,!0),s:zte(r,o,!0),v:Ute(r,o,!0)}));t.push(s)}t.push(UN(n));for(var a=1;a<=Xge;a+=1){var l=Hte(n),c=UN(cC({h:$te(l,a),s:zte(l,a),v:Ute(l,a)}));t.push(c)}return e.theme==="dark"?k8e.map(function(d){var u=d.index,h=d.opacity,f=UN(I8e(cC(e.backgroundColor||"#141414"),cC(t[u]),h*100));return f}):t}var J8={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},UR={},e6={};Object.keys(J8).forEach(function(i){UR[i]=j0(J8[i]),UR[i].primary=UR[i][5],e6[i]=j0(J8[i],{theme:"dark",backgroundColor:"#141414"}),e6[i].primary=e6[i][5]});var T8e=UR.blue;const N8e=i=>{const{controlHeight:e}=i;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};var R8e=N8e;function M8e(i){const{sizeUnit:e,sizeStep:t}=i;return{sizeXXL:e*(t+8),sizeXL:e*(t+4),sizeLG:e*(t+2),sizeMD:e*(t+1),sizeMS:e*t,size:e*t,sizeSM:e*(t-1),sizeXS:e*(t-2),sizeXXS:e*(t-3)}}const Yge={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},A8e=Object.assign(Object.assign({},Yge),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', -'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});var pD=A8e;function P8e(i,e){let{generateColorPalettes:t,generateNeutralColorPalettes:n}=e;const{colorSuccess:o,colorWarning:r,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:d}=i,u=t(l),h=t(o),f=t(r),g=t(s),p=t(a),v=n(c,d),m=i.colorLink||i.colorInfo,_=t(m);return Object.assign(Object.assign({},v),{colorPrimaryBg:u[1],colorPrimaryBgHover:u[2],colorPrimaryBorder:u[3],colorPrimaryBorderHover:u[4],colorPrimaryHover:u[5],colorPrimary:u[6],colorPrimaryActive:u[7],colorPrimaryTextHover:u[8],colorPrimaryText:u[9],colorPrimaryTextActive:u[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:p[1],colorInfoBgHover:p[2],colorInfoBorder:p[3],colorInfoBorderHover:p[4],colorInfoHover:p[4],colorInfo:p[6],colorInfoActive:p[7],colorInfoTextHover:p[8],colorInfoText:p[9],colorInfoTextActive:p[10],colorLinkHover:_[4],colorLink:_[6],colorLinkActive:_[7],colorBgMask:new na("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const O8e=i=>{let e=i,t=i,n=i,o=i;return i<6&&i>=5?e=i+1:i<16&&i>=6?e=i+2:i>=16&&(e=16),i<7&&i>=5?t=4:i<8&&i>=7?t=5:i<14&&i>=8?t=6:i<16&&i>=14?t=7:i>=16&&(t=8),i<6&&i>=2?n=1:i>=6&&(n=2),i>4&&i<8?o=4:i>=8&&(o=6),{borderRadius:i,borderRadiusXS:n,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:o}};var F8e=O8e;function B8e(i){const{motionUnit:e,motionBase:t,borderRadius:n,lineWidth:o}=i;return Object.assign({motionDurationFast:`${(t+e).toFixed(1)}s`,motionDurationMid:`${(t+e*2).toFixed(1)}s`,motionDurationSlow:`${(t+e*3).toFixed(1)}s`,lineWidthBold:o+1},F8e(n))}const qf=(i,e)=>new na(i).setAlpha(e).toRgbString(),xx=(i,e)=>new na(i).darken(e).toHexString(),W8e=i=>{const e=j0(i);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},V8e=(i,e)=>{const t=i||"#fff",n=e||"#000";return{colorBgBase:t,colorTextBase:n,colorText:qf(n,.88),colorTextSecondary:qf(n,.65),colorTextTertiary:qf(n,.45),colorTextQuaternary:qf(n,.25),colorFill:qf(n,.15),colorFillSecondary:qf(n,.06),colorFillTertiary:qf(n,.04),colorFillQuaternary:qf(n,.02),colorBgLayout:xx(t,4),colorBgContainer:xx(t,0),colorBgElevated:xx(t,0),colorBgSpotlight:qf(n,.85),colorBgBlur:"transparent",colorBorder:xx(t,15),colorBorderSecondary:xx(t,6)}};function jR(i){return(i+8)/i}function H8e(i){const e=new Array(10).fill(null).map((t,n)=>{const o=n-1,r=i*Math.pow(2.71828,o/5),s=n>1?Math.floor(r):Math.ceil(r);return Math.floor(s/2)*2});return e[1]=i,e.map(t=>({size:t,lineHeight:jR(t)}))}const $8e=i=>{const e=H8e(i),t=e.map(d=>d.size),n=e.map(d=>d.lineHeight),o=t[1],r=t[0],s=t[2],a=n[1],l=n[0],c=n[2];return{fontSizeSM:r,fontSize:o,fontSizeLG:s,fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:a,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(a*o),fontHeightLG:Math.round(c*s),fontHeightSM:Math.round(l*r),lineHeightHeading1:n[6],lineHeightHeading2:n[5],lineHeightHeading3:n[4],lineHeightHeading4:n[3],lineHeightHeading5:n[2]}};var z8e=$8e;function U8e(i){const e=Object.keys(Xge).map(t=>{const n=j0(i[t]);return new Array(10).fill(1).reduce((o,r,s)=>(o[`${t}-${s+1}`]=n[s],o[`${t}${s+1}`]=n[s],o),{})}).reduce((t,n)=>(t=Object.assign(Object.assign({},t),n),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),e),P8e(i,{generateColorPalettes:W8e,generateNeutralColorPalettes:V8e})),z8e(i.fontSize)),M8e(i)),R8e(i)),B8e(i))}const Yge=ZB(U8e),Zge={token:pD,override:{override:pD},hashed:!0},Qge=Bt.createContext(Zge),AK="anticon",j8e=(i,e)=>e||(i?`ant-${i}`:"ant"),Hi=x.exports.createContext({getPrefixCls:j8e,iconPrefixCls:AK}),K8e=`-ant-${Date.now()}-${Math.random()}`;function q8e(i,e){const t={},n=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},o=(s,a)=>{const l=new na(s),c=j0(l.toRgbString());t[`${a}-color`]=n(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){o(e.primaryColor,"primary");const s=new na(e.primaryColor),a=j0(s.toRgbString());a.forEach((c,d)=>{t[`primary-${d+1}`]=c}),t["primary-color-deprecated-l-35"]=n(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=n(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=n(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=n(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=n(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new na(a[0]);t["primary-color-active-deprecated-f-30"]=n(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=n(l,c=>c.darken(2))}return e.successColor&&o(e.successColor,"success"),e.warningColor&&o(e.warningColor,"warning"),e.errorColor&&o(e.errorColor,"error"),e.infoColor&&o(e.infoColor,"info"),` +'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});var pD=A8e;function P8e(i,e){let{generateColorPalettes:t,generateNeutralColorPalettes:n}=e;const{colorSuccess:o,colorWarning:r,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:d}=i,u=t(l),h=t(o),f=t(r),g=t(s),p=t(a),v=n(c,d),m=i.colorLink||i.colorInfo,_=t(m);return Object.assign(Object.assign({},v),{colorPrimaryBg:u[1],colorPrimaryBgHover:u[2],colorPrimaryBorder:u[3],colorPrimaryBorderHover:u[4],colorPrimaryHover:u[5],colorPrimary:u[6],colorPrimaryActive:u[7],colorPrimaryTextHover:u[8],colorPrimaryText:u[9],colorPrimaryTextActive:u[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:p[1],colorInfoBgHover:p[2],colorInfoBorder:p[3],colorInfoBorderHover:p[4],colorInfoHover:p[4],colorInfo:p[6],colorInfoActive:p[7],colorInfoTextHover:p[8],colorInfoText:p[9],colorInfoTextActive:p[10],colorLinkHover:_[4],colorLink:_[6],colorLinkActive:_[7],colorBgMask:new na("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const O8e=i=>{let e=i,t=i,n=i,o=i;return i<6&&i>=5?e=i+1:i<16&&i>=6?e=i+2:i>=16&&(e=16),i<7&&i>=5?t=4:i<8&&i>=7?t=5:i<14&&i>=8?t=6:i<16&&i>=14?t=7:i>=16&&(t=8),i<6&&i>=2?n=1:i>=6&&(n=2),i>4&&i<8?o=4:i>=8&&(o=6),{borderRadius:i,borderRadiusXS:n,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:o}};var F8e=O8e;function B8e(i){const{motionUnit:e,motionBase:t,borderRadius:n,lineWidth:o}=i;return Object.assign({motionDurationFast:`${(t+e).toFixed(1)}s`,motionDurationMid:`${(t+e*2).toFixed(1)}s`,motionDurationSlow:`${(t+e*3).toFixed(1)}s`,lineWidthBold:o+1},F8e(n))}const qf=(i,e)=>new na(i).setAlpha(e).toRgbString(),xx=(i,e)=>new na(i).darken(e).toHexString(),W8e=i=>{const e=j0(i);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},V8e=(i,e)=>{const t=i||"#fff",n=e||"#000";return{colorBgBase:t,colorTextBase:n,colorText:qf(n,.88),colorTextSecondary:qf(n,.65),colorTextTertiary:qf(n,.45),colorTextQuaternary:qf(n,.25),colorFill:qf(n,.15),colorFillSecondary:qf(n,.06),colorFillTertiary:qf(n,.04),colorFillQuaternary:qf(n,.02),colorBgLayout:xx(t,4),colorBgContainer:xx(t,0),colorBgElevated:xx(t,0),colorBgSpotlight:qf(n,.85),colorBgBlur:"transparent",colorBorder:xx(t,15),colorBorderSecondary:xx(t,6)}};function jR(i){return(i+8)/i}function H8e(i){const e=new Array(10).fill(null).map((t,n)=>{const o=n-1,r=i*Math.pow(2.71828,o/5),s=n>1?Math.floor(r):Math.ceil(r);return Math.floor(s/2)*2});return e[1]=i,e.map(t=>({size:t,lineHeight:jR(t)}))}const $8e=i=>{const e=H8e(i),t=e.map(d=>d.size),n=e.map(d=>d.lineHeight),o=t[1],r=t[0],s=t[2],a=n[1],l=n[0],c=n[2];return{fontSizeSM:r,fontSize:o,fontSizeLG:s,fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:a,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(a*o),fontHeightLG:Math.round(c*s),fontHeightSM:Math.round(l*r),lineHeightHeading1:n[6],lineHeightHeading2:n[5],lineHeightHeading3:n[4],lineHeightHeading4:n[3],lineHeightHeading5:n[2]}};var z8e=$8e;function U8e(i){const e=Object.keys(Yge).map(t=>{const n=j0(i[t]);return new Array(10).fill(1).reduce((o,r,s)=>(o[`${t}-${s+1}`]=n[s],o[`${t}${s+1}`]=n[s],o),{})}).reduce((t,n)=>(t=Object.assign(Object.assign({},t),n),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),e),P8e(i,{generateColorPalettes:W8e,generateNeutralColorPalettes:V8e})),z8e(i.fontSize)),M8e(i)),R8e(i)),B8e(i))}const Zge=QB(U8e),Qge={token:pD,override:{override:pD},hashed:!0},Jge=Bt.createContext(Qge),PK="anticon",j8e=(i,e)=>e||(i?`ant-${i}`:"ant"),Hi=x.exports.createContext({getPrefixCls:j8e,iconPrefixCls:PK}),K8e=`-ant-${Date.now()}-${Math.random()}`;function q8e(i,e){const t={},n=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},o=(s,a)=>{const l=new na(s),c=j0(l.toRgbString());t[`${a}-color`]=n(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){o(e.primaryColor,"primary");const s=new na(e.primaryColor),a=j0(s.toRgbString());a.forEach((c,d)=>{t[`primary-${d+1}`]=c}),t["primary-color-deprecated-l-35"]=n(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=n(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=n(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=n(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=n(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new na(a[0]);t["primary-color-active-deprecated-f-30"]=n(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=n(l,c=>c.darken(2))}return e.successColor&&o(e.successColor,"success"),e.warningColor&&o(e.warningColor,"warning"),e.errorColor&&o(e.errorColor,"error"),e.infoColor&&o(e.infoColor,"info"),` :root { ${Object.keys(t).map(s=>`--${i}-${s}: ${t[s]};`).join(` `)} } - `.trim()}function G8e(i,e){const t=q8e(i,e);Fa()&&pv(t,`${K8e}-dynamic-theme`)}const lW=x.exports.createContext(!1),PK=i=>{let{children:e,disabled:t}=i;const n=x.exports.useContext(lW);return x.exports.createElement(lW.Provider,{value:t!=null?t:n},e)};var dS=lW;const cW=x.exports.createContext(void 0),X8e=i=>{let{children:e,size:t}=i;const n=x.exports.useContext(cW);return x.exports.createElement(cW.Provider,{value:t||n},e)};var DI=cW;function Y8e(){const i=x.exports.useContext(dS),e=x.exports.useContext(DI);return{componentDisabled:i,componentSize:e}}const yA=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"];var Z8e="5.13.3";function e6(i){return i>=0&&i<=255}function jN(i,e){const{r:t,g:n,b:o,a:r}=new na(i).toRgb();if(r<1)return i;const{r:s,g:a,b:l}=new na(e).toRgb();for(let c=.01;c<=1;c+=.01){const d=Math.round((t-s*(1-c))/c),u=Math.round((n-a*(1-c))/c),h=Math.round((o-l*(1-c))/c);if(e6(d)&&e6(u)&&e6(h))return new na({r:d,g:u,b:h,a:Math.round(c*100)/100}).toRgbString()}return new na({r:t,g:n,b:o,a:1}).toRgbString()}var Q8e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{delete n[h]});const o=Object.assign(Object.assign({},t),n),r=480,s=576,a=768,l=992,c=1200,d=1600;if(o.motion===!1){const h="0s";o.motionDurationFast=h,o.motionDurationMid=h,o.motionDurationSlow=h}return Object.assign(Object.assign(Object.assign({},o),{colorFillContent:o.colorFillSecondary,colorFillContentHover:o.colorFill,colorFillAlter:o.colorFillQuaternary,colorBgContainerDisabled:o.colorFillTertiary,colorBorderBg:o.colorBgContainer,colorSplit:jN(o.colorBorderSecondary,o.colorBgContainer),colorTextPlaceholder:o.colorTextQuaternary,colorTextDisabled:o.colorTextQuaternary,colorTextHeading:o.colorText,colorTextLabel:o.colorTextSecondary,colorTextDescription:o.colorTextTertiary,colorTextLightSolid:o.colorWhite,colorHighlight:o.colorError,colorBgTextHover:o.colorFillSecondary,colorBgTextActive:o.colorFill,colorIcon:o.colorTextTertiary,colorIconHover:o.colorText,colorErrorOutline:jN(o.colorErrorBg,o.colorBgContainer),colorWarningOutline:jN(o.colorWarningBg,o.colorBgContainer),fontSizeIcon:o.fontSizeSM,lineWidthFocus:o.lineWidth*4,lineWidth:o.lineWidth,controlOutlineWidth:o.lineWidth*2,controlInteractiveSize:o.controlHeight/2,controlItemBgHover:o.colorFillTertiary,controlItemBgActive:o.colorPrimaryBg,controlItemBgActiveHover:o.colorPrimaryBgHover,controlItemBgActiveDisabled:o.colorFill,controlTmpOutline:o.colorFillQuaternary,controlOutline:jN(o.colorPrimaryBg,o.colorBgContainer),lineType:o.lineType,borderRadius:o.borderRadius,borderRadiusXS:o.borderRadiusXS,borderRadiusSM:o.borderRadiusSM,borderRadiusLG:o.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:o.sizeXXS,paddingXS:o.sizeXS,paddingSM:o.sizeSM,padding:o.size,paddingMD:o.sizeMD,paddingLG:o.sizeLG,paddingXL:o.sizeXL,paddingContentHorizontalLG:o.sizeLG,paddingContentVerticalLG:o.sizeMS,paddingContentHorizontal:o.sizeMS,paddingContentVertical:o.sizeSM,paddingContentHorizontalSM:o.size,paddingContentVerticalSM:o.sizeXS,marginXXS:o.sizeXXS,marginXS:o.sizeXS,marginSM:o.sizeSM,margin:o.size,marginMD:o.sizeMD,marginLG:o.sizeLG,marginXL:o.sizeXL,marginXXL:o.sizeXXL,boxShadow:` + `.trim()}function G8e(i,e){const t=q8e(i,e);Fa()&&mv(t,`${K8e}-dynamic-theme`)}const cW=x.exports.createContext(!1),OK=i=>{let{children:e,disabled:t}=i;const n=x.exports.useContext(cW);return x.exports.createElement(cW.Provider,{value:t!=null?t:n},e)};var dS=cW;const dW=x.exports.createContext(void 0),X8e=i=>{let{children:e,size:t}=i;const n=x.exports.useContext(dW);return x.exports.createElement(dW.Provider,{value:t||n},e)};var DI=dW;function Y8e(){const i=x.exports.useContext(dS),e=x.exports.useContext(DI);return{componentDisabled:i,componentSize:e}}const yA=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"];var Z8e="5.13.3";function t6(i){return i>=0&&i<=255}function jN(i,e){const{r:t,g:n,b:o,a:r}=new na(i).toRgb();if(r<1)return i;const{r:s,g:a,b:l}=new na(e).toRgb();for(let c=.01;c<=1;c+=.01){const d=Math.round((t-s*(1-c))/c),u=Math.round((n-a*(1-c))/c),h=Math.round((o-l*(1-c))/c);if(t6(d)&&t6(u)&&t6(h))return new na({r:d,g:u,b:h,a:Math.round(c*100)/100}).toRgbString()}return new na({r:t,g:n,b:o,a:1}).toRgbString()}var Q8e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{delete n[h]});const o=Object.assign(Object.assign({},t),n),r=480,s=576,a=768,l=992,c=1200,d=1600;if(o.motion===!1){const h="0s";o.motionDurationFast=h,o.motionDurationMid=h,o.motionDurationSlow=h}return Object.assign(Object.assign(Object.assign({},o),{colorFillContent:o.colorFillSecondary,colorFillContentHover:o.colorFill,colorFillAlter:o.colorFillQuaternary,colorBgContainerDisabled:o.colorFillTertiary,colorBorderBg:o.colorBgContainer,colorSplit:jN(o.colorBorderSecondary,o.colorBgContainer),colorTextPlaceholder:o.colorTextQuaternary,colorTextDisabled:o.colorTextQuaternary,colorTextHeading:o.colorText,colorTextLabel:o.colorTextSecondary,colorTextDescription:o.colorTextTertiary,colorTextLightSolid:o.colorWhite,colorHighlight:o.colorError,colorBgTextHover:o.colorFillSecondary,colorBgTextActive:o.colorFill,colorIcon:o.colorTextTertiary,colorIconHover:o.colorText,colorErrorOutline:jN(o.colorErrorBg,o.colorBgContainer),colorWarningOutline:jN(o.colorWarningBg,o.colorBgContainer),fontSizeIcon:o.fontSizeSM,lineWidthFocus:o.lineWidth*4,lineWidth:o.lineWidth,controlOutlineWidth:o.lineWidth*2,controlInteractiveSize:o.controlHeight/2,controlItemBgHover:o.colorFillTertiary,controlItemBgActive:o.colorPrimaryBg,controlItemBgActiveHover:o.colorPrimaryBgHover,controlItemBgActiveDisabled:o.colorFill,controlTmpOutline:o.colorFillQuaternary,controlOutline:jN(o.colorPrimaryBg,o.colorBgContainer),lineType:o.lineType,borderRadius:o.borderRadius,borderRadiusXS:o.borderRadiusXS,borderRadiusSM:o.borderRadiusSM,borderRadiusLG:o.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:o.sizeXXS,paddingXS:o.sizeXS,paddingSM:o.sizeSM,padding:o.size,paddingMD:o.sizeMD,paddingLG:o.sizeLG,paddingXL:o.sizeXL,paddingContentHorizontalLG:o.sizeLG,paddingContentVerticalLG:o.sizeMS,paddingContentHorizontal:o.sizeMS,paddingContentVertical:o.sizeSM,paddingContentHorizontalSM:o.size,paddingContentVerticalSM:o.sizeXS,marginXXS:o.sizeXXS,marginXS:o.sizeXS,marginSM:o.sizeSM,margin:o.size,marginMD:o.sizeMD,marginLG:o.sizeLG,marginXL:o.sizeXL,marginXXL:o.sizeXXL,boxShadow:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) @@ -109,8 +109,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -9px 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),n)}var Ute=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const n=t.getDerivativeToken(i),{override:o}=e,r=Ute(e,["override"]);let s=Object.assign(Object.assign({},n),{override:o});return s=Jge(s),r&&Object.entries(r).forEach(a=>{let[l,c]=a;const{theme:d}=c,u=Ute(c,["theme"]);let h=u;d&&(h=npe(Object.assign(Object.assign({},s),u),{override:u},d)),s[l]=h}),s};function Ba(){const{token:i,hashed:e,theme:t,override:n,cssVar:o}=Bt.useContext(Qge),r=`${Z8e}-${e||""}`,s=t||Yge,[a,l,c]=w3e(s,[pD,i],{salt:r,override:n,getComputedToken:npe,formatToken:Jge,cssVar:o&&{prefix:o.prefix,key:o.key,unitless:epe,ignore:tpe,preserve:J8e}});return[s,c,e?l:"",a,o]}function tl(i){var e=x.exports.useRef();e.current=i;var t=x.exports.useCallback(function(){for(var n,o=arguments.length,r=new Array(o),s=0;s1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,listStyle:"none",fontFamily:e?"inherit":i.fontFamily}},OK=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),ipe=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),e6e=i=>({a:{color:i.colorLink,textDecoration:i.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive},[`&:active, - &:hover`]:{textDecoration:i.linkHoverDecoration,outline:0},"&:focus":{textDecoration:i.linkFocusDecoration,outline:0},"&[disabled]":{color:i.colorTextDisabled,cursor:"not-allowed"}}}),t6e=(i,e)=>{const{fontFamily:t,fontSize:n}=i,o=`[class^="${e}"], [class*=" ${e}"]`;return{[o]:{fontFamily:t,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},FK=i=>({outline:`${rt(i.lineWidthFocus)} solid ${i.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),E4=i=>({"&:focus-visible":Object.assign({},FK(i))});let n6e=pa(function i(){ga(this,i)});var ope=n6e;function i6e(i,e,t){return e=gv(e),LK(i,b4()?Reflect.construct(e,t||[],gv(i).constructor):e.apply(i,t))}let o6e=function(i){fp(e,i);function e(t){var n;return ga(this,e),n=i6e(this,e),n.result=0,t instanceof e?n.result=t.result:typeof t=="number"&&(n.result=t),n}return pa(e,[{key:"add",value:function(n){return n instanceof e?this.result+=n.result:typeof n=="number"&&(this.result+=n),this}},{key:"sub",value:function(n){return n instanceof e?this.result-=n.result:typeof n=="number"&&(this.result-=n),this}},{key:"mul",value:function(n){return n instanceof e?this.result*=n.result:typeof n=="number"&&(this.result*=n),this}},{key:"div",value:function(n){return n instanceof e?this.result/=n.result:typeof n=="number"&&(this.result/=n),this}},{key:"equal",value:function(){return this.result}}]),e}(ope);function r6e(i,e,t){return e=gv(e),LK(i,b4()?Reflect.construct(e,t||[],gv(i).constructor):e.apply(i,t))}const rpe="CALC_UNIT";function n6(i){return typeof i=="number"?`${i}${rpe}`:i}let s6e=function(i){fp(e,i);function e(t){var n;return ga(this,e),n=r6e(this,e),n.result="",t instanceof e?n.result=`(${t.result})`:typeof t=="number"?n.result=n6(t):typeof t=="string"&&(n.result=t),n}return pa(e,[{key:"add",value:function(n){return n instanceof e?this.result=`${this.result} + ${n.getResult()}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} + ${n6(n)}`),this.lowPriority=!0,this}},{key:"sub",value:function(n){return n instanceof e?this.result=`${this.result} - ${n.getResult()}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} - ${n6(n)}`),this.lowPriority=!0,this}},{key:"mul",value:function(n){return this.lowPriority&&(this.result=`(${this.result})`),n instanceof e?this.result=`${this.result} * ${n.getResult(!0)}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} * ${n}`),this.lowPriority=!1,this}},{key:"div",value:function(n){return this.lowPriority&&(this.result=`(${this.result})`),n instanceof e?this.result=`${this.result} / ${n.getResult(!0)}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} / ${n}`),this.lowPriority=!1,this}},{key:"getResult",value:function(n){return this.lowPriority||n?`(${this.result})`:this.result}},{key:"equal",value:function(n){const{unit:o=!0}=n||{},r=new RegExp(`${rpe}`,"g");return this.result=this.result.replace(r,o?"px":""),typeof this.lowPriority!="undefined"?`calc(${this.result})`:this.result}}]),e}(ope);const a6e=i=>{const e=i==="css"?s6e:o6e;return t=>new e(t)};var l6e=a6e;function c6e(i){return i==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=new Array(e),n=0;nrt(o)).join(",")})`},min:function(){for(var e=arguments.length,t=new Array(e),n=0;nrt(o)).join(",")})`}}}const spe=typeof CSSINJS_STATISTIC!="undefined";let dW=!0;function lr(){for(var i=arguments.length,e=new Array(i),t=0;t{Object.keys(o).forEach(s=>{Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get:()=>o[s]})})}),dW=!0,n}const jte={};function d6e(){}const u6e=i=>{let e,t=i,n=d6e;return spe&&typeof Proxy!="undefined"&&(e=new Set,t=new Proxy(i,{get(o,r){return dW&&e.add(r),o[r]}}),n=(o,r)=>{var s;jte[o]={global:Array.from(e),component:Object.assign(Object.assign({},(s=jte[o])===null||s===void 0?void 0:s.component),r)}}),{token:t,keys:e,flush:n}},h6e=(i,e)=>{const[t,n]=Ba();return oW({theme:t,token:n,hashId:"",path:["ant-design-icons",i],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${i}`]:Object.assign(Object.assign({},OK()),{[`.${i} .${i}-icon`]:{display:"block"}})}])};var ape=h6e;const lpe=(i,e,t)=>{var n;return typeof t=="function"?t(lr(e,(n=e[i])!==null&&n!==void 0?n:{})):t!=null?t:{}},cpe=(i,e,t,n)=>{const o=Object.assign({},e[i]);if(n!=null&&n.deprecatedTokens){const{deprecatedTokens:s}=n;s.forEach(a=>{let[l,c]=a;var d;((o==null?void 0:o[l])||(o==null?void 0:o[c]))&&((d=o[c])!==null&&d!==void 0||(o[c]=o==null?void 0:o[l]))})}const r=Object.assign(Object.assign({},t),o);return Object.keys(r).forEach(s=>{r[s]===e[s]&&delete r[s]}),r},f6e=(i,e)=>`${[e,i.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-")}`;function BK(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Array.isArray(i)?i:[i,i],[r]=o,s=o.join("-");return a=>{const[l,c,d,u,h]=Ba(),{getPrefixCls:f,iconPrefixCls:g,csp:p}=x.exports.useContext(Hi),v=f(),m=h?"css":"js",_=l6e(m),{max:y,min:w}=c6e(m),L={theme:l,token:u,hashId:d,nonce:()=>p==null?void 0:p.nonce,clientOnly:n.clientOnly,order:n.order||-999};return oW(Object.assign(Object.assign({},L),{clientOnly:!1,path:["Shared",v]}),()=>[{"&":e6e(u)}]),ape(g,p),[oW(Object.assign(Object.assign({},L),{path:[s,a,g]}),()=>{if(n.injectStyle===!1)return[];const{token:E,flush:I}=u6e(u),k=lpe(r,c,t),R=`.${a}`,A=cpe(r,c,k,{deprecatedTokens:n.deprecatedTokens});h&&Object.keys(k).forEach(M=>{k[M]=`var(${Ege(M,f6e(r,h.prefix))})`});const P=lr(E,{componentCls:R,prefixCls:a,iconCls:`.${g}`,antCls:`.${v}`,calc:_,max:y,min:w},h?k:A),N=e(P,{hashId:d,prefixCls:a,rootPrefixCls:v,iconPrefixCls:g});return I(r,A),[n.resetStyle===!1?null:t6e(P,a),N]}),d]}}const WK=(i,e,t,n)=>{const o=BK(i,e,t,Object.assign({resetStyle:!1,order:-998},n));return s=>{let{prefixCls:a}=s;return o(a),null}},g6e=(i,e,t)=>{function n(c){return`${i}${c.slice(0,1).toUpperCase()}${c.slice(1)}`}const{unitless:o={},injectStyle:r=!0}=t!=null?t:{},s={[n("zIndexPopup")]:!0};Object.keys(o).forEach(c=>{s[n(c)]=o[c]});const a=c=>{let{rootCls:d,cssVar:u}=c;const[,h]=Ba();return Y3e({path:[i],prefix:u.prefix,key:u==null?void 0:u.key,unitless:Object.assign(Object.assign({},epe),s),ignore:tpe,token:h,scope:d},()=>{const f=lpe(i,h,e),g=cpe(i,h,f,{deprecatedTokens:t==null?void 0:t.deprecatedTokens});return Object.keys(f).forEach(p=>{g[n(p)]=g[p],delete g[p]}),g}),null};return c=>{const[,,,,d]=Ba();return[u=>r&&d?fn(ks,{children:[he(a,{rootCls:c,cssVar:d,component:i}),u]}):u,d==null?void 0:d.key]}},jc=(i,e,t,n)=>{const o=BK(i,e,t,n),r=g6e(Array.isArray(i)?i[0]:i,t,n);return function(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;const[,l]=o(s),[c,d]=r(a);return[c,l,d]}};function p6e(i,e){return yA.reduce((t,n)=>{const o=i[`${n}1`],r=i[`${n}3`],s=i[`${n}6`],a=i[`${n}7`];return Object.assign(Object.assign({},t),e(n,{lightColor:o,lightBorderColor:r,darkColor:s,textColor:a}))},{})}const m6e=Object.assign({},fI),{useId:Kte}=m6e,v6e=()=>"",_6e=typeof Kte=="undefined"?v6e:Kte;var b6e=_6e;function C6e(i,e){L4();const t=i||{},n=t.inherit===!1||!e?Zge:e,o=b6e();return LI(()=>{var r,s;if(!i)return e;const a=Object.assign({},n.components);Object.keys(i.components||{}).forEach(d=>{a[d]=Object.assign(Object.assign({},a[d]),i.components[d])});const l=`css-var-${o.replace(/:/g,"")}`,c=((r=t.cssVar)!==null&&r!==void 0?r:n.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:"ant"},typeof n.cssVar=="object"?n.cssVar:{}),typeof t.cssVar=="object"?t.cssVar:{}),{key:typeof t.cssVar=="object"&&((s=t.cssVar)===null||s===void 0?void 0:s.key)||l});return Object.assign(Object.assign(Object.assign({},n),t),{token:Object.assign(Object.assign({},n.token),t.token),components:a,cssVar:c})},[t,n],(r,s)=>r.some((a,l)=>{const c=s[l];return!y4(a,c,!0)}))}var y6e=["children"],dpe=x.exports.createContext({});function w6e(i){var e=i.children,t=Hn(i,y6e);return x.exports.createElement(dpe.Provider,{value:t},e)}var S6e=function(i){fp(t,i);var e=Ob(t);function t(){return ga(this,t),e.apply(this,arguments)}return pa(t,[{key:"render",value:function(){return this.props.children}}]),t}(x.exports.Component),N_="none",KN="appear",qN="enter",GN="leave",qte="none",mu="prepare",EC="start",DC="active",VK="end",upe="prepared";function Gte(i,e){var t={};return t[i.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(i)]="webkit".concat(e),t["Moz".concat(i)]="moz".concat(e),t["ms".concat(i)]="MS".concat(e),t["O".concat(i)]="o".concat(e.toLowerCase()),t}function x6e(i,e){var t={animationend:Gte("Animation","AnimationEnd"),transitionend:Gte("Transition","TransitionEnd")};return i&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var L6e=x6e(Fa(),typeof window!="undefined"?window:{}),hpe={};if(Fa()){var E6e=document.createElement("div");hpe=E6e.style}var XN={};function fpe(i){if(XN[i])return XN[i];var e=L6e[i];if(e)for(var t=Object.keys(e),n=t.length,o=0;o1&&arguments[1]!==void 0?arguments[1]:2;e();var r=Xi(function(){o<=1?n({isCanceled:function(){return r!==i.current}}):t(n,o-1)});i.current=r}return x.exports.useEffect(function(){return function(){e()}},[]),[t,e]},I6e=[mu,EC,DC,VK],T6e=[mu,upe],_pe=!1,N6e=!0;function bpe(i){return i===DC||i===VK}var R6e=function(i,e,t){var n=Um(qte),o=Ne(n,2),r=o[0],s=o[1],a=k6e(),l=Ne(a,2),c=l[0],d=l[1];function u(){s(mu,!0)}var h=e?T6e:I6e;return vpe(function(){if(r!==qte&&r!==VK){var f=h.indexOf(r),g=h[f+1],p=t(r);p===_pe?s(g,!0):g&&c(function(v){function m(){v.isCanceled()||s(g,!0)}p===!0?m():Promise.resolve(p).then(m)})}},[i,r]),x.exports.useEffect(function(){return function(){d()}},[]),[u,r]};function M6e(i,e,t,n){var o=n.motionEnter,r=o===void 0?!0:o,s=n.motionAppear,a=s===void 0?!0:s,l=n.motionLeave,c=l===void 0?!0:l,d=n.motionDeadline,u=n.motionLeaveImmediately,h=n.onAppearPrepare,f=n.onEnterPrepare,g=n.onLeavePrepare,p=n.onAppearStart,v=n.onEnterStart,m=n.onLeaveStart,_=n.onAppearActive,y=n.onEnterActive,w=n.onLeaveActive,L=n.onAppearEnd,D=n.onEnterEnd,E=n.onLeaveEnd,I=n.onVisibleChanged,k=Um(),R=Ne(k,2),A=R[0],P=R[1],N=Um(N_),M=Ne(N,2),H=M[0],B=M[1],F=Um(null),$=Ne(F,2),z=$[0],K=$[1],j=x.exports.useRef(!1),G=x.exports.useRef(null);function X(){return t()}var ue=x.exports.useRef(!1);function fe(){B(N_,!0),K(null,!0)}function pe(Ge){var re=X();if(!(Ge&&!Ge.deadline&&Ge.target!==re)){var ie=ue.current,se;H===KN&&ie?se=L==null?void 0:L(re,Ge):H===qN&&ie?se=D==null?void 0:D(re,Ge):H===GN&&ie&&(se=E==null?void 0:E(re,Ge)),H!==N_&&ie&&se!==!1&&fe()}}var be=D6e(pe),Se=Ne(be,1),Fe=Se[0],De=function(re){var ie,se,U;switch(re){case KN:return ie={},me(ie,mu,h),me(ie,EC,p),me(ie,DC,_),ie;case qN:return se={},me(se,mu,f),me(se,EC,v),me(se,DC,y),se;case GN:return U={},me(U,mu,g),me(U,EC,m),me(U,DC,w),U;default:return{}}},ce=x.exports.useMemo(function(){return De(H)},[H]),Pe=R6e(H,!i,function(Ge){if(Ge===mu){var re=ce[mu];return re?re(X()):_pe}if(Ee in ce){var ie;K(((ie=ce[Ee])===null||ie===void 0?void 0:ie.call(ce,X(),null))||null)}return Ee===DC&&(Fe(X()),d>0&&(clearTimeout(G.current),G.current=setTimeout(function(){pe({deadline:!0})},d))),Ee===upe&&fe(),N6e}),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=bpe(Ee);ue.current=tt,vpe(function(){P(e);var Ge=j.current;j.current=!0;var re;!Ge&&e&&a&&(re=KN),Ge&&e&&r&&(re=qN),(Ge&&!e&&c||!Ge&&u&&!e&&c)&&(re=GN);var ie=De(re);re&&(i||ie[mu])?(B(re),xe()):B(N_)},[e]),x.exports.useEffect(function(){(H===KN&&!a||H===qN&&!r||H===GN&&!c)&&B(N_)},[a,r,c]),x.exports.useEffect(function(){return function(){j.current=!1,clearTimeout(G.current)}},[]);var nt=x.exports.useRef(!1);x.exports.useEffect(function(){A&&(nt.current=!0),A!==void 0&&H===N_&&((nt.current||A)&&(I==null||I(A)),nt.current=!0)},[A,H]);var Qe=z;return ce[mu]&&Ee===EC&&(Qe=Ce({transition:"none"},Qe)),[H,Ee,Qe,A!=null?A:e]}function A6e(i){var e=i;qn(i)==="object"&&(e=i.transitionSupport);function t(o,r){return!!(o.motionName&&e&&r!==!1)}var n=x.exports.forwardRef(function(o,r){var s=o.visible,a=s===void 0?!0:s,l=o.removeOnLeave,c=l===void 0?!0:l,d=o.forceRender,u=o.children,h=o.motionName,f=o.leavedClassName,g=o.eventProps,p=x.exports.useContext(dpe),v=p.motion,m=t(o,v),_=x.exports.useRef(),y=x.exports.useRef();function w(){try{return _.current instanceof HTMLElement?_.current:tE(y.current)}catch{return null}}var L=M6e(m,a,w,o),D=Ne(L,4),E=D[0],I=D[1],k=D[2],R=D[3],A=x.exports.useRef(R);R&&(A.current=!0);var P=x.exports.useCallback(function(K){_.current=K,xK(r,K)},[r]),N,M=Ce(Ce({},g),{},{visible:a});if(!u)N=null;else if(E===N_)R?N=u(Ce({},M),P):!c&&A.current&&f?N=u(Ce(Ce({},M),{},{className:f}),P):d||!c&&!f?N=u(Ce(Ce({},M),{},{style:{display:"none"}}),P):N=null;else{var H,B;I===mu?B="prepare":bpe(I)?B="active":I===EC&&(B="start");var F=Zte(h,"".concat(E,"-").concat(B));N=u(Ce(Ce({},M),{},{className:Ue(Zte(h,E),(H={},me(H,F,F&&B),me(H,h,typeof h=="string"),H)),style:k}),P)}if(x.exports.isValidElement(N)&&Gv(N)){var $=N,z=$.ref;z||(N=x.exports.cloneElement(N,{ref:P}))}return x.exports.createElement(S6e,{ref:y},N)});return n.displayName="CSSMotion",n}var th=A6e(mpe),uW="add",hW="keep",fW="remove",i6="removed";function P6e(i){var e;return i&&qn(i)==="object"&&"key"in i?e=i:e={key:i},Ce(Ce({},e),{},{key:String(e.key)})}function gW(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return i.map(P6e)}function O6e(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],n=0,o=e.length,r=gW(i),s=gW(e);r.forEach(function(c){for(var d=!1,u=n;u1});return l.forEach(function(c){t=t.filter(function(d){var u=d.key,h=d.status;return u!==c||h!==fW}),t.forEach(function(d){d.key===c&&(d.status=hW)})}),t}var F6e=["component","children","onVisibleChanged","onAllRemoved"],B6e=["status"],W6e=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function V6e(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:th,t=function(n){fp(r,n);var o=Ob(r);function r(){var s;ga(this,r);for(var a=arguments.length,l=new Array(a),c=0;cnull,z6e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oe.endsWith("Color"))}const G6e=i=>{const{prefixCls:e,iconPrefixCls:t,theme:n,holderRender:o}=i;e!==void 0&&(SA=e),t!==void 0&&(ype=t),"holderRender"in i&&(Spe=o),n&&(q6e(n)?G8e(KR(),n):wpe=n)},HK=()=>({getPrefixCls:(i,e)=>e||(i?`${KR()}-${i}`:KR()),getIconPrefixCls:K6e,getRootPrefixCls:()=>SA||KR(),getTheme:()=>wpe,holderRender:Spe}),X6e=i=>{const{children:e,csp:t,autoInsertSpaceInButton:n,alert:o,anchor:r,form:s,locale:a,componentSize:l,direction:c,space:d,virtual:u,dropdownMatchSelectWidth:h,popupMatchSelectWidth:f,popupOverflow:g,legacyLocale:p,parentContext:v,iconPrefixCls:m,theme:_,componentDisabled:y,segmented:w,statistic:L,spin:D,calendar:E,carousel:I,cascader:k,collapse:R,typography:A,checkbox:P,descriptions:N,divider:M,drawer:H,skeleton:B,steps:F,image:$,layout:z,list:K,mentions:j,modal:G,progress:X,result:ue,slider:fe,breadcrumb:pe,menu:be,pagination:Se,input:Fe,empty:De,badge:ce,radio:Pe,rate:Oe,switch:xe,transfer:Ee,avatar:tt,message:nt,tag:Qe,table:Ge,card:re,tabs:ie,timeline:se,timePicker:U,upload:Y,notification:oe,tree:te,colorPicker:ye,datePicker:Le,rangePicker:Te,flex:We,wave:je,dropdown:mt,warning:Dt}=i,At=x.exports.useCallback((Pt,qt)=>{const{prefixCls:Nt}=i;if(qt)return qt;const jt=Nt||v.getPrefixCls("");return Pt?`${jt}-${Pt}`:jt},[v.getPrefixCls,i.prefixCls]),Je=m||v.iconPrefixCls||AK,Lt=t||v.csp;ape(Je,Lt);const Ot=C6e(_,v.theme),Vn={csp:Lt,autoInsertSpaceInButton:n,alert:o,anchor:r,locale:a||p,direction:c,space:d,virtual:u,popupMatchSelectWidth:f!=null?f:h,popupOverflow:g,getPrefixCls:At,iconPrefixCls:Je,theme:Ot,segmented:w,statistic:L,spin:D,calendar:E,carousel:I,cascader:k,collapse:R,typography:A,checkbox:P,descriptions:N,divider:M,drawer:H,skeleton:B,steps:F,image:$,input:Fe,layout:z,list:K,mentions:j,modal:G,progress:X,result:ue,slider:fe,breadcrumb:pe,menu:be,pagination:Se,empty:De,badge:ce,radio:Pe,rate:Oe,switch:xe,transfer:Ee,avatar:tt,message:nt,tag:Qe,table:Ge,card:re,tabs:ie,timeline:se,timePicker:U,upload:Y,notification:oe,tree:te,colorPicker:ye,datePicker:Le,rangePicker:Te,flex:We,wave:je,dropdown:mt,warning:Dt},Et=Object.assign({},v);Object.keys(Vn).forEach(Pt=>{Vn[Pt]!==void 0&&(Et[Pt]=Vn[Pt])}),U6e.forEach(Pt=>{const qt=i[Pt];qt&&(Et[Pt]=qt)});const tn=LI(()=>Et,Et,(Pt,qt)=>{const Nt=Object.keys(Pt),jt=Object.keys(qt);return Nt.length!==jt.length||Nt.some(Gt=>Pt[Gt]!==qt[Gt])}),di=x.exports.useMemo(()=>({prefixCls:Je,csp:Lt}),[Je,Lt]);let cn=x.exports.createElement(x.exports.Fragment,null,x.exports.createElement($6e,{dropdownMatchSelectWidth:h}),e);const Gn=x.exports.useMemo(()=>{var Pt,qt,Nt,jt;return LC(((Pt=mv.Form)===null||Pt===void 0?void 0:Pt.defaultValidateMessages)||{},((Nt=(qt=tn.locale)===null||qt===void 0?void 0:qt.Form)===null||Nt===void 0?void 0:Nt.defaultValidateMessages)||{},((jt=tn.form)===null||jt===void 0?void 0:jt.validateMessages)||{},(s==null?void 0:s.validateMessages)||{})},[tn,s==null?void 0:s.validateMessages]);Object.keys(Gn).length>0&&(cn=x.exports.createElement(zge.Provider,{value:Gn},cn)),a&&(cn=x.exports.createElement(f8e,{locale:a,_ANT_MARK__:u8e},cn)),(Je||Lt)&&(cn=x.exports.createElement(RK.Provider,{value:di},cn)),l&&(cn=x.exports.createElement(X8e,{size:l},cn)),cn=x.exports.createElement(H6e,null,cn);const bn=x.exports.useMemo(()=>{const Pt=Ot||{},{algorithm:qt,token:Nt,components:jt,cssVar:Gt}=Pt,It=z6e(Pt,["algorithm","token","components","cssVar"]),Ft=qt&&(!Array.isArray(qt)||qt.length>0)?ZB(qt):Yge,Ct={};Object.entries(jt||{}).forEach(wn=>{let[Dn,Xn]=wn;const jn=Object.assign({},Xn);"algorithm"in jn&&(jn.algorithm===!0?jn.theme=Ft:(Array.isArray(jn.algorithm)||typeof jn.algorithm=="function")&&(jn.theme=ZB(jn.algorithm)),delete jn.algorithm),Ct[Dn]=jn});const Zt=Object.assign(Object.assign({},pD),Nt);return Object.assign(Object.assign({},It),{theme:Ft,token:Zt,components:Ct,override:Object.assign({override:Zt},Ct),cssVar:Gt})},[Ot]);return _&&(cn=x.exports.createElement(Qge.Provider,{value:bn},cn)),tn.warning&&(cn=x.exports.createElement(n8e.Provider,{value:tn.warning},cn)),y!==void 0&&(cn=x.exports.createElement(PK,{disabled:y},cn)),x.exports.createElement(Hi.Provider,{value:tn},cn)},gp=i=>{const e=x.exports.useContext(Hi),t=x.exports.useContext(MK);return x.exports.createElement(X6e,Object.assign({parentContext:e,legacyLocale:t},i))};gp.ConfigContext=Hi;gp.SizeContext=DI;gp.config=G6e;gp.useConfig=Y8e;Object.defineProperty(gp,"SizeContext",{get:()=>DI});var Y6e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},Z6e=Y6e;function xpe(i){var e;return i==null||(e=i.getRootNode)===null||e===void 0?void 0:e.call(i)}function Q6e(i){return xpe(i)instanceof ShadowRoot}function xA(i){return Q6e(i)?xpe(i):null}function J6e(i){return i.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function e9e(i,e){rr(i,"[@ant-design/icons] ".concat(e))}function Qte(i){return qn(i)==="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(qn(i.icon)==="object"||typeof i.icon=="function")}function Jte(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(i).reduce(function(e,t){var n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:delete e[t],e[J6e(t)]=n}return e},{})}function pW(i,e,t){return t?Bt.createElement(i.tag,Ce(Ce({key:e},Jte(i.attrs)),t),(i.children||[]).map(function(n,o){return pW(n,"".concat(e,"-").concat(i.tag,"-").concat(o))})):Bt.createElement(i.tag,Ce({key:e},Jte(i.attrs)),(i.children||[]).map(function(n,o){return pW(n,"".concat(e,"-").concat(i.tag,"-").concat(o))}))}function Lpe(i){return j0(i)[0]}function Epe(i){return i?Array.isArray(i)?i:[i]:[]}var t9e=` + `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),n)}var jte=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const n=t.getDerivativeToken(i),{override:o}=e,r=jte(e,["override"]);let s=Object.assign(Object.assign({},n),{override:o});return s=epe(s),r&&Object.entries(r).forEach(a=>{let[l,c]=a;const{theme:d}=c,u=jte(c,["theme"]);let h=u;d&&(h=ipe(Object.assign(Object.assign({},s),u),{override:u},d)),s[l]=h}),s};function Ba(){const{token:i,hashed:e,theme:t,override:n,cssVar:o}=Bt.useContext(Jge),r=`${Z8e}-${e||""}`,s=t||Zge,[a,l,c]=w3e(s,[pD,i],{salt:r,override:n,getComputedToken:ipe,formatToken:epe,cssVar:o&&{prefix:o.prefix,key:o.key,unitless:tpe,ignore:npe,preserve:J8e}});return[s,c,e?l:"",a,o]}function tl(i){var e=x.exports.useRef();e.current=i;var t=x.exports.useCallback(function(){for(var n,o=arguments.length,r=new Array(o),s=0;s1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,listStyle:"none",fontFamily:e?"inherit":i.fontFamily}},FK=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),ope=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),e6e=i=>({a:{color:i.colorLink,textDecoration:i.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive},[`&:active, + &:hover`]:{textDecoration:i.linkHoverDecoration,outline:0},"&:focus":{textDecoration:i.linkFocusDecoration,outline:0},"&[disabled]":{color:i.colorTextDisabled,cursor:"not-allowed"}}}),t6e=(i,e)=>{const{fontFamily:t,fontSize:n}=i,o=`[class^="${e}"], [class*=" ${e}"]`;return{[o]:{fontFamily:t,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},BK=i=>({outline:`${rt(i.lineWidthFocus)} solid ${i.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),E4=i=>({"&:focus-visible":Object.assign({},BK(i))});let n6e=pa(function i(){ga(this,i)});var rpe=n6e;function i6e(i,e,t){return e=pv(e),EK(i,b4()?Reflect.construct(e,t||[],pv(i).constructor):e.apply(i,t))}let o6e=function(i){gp(e,i);function e(t){var n;return ga(this,e),n=i6e(this,e),n.result=0,t instanceof e?n.result=t.result:typeof t=="number"&&(n.result=t),n}return pa(e,[{key:"add",value:function(n){return n instanceof e?this.result+=n.result:typeof n=="number"&&(this.result+=n),this}},{key:"sub",value:function(n){return n instanceof e?this.result-=n.result:typeof n=="number"&&(this.result-=n),this}},{key:"mul",value:function(n){return n instanceof e?this.result*=n.result:typeof n=="number"&&(this.result*=n),this}},{key:"div",value:function(n){return n instanceof e?this.result/=n.result:typeof n=="number"&&(this.result/=n),this}},{key:"equal",value:function(){return this.result}}]),e}(rpe);function r6e(i,e,t){return e=pv(e),EK(i,b4()?Reflect.construct(e,t||[],pv(i).constructor):e.apply(i,t))}const spe="CALC_UNIT";function i6(i){return typeof i=="number"?`${i}${spe}`:i}let s6e=function(i){gp(e,i);function e(t){var n;return ga(this,e),n=r6e(this,e),n.result="",t instanceof e?n.result=`(${t.result})`:typeof t=="number"?n.result=i6(t):typeof t=="string"&&(n.result=t),n}return pa(e,[{key:"add",value:function(n){return n instanceof e?this.result=`${this.result} + ${n.getResult()}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} + ${i6(n)}`),this.lowPriority=!0,this}},{key:"sub",value:function(n){return n instanceof e?this.result=`${this.result} - ${n.getResult()}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} - ${i6(n)}`),this.lowPriority=!0,this}},{key:"mul",value:function(n){return this.lowPriority&&(this.result=`(${this.result})`),n instanceof e?this.result=`${this.result} * ${n.getResult(!0)}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} * ${n}`),this.lowPriority=!1,this}},{key:"div",value:function(n){return this.lowPriority&&(this.result=`(${this.result})`),n instanceof e?this.result=`${this.result} / ${n.getResult(!0)}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} / ${n}`),this.lowPriority=!1,this}},{key:"getResult",value:function(n){return this.lowPriority||n?`(${this.result})`:this.result}},{key:"equal",value:function(n){const{unit:o=!0}=n||{},r=new RegExp(`${spe}`,"g");return this.result=this.result.replace(r,o?"px":""),typeof this.lowPriority!="undefined"?`calc(${this.result})`:this.result}}]),e}(rpe);const a6e=i=>{const e=i==="css"?s6e:o6e;return t=>new e(t)};var l6e=a6e;function c6e(i){return i==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=new Array(e),n=0;nrt(o)).join(",")})`},min:function(){for(var e=arguments.length,t=new Array(e),n=0;nrt(o)).join(",")})`}}}const ape=typeof CSSINJS_STATISTIC!="undefined";let uW=!0;function lr(){for(var i=arguments.length,e=new Array(i),t=0;t{Object.keys(o).forEach(s=>{Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get:()=>o[s]})})}),uW=!0,n}const Kte={};function d6e(){}const u6e=i=>{let e,t=i,n=d6e;return ape&&typeof Proxy!="undefined"&&(e=new Set,t=new Proxy(i,{get(o,r){return uW&&e.add(r),o[r]}}),n=(o,r)=>{var s;Kte[o]={global:Array.from(e),component:Object.assign(Object.assign({},(s=Kte[o])===null||s===void 0?void 0:s.component),r)}}),{token:t,keys:e,flush:n}},h6e=(i,e)=>{const[t,n]=Ba();return rW({theme:t,token:n,hashId:"",path:["ant-design-icons",i],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${i}`]:Object.assign(Object.assign({},FK()),{[`.${i} .${i}-icon`]:{display:"block"}})}])};var lpe=h6e;const cpe=(i,e,t)=>{var n;return typeof t=="function"?t(lr(e,(n=e[i])!==null&&n!==void 0?n:{})):t!=null?t:{}},dpe=(i,e,t,n)=>{const o=Object.assign({},e[i]);if(n!=null&&n.deprecatedTokens){const{deprecatedTokens:s}=n;s.forEach(a=>{let[l,c]=a;var d;((o==null?void 0:o[l])||(o==null?void 0:o[c]))&&((d=o[c])!==null&&d!==void 0||(o[c]=o==null?void 0:o[l]))})}const r=Object.assign(Object.assign({},t),o);return Object.keys(r).forEach(s=>{r[s]===e[s]&&delete r[s]}),r},f6e=(i,e)=>`${[e,i.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-")}`;function WK(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Array.isArray(i)?i:[i,i],[r]=o,s=o.join("-");return a=>{const[l,c,d,u,h]=Ba(),{getPrefixCls:f,iconPrefixCls:g,csp:p}=x.exports.useContext(Hi),v=f(),m=h?"css":"js",_=l6e(m),{max:y,min:w}=c6e(m),L={theme:l,token:u,hashId:d,nonce:()=>p==null?void 0:p.nonce,clientOnly:n.clientOnly,order:n.order||-999};return rW(Object.assign(Object.assign({},L),{clientOnly:!1,path:["Shared",v]}),()=>[{"&":e6e(u)}]),lpe(g,p),[rW(Object.assign(Object.assign({},L),{path:[s,a,g]}),()=>{if(n.injectStyle===!1)return[];const{token:E,flush:I}=u6e(u),k=cpe(r,c,t),R=`.${a}`,A=dpe(r,c,k,{deprecatedTokens:n.deprecatedTokens});h&&Object.keys(k).forEach(M=>{k[M]=`var(${Dge(M,f6e(r,h.prefix))})`});const P=lr(E,{componentCls:R,prefixCls:a,iconCls:`.${g}`,antCls:`.${v}`,calc:_,max:y,min:w},h?k:A),N=e(P,{hashId:d,prefixCls:a,rootPrefixCls:v,iconPrefixCls:g});return I(r,A),[n.resetStyle===!1?null:t6e(P,a),N]}),d]}}const VK=(i,e,t,n)=>{const o=WK(i,e,t,Object.assign({resetStyle:!1,order:-998},n));return s=>{let{prefixCls:a}=s;return o(a),null}},g6e=(i,e,t)=>{function n(c){return`${i}${c.slice(0,1).toUpperCase()}${c.slice(1)}`}const{unitless:o={},injectStyle:r=!0}=t!=null?t:{},s={[n("zIndexPopup")]:!0};Object.keys(o).forEach(c=>{s[n(c)]=o[c]});const a=c=>{let{rootCls:d,cssVar:u}=c;const[,h]=Ba();return Y3e({path:[i],prefix:u.prefix,key:u==null?void 0:u.key,unitless:Object.assign(Object.assign({},tpe),s),ignore:npe,token:h,scope:d},()=>{const f=cpe(i,h,e),g=dpe(i,h,f,{deprecatedTokens:t==null?void 0:t.deprecatedTokens});return Object.keys(f).forEach(p=>{g[n(p)]=g[p],delete g[p]}),g}),null};return c=>{const[,,,,d]=Ba();return[u=>r&&d?fn(ks,{children:[he(a,{rootCls:c,cssVar:d,component:i}),u]}):u,d==null?void 0:d.key]}},jc=(i,e,t,n)=>{const o=WK(i,e,t,n),r=g6e(Array.isArray(i)?i[0]:i,t,n);return function(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;const[,l]=o(s),[c,d]=r(a);return[c,l,d]}};function p6e(i,e){return yA.reduce((t,n)=>{const o=i[`${n}1`],r=i[`${n}3`],s=i[`${n}6`],a=i[`${n}7`];return Object.assign(Object.assign({},t),e(n,{lightColor:o,lightBorderColor:r,darkColor:s,textColor:a}))},{})}const m6e=Object.assign({},fI),{useId:qte}=m6e,v6e=()=>"",_6e=typeof qte=="undefined"?v6e:qte;var b6e=_6e;function C6e(i,e){L4();const t=i||{},n=t.inherit===!1||!e?Qge:e,o=b6e();return LI(()=>{var r,s;if(!i)return e;const a=Object.assign({},n.components);Object.keys(i.components||{}).forEach(d=>{a[d]=Object.assign(Object.assign({},a[d]),i.components[d])});const l=`css-var-${o.replace(/:/g,"")}`,c=((r=t.cssVar)!==null&&r!==void 0?r:n.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:"ant"},typeof n.cssVar=="object"?n.cssVar:{}),typeof t.cssVar=="object"?t.cssVar:{}),{key:typeof t.cssVar=="object"&&((s=t.cssVar)===null||s===void 0?void 0:s.key)||l});return Object.assign(Object.assign(Object.assign({},n),t),{token:Object.assign(Object.assign({},n.token),t.token),components:a,cssVar:c})},[t,n],(r,s)=>r.some((a,l)=>{const c=s[l];return!y4(a,c,!0)}))}var y6e=["children"],upe=x.exports.createContext({});function w6e(i){var e=i.children,t=Hn(i,y6e);return x.exports.createElement(upe.Provider,{value:t},e)}var S6e=function(i){gp(t,i);var e=Ob(t);function t(){return ga(this,t),e.apply(this,arguments)}return pa(t,[{key:"render",value:function(){return this.props.children}}]),t}(x.exports.Component),N_="none",KN="appear",qN="enter",GN="leave",Gte="none",mu="prepare",EC="start",DC="active",HK="end",hpe="prepared";function Xte(i,e){var t={};return t[i.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(i)]="webkit".concat(e),t["Moz".concat(i)]="moz".concat(e),t["ms".concat(i)]="MS".concat(e),t["O".concat(i)]="o".concat(e.toLowerCase()),t}function x6e(i,e){var t={animationend:Xte("Animation","AnimationEnd"),transitionend:Xte("Transition","TransitionEnd")};return i&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var L6e=x6e(Fa(),typeof window!="undefined"?window:{}),fpe={};if(Fa()){var E6e=document.createElement("div");fpe=E6e.style}var XN={};function gpe(i){if(XN[i])return XN[i];var e=L6e[i];if(e)for(var t=Object.keys(e),n=t.length,o=0;o1&&arguments[1]!==void 0?arguments[1]:2;e();var r=Xi(function(){o<=1?n({isCanceled:function(){return r!==i.current}}):t(n,o-1)});i.current=r}return x.exports.useEffect(function(){return function(){e()}},[]),[t,e]},I6e=[mu,EC,DC,HK],T6e=[mu,hpe],bpe=!1,N6e=!0;function Cpe(i){return i===DC||i===HK}var R6e=function(i,e,t){var n=jm(Gte),o=Ne(n,2),r=o[0],s=o[1],a=k6e(),l=Ne(a,2),c=l[0],d=l[1];function u(){s(mu,!0)}var h=e?T6e:I6e;return _pe(function(){if(r!==Gte&&r!==HK){var f=h.indexOf(r),g=h[f+1],p=t(r);p===bpe?s(g,!0):g&&c(function(v){function m(){v.isCanceled()||s(g,!0)}p===!0?m():Promise.resolve(p).then(m)})}},[i,r]),x.exports.useEffect(function(){return function(){d()}},[]),[u,r]};function M6e(i,e,t,n){var o=n.motionEnter,r=o===void 0?!0:o,s=n.motionAppear,a=s===void 0?!0:s,l=n.motionLeave,c=l===void 0?!0:l,d=n.motionDeadline,u=n.motionLeaveImmediately,h=n.onAppearPrepare,f=n.onEnterPrepare,g=n.onLeavePrepare,p=n.onAppearStart,v=n.onEnterStart,m=n.onLeaveStart,_=n.onAppearActive,y=n.onEnterActive,w=n.onLeaveActive,L=n.onAppearEnd,D=n.onEnterEnd,E=n.onLeaveEnd,I=n.onVisibleChanged,k=jm(),R=Ne(k,2),A=R[0],P=R[1],N=jm(N_),M=Ne(N,2),H=M[0],B=M[1],F=jm(null),$=Ne(F,2),z=$[0],K=$[1],j=x.exports.useRef(!1),G=x.exports.useRef(null);function X(){return t()}var ue=x.exports.useRef(!1);function fe(){B(N_,!0),K(null,!0)}function pe(Ge){var re=X();if(!(Ge&&!Ge.deadline&&Ge.target!==re)){var ie=ue.current,se;H===KN&&ie?se=L==null?void 0:L(re,Ge):H===qN&&ie?se=D==null?void 0:D(re,Ge):H===GN&&ie&&(se=E==null?void 0:E(re,Ge)),H!==N_&&ie&&se!==!1&&fe()}}var be=D6e(pe),Se=Ne(be,1),Fe=Se[0],De=function(re){var ie,se,U;switch(re){case KN:return ie={},me(ie,mu,h),me(ie,EC,p),me(ie,DC,_),ie;case qN:return se={},me(se,mu,f),me(se,EC,v),me(se,DC,y),se;case GN:return U={},me(U,mu,g),me(U,EC,m),me(U,DC,w),U;default:return{}}},ce=x.exports.useMemo(function(){return De(H)},[H]),Pe=R6e(H,!i,function(Ge){if(Ge===mu){var re=ce[mu];return re?re(X()):bpe}if(Ee in ce){var ie;K(((ie=ce[Ee])===null||ie===void 0?void 0:ie.call(ce,X(),null))||null)}return Ee===DC&&(Fe(X()),d>0&&(clearTimeout(G.current),G.current=setTimeout(function(){pe({deadline:!0})},d))),Ee===hpe&&fe(),N6e}),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=Cpe(Ee);ue.current=tt,_pe(function(){P(e);var Ge=j.current;j.current=!0;var re;!Ge&&e&&a&&(re=KN),Ge&&e&&r&&(re=qN),(Ge&&!e&&c||!Ge&&u&&!e&&c)&&(re=GN);var ie=De(re);re&&(i||ie[mu])?(B(re),xe()):B(N_)},[e]),x.exports.useEffect(function(){(H===KN&&!a||H===qN&&!r||H===GN&&!c)&&B(N_)},[a,r,c]),x.exports.useEffect(function(){return function(){j.current=!1,clearTimeout(G.current)}},[]);var nt=x.exports.useRef(!1);x.exports.useEffect(function(){A&&(nt.current=!0),A!==void 0&&H===N_&&((nt.current||A)&&(I==null||I(A)),nt.current=!0)},[A,H]);var Qe=z;return ce[mu]&&Ee===EC&&(Qe=Ce({transition:"none"},Qe)),[H,Ee,Qe,A!=null?A:e]}function A6e(i){var e=i;qn(i)==="object"&&(e=i.transitionSupport);function t(o,r){return!!(o.motionName&&e&&r!==!1)}var n=x.exports.forwardRef(function(o,r){var s=o.visible,a=s===void 0?!0:s,l=o.removeOnLeave,c=l===void 0?!0:l,d=o.forceRender,u=o.children,h=o.motionName,f=o.leavedClassName,g=o.eventProps,p=x.exports.useContext(upe),v=p.motion,m=t(o,v),_=x.exports.useRef(),y=x.exports.useRef();function w(){try{return _.current instanceof HTMLElement?_.current:tE(y.current)}catch{return null}}var L=M6e(m,a,w,o),D=Ne(L,4),E=D[0],I=D[1],k=D[2],R=D[3],A=x.exports.useRef(R);R&&(A.current=!0);var P=x.exports.useCallback(function(K){_.current=K,LK(r,K)},[r]),N,M=Ce(Ce({},g),{},{visible:a});if(!u)N=null;else if(E===N_)R?N=u(Ce({},M),P):!c&&A.current&&f?N=u(Ce(Ce({},M),{},{className:f}),P):d||!c&&!f?N=u(Ce(Ce({},M),{},{style:{display:"none"}}),P):N=null;else{var H,B;I===mu?B="prepare":Cpe(I)?B="active":I===EC&&(B="start");var F=Qte(h,"".concat(E,"-").concat(B));N=u(Ce(Ce({},M),{},{className:Ue(Qte(h,E),(H={},me(H,F,F&&B),me(H,h,typeof h=="string"),H)),style:k}),P)}if(x.exports.isValidElement(N)&&Gv(N)){var $=N,z=$.ref;z||(N=x.exports.cloneElement(N,{ref:P}))}return x.exports.createElement(S6e,{ref:y},N)});return n.displayName="CSSMotion",n}var th=A6e(vpe),hW="add",fW="keep",gW="remove",o6="removed";function P6e(i){var e;return i&&qn(i)==="object"&&"key"in i?e=i:e={key:i},Ce(Ce({},e),{},{key:String(e.key)})}function pW(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return i.map(P6e)}function O6e(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],n=0,o=e.length,r=pW(i),s=pW(e);r.forEach(function(c){for(var d=!1,u=n;u1});return l.forEach(function(c){t=t.filter(function(d){var u=d.key,h=d.status;return u!==c||h!==gW}),t.forEach(function(d){d.key===c&&(d.status=fW)})}),t}var F6e=["component","children","onVisibleChanged","onAllRemoved"],B6e=["status"],W6e=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function V6e(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:th,t=function(n){gp(r,n);var o=Ob(r);function r(){var s;ga(this,r);for(var a=arguments.length,l=new Array(a),c=0;cnull,z6e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oe.endsWith("Color"))}const G6e=i=>{const{prefixCls:e,iconPrefixCls:t,theme:n,holderRender:o}=i;e!==void 0&&(SA=e),t!==void 0&&(wpe=t),"holderRender"in i&&(xpe=o),n&&(q6e(n)?G8e(KR(),n):Spe=n)},$K=()=>({getPrefixCls:(i,e)=>e||(i?`${KR()}-${i}`:KR()),getIconPrefixCls:K6e,getRootPrefixCls:()=>SA||KR(),getTheme:()=>Spe,holderRender:xpe}),X6e=i=>{const{children:e,csp:t,autoInsertSpaceInButton:n,alert:o,anchor:r,form:s,locale:a,componentSize:l,direction:c,space:d,virtual:u,dropdownMatchSelectWidth:h,popupMatchSelectWidth:f,popupOverflow:g,legacyLocale:p,parentContext:v,iconPrefixCls:m,theme:_,componentDisabled:y,segmented:w,statistic:L,spin:D,calendar:E,carousel:I,cascader:k,collapse:R,typography:A,checkbox:P,descriptions:N,divider:M,drawer:H,skeleton:B,steps:F,image:$,layout:z,list:K,mentions:j,modal:G,progress:X,result:ue,slider:fe,breadcrumb:pe,menu:be,pagination:Se,input:Fe,empty:De,badge:ce,radio:Pe,rate:Oe,switch:xe,transfer:Ee,avatar:tt,message:nt,tag:Qe,table:Ge,card:re,tabs:ie,timeline:se,timePicker:U,upload:Y,notification:oe,tree:te,colorPicker:ye,datePicker:Le,rangePicker:Te,flex:We,wave:je,dropdown:mt,warning:Dt}=i,At=x.exports.useCallback((Pt,qt)=>{const{prefixCls:Nt}=i;if(qt)return qt;const jt=Nt||v.getPrefixCls("");return Pt?`${jt}-${Pt}`:jt},[v.getPrefixCls,i.prefixCls]),Je=m||v.iconPrefixCls||PK,Lt=t||v.csp;lpe(Je,Lt);const Ot=C6e(_,v.theme),Vn={csp:Lt,autoInsertSpaceInButton:n,alert:o,anchor:r,locale:a||p,direction:c,space:d,virtual:u,popupMatchSelectWidth:f!=null?f:h,popupOverflow:g,getPrefixCls:At,iconPrefixCls:Je,theme:Ot,segmented:w,statistic:L,spin:D,calendar:E,carousel:I,cascader:k,collapse:R,typography:A,checkbox:P,descriptions:N,divider:M,drawer:H,skeleton:B,steps:F,image:$,input:Fe,layout:z,list:K,mentions:j,modal:G,progress:X,result:ue,slider:fe,breadcrumb:pe,menu:be,pagination:Se,empty:De,badge:ce,radio:Pe,rate:Oe,switch:xe,transfer:Ee,avatar:tt,message:nt,tag:Qe,table:Ge,card:re,tabs:ie,timeline:se,timePicker:U,upload:Y,notification:oe,tree:te,colorPicker:ye,datePicker:Le,rangePicker:Te,flex:We,wave:je,dropdown:mt,warning:Dt},Et=Object.assign({},v);Object.keys(Vn).forEach(Pt=>{Vn[Pt]!==void 0&&(Et[Pt]=Vn[Pt])}),U6e.forEach(Pt=>{const qt=i[Pt];qt&&(Et[Pt]=qt)});const tn=LI(()=>Et,Et,(Pt,qt)=>{const Nt=Object.keys(Pt),jt=Object.keys(qt);return Nt.length!==jt.length||Nt.some(Gt=>Pt[Gt]!==qt[Gt])}),di=x.exports.useMemo(()=>({prefixCls:Je,csp:Lt}),[Je,Lt]);let cn=x.exports.createElement(x.exports.Fragment,null,x.exports.createElement($6e,{dropdownMatchSelectWidth:h}),e);const Gn=x.exports.useMemo(()=>{var Pt,qt,Nt,jt;return LC(((Pt=vv.Form)===null||Pt===void 0?void 0:Pt.defaultValidateMessages)||{},((Nt=(qt=tn.locale)===null||qt===void 0?void 0:qt.Form)===null||Nt===void 0?void 0:Nt.defaultValidateMessages)||{},((jt=tn.form)===null||jt===void 0?void 0:jt.validateMessages)||{},(s==null?void 0:s.validateMessages)||{})},[tn,s==null?void 0:s.validateMessages]);Object.keys(Gn).length>0&&(cn=x.exports.createElement(Uge.Provider,{value:Gn},cn)),a&&(cn=x.exports.createElement(f8e,{locale:a,_ANT_MARK__:u8e},cn)),(Je||Lt)&&(cn=x.exports.createElement(MK.Provider,{value:di},cn)),l&&(cn=x.exports.createElement(X8e,{size:l},cn)),cn=x.exports.createElement(H6e,null,cn);const bn=x.exports.useMemo(()=>{const Pt=Ot||{},{algorithm:qt,token:Nt,components:jt,cssVar:Gt}=Pt,It=z6e(Pt,["algorithm","token","components","cssVar"]),Ft=qt&&(!Array.isArray(qt)||qt.length>0)?QB(qt):Zge,Ct={};Object.entries(jt||{}).forEach(wn=>{let[Dn,Xn]=wn;const jn=Object.assign({},Xn);"algorithm"in jn&&(jn.algorithm===!0?jn.theme=Ft:(Array.isArray(jn.algorithm)||typeof jn.algorithm=="function")&&(jn.theme=QB(jn.algorithm)),delete jn.algorithm),Ct[Dn]=jn});const Zt=Object.assign(Object.assign({},pD),Nt);return Object.assign(Object.assign({},It),{theme:Ft,token:Zt,components:Ct,override:Object.assign({override:Zt},Ct),cssVar:Gt})},[Ot]);return _&&(cn=x.exports.createElement(Jge.Provider,{value:bn},cn)),tn.warning&&(cn=x.exports.createElement(n8e.Provider,{value:tn.warning},cn)),y!==void 0&&(cn=x.exports.createElement(OK,{disabled:y},cn)),x.exports.createElement(Hi.Provider,{value:tn},cn)},pp=i=>{const e=x.exports.useContext(Hi),t=x.exports.useContext(AK);return x.exports.createElement(X6e,Object.assign({parentContext:e,legacyLocale:t},i))};pp.ConfigContext=Hi;pp.SizeContext=DI;pp.config=G6e;pp.useConfig=Y8e;Object.defineProperty(pp,"SizeContext",{get:()=>DI});var Y6e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},Z6e=Y6e;function Lpe(i){var e;return i==null||(e=i.getRootNode)===null||e===void 0?void 0:e.call(i)}function Q6e(i){return Lpe(i)instanceof ShadowRoot}function xA(i){return Q6e(i)?Lpe(i):null}function J6e(i){return i.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function e9e(i,e){rr(i,"[@ant-design/icons] ".concat(e))}function Jte(i){return qn(i)==="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(qn(i.icon)==="object"||typeof i.icon=="function")}function ene(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(i).reduce(function(e,t){var n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:delete e[t],e[J6e(t)]=n}return e},{})}function mW(i,e,t){return t?Bt.createElement(i.tag,Ce(Ce({key:e},ene(i.attrs)),t),(i.children||[]).map(function(n,o){return mW(n,"".concat(e,"-").concat(i.tag,"-").concat(o))})):Bt.createElement(i.tag,Ce({key:e},ene(i.attrs)),(i.children||[]).map(function(n,o){return mW(n,"".concat(e,"-").concat(i.tag,"-").concat(o))}))}function Epe(i){return j0(i)[0]}function Dpe(i){return i?Array.isArray(i)?i:[i]:[]}var t9e=` .anticon { display: inline-block; color: inherit; @@ -164,7 +164,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho transform: rotate(360deg); } } -`,n9e=function(e){var t=x.exports.useContext(RK),n=t.csp,o=t.prefixCls,r=t9e;o&&(r=r.replace(/anticon/g,o)),x.exports.useEffect(function(){var s=e.current,a=xA(s);pv(r,"@ant-design-icons",{prepend:!0,csp:n,attachTo:a})},[])},i9e=["icon","className","onClick","style","primaryColor","secondaryColor"],oE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function o9e(i){var e=i.primaryColor,t=i.secondaryColor;oE.primaryColor=e,oE.secondaryColor=t||Lpe(e),oE.calculated=!!t}function r9e(){return Ce({},oE)}var D4=function(e){var t=e.icon,n=e.className,o=e.onClick,r=e.style,s=e.primaryColor,a=e.secondaryColor,l=Hn(e,i9e),c=x.exports.useRef(),d=oE;if(s&&(d={primaryColor:s,secondaryColor:a||Lpe(s)}),n9e(c),e9e(Qte(t),"icon should be icon definiton, but got ".concat(t)),!Qte(t))return null;var u=t;return u&&typeof u.icon=="function"&&(u=Ce(Ce({},u),{},{icon:u.icon(d.primaryColor,d.secondaryColor)})),pW(u.icon,"svg-".concat(u.name),Ce(Ce({className:n,onClick:o,style:r,"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};D4.displayName="IconReact";D4.getTwoToneColors=r9e;D4.setTwoToneColors=o9e;var $K=D4;function Dpe(i){var e=Epe(i),t=Ne(e,2),n=t[0],o=t[1];return $K.setTwoToneColors({primaryColor:n,secondaryColor:o})}function s9e(){var i=$K.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var a9e=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Dpe(T8e.primary);var k4=x.exports.forwardRef(function(i,e){var t,n=i.className,o=i.icon,r=i.spin,s=i.rotate,a=i.tabIndex,l=i.onClick,c=i.twoToneColor,d=Hn(i,a9e),u=x.exports.useContext(RK),h=u.prefixCls,f=h===void 0?"anticon":h,g=u.rootClassName,p=Ue(g,f,(t={},me(t,"".concat(f,"-").concat(o.name),!!o.name),me(t,"".concat(f,"-spin"),!!r||o.name==="loading"),t),n),v=a;v===void 0&&l&&(v=-1);var m=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,_=Epe(c),y=Ne(_,2),w=y[0],L=y[1];return x.exports.createElement("span",yt({role:"img","aria-label":o.name},d,{ref:e,tabIndex:v,onClick:l,className:p}),x.exports.createElement($K,{icon:o,primaryColor:w,secondaryColor:L,style:m}))});k4.displayName="AntdIcon";k4.getTwoToneColor=s9e;k4.setTwoToneColor=Dpe;var cr=k4,l9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Z6e}))},zK=x.exports.forwardRef(l9e),c9e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},d9e=c9e,u9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:d9e}))},uS=x.exports.forwardRef(u9e),h9e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},f9e=h9e,g9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:f9e}))},hS=x.exports.forwardRef(g9e),p9e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},m9e=p9e,v9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:m9e}))},UK=x.exports.forwardRef(v9e),_9e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},b9e=_9e,C9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:b9e}))},kpe=x.exports.forwardRef(C9e),y9e=`accept acceptCharset accessKey action allowFullScreen allowTransparency +`,n9e=function(e){var t=x.exports.useContext(MK),n=t.csp,o=t.prefixCls,r=t9e;o&&(r=r.replace(/anticon/g,o)),x.exports.useEffect(function(){var s=e.current,a=xA(s);mv(r,"@ant-design-icons",{prepend:!0,csp:n,attachTo:a})},[])},i9e=["icon","className","onClick","style","primaryColor","secondaryColor"],oE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function o9e(i){var e=i.primaryColor,t=i.secondaryColor;oE.primaryColor=e,oE.secondaryColor=t||Epe(e),oE.calculated=!!t}function r9e(){return Ce({},oE)}var D4=function(e){var t=e.icon,n=e.className,o=e.onClick,r=e.style,s=e.primaryColor,a=e.secondaryColor,l=Hn(e,i9e),c=x.exports.useRef(),d=oE;if(s&&(d={primaryColor:s,secondaryColor:a||Epe(s)}),n9e(c),e9e(Jte(t),"icon should be icon definiton, but got ".concat(t)),!Jte(t))return null;var u=t;return u&&typeof u.icon=="function"&&(u=Ce(Ce({},u),{},{icon:u.icon(d.primaryColor,d.secondaryColor)})),mW(u.icon,"svg-".concat(u.name),Ce(Ce({className:n,onClick:o,style:r,"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};D4.displayName="IconReact";D4.getTwoToneColors=r9e;D4.setTwoToneColors=o9e;var zK=D4;function kpe(i){var e=Dpe(i),t=Ne(e,2),n=t[0],o=t[1];return zK.setTwoToneColors({primaryColor:n,secondaryColor:o})}function s9e(){var i=zK.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var a9e=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];kpe(T8e.primary);var k4=x.exports.forwardRef(function(i,e){var t,n=i.className,o=i.icon,r=i.spin,s=i.rotate,a=i.tabIndex,l=i.onClick,c=i.twoToneColor,d=Hn(i,a9e),u=x.exports.useContext(MK),h=u.prefixCls,f=h===void 0?"anticon":h,g=u.rootClassName,p=Ue(g,f,(t={},me(t,"".concat(f,"-").concat(o.name),!!o.name),me(t,"".concat(f,"-spin"),!!r||o.name==="loading"),t),n),v=a;v===void 0&&l&&(v=-1);var m=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,_=Dpe(c),y=Ne(_,2),w=y[0],L=y[1];return x.exports.createElement("span",yt({role:"img","aria-label":o.name},d,{ref:e,tabIndex:v,onClick:l,className:p}),x.exports.createElement(zK,{icon:o,primaryColor:w,secondaryColor:L,style:m}))});k4.displayName="AntdIcon";k4.getTwoToneColor=s9e;k4.setTwoToneColor=kpe;var cr=k4,l9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Z6e}))},UK=x.exports.forwardRef(l9e),c9e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},d9e=c9e,u9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:d9e}))},uS=x.exports.forwardRef(u9e),h9e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},f9e=h9e,g9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:f9e}))},hS=x.exports.forwardRef(g9e),p9e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},m9e=p9e,v9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:m9e}))},jK=x.exports.forwardRef(v9e),_9e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},b9e=_9e,C9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:b9e}))},Ipe=x.exports.forwardRef(C9e),y9e=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable @@ -181,20 +181,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata - onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,S9e="".concat(y9e," ").concat(w9e).split(/[\s\n]+/),x9e="aria-",L9e="data-";function ene(i,e){return i.indexOf(e)===0}function K0(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t;e===!1?t={aria:!0,data:!0,attr:!0}:e===!0?t={aria:!0}:t=Ce({},e);var n={};return Object.keys(i).forEach(function(o){(t.aria&&(o==="role"||ene(o,x9e))||t.data&&ene(o,L9e)||t.attr&&S9e.includes(o))&&(n[o]=i[o])}),n}const{isValidElement:lw}=fI;function Ipe(i){return i&&lw(i)&&i.type===x.exports.Fragment}function E9e(i,e,t){return lw(i)?x.exports.cloneElement(i,typeof t=="function"?t(i.props||{}):t):e}function vv(i,e){return E9e(i,i,e)}const tne=i=>typeof i=="object"&&i!=null&&i.nodeType===1,nne=(i,e)=>(!e||i!=="hidden")&&i!=="visible"&&i!=="clip",o6=(i,e)=>{if(i.clientHeight{const o=(r=>{if(!r.ownerDocument||!r.ownerDocument.defaultView)return null;try{return r.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!o&&(o.clientHeightre||r>i&&s=e&&a>=t?r-i-n:s>e&&at?s-e+o:0,D9e=i=>{const e=i.parentElement;return e==null?i.getRootNode().host||null:e},ine=(i,e)=>{var t,n,o,r;if(typeof document=="undefined")return[];const{scrollMode:s,block:a,inline:l,boundary:c,skipOverflowHiddenElements:d}=e,u=typeof c=="function"?c:B=>B!==c;if(!tne(i))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,f=[];let g=i;for(;tne(g)&&u(g);){if(g=D9e(g),g===h){f.push(g);break}g!=null&&g===document.body&&o6(g)&&!o6(document.documentElement)||g!=null&&o6(g,d)&&f.push(g)}const p=(n=(t=window.visualViewport)==null?void 0:t.width)!=null?n:innerWidth,v=(r=(o=window.visualViewport)==null?void 0:o.height)!=null?r:innerHeight,{scrollX:m,scrollY:_}=window,{height:y,width:w,top:L,right:D,bottom:E,left:I}=i.getBoundingClientRect(),{top:k,right:R,bottom:A,left:P}=(B=>{const F=window.getComputedStyle(B);return{top:parseFloat(F.scrollMarginTop)||0,right:parseFloat(F.scrollMarginRight)||0,bottom:parseFloat(F.scrollMarginBottom)||0,left:parseFloat(F.scrollMarginLeft)||0}})(i);let N=a==="start"||a==="nearest"?L-k:a==="end"?E+A:L+y/2-k+A,M=l==="center"?I+w/2-P+R:l==="end"?D+R:I-P;const H=[];for(let B=0;B=0&&I>=0&&E<=v&&D<=p&&L>=K&&E<=G&&I>=X&&D<=j)return H;const ue=getComputedStyle(F),fe=parseInt(ue.borderLeftWidth,10),pe=parseInt(ue.borderTopWidth,10),be=parseInt(ue.borderRightWidth,10),Se=parseInt(ue.borderBottomWidth,10);let Fe=0,De=0;const ce="offsetWidth"in F?F.offsetWidth-F.clientWidth-fe-be:0,Pe="offsetHeight"in F?F.offsetHeight-F.clientHeight-pe-Se:0,Oe="offsetWidth"in F?F.offsetWidth===0?0:z/F.offsetWidth:0,xe="offsetHeight"in F?F.offsetHeight===0?0:$/F.offsetHeight:0;if(h===F)Fe=a==="start"?N:a==="end"?N-v:a==="nearest"?YN(_,_+v,v,pe,Se,_+N,_+N+y,y):N-v/2,De=l==="start"?M:l==="center"?M-p/2:l==="end"?M-p:YN(m,m+p,p,fe,be,m+M,m+M+w,w),Fe=Math.max(0,Fe+_),De=Math.max(0,De+m);else{Fe=a==="start"?N-K-pe:a==="end"?N-G+Se+Pe:a==="nearest"?YN(K,G,$,pe,Se+Pe,N,N+y,y):N-(K+$/2)+Pe/2,De=l==="start"?M-X-fe:l==="center"?M-(X+z/2)+ce/2:l==="end"?M-j+be+ce:YN(X,j,z,fe,be+ce,M,M+w,w);const{scrollLeft:Ee,scrollTop:tt}=F;Fe=xe===0?0:Math.max(0,Math.min(tt+Fe/xe,F.scrollHeight-$/xe+Pe)),De=Oe===0?0:Math.max(0,Math.min(Ee+De/Oe,F.scrollWidth-z/Oe+ce)),N+=tt-Fe,M+=Ee-De}H.push({el:F,top:Fe,left:De})}return H},k9e=i=>i===!1?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&Object.keys(e).length!==0)(i)?i:{block:"start",inline:"nearest"};function I9e(i,e){if(!i.isConnected||!(o=>{let r=o;for(;r&&r.parentNode;){if(r.parentNode===document)return!0;r=r.parentNode instanceof ShadowRoot?r.parentNode.host:r.parentNode}return!1})(i))return;const t=(o=>{const r=window.getComputedStyle(o);return{top:parseFloat(r.scrollMarginTop)||0,right:parseFloat(r.scrollMarginRight)||0,bottom:parseFloat(r.scrollMarginBottom)||0,left:parseFloat(r.scrollMarginLeft)||0}})(i);if((o=>typeof o=="object"&&typeof o.behavior=="function")(e))return e.behavior(ine(i,e));const n=typeof e=="boolean"||e==null?void 0:e.behavior;for(const{el:o,top:r,left:s}of ine(i,k9e(e))){const a=r-t.top+t.bottom,l=s-t.left+t.right;o.scroll({top:a,left:l,behavior:n})}}const T9e=i=>{const[,,,,e]=Ba();return e?`${i}-css-var`:""};var nh=T9e,at={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=at.F1&&t<=at.F12)return!1;switch(t){case at.ALT:case at.CAPS_LOCK:case at.CONTEXT_MENU:case at.CTRL:case at.DOWN:case at.END:case at.ESC:case at.HOME:case at.INSERT:case at.LEFT:case at.MAC_FF_META:case at.META:case at.NUMLOCK:case at.NUM_CENTER:case at.PAGE_DOWN:case at.PAGE_UP:case at.PAUSE:case at.PRINT_SCREEN:case at.RIGHT:case at.SHIFT:case at.UP:case at.WIN_KEY:case at.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=at.ZERO&&e<=at.NINE||e>=at.NUM_ZERO&&e<=at.NUM_MULTIPLY||e>=at.A&&e<=at.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case at.SPACE:case at.QUESTION_MARK:case at.NUM_PLUS:case at.NUM_MINUS:case at.NUM_PERIOD:case at.NUM_DIVISION:case at.SEMICOLON:case at.DASH:case at.EQUALS:case at.COMMA:case at.PERIOD:case at.SLASH:case at.APOSTROPHE:case at.SINGLE_QUOTE:case at.OPEN_SQUARE_BRACKET:case at.BACKSLASH:case at.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Tpe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.style,o=i.className,r=i.duration,s=r===void 0?4.5:r,a=i.eventKey,l=i.content,c=i.closable,d=i.closeIcon,u=d===void 0?"x":d,h=i.props,f=i.onClick,g=i.onNoticeClose,p=i.times,v=i.hovering,m=x.exports.useState(!1),_=Ne(m,2),y=_[0],w=_[1],L=v||y,D=function(){g(a)},E=function(R){(R.key==="Enter"||R.code==="Enter"||R.keyCode===at.ENTER)&&D()};x.exports.useEffect(function(){if(!L&&s>0){var k=setTimeout(function(){D()},s*1e3);return function(){clearTimeout(k)}}},[s,L,p]);var I="".concat(t,"-notice");return x.exports.createElement("div",yt({},h,{ref:e,className:Ue(I,o,me({},"".concat(I,"-closable"),c)),style:n,onMouseEnter:function(R){var A;w(!0),h==null||(A=h.onMouseEnter)===null||A===void 0||A.call(h,R)},onMouseLeave:function(R){var A;w(!1),h==null||(A=h.onMouseLeave)===null||A===void 0||A.call(h,R)},onClick:f}),x.exports.createElement("div",{className:"".concat(I,"-content")},l),c&&x.exports.createElement("a",{tabIndex:0,className:"".concat(I,"-close"),onKeyDown:E,onClick:function(R){R.preventDefault(),R.stopPropagation(),D()}},u))}),Npe=Bt.createContext({}),N9e=function(e){var t=e.children,n=e.classNames;return Bt.createElement(Npe.Provider,{value:{classNames:n}},t)},one=8,rne=3,sne=16,R9e=function(e){var t={offset:one,threshold:rne,gap:sne};if(e&&qn(e)==="object"){var n,o,r;t.offset=(n=e.offset)!==null&&n!==void 0?n:one,t.threshold=(o=e.threshold)!==null&&o!==void 0?o:rne,t.gap=(r=e.gap)!==null&&r!==void 0?r:sne}return[!!e,t]},M9e=["className","style","classNames","styles"],A9e=function(e){var t,n=e.configList,o=e.placement,r=e.prefixCls,s=e.className,a=e.style,l=e.motion,c=e.onAllNoticeRemoved,d=e.onNoticeClose,u=e.stack,h=x.exports.useContext(Npe),f=h.classNames,g=x.exports.useRef({}),p=x.exports.useState(null),v=Ne(p,2),m=v[0],_=v[1],y=x.exports.useState([]),w=Ne(y,2),L=w[0],D=w[1],E=n.map(function(F){return{config:F,key:String(F.key)}}),I=R9e(u),k=Ne(I,2),R=k[0],A=k[1],P=A.offset,N=A.threshold,M=A.gap,H=R&&(L.length>0||E.length<=N),B=typeof l=="function"?l(o):l;return x.exports.useEffect(function(){R&&L.length>1&&D(function(F){return F.filter(function($){return E.some(function(z){var K=z.key;return $===K})})})},[L,E,R]),x.exports.useEffect(function(){var F;if(R&&g.current[(F=E[E.length-1])===null||F===void 0?void 0:F.key]){var $;_(g.current[($=E[E.length-1])===null||$===void 0?void 0:$.key])}},[E,R]),he(Cpe,{className:Ue(r,"".concat(r,"-").concat(o),f==null?void 0:f.list,s,(t={},me(t,"".concat(r,"-stack"),!!R),me(t,"".concat(r,"-stack-expanded"),H),t)),style:a,keys:E,motionAppear:!0,...B,onAllRemoved:function(){c(o)},children:function(F,$){var z=F.config,K=F.className,j=F.style,G=F.index,X=z,ue=X.key,fe=X.times,pe=String(ue),be=z,Se=be.className,Fe=be.style,De=be.classNames,ce=be.styles,Pe=Hn(be,M9e),Oe=E.findIndex(function(oe){return oe.key===pe}),xe={};if(R){var Ee=E.length-1-(Oe>-1?Oe:G-1),tt=o==="top"||o==="bottom"?"-50%":"0";if(Ee>0){var nt,Qe,Ge;xe.height=H?(nt=g.current[pe])===null||nt===void 0?void 0:nt.offsetHeight:m==null?void 0:m.offsetHeight;for(var re=0,ie=0;ie-1?g.current[pe]=te:delete g.current[pe]},prefixCls:r,classNames:De,styles:ce,className:Ue(Se,f==null?void 0:f.notice),style:Fe,times:fe,key:ue,eventKey:ue,onNoticeClose:d,hovering:R&&L.length>0})})}},o)},P9e=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=t===void 0?"rc-notification":t,o=i.container,r=i.motion,s=i.maxCount,a=i.className,l=i.style,c=i.onAllRemoved,d=i.stack,u=i.renderNotifications,h=x.exports.useState([]),f=Ne(h,2),g=f[0],p=f[1],v=function(k){var R,A=g.find(function(P){return P.key===k});A==null||(R=A.onClose)===null||R===void 0||R.call(A),p(function(P){return P.filter(function(N){return N.key!==k})})};x.exports.useImperativeHandle(e,function(){return{open:function(k){p(function(R){var A=_t(R),P=A.findIndex(function(H){return H.key===k.key}),N=Ce({},k);if(P>=0){var M;N.times=(((M=R[P])===null||M===void 0?void 0:M.times)||0)+1,A[P]=N}else N.times=0,A.push(N);return s>0&&A.length>s&&(A=A.slice(-s)),A})},close:function(k){v(k)},destroy:function(){p([])}}});var m=x.exports.useState({}),_=Ne(m,2),y=_[0],w=_[1];x.exports.useEffect(function(){var I={};g.forEach(function(k){var R=k.placement,A=R===void 0?"topRight":R;A&&(I[A]=I[A]||[],I[A].push(k))}),Object.keys(y).forEach(function(k){I[k]=I[k]||[]}),w(I)},[g]);var L=function(k){w(function(R){var A=Ce({},R),P=A[k]||[];return P.length||delete A[k],A})},D=x.exports.useRef(!1);if(x.exports.useEffect(function(){Object.keys(y).length>0?D.current=!0:D.current&&(c==null||c(),D.current=!1)},[y]),!o)return null;var E=Object.keys(y);return zu.exports.createPortal(x.exports.createElement(x.exports.Fragment,null,E.map(function(I){var k=y[I],R=x.exports.createElement(A9e,{key:I,configList:k,placement:I,prefixCls:n,className:a==null?void 0:a(I),style:l==null?void 0:l(I),motion:r,onNoticeClose:v,onAllNoticeRemoved:L,stack:d});return u?u(R,{prefixCls:n,key:I}):R})),o)}),O9e=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],F9e=function(){return document.body},ane=0;function B9e(){for(var i={},e=arguments.length,t=new Array(e),n=0;n0&&arguments[0]!==void 0?arguments[0]:{},e=i.getContainer,t=e===void 0?F9e:e,n=i.motion,o=i.prefixCls,r=i.maxCount,s=i.className,a=i.style,l=i.onAllRemoved,c=i.stack,d=i.renderNotifications,u=Hn(i,O9e),h=x.exports.useState(),f=Ne(h,2),g=f[0],p=f[1],v=x.exports.useRef(),m=x.exports.createElement(P9e,{container:g,ref:v,prefixCls:o,motion:n,maxCount:r,className:s,style:a,onAllRemoved:l,stack:c,renderNotifications:d}),_=x.exports.useState([]),y=Ne(_,2),w=y[0],L=y[1],D=x.exports.useMemo(function(){return{open:function(I){var k=B9e(u,I);(k.key===null||k.key===void 0)&&(k.key="rc-notification-".concat(ane),ane+=1),L(function(R){return[].concat(_t(R),[{type:"open",config:k}])})},close:function(I){L(function(k){return[].concat(_t(k),[{type:"close",key:I}])})},destroy:function(){L(function(I){return[].concat(_t(I),[{type:"destroy"}])})}}},[]);return x.exports.useEffect(function(){p(t())}),x.exports.useEffect(function(){v.current&&w.length&&(w.forEach(function(E){switch(E.type){case"open":v.current.open(E.config);break;case"close":v.current.close(E.key);break;case"destroy":v.current.destroy();break}}),L(function(E){return E.filter(function(I){return!w.includes(I)})}))},[w]),[D,m]}var V9e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},H9e=V9e,$9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:H9e}))},kI=x.exports.forwardRef($9e);const z9e=Bt.createContext(void 0);var jK=z9e;const R_=100,U9e=10,KK=R_*U9e,Rpe={Modal:R_,Drawer:R_,Popover:R_,Popconfirm:R_,Tooltip:R_,Tour:R_},j9e={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function K9e(i){return i in Rpe}function qK(i,e){const[,t]=Ba(),n=Bt.useContext(jK),o=K9e(i);if(e!==void 0)return[e,e];let r=n!=null?n:0;return o?(r+=(n?0:t.zIndexPopupBase)+Rpe[i],r=Math.min(r,t.zIndexPopupBase+KK)):r+=j9e[i],[n===void 0?e:r,r]}const q9e=i=>{const{componentCls:e,iconCls:t,boxShadow:n,colorText:o,colorSuccess:r,colorError:s,colorWarning:a,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:d,motionDurationSlow:u,marginXS:h,paddingXS:f,borderRadiusLG:g,zIndexPopup:p,contentPadding:v,contentBg:m}=i,_=`${e}-notice`,y=new ji("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:f,transform:"translateY(0)",opacity:1}}),w=new ji("MessageMoveOut",{"0%":{maxHeight:i.height,padding:f,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),L={padding:f,textAlign:"center",[`${e}-custom-content > ${t}`]:{verticalAlign:"text-bottom",marginInlineEnd:h,fontSize:c},[`${_}-content`]:{display:"inline-block",padding:v,background:m,borderRadius:g,boxShadow:n,pointerEvents:"all"},[`${e}-success > ${t}`]:{color:r},[`${e}-error > ${t}`]:{color:s},[`${e}-warning > ${t}`]:{color:a},[`${e}-info > ${t}, + onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,S9e="".concat(y9e," ").concat(w9e).split(/[\s\n]+/),x9e="aria-",L9e="data-";function tne(i,e){return i.indexOf(e)===0}function K0(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t;e===!1?t={aria:!0,data:!0,attr:!0}:e===!0?t={aria:!0}:t=Ce({},e);var n={};return Object.keys(i).forEach(function(o){(t.aria&&(o==="role"||tne(o,x9e))||t.data&&tne(o,L9e)||t.attr&&S9e.includes(o))&&(n[o]=i[o])}),n}const{isValidElement:lw}=fI;function Tpe(i){return i&&lw(i)&&i.type===x.exports.Fragment}function E9e(i,e,t){return lw(i)?x.exports.cloneElement(i,typeof t=="function"?t(i.props||{}):t):e}function _v(i,e){return E9e(i,i,e)}const nne=i=>typeof i=="object"&&i!=null&&i.nodeType===1,ine=(i,e)=>(!e||i!=="hidden")&&i!=="visible"&&i!=="clip",r6=(i,e)=>{if(i.clientHeight{const o=(r=>{if(!r.ownerDocument||!r.ownerDocument.defaultView)return null;try{return r.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!o&&(o.clientHeightre||r>i&&s=e&&a>=t?r-i-n:s>e&&at?s-e+o:0,D9e=i=>{const e=i.parentElement;return e==null?i.getRootNode().host||null:e},one=(i,e)=>{var t,n,o,r;if(typeof document=="undefined")return[];const{scrollMode:s,block:a,inline:l,boundary:c,skipOverflowHiddenElements:d}=e,u=typeof c=="function"?c:B=>B!==c;if(!nne(i))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,f=[];let g=i;for(;nne(g)&&u(g);){if(g=D9e(g),g===h){f.push(g);break}g!=null&&g===document.body&&r6(g)&&!r6(document.documentElement)||g!=null&&r6(g,d)&&f.push(g)}const p=(n=(t=window.visualViewport)==null?void 0:t.width)!=null?n:innerWidth,v=(r=(o=window.visualViewport)==null?void 0:o.height)!=null?r:innerHeight,{scrollX:m,scrollY:_}=window,{height:y,width:w,top:L,right:D,bottom:E,left:I}=i.getBoundingClientRect(),{top:k,right:R,bottom:A,left:P}=(B=>{const F=window.getComputedStyle(B);return{top:parseFloat(F.scrollMarginTop)||0,right:parseFloat(F.scrollMarginRight)||0,bottom:parseFloat(F.scrollMarginBottom)||0,left:parseFloat(F.scrollMarginLeft)||0}})(i);let N=a==="start"||a==="nearest"?L-k:a==="end"?E+A:L+y/2-k+A,M=l==="center"?I+w/2-P+R:l==="end"?D+R:I-P;const H=[];for(let B=0;B=0&&I>=0&&E<=v&&D<=p&&L>=K&&E<=G&&I>=X&&D<=j)return H;const ue=getComputedStyle(F),fe=parseInt(ue.borderLeftWidth,10),pe=parseInt(ue.borderTopWidth,10),be=parseInt(ue.borderRightWidth,10),Se=parseInt(ue.borderBottomWidth,10);let Fe=0,De=0;const ce="offsetWidth"in F?F.offsetWidth-F.clientWidth-fe-be:0,Pe="offsetHeight"in F?F.offsetHeight-F.clientHeight-pe-Se:0,Oe="offsetWidth"in F?F.offsetWidth===0?0:z/F.offsetWidth:0,xe="offsetHeight"in F?F.offsetHeight===0?0:$/F.offsetHeight:0;if(h===F)Fe=a==="start"?N:a==="end"?N-v:a==="nearest"?YN(_,_+v,v,pe,Se,_+N,_+N+y,y):N-v/2,De=l==="start"?M:l==="center"?M-p/2:l==="end"?M-p:YN(m,m+p,p,fe,be,m+M,m+M+w,w),Fe=Math.max(0,Fe+_),De=Math.max(0,De+m);else{Fe=a==="start"?N-K-pe:a==="end"?N-G+Se+Pe:a==="nearest"?YN(K,G,$,pe,Se+Pe,N,N+y,y):N-(K+$/2)+Pe/2,De=l==="start"?M-X-fe:l==="center"?M-(X+z/2)+ce/2:l==="end"?M-j+be+ce:YN(X,j,z,fe,be+ce,M,M+w,w);const{scrollLeft:Ee,scrollTop:tt}=F;Fe=xe===0?0:Math.max(0,Math.min(tt+Fe/xe,F.scrollHeight-$/xe+Pe)),De=Oe===0?0:Math.max(0,Math.min(Ee+De/Oe,F.scrollWidth-z/Oe+ce)),N+=tt-Fe,M+=Ee-De}H.push({el:F,top:Fe,left:De})}return H},k9e=i=>i===!1?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&Object.keys(e).length!==0)(i)?i:{block:"start",inline:"nearest"};function I9e(i,e){if(!i.isConnected||!(o=>{let r=o;for(;r&&r.parentNode;){if(r.parentNode===document)return!0;r=r.parentNode instanceof ShadowRoot?r.parentNode.host:r.parentNode}return!1})(i))return;const t=(o=>{const r=window.getComputedStyle(o);return{top:parseFloat(r.scrollMarginTop)||0,right:parseFloat(r.scrollMarginRight)||0,bottom:parseFloat(r.scrollMarginBottom)||0,left:parseFloat(r.scrollMarginLeft)||0}})(i);if((o=>typeof o=="object"&&typeof o.behavior=="function")(e))return e.behavior(one(i,e));const n=typeof e=="boolean"||e==null?void 0:e.behavior;for(const{el:o,top:r,left:s}of one(i,k9e(e))){const a=r-t.top+t.bottom,l=s-t.left+t.right;o.scroll({top:a,left:l,behavior:n})}}const T9e=i=>{const[,,,,e]=Ba();return e?`${i}-css-var`:""};var nh=T9e,at={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=at.F1&&t<=at.F12)return!1;switch(t){case at.ALT:case at.CAPS_LOCK:case at.CONTEXT_MENU:case at.CTRL:case at.DOWN:case at.END:case at.ESC:case at.HOME:case at.INSERT:case at.LEFT:case at.MAC_FF_META:case at.META:case at.NUMLOCK:case at.NUM_CENTER:case at.PAGE_DOWN:case at.PAGE_UP:case at.PAUSE:case at.PRINT_SCREEN:case at.RIGHT:case at.SHIFT:case at.UP:case at.WIN_KEY:case at.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=at.ZERO&&e<=at.NINE||e>=at.NUM_ZERO&&e<=at.NUM_MULTIPLY||e>=at.A&&e<=at.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case at.SPACE:case at.QUESTION_MARK:case at.NUM_PLUS:case at.NUM_MINUS:case at.NUM_PERIOD:case at.NUM_DIVISION:case at.SEMICOLON:case at.DASH:case at.EQUALS:case at.COMMA:case at.PERIOD:case at.SLASH:case at.APOSTROPHE:case at.SINGLE_QUOTE:case at.OPEN_SQUARE_BRACKET:case at.BACKSLASH:case at.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Npe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.style,o=i.className,r=i.duration,s=r===void 0?4.5:r,a=i.eventKey,l=i.content,c=i.closable,d=i.closeIcon,u=d===void 0?"x":d,h=i.props,f=i.onClick,g=i.onNoticeClose,p=i.times,v=i.hovering,m=x.exports.useState(!1),_=Ne(m,2),y=_[0],w=_[1],L=v||y,D=function(){g(a)},E=function(R){(R.key==="Enter"||R.code==="Enter"||R.keyCode===at.ENTER)&&D()};x.exports.useEffect(function(){if(!L&&s>0){var k=setTimeout(function(){D()},s*1e3);return function(){clearTimeout(k)}}},[s,L,p]);var I="".concat(t,"-notice");return x.exports.createElement("div",yt({},h,{ref:e,className:Ue(I,o,me({},"".concat(I,"-closable"),c)),style:n,onMouseEnter:function(R){var A;w(!0),h==null||(A=h.onMouseEnter)===null||A===void 0||A.call(h,R)},onMouseLeave:function(R){var A;w(!1),h==null||(A=h.onMouseLeave)===null||A===void 0||A.call(h,R)},onClick:f}),x.exports.createElement("div",{className:"".concat(I,"-content")},l),c&&x.exports.createElement("a",{tabIndex:0,className:"".concat(I,"-close"),onKeyDown:E,onClick:function(R){R.preventDefault(),R.stopPropagation(),D()}},u))}),Rpe=Bt.createContext({}),N9e=function(e){var t=e.children,n=e.classNames;return Bt.createElement(Rpe.Provider,{value:{classNames:n}},t)},rne=8,sne=3,ane=16,R9e=function(e){var t={offset:rne,threshold:sne,gap:ane};if(e&&qn(e)==="object"){var n,o,r;t.offset=(n=e.offset)!==null&&n!==void 0?n:rne,t.threshold=(o=e.threshold)!==null&&o!==void 0?o:sne,t.gap=(r=e.gap)!==null&&r!==void 0?r:ane}return[!!e,t]},M9e=["className","style","classNames","styles"],A9e=function(e){var t,n=e.configList,o=e.placement,r=e.prefixCls,s=e.className,a=e.style,l=e.motion,c=e.onAllNoticeRemoved,d=e.onNoticeClose,u=e.stack,h=x.exports.useContext(Rpe),f=h.classNames,g=x.exports.useRef({}),p=x.exports.useState(null),v=Ne(p,2),m=v[0],_=v[1],y=x.exports.useState([]),w=Ne(y,2),L=w[0],D=w[1],E=n.map(function(F){return{config:F,key:String(F.key)}}),I=R9e(u),k=Ne(I,2),R=k[0],A=k[1],P=A.offset,N=A.threshold,M=A.gap,H=R&&(L.length>0||E.length<=N),B=typeof l=="function"?l(o):l;return x.exports.useEffect(function(){R&&L.length>1&&D(function(F){return F.filter(function($){return E.some(function(z){var K=z.key;return $===K})})})},[L,E,R]),x.exports.useEffect(function(){var F;if(R&&g.current[(F=E[E.length-1])===null||F===void 0?void 0:F.key]){var $;_(g.current[($=E[E.length-1])===null||$===void 0?void 0:$.key])}},[E,R]),he(ype,{className:Ue(r,"".concat(r,"-").concat(o),f==null?void 0:f.list,s,(t={},me(t,"".concat(r,"-stack"),!!R),me(t,"".concat(r,"-stack-expanded"),H),t)),style:a,keys:E,motionAppear:!0,...B,onAllRemoved:function(){c(o)},children:function(F,$){var z=F.config,K=F.className,j=F.style,G=F.index,X=z,ue=X.key,fe=X.times,pe=String(ue),be=z,Se=be.className,Fe=be.style,De=be.classNames,ce=be.styles,Pe=Hn(be,M9e),Oe=E.findIndex(function(oe){return oe.key===pe}),xe={};if(R){var Ee=E.length-1-(Oe>-1?Oe:G-1),tt=o==="top"||o==="bottom"?"-50%":"0";if(Ee>0){var nt,Qe,Ge;xe.height=H?(nt=g.current[pe])===null||nt===void 0?void 0:nt.offsetHeight:m==null?void 0:m.offsetHeight;for(var re=0,ie=0;ie-1?g.current[pe]=te:delete g.current[pe]},prefixCls:r,classNames:De,styles:ce,className:Ue(Se,f==null?void 0:f.notice),style:Fe,times:fe,key:ue,eventKey:ue,onNoticeClose:d,hovering:R&&L.length>0})})}},o)},P9e=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=t===void 0?"rc-notification":t,o=i.container,r=i.motion,s=i.maxCount,a=i.className,l=i.style,c=i.onAllRemoved,d=i.stack,u=i.renderNotifications,h=x.exports.useState([]),f=Ne(h,2),g=f[0],p=f[1],v=function(k){var R,A=g.find(function(P){return P.key===k});A==null||(R=A.onClose)===null||R===void 0||R.call(A),p(function(P){return P.filter(function(N){return N.key!==k})})};x.exports.useImperativeHandle(e,function(){return{open:function(k){p(function(R){var A=_t(R),P=A.findIndex(function(H){return H.key===k.key}),N=Ce({},k);if(P>=0){var M;N.times=(((M=R[P])===null||M===void 0?void 0:M.times)||0)+1,A[P]=N}else N.times=0,A.push(N);return s>0&&A.length>s&&(A=A.slice(-s)),A})},close:function(k){v(k)},destroy:function(){p([])}}});var m=x.exports.useState({}),_=Ne(m,2),y=_[0],w=_[1];x.exports.useEffect(function(){var I={};g.forEach(function(k){var R=k.placement,A=R===void 0?"topRight":R;A&&(I[A]=I[A]||[],I[A].push(k))}),Object.keys(y).forEach(function(k){I[k]=I[k]||[]}),w(I)},[g]);var L=function(k){w(function(R){var A=Ce({},R),P=A[k]||[];return P.length||delete A[k],A})},D=x.exports.useRef(!1);if(x.exports.useEffect(function(){Object.keys(y).length>0?D.current=!0:D.current&&(c==null||c(),D.current=!1)},[y]),!o)return null;var E=Object.keys(y);return zu.exports.createPortal(x.exports.createElement(x.exports.Fragment,null,E.map(function(I){var k=y[I],R=x.exports.createElement(A9e,{key:I,configList:k,placement:I,prefixCls:n,className:a==null?void 0:a(I),style:l==null?void 0:l(I),motion:r,onNoticeClose:v,onAllNoticeRemoved:L,stack:d});return u?u(R,{prefixCls:n,key:I}):R})),o)}),O9e=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],F9e=function(){return document.body},lne=0;function B9e(){for(var i={},e=arguments.length,t=new Array(e),n=0;n0&&arguments[0]!==void 0?arguments[0]:{},e=i.getContainer,t=e===void 0?F9e:e,n=i.motion,o=i.prefixCls,r=i.maxCount,s=i.className,a=i.style,l=i.onAllRemoved,c=i.stack,d=i.renderNotifications,u=Hn(i,O9e),h=x.exports.useState(),f=Ne(h,2),g=f[0],p=f[1],v=x.exports.useRef(),m=x.exports.createElement(P9e,{container:g,ref:v,prefixCls:o,motion:n,maxCount:r,className:s,style:a,onAllRemoved:l,stack:c,renderNotifications:d}),_=x.exports.useState([]),y=Ne(_,2),w=y[0],L=y[1],D=x.exports.useMemo(function(){return{open:function(I){var k=B9e(u,I);(k.key===null||k.key===void 0)&&(k.key="rc-notification-".concat(lne),lne+=1),L(function(R){return[].concat(_t(R),[{type:"open",config:k}])})},close:function(I){L(function(k){return[].concat(_t(k),[{type:"close",key:I}])})},destroy:function(){L(function(I){return[].concat(_t(I),[{type:"destroy"}])})}}},[]);return x.exports.useEffect(function(){p(t())}),x.exports.useEffect(function(){v.current&&w.length&&(w.forEach(function(E){switch(E.type){case"open":v.current.open(E.config);break;case"close":v.current.close(E.key);break;case"destroy":v.current.destroy();break}}),L(function(E){return E.filter(function(I){return!w.includes(I)})}))},[w]),[D,m]}var V9e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},H9e=V9e,$9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:H9e}))},kI=x.exports.forwardRef($9e);const z9e=Bt.createContext(void 0);var KK=z9e;const R_=100,U9e=10,qK=R_*U9e,Mpe={Modal:R_,Drawer:R_,Popover:R_,Popconfirm:R_,Tooltip:R_,Tour:R_},j9e={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function K9e(i){return i in Mpe}function GK(i,e){const[,t]=Ba(),n=Bt.useContext(KK),o=K9e(i);if(e!==void 0)return[e,e];let r=n!=null?n:0;return o?(r+=(n?0:t.zIndexPopupBase)+Mpe[i],r=Math.min(r,t.zIndexPopupBase+qK)):r+=j9e[i],[n===void 0?e:r,r]}const q9e=i=>{const{componentCls:e,iconCls:t,boxShadow:n,colorText:o,colorSuccess:r,colorError:s,colorWarning:a,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:d,motionDurationSlow:u,marginXS:h,paddingXS:f,borderRadiusLG:g,zIndexPopup:p,contentPadding:v,contentBg:m}=i,_=`${e}-notice`,y=new ji("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:f,transform:"translateY(0)",opacity:1}}),w=new ji("MessageMoveOut",{"0%":{maxHeight:i.height,padding:f,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),L={padding:f,textAlign:"center",[`${e}-custom-content > ${t}`]:{verticalAlign:"text-bottom",marginInlineEnd:h,fontSize:c},[`${_}-content`]:{display:"inline-block",padding:v,background:m,borderRadius:g,boxShadow:n,pointerEvents:"all"},[`${e}-success > ${t}`]:{color:r},[`${e}-error > ${t}`]:{color:s},[`${e}-warning > ${t}`]:{color:a},[`${e}-info > ${t}, ${e}-loading > ${t}`]:{color:l}};return[{[e]:Object.assign(Object.assign({},Pa(i)),{color:o,position:"fixed",top:h,width:"100%",pointerEvents:"none",zIndex:p,[`${e}-move-up`]:{animationFillMode:"forwards"},[` ${e}-move-up-appear, ${e}-move-up-enter `]:{animationName:y,animationDuration:u,animationPlayState:"paused",animationTimingFunction:d},[` ${e}-move-up-appear${e}-move-up-appear-active, ${e}-move-up-enter${e}-move-up-enter-active - `]:{animationPlayState:"running"},[`${e}-move-up-leave`]:{animationName:w,animationDuration:u,animationPlayState:"paused",animationTimingFunction:d},[`${e}-move-up-leave${e}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[e]:{[`${_}-wrapper`]:Object.assign({},L)}},{[`${e}-notice-pure-panel`]:Object.assign(Object.assign({},L),{padding:0,textAlign:"start"})}]},G9e=i=>({zIndexPopup:i.zIndexPopupBase+KK+10,contentBg:i.colorBgElevated,contentPadding:`${(i.controlHeightLG-i.fontSize*i.lineHeight)/2}px ${i.paddingSM}px`});var Mpe=jc("Message",i=>{const e=lr(i,{height:150});return[q9e(e)]},G9e),X9e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{prefixCls:e,type:t,icon:n,children:o}=i;return x.exports.createElement("div",{className:Ue(`${e}-custom-content`,`${e}-${t}`)},n||Y9e[t],x.exports.createElement("span",null,o))},Z9e=i=>{const{prefixCls:e,className:t,type:n,icon:o,content:r}=i,s=X9e(i,["prefixCls","className","type","icon","content"]),{getPrefixCls:a}=x.exports.useContext(Hi),l=e||a("message"),c=nh(l),[d,u,h]=Mpe(l,c);return d(x.exports.createElement(Tpe,Object.assign({},s,{prefixCls:l,className:Ue(t,u,`${l}-notice-pure-panel`,h,c),eventKey:"pure",duration:null,content:x.exports.createElement(Ape,{prefixCls:l,type:n,icon:o},r)})))};var Q9e=Z9e;function J9e(i,e){return{motionName:e!=null?e:`${i}-move-up`}}function GK(i){let e;const t=new Promise(o=>{e=i(()=>{o(!0)})}),n=()=>{e==null||e()};return n.then=(o,r)=>t.then(o,r),n.promise=t,n}var e7e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{children:e,prefixCls:t}=i;const n=nh(t),[o,r,s]=Mpe(t,n);return o(x.exports.createElement(N9e,{classNames:{list:Ue(r,s,n)}},e))},o7e=(i,e)=>{let{prefixCls:t,key:n}=e;return x.exports.createElement(i7e,{prefixCls:t,key:n},i)},r7e=x.exports.forwardRef((i,e)=>{const{top:t,prefixCls:n,getContainer:o,maxCount:r,duration:s=n7e,rtl:a,transitionName:l,onAllRemoved:c}=i,{getPrefixCls:d,getPopupContainer:u,message:h,direction:f}=x.exports.useContext(Hi),g=n||d("message"),p=()=>({left:"50%",transform:"translateX(-50%)",top:t!=null?t:t7e}),v=()=>Ue({[`${g}-rtl`]:a!=null?a:f==="rtl"}),m=()=>J9e(g,l),_=x.exports.createElement("span",{className:`${g}-close-x`},x.exports.createElement(hS,{className:`${g}-close-icon`})),[y,w]=W9e({prefixCls:g,style:p,className:v,motion:m,closable:!1,closeIcon:_,duration:s,getContainer:()=>(o==null?void 0:o())||(u==null?void 0:u())||document.body,maxCount:r,onAllRemoved:c,renderNotifications:o7e});return x.exports.useImperativeHandle(e,()=>Object.assign(Object.assign({},y),{prefixCls:g,message:h})),w});let lne=0;function Ppe(i){const e=x.exports.useRef(null);return L4(),[x.exports.useMemo(()=>{const n=l=>{var c;(c=e.current)===null||c===void 0||c.close(l)},o=l=>{if(!e.current){const D=()=>{};return D.then=()=>{},D}const{open:c,prefixCls:d,message:u}=e.current,h=`${d}-notice`,{content:f,icon:g,type:p,key:v,className:m,style:_,onClose:y}=l,w=e7e(l,["content","icon","type","key","className","style","onClose"]);let L=v;return L==null&&(lne+=1,L=`antd-message-${lne}`),GK(D=>(c(Object.assign(Object.assign({},w),{key:L,content:x.exports.createElement(Ape,{prefixCls:d,type:p,icon:g},f),placement:"top",className:Ue(p&&`${h}-${p}`,m,u==null?void 0:u.className),style:Object.assign(Object.assign({},u==null?void 0:u.style),_),onClose:()=>{y==null||y(),D()}})),()=>{n(L)}))},s={open:o,destroy:l=>{var c;l!==void 0?n(l):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(d,u,h)=>{let f;d&&typeof d=="object"&&"content"in d?f=d:f={content:d};let g,p;typeof u=="function"?p=u:(g=u,p=h);const v=Object.assign(Object.assign({onClose:p,duration:g},f),{type:l});return o(v)};s[l]=c}),s},[]),x.exports.createElement(r7e,Object.assign({key:"message-holder"},i,{ref:e}))]}function s7e(i){return Ppe(i)}function a7e(){const[i,e]=x.exports.useState([]),t=x.exports.useCallback(n=>(e(o=>[].concat(_t(o),[n])),()=>{e(o=>o.filter(r=>r!==n))}),[]);return[i,t]}function ul(){ul=function(){return e};var i,e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(B,F,$){B[F]=$.value},r=typeof Symbol=="function"?Symbol:{},s=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function c(B,F,$){return Object.defineProperty(B,F,{value:$,enumerable:!0,configurable:!0,writable:!0}),B[F]}try{c({},"")}catch{c=function($,z,K){return $[z]=K}}function d(B,F,$,z){var K=F&&F.prototype instanceof m?F:m,j=Object.create(K.prototype),G=new M(z||[]);return o(j,"_invoke",{value:R(B,$,G)}),j}function u(B,F,$){try{return{type:"normal",arg:B.call(F,$)}}catch(z){return{type:"throw",arg:z}}}e.wrap=d;var h="suspendedStart",f="suspendedYield",g="executing",p="completed",v={};function m(){}function _(){}function y(){}var w={};c(w,s,function(){return this});var L=Object.getPrototypeOf,D=L&&L(L(H([])));D&&D!==t&&n.call(D,s)&&(w=D);var E=y.prototype=m.prototype=Object.create(w);function I(B){["next","throw","return"].forEach(function(F){c(B,F,function($){return this._invoke(F,$)})})}function k(B,F){function $(K,j,G,X){var ue=u(B[K],B,j);if(ue.type!=="throw"){var fe=ue.arg,pe=fe.value;return pe&&qn(pe)=="object"&&n.call(pe,"__await")?F.resolve(pe.__await).then(function(be){$("next",be,G,X)},function(be){$("throw",be,G,X)}):F.resolve(pe).then(function(be){fe.value=be,G(fe)},function(be){return $("throw",be,G,X)})}X(ue.arg)}var z;o(this,"_invoke",{value:function(j,G){function X(){return new F(function(ue,fe){$(j,G,ue,fe)})}return z=z?z.then(X,X):X()}})}function R(B,F,$){var z=h;return function(K,j){if(z===g)throw new Error("Generator is already running");if(z===p){if(K==="throw")throw j;return{value:i,done:!0}}for($.method=K,$.arg=j;;){var G=$.delegate;if(G){var X=A(G,$);if(X){if(X===v)continue;return X}}if($.method==="next")$.sent=$._sent=$.arg;else if($.method==="throw"){if(z===h)throw z=p,$.arg;$.dispatchException($.arg)}else $.method==="return"&&$.abrupt("return",$.arg);z=g;var ue=u(B,F,$);if(ue.type==="normal"){if(z=$.done?p:f,ue.arg===v)continue;return{value:ue.arg,done:$.done}}ue.type==="throw"&&(z=p,$.method="throw",$.arg=ue.arg)}}}function A(B,F){var $=F.method,z=B.iterator[$];if(z===i)return F.delegate=null,$==="throw"&&B.iterator.return&&(F.method="return",F.arg=i,A(B,F),F.method==="throw")||$!=="return"&&(F.method="throw",F.arg=new TypeError("The iterator does not provide a '"+$+"' method")),v;var K=u(z,B.iterator,F.arg);if(K.type==="throw")return F.method="throw",F.arg=K.arg,F.delegate=null,v;var j=K.arg;return j?j.done?(F[B.resultName]=j.value,F.next=B.nextLoc,F.method!=="return"&&(F.method="next",F.arg=i),F.delegate=null,v):j:(F.method="throw",F.arg=new TypeError("iterator result is not an object"),F.delegate=null,v)}function P(B){var F={tryLoc:B[0]};1 in B&&(F.catchLoc=B[1]),2 in B&&(F.finallyLoc=B[2],F.afterLoc=B[3]),this.tryEntries.push(F)}function N(B){var F=B.completion||{};F.type="normal",delete F.arg,B.completion=F}function M(B){this.tryEntries=[{tryLoc:"root"}],B.forEach(P,this),this.reset(!0)}function H(B){if(B||B===""){var F=B[s];if(F)return F.call(B);if(typeof B.next=="function")return B;if(!isNaN(B.length)){var $=-1,z=function K(){for(;++$=0;--K){var j=this.tryEntries[K],G=j.completion;if(j.tryLoc==="root")return z("end");if(j.tryLoc<=this.prev){var X=n.call(j,"catchLoc"),ue=n.call(j,"finallyLoc");if(X&&ue){if(this.prev=0;--z){var K=this.tryEntries[z];if(K.tryLoc<=this.prev&&n.call(K,"finallyLoc")&&this.prev=0;--$){var z=this.tryEntries[$];if(z.finallyLoc===F)return this.complete(z.completion,z.afterLoc),N(z),v}},catch:function(F){for(var $=this.tryEntries.length-1;$>=0;--$){var z=this.tryEntries[$];if(z.tryLoc===F){var K=z.completion;if(K.type==="throw"){var j=K.arg;N(z)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(F,$,z){return this.delegate={iterator:H(F),resultName:$,nextLoc:z},this.method==="next"&&(this.arg=i),v}},e}function cne(i,e,t,n,o,r,s){try{var a=i[r](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(n,o)}function Fb(i){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=i.apply(e,t);function s(l){cne(r,n,o,s,a,"next",l)}function a(l){cne(r,n,o,s,a,"throw",l)}s(void 0)})}}var II=Ce({},NRe),l7e=II.version,c7e=II.render,d7e=II.unmountComponentAtNode,I4;try{var u7e=Number((l7e||"").split(".")[0]);u7e>=18&&(I4=II.createRoot)}catch{}function dne(i){var e=II.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&qn(e)==="object"&&(e.usingClientEntryPoint=i)}var LA="__rc_react_root__";function h7e(i,e){dne(!0);var t=e[LA]||I4(e);dne(!1),t.render(i),e[LA]=t}function f7e(i,e){c7e(i,e)}function XK(i,e){if(I4){h7e(i,e);return}f7e(i,e)}function g7e(i){return mW.apply(this,arguments)}function mW(){return mW=Fb(ul().mark(function i(e){return ul().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var o;(o=e[LA])===null||o===void 0||o.unmount(),delete e[LA]}));case 1:case"end":return n.stop()}},i)})),mW.apply(this,arguments)}function p7e(i){d7e(i)}function Ope(i){return vW.apply(this,arguments)}function vW(){return vW=Fb(ul().mark(function i(e){return ul().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(I4===void 0){n.next=2;break}return n.abrupt("return",g7e(e));case 2:p7e(e);case 3:case"end":return n.stop()}},i)})),vW.apply(this,arguments)}const r6=()=>({height:0,opacity:0}),une=i=>{const{scrollHeight:e}=i;return{height:e,opacity:1}},m7e=i=>({height:i?i.offsetHeight:0}),s6=(i,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",v7e=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:r6,onEnterStart:r6,onAppearActive:une,onEnterActive:une,onLeaveStart:m7e,onLeaveActive:r6,onAppearEnd:s6,onEnterEnd:s6,onLeaveEnd:s6,motionDeadline:500}},q0=(i,e,t)=>t!==void 0?t:`${i}-${e}`;var _W=v7e,T4=function(i){if(!i)return!1;if(i instanceof Element){if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox(),t=e.width,n=e.height;if(t||n)return!0}if(i.getBoundingClientRect){var o=i.getBoundingClientRect(),r=o.width,s=o.height;if(r||s)return!0}}return!1};const _7e=i=>{const{componentCls:e,colorPrimary:t}=i;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${t})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${i.motionEaseOutCirc}`,`opacity 2s ${i.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow 0.3s ${i.motionEaseInOut}`,`opacity 0.35s ${i.motionEaseInOut}`].join(",")}}}}};var b7e=BK("Wave",i=>[_7e(i)]);function C7e(i){const e=(i||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function a6(i){return i&&i!=="#fff"&&i!=="#ffffff"&&i!=="rgb(255, 255, 255)"&&i!=="rgba(255, 255, 255, 1)"&&C7e(i)&&!/rgba\((?:\d*, ){3}0\)/.test(i)&&i!=="transparent"}function y7e(i){const{borderTopColor:e,borderColor:t,backgroundColor:n}=getComputedStyle(i);return a6(e)?e:a6(t)?t:a6(n)?n:null}const Fpe="ant-wave-target";function l6(i){return Number.isNaN(i)?0:i}const w7e=i=>{const{className:e,target:t,component:n}=i,o=x.exports.useRef(null),[r,s]=x.exports.useState(null),[a,l]=x.exports.useState([]),[c,d]=x.exports.useState(0),[u,h]=x.exports.useState(0),[f,g]=x.exports.useState(0),[p,v]=x.exports.useState(0),[m,_]=x.exports.useState(!1),y={left:c,top:u,width:f,height:p,borderRadius:a.map(D=>`${D}px`).join(" ")};r&&(y["--wave-color"]=r);function w(){const D=getComputedStyle(t);s(y7e(t));const E=D.position==="static",{borderLeftWidth:I,borderTopWidth:k}=D;d(E?t.offsetLeft:l6(-parseFloat(I))),h(E?t.offsetTop:l6(-parseFloat(k))),g(t.offsetWidth),v(t.offsetHeight);const{borderTopLeftRadius:R,borderTopRightRadius:A,borderBottomLeftRadius:P,borderBottomRightRadius:N}=D;l([R,A,N,P].map(M=>l6(parseFloat(M))))}if(x.exports.useEffect(()=>{if(t){const D=Xi(()=>{w(),_(!0)});let E;return typeof ResizeObserver!="undefined"&&(E=new ResizeObserver(w),E.observe(t)),()=>{Xi.cancel(D),E==null||E.disconnect()}}},[]),!m)return null;const L=(n==="Checkbox"||n==="Radio")&&(t==null?void 0:t.classList.contains(Fpe));return x.exports.createElement(th,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(D,E)=>{var I;if(E.deadline||E.propertyName==="opacity"){const k=(I=o.current)===null||I===void 0?void 0:I.parentElement;Ope(k).then(()=>{k==null||k.remove()})}return!1}},D=>{let{className:E}=D;return x.exports.createElement("div",{ref:o,className:Ue(e,{"wave-quick":L},E),style:y})})},S7e=(i,e)=>{var t;const{component:n}=e;if(n==="Checkbox"&&!(!((t=i.querySelector("input"))===null||t===void 0)&&t.checked))return;const o=document.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.top="0px",i==null||i.insertBefore(o,i==null?void 0:i.firstChild),XK(x.exports.createElement(w7e,Object.assign({},e,{target:i})),o)};var x7e=S7e;function L7e(i,e,t){const{wave:n}=x.exports.useContext(Hi),[,o,r]=Ba(),s=tl(c=>{const d=i.current;if((n==null?void 0:n.disabled)||!d)return;const u=d.querySelector(`.${Fpe}`)||d,{showEffect:h}=n||{};(h||x7e)(u,{className:e,token:o,component:t,event:c,hashId:r})}),a=x.exports.useRef();return c=>{Xi.cancel(a.current),a.current=Xi(()=>{s(c)})}}const E7e=i=>{const{children:e,disabled:t,component:n}=i,{getPrefixCls:o}=x.exports.useContext(Hi),r=x.exports.useRef(null),s=o("wave"),[,a]=b7e(s),l=L7e(r,Ue(s,a),n);if(Bt.useEffect(()=>{const d=r.current;if(!d||d.nodeType!==1||t)return;const u=h=>{!T4(h.target)||!d.getAttribute||d.getAttribute("disabled")||d.disabled||d.className.includes("disabled")||d.className.includes("-leave")||l(h)};return d.addEventListener("click",u,!0),()=>{d.removeEventListener("click",u,!0)}},[t]),!Bt.isValidElement(e))return e!=null?e:null;const c=Gv(e)?eh(e.ref,r):r;return vv(e,{ref:c})};var D7e=E7e;const k7e=i=>{const e=Bt.useContext(DI);return Bt.useMemo(()=>i?typeof i=="string"?i!=null?i:e:i instanceof Function?i(e):e:e,[i,e])};var Bb=k7e;globalThis&&globalThis.__rest;const Bpe=x.exports.createContext(null),N4=(i,e)=>{const t=x.exports.useContext(Bpe),n=x.exports.useMemo(()=>{if(!t)return"";const{compactDirection:o,isFirstItem:r,isLastItem:s}=t,a=o==="vertical"?"-vertical-":"-";return Ue(`${i}-compact${a}item`,{[`${i}-compact${a}first-item`]:r,[`${i}-compact${a}last-item`]:s,[`${i}-compact${a}item-rtl`]:e==="rtl"})},[i,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:n}},EA=i=>{let{children:e}=i;return x.exports.createElement(Bpe.Provider,{value:null},e)};var I7e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{getPrefixCls:e,direction:t}=x.exports.useContext(Hi),{prefixCls:n,size:o,className:r}=i,s=I7e(i,["prefixCls","size","className"]),a=e("btn-group",n),[,,l]=Ba();let c="";switch(o){case"large":c="lg";break;case"small":c="sm";break}const d=Ue(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},r,l);return x.exports.createElement(Wpe.Provider,{value:o},x.exports.createElement("div",Object.assign({},s,{className:d})))};var N7e=T7e;const hne=/^[\u4e00-\u9fa5]{2}$/,bW=hne.test.bind(hne);function Vpe(i){return i==="danger"?{danger:!0}:{type:i}}function fne(i){return typeof i=="string"}function c6(i){return i==="text"||i==="link"}function R7e(i,e){if(i==null)return;const t=e?" ":"";return typeof i!="string"&&typeof i!="number"&&fne(i.type)&&bW(i.props.children)?vv(i,{children:i.props.children.split("").join(t)}):fne(i)?bW(i)?Bt.createElement("span",null,i.split("").join(t)):Bt.createElement("span",null,i):Ipe(i)?Bt.createElement("span",null,i):i}function M7e(i,e){let t=!1;const n=[];return Bt.Children.forEach(i,o=>{const r=typeof o,s=r==="string"||r==="number";if(t&&s){const a=n.length-1,l=n[a];n[a]=`${l}${o}`}else n.push(o);t=s}),Bt.Children.map(n,o=>R7e(o,e))}const A7e=x.exports.forwardRef((i,e)=>{const{className:t,style:n,children:o,prefixCls:r}=i,s=Ue(`${r}-icon`,t);return he("span",{ref:e,className:s,style:n,children:o})});var Hpe=A7e;const gne=x.exports.forwardRef((i,e)=>{let{prefixCls:t,className:n,style:o,iconClassName:r}=i;const s=Ue(`${t}-loading-icon`,n);return he(Hpe,{prefixCls:t,className:s,style:o,ref:e,children:he(kI,{className:r})})}),d6=()=>({width:0,opacity:0,transform:"scale(0)"}),u6=i=>({width:i.scrollWidth,opacity:1,transform:"scale(1)"}),P7e=i=>{const{prefixCls:e,loading:t,existIcon:n,className:o,style:r}=i,s=!!t;return n?he(gne,{prefixCls:e,className:o,style:r}):he(th,{visible:s,motionName:`${e}-loading-icon-motion`,motionLeave:s,removeOnLeave:!0,onAppearStart:d6,onAppearActive:u6,onEnterStart:d6,onEnterActive:u6,onLeaveStart:u6,onLeaveActive:d6,children:(a,l)=>{let{className:c,style:d}=a;return he(gne,{prefixCls:e,className:o,style:Object.assign(Object.assign({},r),d),ref:l,iconClassName:c})}})};var O7e=P7e;const pne=(i,e)=>({[`> span, > ${i}`]:{"&:not(:last-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),F7e=i=>{const{componentCls:e,fontSize:t,lineWidth:n,groupBorderColor:o,colorErrorHover:r}=i;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:i.calc(n).mul(-1).equal(),[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,[`&:hover, + `]:{animationPlayState:"running"},[`${e}-move-up-leave`]:{animationName:w,animationDuration:u,animationPlayState:"paused",animationTimingFunction:d},[`${e}-move-up-leave${e}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[e]:{[`${_}-wrapper`]:Object.assign({},L)}},{[`${e}-notice-pure-panel`]:Object.assign(Object.assign({},L),{padding:0,textAlign:"start"})}]},G9e=i=>({zIndexPopup:i.zIndexPopupBase+qK+10,contentBg:i.colorBgElevated,contentPadding:`${(i.controlHeightLG-i.fontSize*i.lineHeight)/2}px ${i.paddingSM}px`});var Ape=jc("Message",i=>{const e=lr(i,{height:150});return[q9e(e)]},G9e),X9e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{prefixCls:e,type:t,icon:n,children:o}=i;return x.exports.createElement("div",{className:Ue(`${e}-custom-content`,`${e}-${t}`)},n||Y9e[t],x.exports.createElement("span",null,o))},Z9e=i=>{const{prefixCls:e,className:t,type:n,icon:o,content:r}=i,s=X9e(i,["prefixCls","className","type","icon","content"]),{getPrefixCls:a}=x.exports.useContext(Hi),l=e||a("message"),c=nh(l),[d,u,h]=Ape(l,c);return d(x.exports.createElement(Npe,Object.assign({},s,{prefixCls:l,className:Ue(t,u,`${l}-notice-pure-panel`,h,c),eventKey:"pure",duration:null,content:x.exports.createElement(Ppe,{prefixCls:l,type:n,icon:o},r)})))};var Q9e=Z9e;function J9e(i,e){return{motionName:e!=null?e:`${i}-move-up`}}function XK(i){let e;const t=new Promise(o=>{e=i(()=>{o(!0)})}),n=()=>{e==null||e()};return n.then=(o,r)=>t.then(o,r),n.promise=t,n}var e7e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{children:e,prefixCls:t}=i;const n=nh(t),[o,r,s]=Ape(t,n);return o(x.exports.createElement(N9e,{classNames:{list:Ue(r,s,n)}},e))},o7e=(i,e)=>{let{prefixCls:t,key:n}=e;return x.exports.createElement(i7e,{prefixCls:t,key:n},i)},r7e=x.exports.forwardRef((i,e)=>{const{top:t,prefixCls:n,getContainer:o,maxCount:r,duration:s=n7e,rtl:a,transitionName:l,onAllRemoved:c}=i,{getPrefixCls:d,getPopupContainer:u,message:h,direction:f}=x.exports.useContext(Hi),g=n||d("message"),p=()=>({left:"50%",transform:"translateX(-50%)",top:t!=null?t:t7e}),v=()=>Ue({[`${g}-rtl`]:a!=null?a:f==="rtl"}),m=()=>J9e(g,l),_=x.exports.createElement("span",{className:`${g}-close-x`},x.exports.createElement(hS,{className:`${g}-close-icon`})),[y,w]=W9e({prefixCls:g,style:p,className:v,motion:m,closable:!1,closeIcon:_,duration:s,getContainer:()=>(o==null?void 0:o())||(u==null?void 0:u())||document.body,maxCount:r,onAllRemoved:c,renderNotifications:o7e});return x.exports.useImperativeHandle(e,()=>Object.assign(Object.assign({},y),{prefixCls:g,message:h})),w});let cne=0;function Ope(i){const e=x.exports.useRef(null);return L4(),[x.exports.useMemo(()=>{const n=l=>{var c;(c=e.current)===null||c===void 0||c.close(l)},o=l=>{if(!e.current){const D=()=>{};return D.then=()=>{},D}const{open:c,prefixCls:d,message:u}=e.current,h=`${d}-notice`,{content:f,icon:g,type:p,key:v,className:m,style:_,onClose:y}=l,w=e7e(l,["content","icon","type","key","className","style","onClose"]);let L=v;return L==null&&(cne+=1,L=`antd-message-${cne}`),XK(D=>(c(Object.assign(Object.assign({},w),{key:L,content:x.exports.createElement(Ppe,{prefixCls:d,type:p,icon:g},f),placement:"top",className:Ue(p&&`${h}-${p}`,m,u==null?void 0:u.className),style:Object.assign(Object.assign({},u==null?void 0:u.style),_),onClose:()=>{y==null||y(),D()}})),()=>{n(L)}))},s={open:o,destroy:l=>{var c;l!==void 0?n(l):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(d,u,h)=>{let f;d&&typeof d=="object"&&"content"in d?f=d:f={content:d};let g,p;typeof u=="function"?p=u:(g=u,p=h);const v=Object.assign(Object.assign({onClose:p,duration:g},f),{type:l});return o(v)};s[l]=c}),s},[]),x.exports.createElement(r7e,Object.assign({key:"message-holder"},i,{ref:e}))]}function s7e(i){return Ope(i)}function a7e(){const[i,e]=x.exports.useState([]),t=x.exports.useCallback(n=>(e(o=>[].concat(_t(o),[n])),()=>{e(o=>o.filter(r=>r!==n))}),[]);return[i,t]}function ul(){ul=function(){return e};var i,e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(B,F,$){B[F]=$.value},r=typeof Symbol=="function"?Symbol:{},s=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function c(B,F,$){return Object.defineProperty(B,F,{value:$,enumerable:!0,configurable:!0,writable:!0}),B[F]}try{c({},"")}catch{c=function($,z,K){return $[z]=K}}function d(B,F,$,z){var K=F&&F.prototype instanceof m?F:m,j=Object.create(K.prototype),G=new M(z||[]);return o(j,"_invoke",{value:R(B,$,G)}),j}function u(B,F,$){try{return{type:"normal",arg:B.call(F,$)}}catch(z){return{type:"throw",arg:z}}}e.wrap=d;var h="suspendedStart",f="suspendedYield",g="executing",p="completed",v={};function m(){}function _(){}function y(){}var w={};c(w,s,function(){return this});var L=Object.getPrototypeOf,D=L&&L(L(H([])));D&&D!==t&&n.call(D,s)&&(w=D);var E=y.prototype=m.prototype=Object.create(w);function I(B){["next","throw","return"].forEach(function(F){c(B,F,function($){return this._invoke(F,$)})})}function k(B,F){function $(K,j,G,X){var ue=u(B[K],B,j);if(ue.type!=="throw"){var fe=ue.arg,pe=fe.value;return pe&&qn(pe)=="object"&&n.call(pe,"__await")?F.resolve(pe.__await).then(function(be){$("next",be,G,X)},function(be){$("throw",be,G,X)}):F.resolve(pe).then(function(be){fe.value=be,G(fe)},function(be){return $("throw",be,G,X)})}X(ue.arg)}var z;o(this,"_invoke",{value:function(j,G){function X(){return new F(function(ue,fe){$(j,G,ue,fe)})}return z=z?z.then(X,X):X()}})}function R(B,F,$){var z=h;return function(K,j){if(z===g)throw new Error("Generator is already running");if(z===p){if(K==="throw")throw j;return{value:i,done:!0}}for($.method=K,$.arg=j;;){var G=$.delegate;if(G){var X=A(G,$);if(X){if(X===v)continue;return X}}if($.method==="next")$.sent=$._sent=$.arg;else if($.method==="throw"){if(z===h)throw z=p,$.arg;$.dispatchException($.arg)}else $.method==="return"&&$.abrupt("return",$.arg);z=g;var ue=u(B,F,$);if(ue.type==="normal"){if(z=$.done?p:f,ue.arg===v)continue;return{value:ue.arg,done:$.done}}ue.type==="throw"&&(z=p,$.method="throw",$.arg=ue.arg)}}}function A(B,F){var $=F.method,z=B.iterator[$];if(z===i)return F.delegate=null,$==="throw"&&B.iterator.return&&(F.method="return",F.arg=i,A(B,F),F.method==="throw")||$!=="return"&&(F.method="throw",F.arg=new TypeError("The iterator does not provide a '"+$+"' method")),v;var K=u(z,B.iterator,F.arg);if(K.type==="throw")return F.method="throw",F.arg=K.arg,F.delegate=null,v;var j=K.arg;return j?j.done?(F[B.resultName]=j.value,F.next=B.nextLoc,F.method!=="return"&&(F.method="next",F.arg=i),F.delegate=null,v):j:(F.method="throw",F.arg=new TypeError("iterator result is not an object"),F.delegate=null,v)}function P(B){var F={tryLoc:B[0]};1 in B&&(F.catchLoc=B[1]),2 in B&&(F.finallyLoc=B[2],F.afterLoc=B[3]),this.tryEntries.push(F)}function N(B){var F=B.completion||{};F.type="normal",delete F.arg,B.completion=F}function M(B){this.tryEntries=[{tryLoc:"root"}],B.forEach(P,this),this.reset(!0)}function H(B){if(B||B===""){var F=B[s];if(F)return F.call(B);if(typeof B.next=="function")return B;if(!isNaN(B.length)){var $=-1,z=function K(){for(;++$=0;--K){var j=this.tryEntries[K],G=j.completion;if(j.tryLoc==="root")return z("end");if(j.tryLoc<=this.prev){var X=n.call(j,"catchLoc"),ue=n.call(j,"finallyLoc");if(X&&ue){if(this.prev=0;--z){var K=this.tryEntries[z];if(K.tryLoc<=this.prev&&n.call(K,"finallyLoc")&&this.prev=0;--$){var z=this.tryEntries[$];if(z.finallyLoc===F)return this.complete(z.completion,z.afterLoc),N(z),v}},catch:function(F){for(var $=this.tryEntries.length-1;$>=0;--$){var z=this.tryEntries[$];if(z.tryLoc===F){var K=z.completion;if(K.type==="throw"){var j=K.arg;N(z)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(F,$,z){return this.delegate={iterator:H(F),resultName:$,nextLoc:z},this.method==="next"&&(this.arg=i),v}},e}function dne(i,e,t,n,o,r,s){try{var a=i[r](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(n,o)}function Fb(i){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=i.apply(e,t);function s(l){dne(r,n,o,s,a,"next",l)}function a(l){dne(r,n,o,s,a,"throw",l)}s(void 0)})}}var II=Ce({},NRe),l7e=II.version,c7e=II.render,d7e=II.unmountComponentAtNode,I4;try{var u7e=Number((l7e||"").split(".")[0]);u7e>=18&&(I4=II.createRoot)}catch{}function une(i){var e=II.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&qn(e)==="object"&&(e.usingClientEntryPoint=i)}var LA="__rc_react_root__";function h7e(i,e){une(!0);var t=e[LA]||I4(e);une(!1),t.render(i),e[LA]=t}function f7e(i,e){c7e(i,e)}function YK(i,e){if(I4){h7e(i,e);return}f7e(i,e)}function g7e(i){return vW.apply(this,arguments)}function vW(){return vW=Fb(ul().mark(function i(e){return ul().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var o;(o=e[LA])===null||o===void 0||o.unmount(),delete e[LA]}));case 1:case"end":return n.stop()}},i)})),vW.apply(this,arguments)}function p7e(i){d7e(i)}function Fpe(i){return _W.apply(this,arguments)}function _W(){return _W=Fb(ul().mark(function i(e){return ul().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(I4===void 0){n.next=2;break}return n.abrupt("return",g7e(e));case 2:p7e(e);case 3:case"end":return n.stop()}},i)})),_W.apply(this,arguments)}const s6=()=>({height:0,opacity:0}),hne=i=>{const{scrollHeight:e}=i;return{height:e,opacity:1}},m7e=i=>({height:i?i.offsetHeight:0}),a6=(i,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",v7e=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:s6,onEnterStart:s6,onAppearActive:hne,onEnterActive:hne,onLeaveStart:m7e,onLeaveActive:s6,onAppearEnd:a6,onEnterEnd:a6,onLeaveEnd:a6,motionDeadline:500}},q0=(i,e,t)=>t!==void 0?t:`${i}-${e}`;var bW=v7e,T4=function(i){if(!i)return!1;if(i instanceof Element){if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox(),t=e.width,n=e.height;if(t||n)return!0}if(i.getBoundingClientRect){var o=i.getBoundingClientRect(),r=o.width,s=o.height;if(r||s)return!0}}return!1};const _7e=i=>{const{componentCls:e,colorPrimary:t}=i;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${t})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${i.motionEaseOutCirc}`,`opacity 2s ${i.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow 0.3s ${i.motionEaseInOut}`,`opacity 0.35s ${i.motionEaseInOut}`].join(",")}}}}};var b7e=WK("Wave",i=>[_7e(i)]);function C7e(i){const e=(i||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function l6(i){return i&&i!=="#fff"&&i!=="#ffffff"&&i!=="rgb(255, 255, 255)"&&i!=="rgba(255, 255, 255, 1)"&&C7e(i)&&!/rgba\((?:\d*, ){3}0\)/.test(i)&&i!=="transparent"}function y7e(i){const{borderTopColor:e,borderColor:t,backgroundColor:n}=getComputedStyle(i);return l6(e)?e:l6(t)?t:l6(n)?n:null}const Bpe="ant-wave-target";function c6(i){return Number.isNaN(i)?0:i}const w7e=i=>{const{className:e,target:t,component:n}=i,o=x.exports.useRef(null),[r,s]=x.exports.useState(null),[a,l]=x.exports.useState([]),[c,d]=x.exports.useState(0),[u,h]=x.exports.useState(0),[f,g]=x.exports.useState(0),[p,v]=x.exports.useState(0),[m,_]=x.exports.useState(!1),y={left:c,top:u,width:f,height:p,borderRadius:a.map(D=>`${D}px`).join(" ")};r&&(y["--wave-color"]=r);function w(){const D=getComputedStyle(t);s(y7e(t));const E=D.position==="static",{borderLeftWidth:I,borderTopWidth:k}=D;d(E?t.offsetLeft:c6(-parseFloat(I))),h(E?t.offsetTop:c6(-parseFloat(k))),g(t.offsetWidth),v(t.offsetHeight);const{borderTopLeftRadius:R,borderTopRightRadius:A,borderBottomLeftRadius:P,borderBottomRightRadius:N}=D;l([R,A,N,P].map(M=>c6(parseFloat(M))))}if(x.exports.useEffect(()=>{if(t){const D=Xi(()=>{w(),_(!0)});let E;return typeof ResizeObserver!="undefined"&&(E=new ResizeObserver(w),E.observe(t)),()=>{Xi.cancel(D),E==null||E.disconnect()}}},[]),!m)return null;const L=(n==="Checkbox"||n==="Radio")&&(t==null?void 0:t.classList.contains(Bpe));return x.exports.createElement(th,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(D,E)=>{var I;if(E.deadline||E.propertyName==="opacity"){const k=(I=o.current)===null||I===void 0?void 0:I.parentElement;Fpe(k).then(()=>{k==null||k.remove()})}return!1}},D=>{let{className:E}=D;return x.exports.createElement("div",{ref:o,className:Ue(e,{"wave-quick":L},E),style:y})})},S7e=(i,e)=>{var t;const{component:n}=e;if(n==="Checkbox"&&!(!((t=i.querySelector("input"))===null||t===void 0)&&t.checked))return;const o=document.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.top="0px",i==null||i.insertBefore(o,i==null?void 0:i.firstChild),YK(x.exports.createElement(w7e,Object.assign({},e,{target:i})),o)};var x7e=S7e;function L7e(i,e,t){const{wave:n}=x.exports.useContext(Hi),[,o,r]=Ba(),s=tl(c=>{const d=i.current;if((n==null?void 0:n.disabled)||!d)return;const u=d.querySelector(`.${Bpe}`)||d,{showEffect:h}=n||{};(h||x7e)(u,{className:e,token:o,component:t,event:c,hashId:r})}),a=x.exports.useRef();return c=>{Xi.cancel(a.current),a.current=Xi(()=>{s(c)})}}const E7e=i=>{const{children:e,disabled:t,component:n}=i,{getPrefixCls:o}=x.exports.useContext(Hi),r=x.exports.useRef(null),s=o("wave"),[,a]=b7e(s),l=L7e(r,Ue(s,a),n);if(Bt.useEffect(()=>{const d=r.current;if(!d||d.nodeType!==1||t)return;const u=h=>{!T4(h.target)||!d.getAttribute||d.getAttribute("disabled")||d.disabled||d.className.includes("disabled")||d.className.includes("-leave")||l(h)};return d.addEventListener("click",u,!0),()=>{d.removeEventListener("click",u,!0)}},[t]),!Bt.isValidElement(e))return e!=null?e:null;const c=Gv(e)?eh(e.ref,r):r;return _v(e,{ref:c})};var D7e=E7e;const k7e=i=>{const e=Bt.useContext(DI);return Bt.useMemo(()=>i?typeof i=="string"?i!=null?i:e:i instanceof Function?i(e):e:e,[i,e])};var Bb=k7e;globalThis&&globalThis.__rest;const Wpe=x.exports.createContext(null),N4=(i,e)=>{const t=x.exports.useContext(Wpe),n=x.exports.useMemo(()=>{if(!t)return"";const{compactDirection:o,isFirstItem:r,isLastItem:s}=t,a=o==="vertical"?"-vertical-":"-";return Ue(`${i}-compact${a}item`,{[`${i}-compact${a}first-item`]:r,[`${i}-compact${a}last-item`]:s,[`${i}-compact${a}item-rtl`]:e==="rtl"})},[i,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:n}},EA=i=>{let{children:e}=i;return x.exports.createElement(Wpe.Provider,{value:null},e)};var I7e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{getPrefixCls:e,direction:t}=x.exports.useContext(Hi),{prefixCls:n,size:o,className:r}=i,s=I7e(i,["prefixCls","size","className"]),a=e("btn-group",n),[,,l]=Ba();let c="";switch(o){case"large":c="lg";break;case"small":c="sm";break}const d=Ue(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},r,l);return x.exports.createElement(Vpe.Provider,{value:o},x.exports.createElement("div",Object.assign({},s,{className:d})))};var N7e=T7e;const fne=/^[\u4e00-\u9fa5]{2}$/,CW=fne.test.bind(fne);function Hpe(i){return i==="danger"?{danger:!0}:{type:i}}function gne(i){return typeof i=="string"}function d6(i){return i==="text"||i==="link"}function R7e(i,e){if(i==null)return;const t=e?" ":"";return typeof i!="string"&&typeof i!="number"&&gne(i.type)&&CW(i.props.children)?_v(i,{children:i.props.children.split("").join(t)}):gne(i)?CW(i)?Bt.createElement("span",null,i.split("").join(t)):Bt.createElement("span",null,i):Tpe(i)?Bt.createElement("span",null,i):i}function M7e(i,e){let t=!1;const n=[];return Bt.Children.forEach(i,o=>{const r=typeof o,s=r==="string"||r==="number";if(t&&s){const a=n.length-1,l=n[a];n[a]=`${l}${o}`}else n.push(o);t=s}),Bt.Children.map(n,o=>R7e(o,e))}const A7e=x.exports.forwardRef((i,e)=>{const{className:t,style:n,children:o,prefixCls:r}=i,s=Ue(`${r}-icon`,t);return he("span",{ref:e,className:s,style:n,children:o})});var $pe=A7e;const pne=x.exports.forwardRef((i,e)=>{let{prefixCls:t,className:n,style:o,iconClassName:r}=i;const s=Ue(`${t}-loading-icon`,n);return he($pe,{prefixCls:t,className:s,style:o,ref:e,children:he(kI,{className:r})})}),u6=()=>({width:0,opacity:0,transform:"scale(0)"}),h6=i=>({width:i.scrollWidth,opacity:1,transform:"scale(1)"}),P7e=i=>{const{prefixCls:e,loading:t,existIcon:n,className:o,style:r}=i,s=!!t;return n?he(pne,{prefixCls:e,className:o,style:r}):he(th,{visible:s,motionName:`${e}-loading-icon-motion`,motionLeave:s,removeOnLeave:!0,onAppearStart:u6,onAppearActive:h6,onEnterStart:u6,onEnterActive:h6,onLeaveStart:h6,onLeaveActive:u6,children:(a,l)=>{let{className:c,style:d}=a;return he(pne,{prefixCls:e,className:o,style:Object.assign(Object.assign({},r),d),ref:l,iconClassName:c})}})};var O7e=P7e;const mne=(i,e)=>({[`> span, > ${i}`]:{"&:not(:last-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),F7e=i=>{const{componentCls:e,fontSize:t,lineWidth:n,groupBorderColor:o,colorErrorHover:r}=i;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:i.calc(n).mul(-1).equal(),[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,[`&:hover, &:focus, - &:active`]:{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},pne(`${e}-primary`,o),pne(`${e}-danger`,r)]}};var B7e=F7e;const $pe=i=>{const{paddingInline:e,onlyIconSize:t,paddingBlock:n}=i;return lr(i,{buttonPaddingHorizontal:e,buttonPaddingVertical:n,buttonIconOnlyFontSize:t})},zpe=i=>{var e,t,n,o,r,s;const a=(e=i.contentFontSize)!==null&&e!==void 0?e:i.fontSize,l=(t=i.contentFontSizeSM)!==null&&t!==void 0?t:i.fontSize,c=(n=i.contentFontSizeLG)!==null&&n!==void 0?n:i.fontSizeLG,d=(o=i.contentLineHeight)!==null&&o!==void 0?o:jR(a),u=(r=i.contentLineHeightSM)!==null&&r!==void 0?r:jR(l),h=(s=i.contentLineHeightLG)!==null&&s!==void 0?s:jR(c);return{fontWeight:400,defaultShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlTmpOutline}`,primaryShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlOutline}`,dangerShadow:`0 ${i.controlOutlineWidth}px 0 ${i.colorErrorOutline}`,primaryColor:i.colorTextLightSolid,dangerColor:i.colorTextLightSolid,borderColorDisabled:i.colorBorder,defaultGhostColor:i.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:i.colorBgContainer,paddingInline:i.paddingContentHorizontal-i.lineWidth,paddingInlineLG:i.paddingContentHorizontal-i.lineWidth,paddingInlineSM:8-i.lineWidth,onlyIconSize:i.fontSizeLG,onlyIconSizeSM:i.fontSizeLG-2,onlyIconSizeLG:i.fontSizeLG+2,groupBorderColor:i.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:i.colorBgTextHover,defaultColor:i.colorText,defaultBg:i.colorBgContainer,defaultBorderColor:i.colorBorder,defaultBorderColorDisabled:i.colorBorder,contentFontSize:a,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:d,contentLineHeightSM:u,contentLineHeightLG:h,paddingBlock:Math.max((i.controlHeight-a*d)/2-i.lineWidth,0),paddingBlockSM:Math.max((i.controlHeightSM-l*u)/2-i.lineWidth,0),paddingBlockLG:Math.max((i.controlHeightLG-c*h)/2-i.lineWidth,0)}},W7e=i=>{const{componentCls:e,iconCls:t,fontWeight:n}=i;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:n,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${rt(i.lineWidth)} ${i.lineType} transparent`,cursor:"pointer",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:i.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},[`${e}-icon`]:{lineHeight:0},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:i.marginXS},[`&:not(${e}-icon-only) > ${e}-icon`]:{[`&${e}-loading-icon, &:not(:last-child)`]:{marginInlineEnd:i.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},E4(i)),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${t})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&-icon-only${e}-compact-item`]:{flex:"none"}}}},rp=(i,e,t)=>({[`&:not(:disabled):not(${i}-disabled)`]:{"&:hover":e,"&:active":t}}),V7e=i=>({minWidth:i.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),H7e=i=>({borderRadius:i.controlHeight,paddingInlineStart:i.calc(i.controlHeight).div(2).equal(),paddingInlineEnd:i.calc(i.controlHeight).div(2).equal()}),$7e=i=>({cursor:"not-allowed",borderColor:i.borderColorDisabled,color:i.colorTextDisabled,background:i.colorBgContainerDisabled,boxShadow:"none"}),mD=(i,e,t,n,o,r,s,a)=>({[`&${i}-background-ghost`]:Object.assign(Object.assign({color:t||void 0,background:e,borderColor:n||void 0,boxShadow:"none"},rp(i,Object.assign({background:e},s),Object.assign({background:e},a))),{"&:disabled":{cursor:"not-allowed",color:o||void 0,borderColor:r||void 0}})}),YK=i=>({[`&:disabled, &${i.componentCls}-disabled`]:Object.assign({},$7e(i))}),Upe=i=>Object.assign({},YK(i)),DA=i=>({[`&:disabled, &${i.componentCls}-disabled`]:{cursor:"not-allowed",color:i.colorTextDisabled}}),jpe=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Upe(i)),{background:i.defaultBg,borderColor:i.defaultBorderColor,color:i.defaultColor,boxShadow:i.defaultShadow}),rp(i.componentCls,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),mD(i.componentCls,i.ghostBg,i.defaultGhostColor,i.defaultGhostBorderColor,i.colorTextDisabled,i.colorBorder)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:i.colorError,borderColor:i.colorError},rp(i.componentCls,{color:i.colorErrorHover,borderColor:i.colorErrorBorderHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),mD(i.componentCls,i.ghostBg,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder)),YK(i))}),z7e=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Upe(i)),{color:i.primaryColor,background:i.colorPrimary,boxShadow:i.primaryShadow}),rp(i.componentCls,{color:i.colorTextLightSolid,background:i.colorPrimaryHover},{color:i.colorTextLightSolid,background:i.colorPrimaryActive})),mD(i.componentCls,i.ghostBg,i.colorPrimary,i.colorPrimary,i.colorTextDisabled,i.colorBorder,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({background:i.colorError,boxShadow:i.dangerShadow,color:i.dangerColor},rp(i.componentCls,{background:i.colorErrorHover},{background:i.colorErrorActive})),mD(i.componentCls,i.ghostBg,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder,{color:i.colorErrorHover,borderColor:i.colorErrorHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),YK(i))}),U7e=i=>Object.assign(Object.assign({},jpe(i)),{borderStyle:"dashed"}),j7e=i=>Object.assign(Object.assign(Object.assign({color:i.colorLink},rp(i.componentCls,{color:i.colorLinkHover,background:i.linkHoverBg},{color:i.colorLinkActive})),DA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},rp(i.componentCls,{color:i.colorErrorHover},{color:i.colorErrorActive})),DA(i))}),K7e=i=>Object.assign(Object.assign(Object.assign({},rp(i.componentCls,{color:i.colorText,background:i.textHoverBg},{color:i.colorText,background:i.colorBgTextActive})),DA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},DA(i)),rp(i.componentCls,{color:i.colorErrorHover,background:i.colorErrorBg},{color:i.colorErrorHover,background:i.colorErrorBg}))}),q7e=i=>{const{componentCls:e}=i;return{[`${e}-default`]:jpe(i),[`${e}-primary`]:z7e(i),[`${e}-dashed`]:U7e(i),[`${e}-link`]:j7e(i),[`${e}-text`]:K7e(i),[`${e}-ghost`]:mD(i.componentCls,i.ghostBg,i.colorBgContainer,i.colorBgContainer,i.colorTextDisabled,i.colorBorder)}},ZK=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,controlHeight:n,fontSize:o,lineHeight:r,borderRadius:s,buttonPaddingHorizontal:a,iconCls:l,buttonPaddingVertical:c}=i,d=`${t}-icon-only`;return[{[`${e}`]:{fontSize:o,lineHeight:r,height:n,padding:`${rt(c)} ${rt(a)}`,borderRadius:s,[`&${d}`]:{width:n,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},[l]:{fontSize:i.buttonIconOnlyFontSize}},[`&${t}-loading`]:{opacity:i.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`}}},{[`${t}${t}-circle${e}`]:V7e(i)},{[`${t}${t}-round${e}`]:H7e(i)}]},G7e=i=>{const e=lr(i,{fontSize:i.contentFontSize,lineHeight:i.contentLineHeight});return ZK(e,i.componentCls)},X7e=i=>{const e=lr(i,{controlHeight:i.controlHeightSM,fontSize:i.contentFontSizeSM,lineHeight:i.contentLineHeightSM,padding:i.paddingXS,buttonPaddingHorizontal:i.paddingInlineSM,buttonPaddingVertical:i.paddingBlockSM,borderRadius:i.borderRadiusSM,buttonIconOnlyFontSize:i.onlyIconSizeSM});return ZK(e,`${i.componentCls}-sm`)},Y7e=i=>{const e=lr(i,{controlHeight:i.controlHeightLG,fontSize:i.contentFontSizeLG,lineHeight:i.contentLineHeightLG,buttonPaddingHorizontal:i.paddingInlineLG,buttonPaddingVertical:i.paddingBlockLG,borderRadius:i.borderRadiusLG,buttonIconOnlyFontSize:i.onlyIconSizeLG});return ZK(e,`${i.componentCls}-lg`)},Z7e=i=>{const{componentCls:e}=i;return{[e]:{[`&${e}-block`]:{width:"100%"}}}};var Q7e=jc("Button",i=>{const e=$pe(i);return[W7e(e),G7e(e),X7e(e),Y7e(e),Z7e(e),q7e(e),B7e(e)]},zpe,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function J7e(i,e,t){const{focusElCls:n,focus:o,borderElCls:r}=t,s=r?"> *":"",a=["hover",o?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:i.calc(i.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},n?{[`&${n}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function eBe(i,e,t){const{borderElCls:n}=t,o=n?`> ${n}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${o}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${o}, &${i}-sm ${o}, &${i}-lg ${o}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${o}, &${i}-sm ${o}, &${i}-lg ${o}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function QK(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=i,n=`${t}-compact`;return{[n]:Object.assign(Object.assign({},J7e(i,n,e)),eBe(t,n,e))}}function tBe(i,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:i.calc(i.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function nBe(i,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function iBe(i){const e=`${i.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},tBe(i,e)),nBe(i.componentCls,e))}}const oBe=i=>{const{componentCls:e,calc:t}=i;return{[e]:{[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:t(i.lineWidth).mul(-1).equal(),insetInlineStart:t(i.lineWidth).mul(-1).equal(),display:"inline-block",width:i.lineWidth,height:`calc(100% + ${rt(i.lineWidth)} * 2)`,backgroundColor:i.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:t(i.lineWidth).mul(-1).equal(),insetInlineStart:t(i.lineWidth).mul(-1).equal(),display:"inline-block",width:`calc(100% + ${rt(i.lineWidth)} * 2)`,height:i.lineWidth,backgroundColor:i.colorPrimaryHover,content:'""'}}}}}}};var rBe=WK(["Button","compact"],i=>{const e=$pe(i);return[QK(e),iBe(e),oBe(e)]},zpe),sBe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,n;const{loading:o=!1,prefixCls:r,type:s="default",danger:a,shape:l="default",size:c,styles:d,disabled:u,className:h,rootClassName:f,children:g,icon:p,ghost:v=!1,block:m=!1,htmlType:_="button",classNames:y,style:w={}}=i,L=sBe(i,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","ghost","block","htmlType","classNames","style"]),{getPrefixCls:D,autoInsertSpaceInButton:E,direction:I,button:k}=x.exports.useContext(Hi),R=D("btn",r),[A,P,N]=Q7e(R),M=x.exports.useContext(dS),H=u!=null?u:M,B=x.exports.useContext(Wpe),F=x.exports.useMemo(()=>aBe(o),[o]),[$,z]=x.exports.useState(F.loading),[K,j]=x.exports.useState(!1),X=eh(e,x.exports.createRef()),ue=x.exports.Children.count(g)===1&&!p&&!c6(s);x.exports.useEffect(()=>{let ie=null;F.delay>0?ie=setTimeout(()=>{ie=null,z(!0)},F.delay):z(F.loading);function se(){ie&&(clearTimeout(ie),ie=null)}return se},[F]),x.exports.useEffect(()=>{if(!X||!X.current||E===!1)return;const ie=X.current.textContent;ue&&bW(ie)?K||j(!0):K&&j(!1)},[X]);const fe=ie=>{const{onClick:se}=i;if($||H){ie.preventDefault();return}se==null||se(ie)},pe=E!==!1,{compactSize:be,compactItemClassnames:Se}=N4(R,I),Fe={large:"lg",small:"sm",middle:void 0},De=Bb(ie=>{var se,U;return(U=(se=c!=null?c:be)!==null&&se!==void 0?se:B)!==null&&U!==void 0?U:ie}),ce=De&&Fe[De]||"",Pe=$?"loading":p,Oe=kf(L,["navigate"]),xe=Ue(R,P,N,{[`${R}-${l}`]:l!=="default"&&l,[`${R}-${s}`]:s,[`${R}-${ce}`]:ce,[`${R}-icon-only`]:!g&&g!==0&&!!Pe,[`${R}-background-ghost`]:v&&!c6(s),[`${R}-loading`]:$,[`${R}-two-chinese-chars`]:K&&pe&&!$,[`${R}-block`]:m,[`${R}-dangerous`]:!!a,[`${R}-rtl`]:I==="rtl"},Se,h,f,k==null?void 0:k.className),Ee=Object.assign(Object.assign({},k==null?void 0:k.style),w),tt=Ue(y==null?void 0:y.icon,(t=k==null?void 0:k.classNames)===null||t===void 0?void 0:t.icon),nt=Object.assign(Object.assign({},(d==null?void 0:d.icon)||{}),((n=k==null?void 0:k.styles)===null||n===void 0?void 0:n.icon)||{}),Qe=p&&!$?he(Hpe,{prefixCls:R,className:tt,style:nt,children:p}):he(O7e,{existIcon:!!p,prefixCls:R,loading:!!$}),Ge=g||g===0?M7e(g,ue&&pe):null;if(Oe.href!==void 0)return A(fn("a",{...Object.assign({},Oe,{className:Ue(xe,{[`${R}-disabled`]:H}),href:H?void 0:Oe.href,style:Ee,onClick:fe,ref:X,tabIndex:H?-1:0}),children:[Qe,Ge]}));let re=fn("button",{...Object.assign({},L,{type:_,className:xe,style:Ee,onClick:fe,disabled:H,ref:X}),children:[Qe,Ge,!!Se&&he(rBe,{prefixCls:R},"compact")]});return c6(s)||(re=he(D7e,{component:"Button",disabled:!!$,children:re})),A(re)},JK=x.exports.forwardRef(lBe);JK.Group=N7e;JK.__ANT_BUTTON=!0;var ts=JK;function mne(i){return!!(i&&i.then)}const cBe=i=>{const{type:e,children:t,prefixCls:n,buttonProps:o,close:r,autoFocus:s,emitEvent:a,isSilent:l,quitOnNullishReturnValue:c,actionFn:d}=i,u=x.exports.useRef(!1),h=x.exports.useRef(null),[f,g]=Um(!1),p=function(){r==null||r.apply(void 0,arguments)};x.exports.useEffect(()=>{let _=null;return s&&(_=setTimeout(()=>{var y;(y=h.current)===null||y===void 0||y.focus()})),()=>{_&&clearTimeout(_)}},[]);const v=_=>{!mne(_)||(g(!0),_.then(function(){g(!1,!0),p.apply(void 0,arguments),u.current=!1},y=>{if(g(!1,!0),u.current=!1,!(l!=null&&l()))return Promise.reject(y)}))},m=_=>{if(u.current)return;if(u.current=!0,!d){p();return}let y;if(a){if(y=d(_),c&&!mne(y)){u.current=!1,p(_);return}}else if(d.length)y=d(r),u.current=!1;else if(y=d(),!y){p();return}v(y)};return x.exports.createElement(ts,Object.assign({},Vpe(e),{onClick:m,loading:f,prefixCls:n},o,{ref:h}),t)};var Kpe=cBe;const TI=Bt.createContext({}),{Provider:qpe}=TI,dBe=()=>{const{autoFocusButton:i,cancelButtonProps:e,cancelTextLocale:t,isSilent:n,mergedOkCancel:o,rootPrefixCls:r,close:s,onCancel:a,onConfirm:l}=x.exports.useContext(TI);return o?he(Kpe,{isSilent:n,actionFn:a,close:function(){s==null||s.apply(void 0,arguments),l==null||l(!1)},autoFocus:i==="cancel",buttonProps:e,prefixCls:`${r}-btn`,children:t}):null};var vne=dBe;const uBe=()=>{const{autoFocusButton:i,close:e,isSilent:t,okButtonProps:n,rootPrefixCls:o,okTextLocale:r,okType:s,onConfirm:a,onOk:l}=x.exports.useContext(TI);return he(Kpe,{isSilent:t,type:s||"primary",actionFn:l,close:function(){e==null||e.apply(void 0,arguments),a==null||a(!0)},autoFocus:i==="ok",buttonProps:n,prefixCls:`${o}-btn`,children:r})};var _ne=uBe,Gpe=x.exports.createContext(null),bne=[];function hBe(i,e){var t=x.exports.useState(function(){if(!Fa())return null;var g=document.createElement("div");return g}),n=Ne(t,1),o=n[0],r=x.exports.useRef(!1),s=x.exports.useContext(Gpe),a=x.exports.useState(bne),l=Ne(a,2),c=l[0],d=l[1],u=s||(r.current?void 0:function(g){d(function(p){var v=[g].concat(_t(p));return v})});function h(){o.parentElement||document.body.appendChild(o),r.current=!0}function f(){var g;(g=o.parentElement)===null||g===void 0||g.removeChild(o),r.current=!1}return go(function(){return i?s?s(h):h():f(),f},[i]),go(function(){c.length&&(c.forEach(function(g){return g()}),d(bne))},[c]),[o,u]}var h6;function fBe(i){if(typeof document=="undefined")return 0;if(i||h6===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),n=t.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var o=e.offsetWidth;t.style.overflow="scroll";var r=e.offsetWidth;o===r&&(r=t.clientWidth),document.body.removeChild(t),h6=o-r}return h6}function Cne(i){var e=i.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?fBe():t}function gBe(i){if(typeof document=="undefined"||!i||!(i instanceof Element))return{width:0,height:0};var e=getComputedStyle(i,"::-webkit-scrollbar"),t=e.width,n=e.height;return{width:Cne(t),height:Cne(n)}}function pBe(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var mBe="rc-util-locker-".concat(Date.now()),yne=0;function vBe(i){var e=!!i,t=x.exports.useState(function(){return yne+=1,"".concat(mBe,"_").concat(yne)}),n=Ne(t,1),o=n[0];go(function(){if(e){var r=gBe(document.body).width,s=pBe();pv(` + &:active`]:{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},mne(`${e}-primary`,o),mne(`${e}-danger`,r)]}};var B7e=F7e;const zpe=i=>{const{paddingInline:e,onlyIconSize:t,paddingBlock:n}=i;return lr(i,{buttonPaddingHorizontal:e,buttonPaddingVertical:n,buttonIconOnlyFontSize:t})},Upe=i=>{var e,t,n,o,r,s;const a=(e=i.contentFontSize)!==null&&e!==void 0?e:i.fontSize,l=(t=i.contentFontSizeSM)!==null&&t!==void 0?t:i.fontSize,c=(n=i.contentFontSizeLG)!==null&&n!==void 0?n:i.fontSizeLG,d=(o=i.contentLineHeight)!==null&&o!==void 0?o:jR(a),u=(r=i.contentLineHeightSM)!==null&&r!==void 0?r:jR(l),h=(s=i.contentLineHeightLG)!==null&&s!==void 0?s:jR(c);return{fontWeight:400,defaultShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlTmpOutline}`,primaryShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlOutline}`,dangerShadow:`0 ${i.controlOutlineWidth}px 0 ${i.colorErrorOutline}`,primaryColor:i.colorTextLightSolid,dangerColor:i.colorTextLightSolid,borderColorDisabled:i.colorBorder,defaultGhostColor:i.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:i.colorBgContainer,paddingInline:i.paddingContentHorizontal-i.lineWidth,paddingInlineLG:i.paddingContentHorizontal-i.lineWidth,paddingInlineSM:8-i.lineWidth,onlyIconSize:i.fontSizeLG,onlyIconSizeSM:i.fontSizeLG-2,onlyIconSizeLG:i.fontSizeLG+2,groupBorderColor:i.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:i.colorBgTextHover,defaultColor:i.colorText,defaultBg:i.colorBgContainer,defaultBorderColor:i.colorBorder,defaultBorderColorDisabled:i.colorBorder,contentFontSize:a,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:d,contentLineHeightSM:u,contentLineHeightLG:h,paddingBlock:Math.max((i.controlHeight-a*d)/2-i.lineWidth,0),paddingBlockSM:Math.max((i.controlHeightSM-l*u)/2-i.lineWidth,0),paddingBlockLG:Math.max((i.controlHeightLG-c*h)/2-i.lineWidth,0)}},W7e=i=>{const{componentCls:e,iconCls:t,fontWeight:n}=i;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:n,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${rt(i.lineWidth)} ${i.lineType} transparent`,cursor:"pointer",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:i.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},[`${e}-icon`]:{lineHeight:0},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:i.marginXS},[`&:not(${e}-icon-only) > ${e}-icon`]:{[`&${e}-loading-icon, &:not(:last-child)`]:{marginInlineEnd:i.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},E4(i)),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${t})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&-icon-only${e}-compact-item`]:{flex:"none"}}}},rp=(i,e,t)=>({[`&:not(:disabled):not(${i}-disabled)`]:{"&:hover":e,"&:active":t}}),V7e=i=>({minWidth:i.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),H7e=i=>({borderRadius:i.controlHeight,paddingInlineStart:i.calc(i.controlHeight).div(2).equal(),paddingInlineEnd:i.calc(i.controlHeight).div(2).equal()}),$7e=i=>({cursor:"not-allowed",borderColor:i.borderColorDisabled,color:i.colorTextDisabled,background:i.colorBgContainerDisabled,boxShadow:"none"}),mD=(i,e,t,n,o,r,s,a)=>({[`&${i}-background-ghost`]:Object.assign(Object.assign({color:t||void 0,background:e,borderColor:n||void 0,boxShadow:"none"},rp(i,Object.assign({background:e},s),Object.assign({background:e},a))),{"&:disabled":{cursor:"not-allowed",color:o||void 0,borderColor:r||void 0}})}),ZK=i=>({[`&:disabled, &${i.componentCls}-disabled`]:Object.assign({},$7e(i))}),jpe=i=>Object.assign({},ZK(i)),DA=i=>({[`&:disabled, &${i.componentCls}-disabled`]:{cursor:"not-allowed",color:i.colorTextDisabled}}),Kpe=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},jpe(i)),{background:i.defaultBg,borderColor:i.defaultBorderColor,color:i.defaultColor,boxShadow:i.defaultShadow}),rp(i.componentCls,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),mD(i.componentCls,i.ghostBg,i.defaultGhostColor,i.defaultGhostBorderColor,i.colorTextDisabled,i.colorBorder)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:i.colorError,borderColor:i.colorError},rp(i.componentCls,{color:i.colorErrorHover,borderColor:i.colorErrorBorderHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),mD(i.componentCls,i.ghostBg,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder)),ZK(i))}),z7e=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},jpe(i)),{color:i.primaryColor,background:i.colorPrimary,boxShadow:i.primaryShadow}),rp(i.componentCls,{color:i.colorTextLightSolid,background:i.colorPrimaryHover},{color:i.colorTextLightSolid,background:i.colorPrimaryActive})),mD(i.componentCls,i.ghostBg,i.colorPrimary,i.colorPrimary,i.colorTextDisabled,i.colorBorder,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({background:i.colorError,boxShadow:i.dangerShadow,color:i.dangerColor},rp(i.componentCls,{background:i.colorErrorHover},{background:i.colorErrorActive})),mD(i.componentCls,i.ghostBg,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder,{color:i.colorErrorHover,borderColor:i.colorErrorHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),ZK(i))}),U7e=i=>Object.assign(Object.assign({},Kpe(i)),{borderStyle:"dashed"}),j7e=i=>Object.assign(Object.assign(Object.assign({color:i.colorLink},rp(i.componentCls,{color:i.colorLinkHover,background:i.linkHoverBg},{color:i.colorLinkActive})),DA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},rp(i.componentCls,{color:i.colorErrorHover},{color:i.colorErrorActive})),DA(i))}),K7e=i=>Object.assign(Object.assign(Object.assign({},rp(i.componentCls,{color:i.colorText,background:i.textHoverBg},{color:i.colorText,background:i.colorBgTextActive})),DA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},DA(i)),rp(i.componentCls,{color:i.colorErrorHover,background:i.colorErrorBg},{color:i.colorErrorHover,background:i.colorErrorBg}))}),q7e=i=>{const{componentCls:e}=i;return{[`${e}-default`]:Kpe(i),[`${e}-primary`]:z7e(i),[`${e}-dashed`]:U7e(i),[`${e}-link`]:j7e(i),[`${e}-text`]:K7e(i),[`${e}-ghost`]:mD(i.componentCls,i.ghostBg,i.colorBgContainer,i.colorBgContainer,i.colorTextDisabled,i.colorBorder)}},QK=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,controlHeight:n,fontSize:o,lineHeight:r,borderRadius:s,buttonPaddingHorizontal:a,iconCls:l,buttonPaddingVertical:c}=i,d=`${t}-icon-only`;return[{[`${e}`]:{fontSize:o,lineHeight:r,height:n,padding:`${rt(c)} ${rt(a)}`,borderRadius:s,[`&${d}`]:{width:n,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},[l]:{fontSize:i.buttonIconOnlyFontSize}},[`&${t}-loading`]:{opacity:i.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`}}},{[`${t}${t}-circle${e}`]:V7e(i)},{[`${t}${t}-round${e}`]:H7e(i)}]},G7e=i=>{const e=lr(i,{fontSize:i.contentFontSize,lineHeight:i.contentLineHeight});return QK(e,i.componentCls)},X7e=i=>{const e=lr(i,{controlHeight:i.controlHeightSM,fontSize:i.contentFontSizeSM,lineHeight:i.contentLineHeightSM,padding:i.paddingXS,buttonPaddingHorizontal:i.paddingInlineSM,buttonPaddingVertical:i.paddingBlockSM,borderRadius:i.borderRadiusSM,buttonIconOnlyFontSize:i.onlyIconSizeSM});return QK(e,`${i.componentCls}-sm`)},Y7e=i=>{const e=lr(i,{controlHeight:i.controlHeightLG,fontSize:i.contentFontSizeLG,lineHeight:i.contentLineHeightLG,buttonPaddingHorizontal:i.paddingInlineLG,buttonPaddingVertical:i.paddingBlockLG,borderRadius:i.borderRadiusLG,buttonIconOnlyFontSize:i.onlyIconSizeLG});return QK(e,`${i.componentCls}-lg`)},Z7e=i=>{const{componentCls:e}=i;return{[e]:{[`&${e}-block`]:{width:"100%"}}}};var Q7e=jc("Button",i=>{const e=zpe(i);return[W7e(e),G7e(e),X7e(e),Y7e(e),Z7e(e),q7e(e),B7e(e)]},Upe,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function J7e(i,e,t){const{focusElCls:n,focus:o,borderElCls:r}=t,s=r?"> *":"",a=["hover",o?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:i.calc(i.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},n?{[`&${n}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function eBe(i,e,t){const{borderElCls:n}=t,o=n?`> ${n}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${o}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${o}, &${i}-sm ${o}, &${i}-lg ${o}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${o}, &${i}-sm ${o}, &${i}-lg ${o}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function JK(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=i,n=`${t}-compact`;return{[n]:Object.assign(Object.assign({},J7e(i,n,e)),eBe(t,n,e))}}function tBe(i,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:i.calc(i.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function nBe(i,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function iBe(i){const e=`${i.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},tBe(i,e)),nBe(i.componentCls,e))}}const oBe=i=>{const{componentCls:e,calc:t}=i;return{[e]:{[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:t(i.lineWidth).mul(-1).equal(),insetInlineStart:t(i.lineWidth).mul(-1).equal(),display:"inline-block",width:i.lineWidth,height:`calc(100% + ${rt(i.lineWidth)} * 2)`,backgroundColor:i.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:t(i.lineWidth).mul(-1).equal(),insetInlineStart:t(i.lineWidth).mul(-1).equal(),display:"inline-block",width:`calc(100% + ${rt(i.lineWidth)} * 2)`,height:i.lineWidth,backgroundColor:i.colorPrimaryHover,content:'""'}}}}}}};var rBe=VK(["Button","compact"],i=>{const e=zpe(i);return[JK(e),iBe(e),oBe(e)]},Upe),sBe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,n;const{loading:o=!1,prefixCls:r,type:s="default",danger:a,shape:l="default",size:c,styles:d,disabled:u,className:h,rootClassName:f,children:g,icon:p,ghost:v=!1,block:m=!1,htmlType:_="button",classNames:y,style:w={}}=i,L=sBe(i,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","ghost","block","htmlType","classNames","style"]),{getPrefixCls:D,autoInsertSpaceInButton:E,direction:I,button:k}=x.exports.useContext(Hi),R=D("btn",r),[A,P,N]=Q7e(R),M=x.exports.useContext(dS),H=u!=null?u:M,B=x.exports.useContext(Vpe),F=x.exports.useMemo(()=>aBe(o),[o]),[$,z]=x.exports.useState(F.loading),[K,j]=x.exports.useState(!1),X=eh(e,x.exports.createRef()),ue=x.exports.Children.count(g)===1&&!p&&!d6(s);x.exports.useEffect(()=>{let ie=null;F.delay>0?ie=setTimeout(()=>{ie=null,z(!0)},F.delay):z(F.loading);function se(){ie&&(clearTimeout(ie),ie=null)}return se},[F]),x.exports.useEffect(()=>{if(!X||!X.current||E===!1)return;const ie=X.current.textContent;ue&&CW(ie)?K||j(!0):K&&j(!1)},[X]);const fe=ie=>{const{onClick:se}=i;if($||H){ie.preventDefault();return}se==null||se(ie)},pe=E!==!1,{compactSize:be,compactItemClassnames:Se}=N4(R,I),Fe={large:"lg",small:"sm",middle:void 0},De=Bb(ie=>{var se,U;return(U=(se=c!=null?c:be)!==null&&se!==void 0?se:B)!==null&&U!==void 0?U:ie}),ce=De&&Fe[De]||"",Pe=$?"loading":p,Oe=kf(L,["navigate"]),xe=Ue(R,P,N,{[`${R}-${l}`]:l!=="default"&&l,[`${R}-${s}`]:s,[`${R}-${ce}`]:ce,[`${R}-icon-only`]:!g&&g!==0&&!!Pe,[`${R}-background-ghost`]:v&&!d6(s),[`${R}-loading`]:$,[`${R}-two-chinese-chars`]:K&&pe&&!$,[`${R}-block`]:m,[`${R}-dangerous`]:!!a,[`${R}-rtl`]:I==="rtl"},Se,h,f,k==null?void 0:k.className),Ee=Object.assign(Object.assign({},k==null?void 0:k.style),w),tt=Ue(y==null?void 0:y.icon,(t=k==null?void 0:k.classNames)===null||t===void 0?void 0:t.icon),nt=Object.assign(Object.assign({},(d==null?void 0:d.icon)||{}),((n=k==null?void 0:k.styles)===null||n===void 0?void 0:n.icon)||{}),Qe=p&&!$?he($pe,{prefixCls:R,className:tt,style:nt,children:p}):he(O7e,{existIcon:!!p,prefixCls:R,loading:!!$}),Ge=g||g===0?M7e(g,ue&&pe):null;if(Oe.href!==void 0)return A(fn("a",{...Object.assign({},Oe,{className:Ue(xe,{[`${R}-disabled`]:H}),href:H?void 0:Oe.href,style:Ee,onClick:fe,ref:X,tabIndex:H?-1:0}),children:[Qe,Ge]}));let re=fn("button",{...Object.assign({},L,{type:_,className:xe,style:Ee,onClick:fe,disabled:H,ref:X}),children:[Qe,Ge,!!Se&&he(rBe,{prefixCls:R},"compact")]});return d6(s)||(re=he(D7e,{component:"Button",disabled:!!$,children:re})),A(re)},eq=x.exports.forwardRef(lBe);eq.Group=N7e;eq.__ANT_BUTTON=!0;var ts=eq;function vne(i){return!!(i&&i.then)}const cBe=i=>{const{type:e,children:t,prefixCls:n,buttonProps:o,close:r,autoFocus:s,emitEvent:a,isSilent:l,quitOnNullishReturnValue:c,actionFn:d}=i,u=x.exports.useRef(!1),h=x.exports.useRef(null),[f,g]=jm(!1),p=function(){r==null||r.apply(void 0,arguments)};x.exports.useEffect(()=>{let _=null;return s&&(_=setTimeout(()=>{var y;(y=h.current)===null||y===void 0||y.focus()})),()=>{_&&clearTimeout(_)}},[]);const v=_=>{!vne(_)||(g(!0),_.then(function(){g(!1,!0),p.apply(void 0,arguments),u.current=!1},y=>{if(g(!1,!0),u.current=!1,!(l!=null&&l()))return Promise.reject(y)}))},m=_=>{if(u.current)return;if(u.current=!0,!d){p();return}let y;if(a){if(y=d(_),c&&!vne(y)){u.current=!1,p(_);return}}else if(d.length)y=d(r),u.current=!1;else if(y=d(),!y){p();return}v(y)};return x.exports.createElement(ts,Object.assign({},Hpe(e),{onClick:m,loading:f,prefixCls:n},o,{ref:h}),t)};var qpe=cBe;const TI=Bt.createContext({}),{Provider:Gpe}=TI,dBe=()=>{const{autoFocusButton:i,cancelButtonProps:e,cancelTextLocale:t,isSilent:n,mergedOkCancel:o,rootPrefixCls:r,close:s,onCancel:a,onConfirm:l}=x.exports.useContext(TI);return o?he(qpe,{isSilent:n,actionFn:a,close:function(){s==null||s.apply(void 0,arguments),l==null||l(!1)},autoFocus:i==="cancel",buttonProps:e,prefixCls:`${r}-btn`,children:t}):null};var _ne=dBe;const uBe=()=>{const{autoFocusButton:i,close:e,isSilent:t,okButtonProps:n,rootPrefixCls:o,okTextLocale:r,okType:s,onConfirm:a,onOk:l}=x.exports.useContext(TI);return he(qpe,{isSilent:t,type:s||"primary",actionFn:l,close:function(){e==null||e.apply(void 0,arguments),a==null||a(!0)},autoFocus:i==="ok",buttonProps:n,prefixCls:`${o}-btn`,children:r})};var bne=uBe,Xpe=x.exports.createContext(null),Cne=[];function hBe(i,e){var t=x.exports.useState(function(){if(!Fa())return null;var g=document.createElement("div");return g}),n=Ne(t,1),o=n[0],r=x.exports.useRef(!1),s=x.exports.useContext(Xpe),a=x.exports.useState(Cne),l=Ne(a,2),c=l[0],d=l[1],u=s||(r.current?void 0:function(g){d(function(p){var v=[g].concat(_t(p));return v})});function h(){o.parentElement||document.body.appendChild(o),r.current=!0}function f(){var g;(g=o.parentElement)===null||g===void 0||g.removeChild(o),r.current=!1}return go(function(){return i?s?s(h):h():f(),f},[i]),go(function(){c.length&&(c.forEach(function(g){return g()}),d(Cne))},[c]),[o,u]}var f6;function fBe(i){if(typeof document=="undefined")return 0;if(i||f6===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),n=t.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var o=e.offsetWidth;t.style.overflow="scroll";var r=e.offsetWidth;o===r&&(r=t.clientWidth),document.body.removeChild(t),f6=o-r}return f6}function yne(i){var e=i.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?fBe():t}function gBe(i){if(typeof document=="undefined"||!i||!(i instanceof Element))return{width:0,height:0};var e=getComputedStyle(i,"::-webkit-scrollbar"),t=e.width,n=e.height;return{width:yne(t),height:yne(n)}}function pBe(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var mBe="rc-util-locker-".concat(Date.now()),wne=0;function vBe(i){var e=!!i,t=x.exports.useState(function(){return wne+=1,"".concat(mBe,"_").concat(wne)}),n=Ne(t,1),o=n[0];go(function(){if(e){var r=gBe(document.body).width,s=pBe();mv(` html body { overflow-y: hidden; `.concat(s?"width: calc(100% - ".concat(r,"px);"):"",` -}`),o)}else hD(o);return function(){hD(o)}},[e,o])}var wne=!1;function _Be(i){return typeof i=="boolean"&&(wne=i),wne}var Sne=function(e){return e===!1?!1:!Fa()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},eq=x.exports.forwardRef(function(i,e){var t=i.open,n=i.autoLock,o=i.getContainer;i.debug;var r=i.autoDestroy,s=r===void 0?!0:r,a=i.children,l=x.exports.useState(t),c=Ne(l,2),d=c[0],u=c[1],h=d||t;x.exports.useEffect(function(){(s||t)&&u(t)},[t,s]);var f=x.exports.useState(function(){return Sne(o)}),g=Ne(f,2),p=g[0],v=g[1];x.exports.useEffect(function(){var A=Sne(o);v(A!=null?A:null)});var m=hBe(h&&!p),_=Ne(m,2),y=_[0],w=_[1],L=p!=null?p:y;vBe(n&&t&&Fa()&&(L===y||L===document.body));var D=null;if(a&&Gv(a)&&e){var E=a;D=E.ref}var I=Pb(D,e);if(!h||!Fa()||p===void 0)return null;var k=L===!1||_Be(),R=a;return e&&(R=x.exports.cloneElement(a,{ref:I})),x.exports.createElement(Gpe.Provider,{value:w},k?R:zu.exports.createPortal(R,L))}),Xpe=x.exports.createContext({});function bBe(){var i=Ce({},fI);return i.useId}var xne=0,Lne=bBe(),Ype=Lne?function(e){var t=Lne();return e||t}:function(e){var t=x.exports.useState("ssr-id"),n=Ne(t,2),o=n[0],r=n[1];return x.exports.useEffect(function(){var s=xne;xne+=1,r("rc_unique_".concat(s))},[]),e||o};function Ene(i,e,t){var n=e;return!n&&t&&(n="".concat(i,"-").concat(t)),n}function Dne(i,e){var t=i["page".concat(e?"Y":"X","Offset")],n="scroll".concat(e?"Top":"Left");if(typeof t!="number"){var o=i.document;t=o.documentElement[n],typeof t!="number"&&(t=o.body[n])}return t}function CBe(i){var e=i.getBoundingClientRect(),t={left:e.left,top:e.top},n=i.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=Dne(o),t.top+=Dne(o,!0),t}var yBe=x.exports.memo(function(i){var e=i.children;return e},function(i,e){var t=e.shouldUpdate;return!t}),kne={width:0,height:0,overflow:"hidden",outline:"none"},Zpe=Bt.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,o=i.style,r=i.title,s=i.ariaId,a=i.footer,l=i.closable,c=i.closeIcon,d=i.onClose,u=i.children,h=i.bodyStyle,f=i.bodyProps,g=i.modalRender,p=i.onMouseDown,v=i.onMouseUp,m=i.holderRef,_=i.visible,y=i.forceRender,w=i.width,L=i.height,D=i.classNames,E=i.styles,I=Bt.useContext(Xpe),k=I.panel,R=Pb(m,k),A=x.exports.useRef(),P=x.exports.useRef();Bt.useImperativeHandle(e,function(){return{focus:function(){var z;(z=A.current)===null||z===void 0||z.focus()},changeActive:function(z){var K=document,j=K.activeElement;z&&j===P.current?A.current.focus():!z&&j===A.current&&P.current.focus()}}});var N={};w!==void 0&&(N.width=w),L!==void 0&&(N.height=L);var M;a&&(M=he("div",{className:Ue("".concat(t,"-footer"),D==null?void 0:D.footer),style:Ce({},E==null?void 0:E.footer),children:a}));var H;r&&(H=he("div",{className:Ue("".concat(t,"-header"),D==null?void 0:D.header),style:Ce({},E==null?void 0:E.header),children:he("div",{className:"".concat(t,"-title"),id:s,children:r})}));var B;l&&(B=he("button",{type:"button",onClick:d,"aria-label":"Close",className:"".concat(t,"-close"),children:c||he("span",{className:"".concat(t,"-close-x")})}));var F=fn("div",{className:Ue("".concat(t,"-content"),D==null?void 0:D.content),style:E==null?void 0:E.content,children:[B,H,he("div",{className:Ue("".concat(t,"-body"),D==null?void 0:D.body),style:Ce(Ce({},h),E==null?void 0:E.body),...f,children:u}),M]});return fn("div",{role:"dialog","aria-labelledby":r?s:null,"aria-modal":"true",ref:R,style:Ce(Ce({},o),N),className:Ue(t,n),onMouseDown:p,onMouseUp:v,children:[he("div",{tabIndex:0,ref:A,style:kne,"aria-hidden":"true"}),he(yBe,{shouldUpdate:_||y,children:g?g(F):F}),he("div",{tabIndex:0,ref:P,style:kne,"aria-hidden":"true"})]},"dialog-element")}),Qpe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.title,o=i.style,r=i.className,s=i.visible,a=i.forceRender,l=i.destroyOnClose,c=i.motionName,d=i.ariaId,u=i.onVisibleChanged,h=i.mousePosition,f=x.exports.useRef(),g=x.exports.useState(),p=Ne(g,2),v=p[0],m=p[1],_={};v&&(_.transformOrigin=v);function y(){var w=CBe(f.current);m(h?"".concat(h.x-w.left,"px ").concat(h.y-w.top,"px"):"")}return x.exports.createElement(th,{visible:s,onVisibleChanged:u,onAppearPrepare:y,onEnterPrepare:y,forceRender:a,motionName:c,removeOnLeave:l,ref:f},function(w,L){var D=w.className,E=w.style;return x.exports.createElement(Zpe,yt({},i,{ref:e,title:n,ariaId:d,prefixCls:t,holderRef:L,style:Ce(Ce(Ce({},E),o),_),className:Ue(r,D)}))})});Qpe.displayName="Content";function wBe(i){var e=i.prefixCls,t=i.style,n=i.visible,o=i.maskProps,r=i.motionName,s=i.className;return x.exports.createElement(th,{key:"mask",visible:n,motionName:r,leavedClassName:"".concat(e,"-mask-hidden")},function(a,l){var c=a.className,d=a.style;return x.exports.createElement("div",yt({ref:l,style:Ce(Ce({},d),t),className:Ue("".concat(e,"-mask"),c,s)},o))})}function SBe(i){var e=i.prefixCls,t=e===void 0?"rc-dialog":e,n=i.zIndex,o=i.visible,r=o===void 0?!1:o,s=i.keyboard,a=s===void 0?!0:s,l=i.focusTriggerAfterClose,c=l===void 0?!0:l,d=i.wrapStyle,u=i.wrapClassName,h=i.wrapProps,f=i.onClose,g=i.afterOpenChange,p=i.afterClose,v=i.transitionName,m=i.animation,_=i.closable,y=_===void 0?!0:_,w=i.mask,L=w===void 0?!0:w,D=i.maskTransitionName,E=i.maskAnimation,I=i.maskClosable,k=I===void 0?!0:I,R=i.maskStyle,A=i.maskProps,P=i.rootClassName,N=i.classNames,M=i.styles,H=x.exports.useRef(),B=x.exports.useRef(),F=x.exports.useRef(),$=x.exports.useState(r),z=Ne($,2),K=z[0],j=z[1],G=Ype();function X(){GB(B.current,document.activeElement)||(H.current=document.activeElement)}function ue(){if(!GB(B.current,document.activeElement)){var Oe;(Oe=F.current)===null||Oe===void 0||Oe.focus()}}function fe(Oe){if(Oe)ue();else{if(j(!1),L&&H.current&&c){try{H.current.focus({preventScroll:!0})}catch{}H.current=null}K&&(p==null||p())}g==null||g(Oe)}function pe(Oe){f==null||f(Oe)}var be=x.exports.useRef(!1),Se=x.exports.useRef(),Fe=function(){clearTimeout(Se.current),be.current=!0},De=function(){Se.current=setTimeout(function(){be.current=!1})},ce=null;k&&(ce=function(xe){be.current?be.current=!1:B.current===xe.target&&pe(xe)});function Pe(Oe){if(a&&Oe.keyCode===at.ESC){Oe.stopPropagation(),pe(Oe);return}r&&Oe.keyCode===at.TAB&&F.current.changeActive(!Oe.shiftKey)}return x.exports.useEffect(function(){r&&(j(!0),X())},[r]),x.exports.useEffect(function(){return function(){clearTimeout(Se.current)}},[]),x.exports.createElement("div",yt({className:Ue("".concat(t,"-root"),P)},K0(i,{data:!0})),x.exports.createElement(wBe,{prefixCls:t,visible:L&&r,motionName:Ene(t,D,E),style:Ce(Ce({zIndex:n},R),M==null?void 0:M.mask),maskProps:A,className:N==null?void 0:N.mask}),x.exports.createElement("div",yt({tabIndex:-1,onKeyDown:Pe,className:Ue("".concat(t,"-wrap"),u,N==null?void 0:N.wrapper),ref:B,onClick:ce,style:Ce(Ce(Ce({zIndex:n},d),M==null?void 0:M.wrapper),{},{display:K?null:"none"})},h),x.exports.createElement(Qpe,yt({},i,{onMouseDown:Fe,onMouseUp:De,ref:F,closable:y,ariaId:G,prefixCls:t,visible:r&&K,onClose:pe,onVisibleChanged:fe,motionName:Ene(t,v,m)}))))}var Jpe=function(e){var t=e.visible,n=e.getContainer,o=e.forceRender,r=e.destroyOnClose,s=r===void 0?!1:r,a=e.afterClose,l=e.panelRef,c=x.exports.useState(t),d=Ne(c,2),u=d[0],h=d[1],f=x.exports.useMemo(function(){return{panel:l}},[l]);return x.exports.useEffect(function(){t&&h(!0)},[t]),!o&&s&&!u?null:x.exports.createElement(Xpe.Provider,{value:f},x.exports.createElement(eq,{open:t||o||u,autoDestroy:!1,getContainer:n,autoLock:t||u},x.exports.createElement(SBe,yt({},e,{destroyOnClose:s,afterClose:function(){a==null||a(),h(!1)}}))))};Jpe.displayName="Dialog";function xBe(i,e,t){return typeof i=="boolean"?i:e===void 0?!!t:e!==!1&&e!==null}function LBe(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Bt.createElement(hS,null),o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(!xBe(i,e,o))return[!1,null];const s=typeof e=="boolean"||e===void 0||e===null?n:e;return[!0,t?t(s):s]}const EBe=()=>Fa()&&window.document.documentElement;var r0="RC_FORM_INTERNAL_HOOKS",bo=function(){rr(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},G0=x.exports.createContext({getFieldValue:bo,getFieldsValue:bo,getFieldError:bo,getFieldWarning:bo,getFieldsError:bo,isFieldsTouched:bo,isFieldTouched:bo,isFieldValidating:bo,isFieldsValidating:bo,resetFields:bo,setFields:bo,setFieldValue:bo,setFieldsValue:bo,validateFields:bo,submit:bo,getInternalHooks:function(){return bo(),{dispatch:bo,initEntityValue:bo,registerField:bo,useSubscribe:bo,setInitialValues:bo,destroyForm:bo,setCallbacks:bo,registerWatch:bo,getFields:bo,setValidateMessages:bo,setPreserve:bo,getInitialValue:bo}}}),vD=x.exports.createContext(null);function CW(i){return i==null?[]:Array.isArray(i)?i:[i]}function DBe(i){return i&&!!i._init}function s0(){return s0=Object.assign?Object.assign.bind():function(i){for(var e=1;e1?e-1:0),n=1;n=r)return a;switch(a){case"%s":return String(t[o++]);case"%d":return Number(t[o++]);case"%j":try{return JSON.stringify(t[o++])}catch{return"[Circular]"}break;default:return a}});return s}return i}function MBe(i){return i==="string"||i==="url"||i==="hex"||i==="email"||i==="date"||i==="pattern"}function Ss(i,e){return!!(i==null||e==="array"&&Array.isArray(i)&&!i.length||MBe(e)&&typeof i=="string"&&!i)}function ABe(i,e,t){var n=[],o=0,r=i.length;function s(a){n.push.apply(n,a||[]),o++,o===r&&t(n)}i.forEach(function(a){e(a,s)})}function Ine(i,e,t){var n=0,o=i.length;function r(s){if(s&&s.length){t(s);return}var a=n;n=n+1,a3&&arguments[3]!==void 0?arguments[3]:Bt.createElement(hS,null),o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(!xBe(i,e,o))return[!1,null];const s=typeof e=="boolean"||e===void 0||e===null?n:e;return[!0,t?t(s):s]}const EBe=()=>Fa()&&window.document.documentElement;var r0="RC_FORM_INTERNAL_HOOKS",bo=function(){rr(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},G0=x.exports.createContext({getFieldValue:bo,getFieldsValue:bo,getFieldError:bo,getFieldWarning:bo,getFieldsError:bo,isFieldsTouched:bo,isFieldTouched:bo,isFieldValidating:bo,isFieldsValidating:bo,resetFields:bo,setFields:bo,setFieldValue:bo,setFieldsValue:bo,validateFields:bo,submit:bo,getInternalHooks:function(){return bo(),{dispatch:bo,initEntityValue:bo,registerField:bo,useSubscribe:bo,setInitialValues:bo,destroyForm:bo,setCallbacks:bo,registerWatch:bo,getFields:bo,setValidateMessages:bo,setPreserve:bo,getInitialValue:bo}}}),vD=x.exports.createContext(null);function yW(i){return i==null?[]:Array.isArray(i)?i:[i]}function DBe(i){return i&&!!i._init}function s0(){return s0=Object.assign?Object.assign.bind():function(i){for(var e=1;e1?e-1:0),n=1;n=r)return a;switch(a){case"%s":return String(t[o++]);case"%d":return Number(t[o++]);case"%j":try{return JSON.stringify(t[o++])}catch{return"[Circular]"}break;default:return a}});return s}return i}function MBe(i){return i==="string"||i==="url"||i==="hex"||i==="email"||i==="date"||i==="pattern"}function Ss(i,e){return!!(i==null||e==="array"&&Array.isArray(i)&&!i.length||MBe(e)&&typeof i=="string"&&!i)}function ABe(i,e,t){var n=[],o=0,r=i.length;function s(a){n.push.apply(n,a||[]),o++,o===r&&t(n)}i.forEach(function(a){e(a,s)})}function Tne(i,e,t){var n=0,o=i.length;function r(s){if(s&&s.length){t(s);return}var a=n;n=n+1,a()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},vL={integer:function(e){return vL.number(e)&&parseInt(e,10)===e},float:function(e){return vL.number(e)&&!vL.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!vL.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(Mne.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(VBe())},hex:function(e){return typeof e=="string"&&!!e.match(Mne.hex)}},HBe=function(e,t,n,o,r){if(e.required&&t===void 0){eme(e,t,n,o,r);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?vL[a](t)||o.push(Dc(r.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&o.push(Dc(r.messages.types[a],e.fullField,e.type))},$Be=function(e,t,n,o,r){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=t,u=null,h=typeof t=="number",f=typeof t=="string",g=Array.isArray(t);if(h?u="number":f?u="string":g&&(u="array"),!u)return!1;g&&(d=t.length),f&&(d=t.replace(c,"_").length),s?d!==e.len&&o.push(Dc(r.messages[u].len,e.fullField,e.len)):a&&!l&&de.max?o.push(Dc(r.messages[u].max,e.fullField,e.max)):a&&l&&(de.max)&&o.push(Dc(r.messages[u].range,e.fullField,e.min,e.max))},k1="enum",zBe=function(e,t,n,o,r){e[k1]=Array.isArray(e[k1])?e[k1]:[],e[k1].indexOf(t)===-1&&o.push(Dc(r.messages[k1],e.fullField,e[k1].join(", ")))},UBe=function(e,t,n,o,r){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||o.push(Dc(r.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||o.push(Dc(r.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},ki={required:eme,whitespace:WBe,type:HBe,range:$Be,enum:zBe,pattern:UBe},jBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t,"string")&&!e.required)return n();ki.required(e,t,o,s,r,"string"),Ss(t,"string")||(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r),ki.pattern(e,t,o,s,r),e.whitespace===!0&&ki.whitespace(e,t,o,s,r))}n(s)},KBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},qBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},GBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},XBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),Ss(t)||ki.type(e,t,o,s,r)}n(s)},YBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},ZBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},QBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return n();ki.required(e,t,o,s,r,"array"),t!=null&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},JBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},eWe="enum",tWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki[eWe](e,t,o,s,r)}n(s)},nWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t,"string")&&!e.required)return n();ki.required(e,t,o,s,r),Ss(t,"string")||ki.pattern(e,t,o,s,r)}n(s)},iWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t,"date")&&!e.required)return n();if(ki.required(e,t,o,s,r),!Ss(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),ki.type(e,l,o,s,r),l&&ki.range(e,l.getTime(),o,s,r)}}n(s)},oWe=function(e,t,n,o,r){var s=[],a=Array.isArray(t)?"array":typeof t;ki.required(e,t,o,s,r,a),n(s)},f6=function(e,t,n,o,r){var s=e.type,a=[],l=e.required||!e.required&&o.hasOwnProperty(e.field);if(l){if(Ss(t,s)&&!e.required)return n();ki.required(e,t,o,a,r,s),Ss(t,s)||ki.type(e,t,o,a,r)}n(a)},rWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r)}n(s)},rE={string:jBe,method:KBe,number:qBe,boolean:GBe,regexp:XBe,integer:YBe,float:ZBe,array:QBe,object:JBe,enum:tWe,pattern:nWe,date:iWe,url:f6,hex:f6,email:f6,required:oWe,any:rWe};function xW(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var LW=xW(),NI=function(){function i(t){this.rules=null,this._messages=LW,this.define(t)}var e=i.prototype;return e.define=function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(r){var s=n[r];o.rules[r]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Rne(xW(),n)),this._messages},e.validate=function(n,o,r){var s=this;o===void 0&&(o={}),r===void 0&&(r=function(){});var a=n,l=o,c=r;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function d(p){var v=[],m={};function _(w){if(Array.isArray(w)){var L;v=(L=v).concat.apply(L,w)}else v.push(w)}for(var y=0;y2&&arguments[2]!==void 0?arguments[2]:!1;return i&&i.some(function(n){return nme(e,n,t)})}function nme(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!i||!e||!t&&i.length!==e.length?!1:e.every(function(n,o){return i[o]===n})}function dWe(i,e){if(i===e)return!0;if(!i&&e||i&&!e||!i||!e||qn(i)!=="object"||qn(e)!=="object")return!1;var t=Object.keys(i),n=Object.keys(e),o=new Set([].concat(t,n));return _t(o).every(function(r){var s=i[r],a=e[r];return typeof s=="function"&&typeof a=="function"?!0:s===a})}function uWe(i){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&qn(e.target)==="object"&&i in e.target?e.target[i]:e}function Fne(i,e,t){var n=i.length;if(e<0||e>=n||t<0||t>=n)return i;var o=i[e],r=e-t;return r>0?[].concat(_t(i.slice(0,t)),[o],_t(i.slice(t,e)),_t(i.slice(e+1,n))):r<0?[].concat(_t(i.slice(0,e)),_t(i.slice(e+1,t+1)),[o],_t(i.slice(t+1,n))):i}var hWe=["name"],ld=[];function Bne(i,e,t,n,o,r){return typeof i=="function"?i(e,t,"source"in r?{source:r.source}:{}):n!==o}var tq=function(i){fp(t,i);var e=Ob(t);function t(n){var o;if(ga(this,t),o=e.call(this,n),me(ci(o),"state",{resetCount:0}),me(ci(o),"cancelRegisterFunc",null),me(ci(o),"mounted",!1),me(ci(o),"touched",!1),me(ci(o),"dirty",!1),me(ci(o),"validatePromise",void 0),me(ci(o),"prevValidating",void 0),me(ci(o),"errors",ld),me(ci(o),"warnings",ld),me(ci(o),"cancelRegister",function(){var l=o.props,c=l.preserve,d=l.isListField,u=l.name;o.cancelRegisterFunc&&o.cancelRegisterFunc(d,c,Ar(u)),o.cancelRegisterFunc=null}),me(ci(o),"getNamePath",function(){var l=o.props,c=l.name,d=l.fieldContext,u=d.prefixName,h=u===void 0?[]:u;return c!==void 0?[].concat(_t(h),_t(c)):[]}),me(ci(o),"getRules",function(){var l=o.props,c=l.rules,d=c===void 0?[]:c,u=l.fieldContext;return d.map(function(h){return typeof h=="function"?h(u):h})}),me(ci(o),"refresh",function(){!o.mounted||o.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),me(ci(o),"metaCache",null),me(ci(o),"triggerMetaEvent",function(l){var c=o.props.onMetaChange;if(c){var d=Ce(Ce({},o.getMeta()),{},{destroy:l});y4(o.metaCache,d)||c(d),o.metaCache=d}else o.metaCache=null}),me(ci(o),"onStoreChange",function(l,c,d){var u=o.props,h=u.shouldUpdate,f=u.dependencies,g=f===void 0?[]:f,p=u.onReset,v=d.store,m=o.getNamePath(),_=o.getValue(l),y=o.getValue(v),w=c&&gy(c,m);switch(d.type==="valueUpdate"&&d.source==="external"&&_!==y&&(o.touched=!0,o.dirty=!0,o.validatePromise=null,o.errors=ld,o.warnings=ld,o.triggerMetaEvent()),d.type){case"reset":if(!c||w){o.touched=!1,o.dirty=!1,o.validatePromise=void 0,o.errors=ld,o.warnings=ld,o.triggerMetaEvent(),p==null||p(),o.refresh();return}break;case"remove":{if(h){o.reRender();return}break}case"setField":{var L=d.data;if(w){"touched"in L&&(o.touched=L.touched),"validating"in L&&!("originRCField"in L)&&(o.validatePromise=L.validating?Promise.resolve([]):null),"errors"in L&&(o.errors=L.errors||ld),"warnings"in L&&(o.warnings=L.warnings||ld),o.dirty=!0,o.triggerMetaEvent(),o.reRender();return}else if("value"in L&&gy(c,m,!0)){o.reRender();return}if(h&&!m.length&&Bne(h,l,v,_,y,d)){o.reRender();return}break}case"dependenciesUpdate":{var D=g.map(Ar);if(D.some(function(E){return gy(d.relatedFields,E)})){o.reRender();return}break}default:if(w||(!g.length||m.length||h)&&Bne(h,l,v,_,y,d)){o.reRender();return}break}h===!0&&o.reRender()}),me(ci(o),"validateRules",function(l){var c=o.getNamePath(),d=o.getValue(),u=l||{},h=u.triggerName,f=u.validateOnly,g=f===void 0?!1:f,p=Promise.resolve().then(Fb(ul().mark(function v(){var m,_,y,w,L,D,E;return ul().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(o.mounted){k.next=2;break}return k.abrupt("return",[]);case 2:if(m=o.props,_=m.validateFirst,y=_===void 0?!1:_,w=m.messageVariables,L=m.validateDebounce,D=o.getRules(),h&&(D=D.filter(function(R){return R}).filter(function(R){var A=R.validateTrigger;if(!A)return!0;var P=CW(A);return P.includes(h)})),!(L&&h)){k.next=10;break}return k.next=8,new Promise(function(R){setTimeout(R,L)});case 8:if(o.validatePromise===p){k.next=10;break}return k.abrupt("return",[]);case 10:return E=aWe(c,d,D,l,y,w),E.catch(function(R){return R}).then(function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ld;if(o.validatePromise===p){var A;o.validatePromise=null;var P=[],N=[];(A=R.forEach)===null||A===void 0||A.call(R,function(M){var H=M.rule.warningOnly,B=M.errors,F=B===void 0?ld:B;H?N.push.apply(N,_t(F)):P.push.apply(P,_t(F))}),o.errors=P,o.warnings=N,o.triggerMetaEvent(),o.reRender()}}),k.abrupt("return",E);case 13:case"end":return k.stop()}},v)})));return g||(o.validatePromise=p,o.dirty=!0,o.errors=ld,o.warnings=ld,o.triggerMetaEvent(),o.reRender()),p}),me(ci(o),"isFieldValidating",function(){return!!o.validatePromise}),me(ci(o),"isFieldTouched",function(){return o.touched}),me(ci(o),"isFieldDirty",function(){if(o.dirty||o.props.initialValue!==void 0)return!0;var l=o.props.fieldContext,c=l.getInternalHooks(r0),d=c.getInitialValue;return d(o.getNamePath())!==void 0}),me(ci(o),"getErrors",function(){return o.errors}),me(ci(o),"getWarnings",function(){return o.warnings}),me(ci(o),"isListField",function(){return o.props.isListField}),me(ci(o),"isList",function(){return o.props.isList}),me(ci(o),"isPreserve",function(){return o.props.preserve}),me(ci(o),"getMeta",function(){o.prevValidating=o.isFieldValidating();var l={touched:o.isFieldTouched(),validating:o.prevValidating,errors:o.errors,warnings:o.warnings,name:o.getNamePath(),validated:o.validatePromise===null};return l}),me(ci(o),"getOnlyChild",function(l){if(typeof l=="function"){var c=o.getMeta();return Ce(Ce({},o.getOnlyChild(l(o.getControlled(),c,o.props.fieldContext))),{},{isFunction:!0})}var d=op(l);return d.length!==1||!x.exports.isValidElement(d[0])?{child:d,isFunction:!1}:{child:d[0],isFunction:!1}}),me(ci(o),"getValue",function(l){var c=o.props.fieldContext.getFieldsValue,d=o.getNamePath();return jh(l||c(!0),d)}),me(ci(o),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=o.props,d=c.trigger,u=c.validateTrigger,h=c.getValueFromEvent,f=c.normalize,g=c.valuePropName,p=c.getValueProps,v=c.fieldContext,m=u!==void 0?u:v.validateTrigger,_=o.getNamePath(),y=v.getInternalHooks,w=v.getFieldsValue,L=y(r0),D=L.dispatch,E=o.getValue(),I=p||function(P){return me({},g,P)},k=l[d],R=Ce(Ce({},l),I(E));R[d]=function(){o.touched=!0,o.dirty=!0,o.triggerMetaEvent();for(var P,N=arguments.length,M=new Array(N),H=0;H=0&&R<=A.length?(d.keys=[].concat(_t(d.keys.slice(0,R)),[d.id],_t(d.keys.slice(R))),y([].concat(_t(A.slice(0,R)),[k],_t(A.slice(R))))):(d.keys=[].concat(_t(d.keys),[d.id]),y([].concat(_t(A),[k]))),d.id+=1},remove:function(k){var R=L(),A=new Set(Array.isArray(k)?k:[k]);A.size<=0||(d.keys=d.keys.filter(function(P,N){return!A.has(N)}),y(R.filter(function(P,N){return!A.has(N)})))},move:function(k,R){if(k!==R){var A=L();k<0||k>=A.length||R<0||R>=A.length||(d.keys=Fne(d.keys,k,R),y(Fne(A,k,R)))}}},E=_||[];return Array.isArray(E)||(E=[]),n(E.map(function(I,k){var R=d.keys[k];return R===void 0&&(d.keys[k]=d.id,R=d.keys[k],d.id+=1),{name:k,key:R,isListField:!0}}),D,v)})))}function fWe(i){var e=!1,t=i.length,n=[];return i.length?new Promise(function(o,r){i.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,n[a]=l,!(t>0)&&(e&&r(n),o(n))})})}):Promise.resolve([])}var ome="__@field_split__";function g6(i){return i.map(function(e){return"".concat(qn(e),":").concat(e)}).join(ome)}var I1=function(){function i(){ga(this,i),me(this,"kvs",new Map)}return pa(i,[{key:"set",value:function(t,n){this.kvs.set(g6(t),n)}},{key:"get",value:function(t){return this.kvs.get(g6(t))}},{key:"update",value:function(t,n){var o=this.get(t),r=n(o);r?this.set(t,r):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(g6(t))}},{key:"map",value:function(t){return _t(this.kvs.entries()).map(function(n){var o=Ne(n,2),r=o[0],s=o[1],a=r.split(ome);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),d=Ne(c,3),u=d[1],h=d[2];return u==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(n){var o=n.key,r=n.value;return t[o.join(".")]=r,null}),t}}]),i}(),gWe=["name"],pWe=pa(function i(e){var t=this;ga(this,i),me(this,"formHooked",!1),me(this,"forceRootUpdate",void 0),me(this,"subscribable",!0),me(this,"store",{}),me(this,"fieldEntities",[]),me(this,"initialValues",{}),me(this,"callbacks",{}),me(this,"validateMessages",null),me(this,"preserve",null),me(this,"lastValidatePromise",null),me(this,"getForm",function(){return{getFieldValue:t.getFieldValue,getFieldsValue:t.getFieldsValue,getFieldError:t.getFieldError,getFieldWarning:t.getFieldWarning,getFieldsError:t.getFieldsError,isFieldsTouched:t.isFieldsTouched,isFieldTouched:t.isFieldTouched,isFieldValidating:t.isFieldValidating,isFieldsValidating:t.isFieldsValidating,resetFields:t.resetFields,setFields:t.setFields,setFieldValue:t.setFieldValue,setFieldsValue:t.setFieldsValue,validateFields:t.validateFields,submit:t.submit,_init:!0,getInternalHooks:t.getInternalHooks}}),me(this,"getInternalHooks",function(n){return n===r0?(t.formHooked=!0,{dispatch:t.dispatch,initEntityValue:t.initEntityValue,registerField:t.registerField,useSubscribe:t.useSubscribe,setInitialValues:t.setInitialValues,destroyForm:t.destroyForm,setCallbacks:t.setCallbacks,setValidateMessages:t.setValidateMessages,getFields:t.getFields,setPreserve:t.setPreserve,getInitialValue:t.getInitialValue,registerWatch:t.registerWatch}):(rr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),me(this,"useSubscribe",function(n){t.subscribable=n}),me(this,"prevWithoutPreserves",null),me(this,"setInitialValues",function(n,o){if(t.initialValues=n||{},o){var r,s=LC(n,t.store);(r=t.prevWithoutPreserves)===null||r===void 0||r.map(function(a){var l=a.key;s=pu(s,l,jh(n,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}}),me(this,"destroyForm",function(){var n=new I1;t.getFieldEntities(!0).forEach(function(o){t.isMergedPreserve(o.isPreserve())||n.set(o.getNamePath(),!0)}),t.prevWithoutPreserves=n}),me(this,"getInitialValue",function(n){var o=jh(t.initialValues,n);return n.length?LC(o):o}),me(this,"setCallbacks",function(n){t.callbacks=n}),me(this,"setValidateMessages",function(n){t.validateMessages=n}),me(this,"setPreserve",function(n){t.preserve=n}),me(this,"watchList",[]),me(this,"registerWatch",function(n){return t.watchList.push(n),function(){t.watchList=t.watchList.filter(function(o){return o!==n})}}),me(this,"notifyWatch",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var o=t.getFieldsValue(),r=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(o,r,n)})}}),me(this,"timeoutId",null),me(this,"warningUnhooked",function(){}),me(this,"updateStore",function(n){t.store=n}),me(this,"getFieldEntities",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?t.fieldEntities.filter(function(o){return o.getNamePath().length}):t.fieldEntities}),me(this,"getFieldsMap",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=new I1;return t.getFieldEntities(n).forEach(function(r){var s=r.getNamePath();o.set(s,r)}),o}),me(this,"getFieldEntitiesForNamePathList",function(n){if(!n)return t.getFieldEntities(!0);var o=t.getFieldsMap(!0);return n.map(function(r){var s=Ar(r);return o.get(s)||{INVALIDATE_NAME_PATH:Ar(r)}})}),me(this,"getFieldsValue",function(n,o){t.warningUnhooked();var r,s,a;if(n===!0||Array.isArray(n)?(r=n,s=o):n&&qn(n)==="object"&&(a=n.strict,s=n.filter),r===!0&&!s)return t.store;var l=t.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),c=[];return l.forEach(function(d){var u,h,f="INVALIDATE_NAME_PATH"in d?d.INVALIDATE_NAME_PATH:d.getNamePath();if(a){var g,p;if((g=(p=d).isList)!==null&&g!==void 0&&g.call(p))return}else if(!r&&(u=(h=d).isListField)!==null&&u!==void 0&&u.call(h))return;if(!s)c.push(f);else{var v="getMeta"in d?d.getMeta():null;s(v)&&c.push(f)}}),One(t.store,c.map(Ar))}),me(this,"getFieldValue",function(n){t.warningUnhooked();var o=Ar(n);return jh(t.store,o)}),me(this,"getFieldsError",function(n){t.warningUnhooked();var o=t.getFieldEntitiesForNamePathList(n);return o.map(function(r,s){return r&&!("INVALIDATE_NAME_PATH"in r)?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:Ar(n[s]),errors:[],warnings:[]}})}),me(this,"getFieldError",function(n){t.warningUnhooked();var o=Ar(n),r=t.getFieldsError([o])[0];return r.errors}),me(this,"getFieldWarning",function(n){t.warningUnhooked();var o=Ar(n),r=t.getFieldsError([o])[0];return r.warnings}),me(this,"isFieldsTouched",function(){t.warningUnhooked();for(var n=arguments.length,o=new Array(n),r=0;r0&&arguments[0]!==void 0?arguments[0]:{},o=new I1,r=t.getFieldEntities(!0);r.forEach(function(l){var c=l.props.initialValue,d=l.getNamePath();if(c!==void 0){var u=o.get(d)||new Set;u.add({entity:l,value:c}),o.set(d,u)}});var s=function(c){c.forEach(function(d){var u=d.props.initialValue;if(u!==void 0){var h=d.getNamePath(),f=t.getInitialValue(h);if(f!==void 0)rr(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=o.get(h);if(g&&g.size>1)rr(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var p=t.getFieldValue(h),v=d.isListField();!v&&(!n.skipExist||p===void 0)&&t.updateStore(pu(t.store,h,_t(g)[0].value))}}}})},a;n.entities?a=n.entities:n.namePathList?(a=[],n.namePathList.forEach(function(l){var c=o.get(l);if(c){var d;(d=a).push.apply(d,_t(_t(c).map(function(u){return u.entity})))}})):a=r,s(a)}),me(this,"resetFields",function(n){t.warningUnhooked();var o=t.store;if(!n){t.updateStore(LC(t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(o,null,{type:"reset"}),t.notifyWatch();return}var r=n.map(Ar);r.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(pu(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:r}),t.notifyObservers(o,r,{type:"reset"}),t.notifyWatch(r)}),me(this,"setFields",function(n){t.warningUnhooked();var o=t.store,r=[];n.forEach(function(s){var a=s.name,l=Hn(s,gWe),c=Ar(a);r.push(c),"value"in l&&t.updateStore(pu(t.store,c,l.value)),t.notifyObservers(o,[c],{type:"setField",data:s})}),t.notifyWatch(r)}),me(this,"getFields",function(){var n=t.getFieldEntities(!0),o=n.map(function(r){var s=r.getNamePath(),a=r.getMeta(),l=Ce(Ce({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return o}),me(this,"initEntityValue",function(n){var o=n.props.initialValue;if(o!==void 0){var r=n.getNamePath(),s=jh(t.store,r);s===void 0&&t.updateStore(pu(t.store,r,o))}}),me(this,"isMergedPreserve",function(n){var o=n!==void 0?n:t.preserve;return o!=null?o:!0}),me(this,"registerField",function(n){t.fieldEntities.push(n);var o=n.getNamePath();if(t.notifyWatch([o]),n.props.initialValue!==void 0){var r=t.store;t.resetWithFieldInitialValue({entities:[n],skipExist:!0}),t.notifyObservers(r,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(u){return u!==n}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(o);if(o.length&&t.getFieldValue(o)!==c&&t.fieldEntities.every(function(u){return!nme(u.getNamePath(),o)})){var d=t.store;t.updateStore(pu(d,o,c,!0)),t.notifyObservers(d,[o],{type:"remove"}),t.triggerDependenciesUpdate(d,o)}}t.notifyWatch([o])}}),me(this,"dispatch",function(n){switch(n.type){case"updateValue":{var o=n.namePath,r=n.value;t.updateValue(o,r);break}case"validateField":{var s=n.namePath,a=n.triggerName;t.validateFields([s],{triggerName:a});break}}}),me(this,"notifyObservers",function(n,o,r){if(t.subscribable){var s=Ce(Ce({},r),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(n,o,s)})}else t.forceRootUpdate()}),me(this,"triggerDependenciesUpdate",function(n,o){var r=t.getDependencyChildrenFields(o);return r.length&&t.validateFields(r),t.notifyObservers(n,r,{type:"dependenciesUpdate",relatedFields:[o].concat(_t(r))}),r}),me(this,"updateValue",function(n,o){var r=Ar(n),s=t.store;t.updateStore(pu(t.store,r,o)),t.notifyObservers(s,[r],{type:"valueUpdate",source:"internal"}),t.notifyWatch([r]);var a=t.triggerDependenciesUpdate(s,r),l=t.callbacks.onValuesChange;if(l){var c=One(t.store,[r]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([r].concat(_t(a)))}),me(this,"setFieldsValue",function(n){t.warningUnhooked();var o=t.store;if(n){var r=LC(t.store,n);t.updateStore(r)}t.notifyObservers(o,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()}),me(this,"setFieldValue",function(n,o){t.setFields([{name:n,value:o}])}),me(this,"getDependencyChildrenFields",function(n){var o=new Set,r=[],s=new I1;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(d){var u=Ar(d);s.update(u,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var d=s.get(c)||new Set;d.forEach(function(u){if(!o.has(u)){o.add(u);var h=u.getNamePath();u.isFieldDirty()&&h.length&&(r.push(h),l(h))}})};return a(n),r}),me(this,"triggerOnFieldsChange",function(n,o){var r=t.callbacks.onFieldsChange;if(r){var s=t.getFields();if(o){var a=new I1;o.forEach(function(c){var d=c.name,u=c.errors;a.set(d,u)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var d=c.name;return gy(n,d)});l.length&&r(l,s)}}),me(this,"validateFields",function(n,o){t.warningUnhooked();var r,s;Array.isArray(n)||typeof n=="string"||typeof o=="string"?(r=n,s=o):s=n;var a=!!r,l=a?r.map(Ar):[],c=[],d=String(Date.now()),u=new Set,h=s||{},f=h.recursive,g=h.dirty;t.getFieldEntities(!0).forEach(function(_){if(a||l.push(_.getNamePath()),!(!_.props.rules||!_.props.rules.length)&&!(g&&!_.isFieldDirty())){var y=_.getNamePath();if(u.add(y.join(d)),!a||gy(l,y,f)){var w=_.validateRules(Ce({validateMessages:Ce(Ce({},tme),t.validateMessages)},s));c.push(w.then(function(){return{name:y,errors:[],warnings:[]}}).catch(function(L){var D,E=[],I=[];return(D=L.forEach)===null||D===void 0||D.call(L,function(k){var R=k.rule.warningOnly,A=k.errors;R?I.push.apply(I,_t(A)):E.push.apply(E,_t(A))}),E.length?Promise.reject({name:y,errors:E,warnings:I}):{name:y,errors:E,warnings:I}}))}}});var p=fWe(c);t.lastValidatePromise=p,p.catch(function(_){return _}).then(function(_){var y=_.map(function(w){var L=w.name;return L});t.notifyObservers(t.store,y,{type:"validateFinish"}),t.triggerOnFieldsChange(y,_)});var v=p.then(function(){return t.lastValidatePromise===p?Promise.resolve(t.getFieldsValue(l)):Promise.reject([])}).catch(function(_){var y=_.filter(function(w){return w&&w.errors.length});return Promise.reject({values:t.getFieldsValue(l),errorFields:y,outOfDate:t.lastValidatePromise!==p})});v.catch(function(_){return _});var m=l.filter(function(_){return u.has(_.join(d))});return t.triggerOnFieldsChange(m),v}),me(this,"submit",function(){t.warningUnhooked(),t.validateFields().then(function(n){var o=t.callbacks.onFinish;if(o)try{o(n)}catch(r){console.error(r)}}).catch(function(n){var o=t.callbacks.onFinishFailed;o&&o(n)})}),this.forceRootUpdate=e});function iq(i){var e=x.exports.useRef(),t=x.exports.useState({}),n=Ne(t,2),o=n[1];if(!e.current)if(i)e.current=i;else{var r=function(){o({})},s=new pWe(r);e.current=s.getForm()}return[e.current]}var TW=x.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),rme=function(e){var t=e.validateMessages,n=e.onFormChange,o=e.onFormFinish,r=e.children,s=x.exports.useContext(TW),a=x.exports.useRef({});return x.exports.createElement(TW.Provider,{value:Ce(Ce({},s),{},{validateMessages:Ce(Ce({},s.validateMessages),t),triggerFormChange:function(c,d){n&&n(c,{changedFields:d,forms:a.current}),s.triggerFormChange(c,d)},triggerFormFinish:function(c,d){o&&o(c,{values:d,forms:a.current}),s.triggerFormFinish(c,d)},registerForm:function(c,d){c&&(a.current=Ce(Ce({},a.current),{},me({},c,d))),s.registerForm(c,d)},unregisterForm:function(c){var d=Ce({},a.current);delete d[c],a.current=d,s.unregisterForm(c)}})},r)},mWe=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],vWe=function(e,t){var n=e.name,o=e.initialValues,r=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,d=c===void 0?"form":c,u=e.validateMessages,h=e.validateTrigger,f=h===void 0?"onChange":h,g=e.onValuesChange,p=e.onFieldsChange,v=e.onFinish,m=e.onFinishFailed,_=Hn(e,mWe),y=x.exports.useContext(TW),w=iq(s),L=Ne(w,1),D=L[0],E=D.getInternalHooks(r0),I=E.useSubscribe,k=E.setInitialValues,R=E.setCallbacks,A=E.setValidateMessages,P=E.setPreserve,N=E.destroyForm;x.exports.useImperativeHandle(t,function(){return D}),x.exports.useEffect(function(){return y.registerForm(n,D),function(){y.unregisterForm(n)}},[y,D,n]),A(Ce(Ce({},y.validateMessages),u)),R({onValuesChange:g,onFieldsChange:function(G){if(y.triggerFormChange(n,G),p){for(var X=arguments.length,ue=new Array(X>1?X-1:0),fe=1;fe{}}),ame=x.exports.createContext(null),lme=i=>{const e=kf(i,["prefixCls"]);return x.exports.createElement(rme,Object.assign({},e))},oq=x.exports.createContext({prefixCls:""}),Uu=x.exports.createContext({}),NW=i=>{let{children:e,status:t,override:n}=i;const o=x.exports.useContext(Uu),r=x.exports.useMemo(()=>{const s=Object.assign({},o);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,o]);return x.exports.createElement(Uu.Provider,{value:r},e)},cme=x.exports.createContext(void 0);function Vne(){}const bWe=x.exports.createContext({add:Vne,remove:Vne});function CWe(i){const e=x.exports.useContext(bWe),t=x.exports.useRef();return tl(o=>{if(o){const r=i?o.querySelector(i):o;e.add(r),t.current=r}else e.remove(t.current)})}const yWe=()=>{const{cancelButtonProps:i,cancelTextLocale:e,onCancel:t}=x.exports.useContext(TI);return he(ts,{...Object.assign({onClick:t},i),children:e})};var Hne=yWe;const wWe=()=>{const{confirmLoading:i,okButtonProps:e,okType:t,okTextLocale:n,onOk:o}=x.exports.useContext(TI);return he(ts,{...Object.assign({},Vpe(t),{loading:i,onClick:o},e),children:n})};var $ne=wWe;function dme(i,e){return Bt.createElement("span",{className:`${i}-close-x`},e||Bt.createElement(hS,{className:`${i}-close-icon`}))}const ume=i=>{const{okText:e,okType:t="primary",cancelText:n,confirmLoading:o,onOk:r,onCancel:s,okButtonProps:a,cancelButtonProps:l,footer:c}=i,[d]=EI("Modal",jge()),u=e||(d==null?void 0:d.okText),h=n||(d==null?void 0:d.cancelText),f={confirmLoading:o,okButtonProps:a,cancelButtonProps:l,okTextLocale:u,cancelTextLocale:h,okType:t,onOk:r,onCancel:s},g=Bt.useMemo(()=>f,_t(Object.values(f)));let p;return typeof c=="function"||typeof c=="undefined"?(p=Bt.createElement(Bt.Fragment,null,Bt.createElement(Hne,null),Bt.createElement($ne,null)),typeof c=="function"&&(p=c(p,{OkBtn:$ne,CancelBtn:Hne})),p=Bt.createElement(qpe,{value:g},p)):p=c,Bt.createElement(PK,{disabled:!1},p)},SWe=i=>({animationDuration:i,animationFillMode:"both"}),xWe=i=>({animationDuration:i,animationFillMode:"both"}),R4=function(i,e,t,n){const r=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` +`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),r=new RegExp("(?:^"+t+"$)|(?:^"+o+"$)"),s=new RegExp("^"+t+"$"),a=new RegExp("^"+o+"$"),l=function(w){return w&&w.exact?r:new RegExp("(?:"+e(w)+t+e(w)+")|(?:"+e(w)+o+e(w)+")","g")};l.v4=function(y){return y&&y.exact?s:new RegExp(""+e(y)+t+e(y),"g")},l.v6=function(y){return y&&y.exact?a:new RegExp(""+e(y)+o+e(y),"g")};var c="(?:(?:[a-z]+:)?//)",d="(?:\\S+(?::\\S*)?@)?",u=l.v4().source,h=l.v6().source,f="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",g="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",p="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",v="(?::\\d{2,5})?",m='(?:[/?#][^\\s"]*)?',_="(?:"+c+"|www\\.)"+d+"(?:localhost|"+u+"|"+h+"|"+f+g+p+")"+v+m;return ZN=new RegExp("(?:^"+_+"$)","i"),ZN},Ane={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},vL={integer:function(e){return vL.number(e)&&parseInt(e,10)===e},float:function(e){return vL.number(e)&&!vL.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!vL.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(Ane.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(VBe())},hex:function(e){return typeof e=="string"&&!!e.match(Ane.hex)}},HBe=function(e,t,n,o,r){if(e.required&&t===void 0){tme(e,t,n,o,r);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?vL[a](t)||o.push(Dc(r.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&o.push(Dc(r.messages.types[a],e.fullField,e.type))},$Be=function(e,t,n,o,r){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=t,u=null,h=typeof t=="number",f=typeof t=="string",g=Array.isArray(t);if(h?u="number":f?u="string":g&&(u="array"),!u)return!1;g&&(d=t.length),f&&(d=t.replace(c,"_").length),s?d!==e.len&&o.push(Dc(r.messages[u].len,e.fullField,e.len)):a&&!l&&de.max?o.push(Dc(r.messages[u].max,e.fullField,e.max)):a&&l&&(de.max)&&o.push(Dc(r.messages[u].range,e.fullField,e.min,e.max))},k1="enum",zBe=function(e,t,n,o,r){e[k1]=Array.isArray(e[k1])?e[k1]:[],e[k1].indexOf(t)===-1&&o.push(Dc(r.messages[k1],e.fullField,e[k1].join(", ")))},UBe=function(e,t,n,o,r){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||o.push(Dc(r.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||o.push(Dc(r.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},ki={required:tme,whitespace:WBe,type:HBe,range:$Be,enum:zBe,pattern:UBe},jBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t,"string")&&!e.required)return n();ki.required(e,t,o,s,r,"string"),Ss(t,"string")||(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r),ki.pattern(e,t,o,s,r),e.whitespace===!0&&ki.whitespace(e,t,o,s,r))}n(s)},KBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},qBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},GBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},XBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),Ss(t)||ki.type(e,t,o,s,r)}n(s)},YBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},ZBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},QBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return n();ki.required(e,t,o,s,r,"array"),t!=null&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},JBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},eWe="enum",tWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki[eWe](e,t,o,s,r)}n(s)},nWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t,"string")&&!e.required)return n();ki.required(e,t,o,s,r),Ss(t,"string")||ki.pattern(e,t,o,s,r)}n(s)},iWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t,"date")&&!e.required)return n();if(ki.required(e,t,o,s,r),!Ss(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),ki.type(e,l,o,s,r),l&&ki.range(e,l.getTime(),o,s,r)}}n(s)},oWe=function(e,t,n,o,r){var s=[],a=Array.isArray(t)?"array":typeof t;ki.required(e,t,o,s,r,a),n(s)},g6=function(e,t,n,o,r){var s=e.type,a=[],l=e.required||!e.required&&o.hasOwnProperty(e.field);if(l){if(Ss(t,s)&&!e.required)return n();ki.required(e,t,o,a,r,s),Ss(t,s)||ki.type(e,t,o,a,r)}n(a)},rWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r)}n(s)},rE={string:jBe,method:KBe,number:qBe,boolean:GBe,regexp:XBe,integer:YBe,float:ZBe,array:QBe,object:JBe,enum:tWe,pattern:nWe,date:iWe,url:g6,hex:g6,email:g6,required:oWe,any:rWe};function LW(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var EW=LW(),NI=function(){function i(t){this.rules=null,this._messages=EW,this.define(t)}var e=i.prototype;return e.define=function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(r){var s=n[r];o.rules[r]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Mne(LW(),n)),this._messages},e.validate=function(n,o,r){var s=this;o===void 0&&(o={}),r===void 0&&(r=function(){});var a=n,l=o,c=r;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function d(p){var v=[],m={};function _(w){if(Array.isArray(w)){var L;v=(L=v).concat.apply(L,w)}else v.push(w)}for(var y=0;y2&&arguments[2]!==void 0?arguments[2]:!1;return i&&i.some(function(n){return ime(e,n,t)})}function ime(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!i||!e||!t&&i.length!==e.length?!1:e.every(function(n,o){return i[o]===n})}function dWe(i,e){if(i===e)return!0;if(!i&&e||i&&!e||!i||!e||qn(i)!=="object"||qn(e)!=="object")return!1;var t=Object.keys(i),n=Object.keys(e),o=new Set([].concat(t,n));return _t(o).every(function(r){var s=i[r],a=e[r];return typeof s=="function"&&typeof a=="function"?!0:s===a})}function uWe(i){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&qn(e.target)==="object"&&i in e.target?e.target[i]:e}function Bne(i,e,t){var n=i.length;if(e<0||e>=n||t<0||t>=n)return i;var o=i[e],r=e-t;return r>0?[].concat(_t(i.slice(0,t)),[o],_t(i.slice(t,e)),_t(i.slice(e+1,n))):r<0?[].concat(_t(i.slice(0,e)),_t(i.slice(e+1,t+1)),[o],_t(i.slice(t+1,n))):i}var hWe=["name"],ld=[];function Wne(i,e,t,n,o,r){return typeof i=="function"?i(e,t,"source"in r?{source:r.source}:{}):n!==o}var nq=function(i){gp(t,i);var e=Ob(t);function t(n){var o;if(ga(this,t),o=e.call(this,n),me(ci(o),"state",{resetCount:0}),me(ci(o),"cancelRegisterFunc",null),me(ci(o),"mounted",!1),me(ci(o),"touched",!1),me(ci(o),"dirty",!1),me(ci(o),"validatePromise",void 0),me(ci(o),"prevValidating",void 0),me(ci(o),"errors",ld),me(ci(o),"warnings",ld),me(ci(o),"cancelRegister",function(){var l=o.props,c=l.preserve,d=l.isListField,u=l.name;o.cancelRegisterFunc&&o.cancelRegisterFunc(d,c,Ar(u)),o.cancelRegisterFunc=null}),me(ci(o),"getNamePath",function(){var l=o.props,c=l.name,d=l.fieldContext,u=d.prefixName,h=u===void 0?[]:u;return c!==void 0?[].concat(_t(h),_t(c)):[]}),me(ci(o),"getRules",function(){var l=o.props,c=l.rules,d=c===void 0?[]:c,u=l.fieldContext;return d.map(function(h){return typeof h=="function"?h(u):h})}),me(ci(o),"refresh",function(){!o.mounted||o.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),me(ci(o),"metaCache",null),me(ci(o),"triggerMetaEvent",function(l){var c=o.props.onMetaChange;if(c){var d=Ce(Ce({},o.getMeta()),{},{destroy:l});y4(o.metaCache,d)||c(d),o.metaCache=d}else o.metaCache=null}),me(ci(o),"onStoreChange",function(l,c,d){var u=o.props,h=u.shouldUpdate,f=u.dependencies,g=f===void 0?[]:f,p=u.onReset,v=d.store,m=o.getNamePath(),_=o.getValue(l),y=o.getValue(v),w=c&&gy(c,m);switch(d.type==="valueUpdate"&&d.source==="external"&&_!==y&&(o.touched=!0,o.dirty=!0,o.validatePromise=null,o.errors=ld,o.warnings=ld,o.triggerMetaEvent()),d.type){case"reset":if(!c||w){o.touched=!1,o.dirty=!1,o.validatePromise=void 0,o.errors=ld,o.warnings=ld,o.triggerMetaEvent(),p==null||p(),o.refresh();return}break;case"remove":{if(h){o.reRender();return}break}case"setField":{var L=d.data;if(w){"touched"in L&&(o.touched=L.touched),"validating"in L&&!("originRCField"in L)&&(o.validatePromise=L.validating?Promise.resolve([]):null),"errors"in L&&(o.errors=L.errors||ld),"warnings"in L&&(o.warnings=L.warnings||ld),o.dirty=!0,o.triggerMetaEvent(),o.reRender();return}else if("value"in L&&gy(c,m,!0)){o.reRender();return}if(h&&!m.length&&Wne(h,l,v,_,y,d)){o.reRender();return}break}case"dependenciesUpdate":{var D=g.map(Ar);if(D.some(function(E){return gy(d.relatedFields,E)})){o.reRender();return}break}default:if(w||(!g.length||m.length||h)&&Wne(h,l,v,_,y,d)){o.reRender();return}break}h===!0&&o.reRender()}),me(ci(o),"validateRules",function(l){var c=o.getNamePath(),d=o.getValue(),u=l||{},h=u.triggerName,f=u.validateOnly,g=f===void 0?!1:f,p=Promise.resolve().then(Fb(ul().mark(function v(){var m,_,y,w,L,D,E;return ul().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(o.mounted){k.next=2;break}return k.abrupt("return",[]);case 2:if(m=o.props,_=m.validateFirst,y=_===void 0?!1:_,w=m.messageVariables,L=m.validateDebounce,D=o.getRules(),h&&(D=D.filter(function(R){return R}).filter(function(R){var A=R.validateTrigger;if(!A)return!0;var P=yW(A);return P.includes(h)})),!(L&&h)){k.next=10;break}return k.next=8,new Promise(function(R){setTimeout(R,L)});case 8:if(o.validatePromise===p){k.next=10;break}return k.abrupt("return",[]);case 10:return E=aWe(c,d,D,l,y,w),E.catch(function(R){return R}).then(function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ld;if(o.validatePromise===p){var A;o.validatePromise=null;var P=[],N=[];(A=R.forEach)===null||A===void 0||A.call(R,function(M){var H=M.rule.warningOnly,B=M.errors,F=B===void 0?ld:B;H?N.push.apply(N,_t(F)):P.push.apply(P,_t(F))}),o.errors=P,o.warnings=N,o.triggerMetaEvent(),o.reRender()}}),k.abrupt("return",E);case 13:case"end":return k.stop()}},v)})));return g||(o.validatePromise=p,o.dirty=!0,o.errors=ld,o.warnings=ld,o.triggerMetaEvent(),o.reRender()),p}),me(ci(o),"isFieldValidating",function(){return!!o.validatePromise}),me(ci(o),"isFieldTouched",function(){return o.touched}),me(ci(o),"isFieldDirty",function(){if(o.dirty||o.props.initialValue!==void 0)return!0;var l=o.props.fieldContext,c=l.getInternalHooks(r0),d=c.getInitialValue;return d(o.getNamePath())!==void 0}),me(ci(o),"getErrors",function(){return o.errors}),me(ci(o),"getWarnings",function(){return o.warnings}),me(ci(o),"isListField",function(){return o.props.isListField}),me(ci(o),"isList",function(){return o.props.isList}),me(ci(o),"isPreserve",function(){return o.props.preserve}),me(ci(o),"getMeta",function(){o.prevValidating=o.isFieldValidating();var l={touched:o.isFieldTouched(),validating:o.prevValidating,errors:o.errors,warnings:o.warnings,name:o.getNamePath(),validated:o.validatePromise===null};return l}),me(ci(o),"getOnlyChild",function(l){if(typeof l=="function"){var c=o.getMeta();return Ce(Ce({},o.getOnlyChild(l(o.getControlled(),c,o.props.fieldContext))),{},{isFunction:!0})}var d=op(l);return d.length!==1||!x.exports.isValidElement(d[0])?{child:d,isFunction:!1}:{child:d[0],isFunction:!1}}),me(ci(o),"getValue",function(l){var c=o.props.fieldContext.getFieldsValue,d=o.getNamePath();return jh(l||c(!0),d)}),me(ci(o),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=o.props,d=c.trigger,u=c.validateTrigger,h=c.getValueFromEvent,f=c.normalize,g=c.valuePropName,p=c.getValueProps,v=c.fieldContext,m=u!==void 0?u:v.validateTrigger,_=o.getNamePath(),y=v.getInternalHooks,w=v.getFieldsValue,L=y(r0),D=L.dispatch,E=o.getValue(),I=p||function(P){return me({},g,P)},k=l[d],R=Ce(Ce({},l),I(E));R[d]=function(){o.touched=!0,o.dirty=!0,o.triggerMetaEvent();for(var P,N=arguments.length,M=new Array(N),H=0;H=0&&R<=A.length?(d.keys=[].concat(_t(d.keys.slice(0,R)),[d.id],_t(d.keys.slice(R))),y([].concat(_t(A.slice(0,R)),[k],_t(A.slice(R))))):(d.keys=[].concat(_t(d.keys),[d.id]),y([].concat(_t(A),[k]))),d.id+=1},remove:function(k){var R=L(),A=new Set(Array.isArray(k)?k:[k]);A.size<=0||(d.keys=d.keys.filter(function(P,N){return!A.has(N)}),y(R.filter(function(P,N){return!A.has(N)})))},move:function(k,R){if(k!==R){var A=L();k<0||k>=A.length||R<0||R>=A.length||(d.keys=Bne(d.keys,k,R),y(Bne(A,k,R)))}}},E=_||[];return Array.isArray(E)||(E=[]),n(E.map(function(I,k){var R=d.keys[k];return R===void 0&&(d.keys[k]=d.id,R=d.keys[k],d.id+=1),{name:k,key:R,isListField:!0}}),D,v)})))}function fWe(i){var e=!1,t=i.length,n=[];return i.length?new Promise(function(o,r){i.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,n[a]=l,!(t>0)&&(e&&r(n),o(n))})})}):Promise.resolve([])}var rme="__@field_split__";function p6(i){return i.map(function(e){return"".concat(qn(e),":").concat(e)}).join(rme)}var I1=function(){function i(){ga(this,i),me(this,"kvs",new Map)}return pa(i,[{key:"set",value:function(t,n){this.kvs.set(p6(t),n)}},{key:"get",value:function(t){return this.kvs.get(p6(t))}},{key:"update",value:function(t,n){var o=this.get(t),r=n(o);r?this.set(t,r):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(p6(t))}},{key:"map",value:function(t){return _t(this.kvs.entries()).map(function(n){var o=Ne(n,2),r=o[0],s=o[1],a=r.split(rme);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),d=Ne(c,3),u=d[1],h=d[2];return u==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(n){var o=n.key,r=n.value;return t[o.join(".")]=r,null}),t}}]),i}(),gWe=["name"],pWe=pa(function i(e){var t=this;ga(this,i),me(this,"formHooked",!1),me(this,"forceRootUpdate",void 0),me(this,"subscribable",!0),me(this,"store",{}),me(this,"fieldEntities",[]),me(this,"initialValues",{}),me(this,"callbacks",{}),me(this,"validateMessages",null),me(this,"preserve",null),me(this,"lastValidatePromise",null),me(this,"getForm",function(){return{getFieldValue:t.getFieldValue,getFieldsValue:t.getFieldsValue,getFieldError:t.getFieldError,getFieldWarning:t.getFieldWarning,getFieldsError:t.getFieldsError,isFieldsTouched:t.isFieldsTouched,isFieldTouched:t.isFieldTouched,isFieldValidating:t.isFieldValidating,isFieldsValidating:t.isFieldsValidating,resetFields:t.resetFields,setFields:t.setFields,setFieldValue:t.setFieldValue,setFieldsValue:t.setFieldsValue,validateFields:t.validateFields,submit:t.submit,_init:!0,getInternalHooks:t.getInternalHooks}}),me(this,"getInternalHooks",function(n){return n===r0?(t.formHooked=!0,{dispatch:t.dispatch,initEntityValue:t.initEntityValue,registerField:t.registerField,useSubscribe:t.useSubscribe,setInitialValues:t.setInitialValues,destroyForm:t.destroyForm,setCallbacks:t.setCallbacks,setValidateMessages:t.setValidateMessages,getFields:t.getFields,setPreserve:t.setPreserve,getInitialValue:t.getInitialValue,registerWatch:t.registerWatch}):(rr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),me(this,"useSubscribe",function(n){t.subscribable=n}),me(this,"prevWithoutPreserves",null),me(this,"setInitialValues",function(n,o){if(t.initialValues=n||{},o){var r,s=LC(n,t.store);(r=t.prevWithoutPreserves)===null||r===void 0||r.map(function(a){var l=a.key;s=pu(s,l,jh(n,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}}),me(this,"destroyForm",function(){var n=new I1;t.getFieldEntities(!0).forEach(function(o){t.isMergedPreserve(o.isPreserve())||n.set(o.getNamePath(),!0)}),t.prevWithoutPreserves=n}),me(this,"getInitialValue",function(n){var o=jh(t.initialValues,n);return n.length?LC(o):o}),me(this,"setCallbacks",function(n){t.callbacks=n}),me(this,"setValidateMessages",function(n){t.validateMessages=n}),me(this,"setPreserve",function(n){t.preserve=n}),me(this,"watchList",[]),me(this,"registerWatch",function(n){return t.watchList.push(n),function(){t.watchList=t.watchList.filter(function(o){return o!==n})}}),me(this,"notifyWatch",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var o=t.getFieldsValue(),r=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(o,r,n)})}}),me(this,"timeoutId",null),me(this,"warningUnhooked",function(){}),me(this,"updateStore",function(n){t.store=n}),me(this,"getFieldEntities",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?t.fieldEntities.filter(function(o){return o.getNamePath().length}):t.fieldEntities}),me(this,"getFieldsMap",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=new I1;return t.getFieldEntities(n).forEach(function(r){var s=r.getNamePath();o.set(s,r)}),o}),me(this,"getFieldEntitiesForNamePathList",function(n){if(!n)return t.getFieldEntities(!0);var o=t.getFieldsMap(!0);return n.map(function(r){var s=Ar(r);return o.get(s)||{INVALIDATE_NAME_PATH:Ar(r)}})}),me(this,"getFieldsValue",function(n,o){t.warningUnhooked();var r,s,a;if(n===!0||Array.isArray(n)?(r=n,s=o):n&&qn(n)==="object"&&(a=n.strict,s=n.filter),r===!0&&!s)return t.store;var l=t.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),c=[];return l.forEach(function(d){var u,h,f="INVALIDATE_NAME_PATH"in d?d.INVALIDATE_NAME_PATH:d.getNamePath();if(a){var g,p;if((g=(p=d).isList)!==null&&g!==void 0&&g.call(p))return}else if(!r&&(u=(h=d).isListField)!==null&&u!==void 0&&u.call(h))return;if(!s)c.push(f);else{var v="getMeta"in d?d.getMeta():null;s(v)&&c.push(f)}}),Fne(t.store,c.map(Ar))}),me(this,"getFieldValue",function(n){t.warningUnhooked();var o=Ar(n);return jh(t.store,o)}),me(this,"getFieldsError",function(n){t.warningUnhooked();var o=t.getFieldEntitiesForNamePathList(n);return o.map(function(r,s){return r&&!("INVALIDATE_NAME_PATH"in r)?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:Ar(n[s]),errors:[],warnings:[]}})}),me(this,"getFieldError",function(n){t.warningUnhooked();var o=Ar(n),r=t.getFieldsError([o])[0];return r.errors}),me(this,"getFieldWarning",function(n){t.warningUnhooked();var o=Ar(n),r=t.getFieldsError([o])[0];return r.warnings}),me(this,"isFieldsTouched",function(){t.warningUnhooked();for(var n=arguments.length,o=new Array(n),r=0;r0&&arguments[0]!==void 0?arguments[0]:{},o=new I1,r=t.getFieldEntities(!0);r.forEach(function(l){var c=l.props.initialValue,d=l.getNamePath();if(c!==void 0){var u=o.get(d)||new Set;u.add({entity:l,value:c}),o.set(d,u)}});var s=function(c){c.forEach(function(d){var u=d.props.initialValue;if(u!==void 0){var h=d.getNamePath(),f=t.getInitialValue(h);if(f!==void 0)rr(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=o.get(h);if(g&&g.size>1)rr(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var p=t.getFieldValue(h),v=d.isListField();!v&&(!n.skipExist||p===void 0)&&t.updateStore(pu(t.store,h,_t(g)[0].value))}}}})},a;n.entities?a=n.entities:n.namePathList?(a=[],n.namePathList.forEach(function(l){var c=o.get(l);if(c){var d;(d=a).push.apply(d,_t(_t(c).map(function(u){return u.entity})))}})):a=r,s(a)}),me(this,"resetFields",function(n){t.warningUnhooked();var o=t.store;if(!n){t.updateStore(LC(t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(o,null,{type:"reset"}),t.notifyWatch();return}var r=n.map(Ar);r.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(pu(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:r}),t.notifyObservers(o,r,{type:"reset"}),t.notifyWatch(r)}),me(this,"setFields",function(n){t.warningUnhooked();var o=t.store,r=[];n.forEach(function(s){var a=s.name,l=Hn(s,gWe),c=Ar(a);r.push(c),"value"in l&&t.updateStore(pu(t.store,c,l.value)),t.notifyObservers(o,[c],{type:"setField",data:s})}),t.notifyWatch(r)}),me(this,"getFields",function(){var n=t.getFieldEntities(!0),o=n.map(function(r){var s=r.getNamePath(),a=r.getMeta(),l=Ce(Ce({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return o}),me(this,"initEntityValue",function(n){var o=n.props.initialValue;if(o!==void 0){var r=n.getNamePath(),s=jh(t.store,r);s===void 0&&t.updateStore(pu(t.store,r,o))}}),me(this,"isMergedPreserve",function(n){var o=n!==void 0?n:t.preserve;return o!=null?o:!0}),me(this,"registerField",function(n){t.fieldEntities.push(n);var o=n.getNamePath();if(t.notifyWatch([o]),n.props.initialValue!==void 0){var r=t.store;t.resetWithFieldInitialValue({entities:[n],skipExist:!0}),t.notifyObservers(r,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(u){return u!==n}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(o);if(o.length&&t.getFieldValue(o)!==c&&t.fieldEntities.every(function(u){return!ime(u.getNamePath(),o)})){var d=t.store;t.updateStore(pu(d,o,c,!0)),t.notifyObservers(d,[o],{type:"remove"}),t.triggerDependenciesUpdate(d,o)}}t.notifyWatch([o])}}),me(this,"dispatch",function(n){switch(n.type){case"updateValue":{var o=n.namePath,r=n.value;t.updateValue(o,r);break}case"validateField":{var s=n.namePath,a=n.triggerName;t.validateFields([s],{triggerName:a});break}}}),me(this,"notifyObservers",function(n,o,r){if(t.subscribable){var s=Ce(Ce({},r),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(n,o,s)})}else t.forceRootUpdate()}),me(this,"triggerDependenciesUpdate",function(n,o){var r=t.getDependencyChildrenFields(o);return r.length&&t.validateFields(r),t.notifyObservers(n,r,{type:"dependenciesUpdate",relatedFields:[o].concat(_t(r))}),r}),me(this,"updateValue",function(n,o){var r=Ar(n),s=t.store;t.updateStore(pu(t.store,r,o)),t.notifyObservers(s,[r],{type:"valueUpdate",source:"internal"}),t.notifyWatch([r]);var a=t.triggerDependenciesUpdate(s,r),l=t.callbacks.onValuesChange;if(l){var c=Fne(t.store,[r]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([r].concat(_t(a)))}),me(this,"setFieldsValue",function(n){t.warningUnhooked();var o=t.store;if(n){var r=LC(t.store,n);t.updateStore(r)}t.notifyObservers(o,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()}),me(this,"setFieldValue",function(n,o){t.setFields([{name:n,value:o}])}),me(this,"getDependencyChildrenFields",function(n){var o=new Set,r=[],s=new I1;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(d){var u=Ar(d);s.update(u,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var d=s.get(c)||new Set;d.forEach(function(u){if(!o.has(u)){o.add(u);var h=u.getNamePath();u.isFieldDirty()&&h.length&&(r.push(h),l(h))}})};return a(n),r}),me(this,"triggerOnFieldsChange",function(n,o){var r=t.callbacks.onFieldsChange;if(r){var s=t.getFields();if(o){var a=new I1;o.forEach(function(c){var d=c.name,u=c.errors;a.set(d,u)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var d=c.name;return gy(n,d)});l.length&&r(l,s)}}),me(this,"validateFields",function(n,o){t.warningUnhooked();var r,s;Array.isArray(n)||typeof n=="string"||typeof o=="string"?(r=n,s=o):s=n;var a=!!r,l=a?r.map(Ar):[],c=[],d=String(Date.now()),u=new Set,h=s||{},f=h.recursive,g=h.dirty;t.getFieldEntities(!0).forEach(function(_){if(a||l.push(_.getNamePath()),!(!_.props.rules||!_.props.rules.length)&&!(g&&!_.isFieldDirty())){var y=_.getNamePath();if(u.add(y.join(d)),!a||gy(l,y,f)){var w=_.validateRules(Ce({validateMessages:Ce(Ce({},nme),t.validateMessages)},s));c.push(w.then(function(){return{name:y,errors:[],warnings:[]}}).catch(function(L){var D,E=[],I=[];return(D=L.forEach)===null||D===void 0||D.call(L,function(k){var R=k.rule.warningOnly,A=k.errors;R?I.push.apply(I,_t(A)):E.push.apply(E,_t(A))}),E.length?Promise.reject({name:y,errors:E,warnings:I}):{name:y,errors:E,warnings:I}}))}}});var p=fWe(c);t.lastValidatePromise=p,p.catch(function(_){return _}).then(function(_){var y=_.map(function(w){var L=w.name;return L});t.notifyObservers(t.store,y,{type:"validateFinish"}),t.triggerOnFieldsChange(y,_)});var v=p.then(function(){return t.lastValidatePromise===p?Promise.resolve(t.getFieldsValue(l)):Promise.reject([])}).catch(function(_){var y=_.filter(function(w){return w&&w.errors.length});return Promise.reject({values:t.getFieldsValue(l),errorFields:y,outOfDate:t.lastValidatePromise!==p})});v.catch(function(_){return _});var m=l.filter(function(_){return u.has(_.join(d))});return t.triggerOnFieldsChange(m),v}),me(this,"submit",function(){t.warningUnhooked(),t.validateFields().then(function(n){var o=t.callbacks.onFinish;if(o)try{o(n)}catch(r){console.error(r)}}).catch(function(n){var o=t.callbacks.onFinishFailed;o&&o(n)})}),this.forceRootUpdate=e});function oq(i){var e=x.exports.useRef(),t=x.exports.useState({}),n=Ne(t,2),o=n[1];if(!e.current)if(i)e.current=i;else{var r=function(){o({})},s=new pWe(r);e.current=s.getForm()}return[e.current]}var NW=x.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),sme=function(e){var t=e.validateMessages,n=e.onFormChange,o=e.onFormFinish,r=e.children,s=x.exports.useContext(NW),a=x.exports.useRef({});return x.exports.createElement(NW.Provider,{value:Ce(Ce({},s),{},{validateMessages:Ce(Ce({},s.validateMessages),t),triggerFormChange:function(c,d){n&&n(c,{changedFields:d,forms:a.current}),s.triggerFormChange(c,d)},triggerFormFinish:function(c,d){o&&o(c,{values:d,forms:a.current}),s.triggerFormFinish(c,d)},registerForm:function(c,d){c&&(a.current=Ce(Ce({},a.current),{},me({},c,d))),s.registerForm(c,d)},unregisterForm:function(c){var d=Ce({},a.current);delete d[c],a.current=d,s.unregisterForm(c)}})},r)},mWe=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],vWe=function(e,t){var n=e.name,o=e.initialValues,r=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,d=c===void 0?"form":c,u=e.validateMessages,h=e.validateTrigger,f=h===void 0?"onChange":h,g=e.onValuesChange,p=e.onFieldsChange,v=e.onFinish,m=e.onFinishFailed,_=Hn(e,mWe),y=x.exports.useContext(NW),w=oq(s),L=Ne(w,1),D=L[0],E=D.getInternalHooks(r0),I=E.useSubscribe,k=E.setInitialValues,R=E.setCallbacks,A=E.setValidateMessages,P=E.setPreserve,N=E.destroyForm;x.exports.useImperativeHandle(t,function(){return D}),x.exports.useEffect(function(){return y.registerForm(n,D),function(){y.unregisterForm(n)}},[y,D,n]),A(Ce(Ce({},y.validateMessages),u)),R({onValuesChange:g,onFieldsChange:function(G){if(y.triggerFormChange(n,G),p){for(var X=arguments.length,ue=new Array(X>1?X-1:0),fe=1;fe{}}),lme=x.exports.createContext(null),cme=i=>{const e=kf(i,["prefixCls"]);return x.exports.createElement(sme,Object.assign({},e))},rq=x.exports.createContext({prefixCls:""}),Uu=x.exports.createContext({}),RW=i=>{let{children:e,status:t,override:n}=i;const o=x.exports.useContext(Uu),r=x.exports.useMemo(()=>{const s=Object.assign({},o);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,o]);return x.exports.createElement(Uu.Provider,{value:r},e)},dme=x.exports.createContext(void 0);function Hne(){}const bWe=x.exports.createContext({add:Hne,remove:Hne});function CWe(i){const e=x.exports.useContext(bWe),t=x.exports.useRef();return tl(o=>{if(o){const r=i?o.querySelector(i):o;e.add(r),t.current=r}else e.remove(t.current)})}const yWe=()=>{const{cancelButtonProps:i,cancelTextLocale:e,onCancel:t}=x.exports.useContext(TI);return he(ts,{...Object.assign({onClick:t},i),children:e})};var $ne=yWe;const wWe=()=>{const{confirmLoading:i,okButtonProps:e,okType:t,okTextLocale:n,onOk:o}=x.exports.useContext(TI);return he(ts,{...Object.assign({},Hpe(t),{loading:i,onClick:o},e),children:n})};var zne=wWe;function ume(i,e){return Bt.createElement("span",{className:`${i}-close-x`},e||Bt.createElement(hS,{className:`${i}-close-icon`}))}const hme=i=>{const{okText:e,okType:t="primary",cancelText:n,confirmLoading:o,onOk:r,onCancel:s,okButtonProps:a,cancelButtonProps:l,footer:c}=i,[d]=EI("Modal",Kge()),u=e||(d==null?void 0:d.okText),h=n||(d==null?void 0:d.cancelText),f={confirmLoading:o,okButtonProps:a,cancelButtonProps:l,okTextLocale:u,cancelTextLocale:h,okType:t,onOk:r,onCancel:s},g=Bt.useMemo(()=>f,_t(Object.values(f)));let p;return typeof c=="function"||typeof c=="undefined"?(p=Bt.createElement(Bt.Fragment,null,Bt.createElement($ne,null),Bt.createElement(zne,null)),typeof c=="function"&&(p=c(p,{OkBtn:zne,CancelBtn:$ne})),p=Bt.createElement(Gpe,{value:g},p)):p=c,Bt.createElement(OK,{disabled:!1},p)},SWe=i=>({animationDuration:i,animationFillMode:"both"}),xWe=i=>({animationDuration:i,animationFillMode:"both"}),R4=function(i,e,t,n){const r=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` ${r}${i}-enter, ${r}${i}-appear `]:Object.assign(Object.assign({},SWe(n)),{animationPlayState:"paused"}),[`${r}${i}-leave`]:Object.assign(Object.assign({},xWe(n)),{animationPlayState:"paused"}),[` @@ -214,49 +214,49 @@ html body { `]:{animationName:e,animationPlayState:"running"},[`${r}${i}-leave${i}-leave-active`]:{animationName:t,animationPlayState:"running",pointerEvents:"none"}}},LWe=new ji("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),EWe=new ji("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),DWe=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{antCls:t}=i,n=`${t}-fade`,o=e?"&":"";return[R4(n,LWe,EWe,i.motionDurationMid,e),{[` ${o}${n}-enter, ${o}${n}-appear - `]:{opacity:0,animationTimingFunction:"linear"},[`${o}${n}-leave`]:{animationTimingFunction:"linear"}}]},kWe=new ji("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),IWe=new ji("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),TWe=new ji("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),NWe=new ji("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),RWe=new ji("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),MWe=new ji("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),AWe=new ji("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),PWe=new ji("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),OWe={"move-up":{inKeyframes:AWe,outKeyframes:PWe},"move-down":{inKeyframes:kWe,outKeyframes:IWe},"move-left":{inKeyframes:TWe,outKeyframes:NWe},"move-right":{inKeyframes:RWe,outKeyframes:MWe}},zne=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=OWe[e];return[R4(n,o,r,i.motionDurationMid),{[` + `]:{opacity:0,animationTimingFunction:"linear"},[`${o}${n}-leave`]:{animationTimingFunction:"linear"}}]},kWe=new ji("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),IWe=new ji("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),TWe=new ji("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),NWe=new ji("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),RWe=new ji("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),MWe=new ji("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),AWe=new ji("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),PWe=new ji("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),OWe={"move-up":{inKeyframes:AWe,outKeyframes:PWe},"move-down":{inKeyframes:kWe,outKeyframes:IWe},"move-left":{inKeyframes:TWe,outKeyframes:NWe},"move-right":{inKeyframes:RWe,outKeyframes:MWe}},Une=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=OWe[e];return[R4(n,o,r,i.motionDurationMid),{[` ${n}-enter, ${n}-appear - `]:{opacity:0,animationTimingFunction:i.motionEaseOutCirc},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInOutCirc}}]},hme=new ji("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),fme=new ji("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),gme=new ji("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),pme=new ji("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),FWe=new ji("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),BWe=new ji("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),WWe=new ji("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),VWe=new ji("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),HWe={"slide-up":{inKeyframes:hme,outKeyframes:fme},"slide-down":{inKeyframes:gme,outKeyframes:pme},"slide-left":{inKeyframes:FWe,outKeyframes:BWe},"slide-right":{inKeyframes:WWe,outKeyframes:VWe}},kA=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=HWe[e];return[R4(n,o,r,i.motionDurationMid),{[` + `]:{opacity:0,animationTimingFunction:i.motionEaseOutCirc},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInOutCirc}}]},fme=new ji("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),gme=new ji("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),pme=new ji("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),mme=new ji("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),FWe=new ji("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),BWe=new ji("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),WWe=new ji("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),VWe=new ji("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),HWe={"slide-up":{inKeyframes:fme,outKeyframes:gme},"slide-down":{inKeyframes:pme,outKeyframes:mme},"slide-left":{inKeyframes:FWe,outKeyframes:BWe},"slide-right":{inKeyframes:WWe,outKeyframes:VWe}},kA=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=HWe[e];return[R4(n,o,r,i.motionDurationMid),{[` ${n}-enter, ${n}-appear - `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:i.motionEaseOutQuint,["&-prepare"]:{transform:"scale(1)"}},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInQuint}}]},rq=new ji("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),$We=new ji("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),Une=new ji("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),jne=new ji("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),zWe=new ji("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),UWe=new ji("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),jWe=new ji("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),KWe=new ji("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),qWe=new ji("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),GWe=new ji("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),XWe=new ji("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),YWe=new ji("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),ZWe={zoom:{inKeyframes:rq,outKeyframes:$We},"zoom-big":{inKeyframes:Une,outKeyframes:jne},"zoom-big-fast":{inKeyframes:Une,outKeyframes:jne},"zoom-left":{inKeyframes:jWe,outKeyframes:KWe},"zoom-right":{inKeyframes:qWe,outKeyframes:GWe},"zoom-up":{inKeyframes:zWe,outKeyframes:UWe},"zoom-down":{inKeyframes:XWe,outKeyframes:YWe}},mme=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=ZWe[e];return[R4(n,o,r,e==="zoom-big-fast"?i.motionDurationFast:i.motionDurationMid),{[` + `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:i.motionEaseOutQuint,["&-prepare"]:{transform:"scale(1)"}},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInQuint}}]},sq=new ji("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),$We=new ji("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),jne=new ji("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),Kne=new ji("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),zWe=new ji("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),UWe=new ji("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),jWe=new ji("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),KWe=new ji("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),qWe=new ji("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),GWe=new ji("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),XWe=new ji("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),YWe=new ji("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),ZWe={zoom:{inKeyframes:sq,outKeyframes:$We},"zoom-big":{inKeyframes:jne,outKeyframes:Kne},"zoom-big-fast":{inKeyframes:jne,outKeyframes:Kne},"zoom-left":{inKeyframes:jWe,outKeyframes:KWe},"zoom-right":{inKeyframes:qWe,outKeyframes:GWe},"zoom-up":{inKeyframes:zWe,outKeyframes:UWe},"zoom-down":{inKeyframes:XWe,outKeyframes:YWe}},vme=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=ZWe[e];return[R4(n,o,r,e==="zoom-big-fast"?i.motionDurationFast:i.motionDurationMid),{[` ${n}-enter, ${n}-appear `]:{transform:"scale(0)",opacity:0,animationTimingFunction:i.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInOutCirc}}]},QWe=i=>({[i.componentCls]:{[`${i.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${i.motionDurationMid} ${i.motionEaseInOut}, opacity ${i.motionDurationMid} ${i.motionEaseInOut} !important`}},[`${i.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${i.motionDurationMid} ${i.motionEaseInOut}, - opacity ${i.motionDurationMid} ${i.motionEaseInOut} !important`}}});var vme=QWe;function Kne(i){return{position:i,inset:0}}const JWe=i=>{const{componentCls:e,antCls:t}=i;return[{[`${e}-root`]:{[`${e}${t}-zoom-enter, ${e}${t}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:i.motionDurationSlow,userSelect:"none"},[`${e}${t}-zoom-leave ${e}-content`]:{pointerEvents:"none"},[`${e}-mask`]:Object.assign(Object.assign({},Kne("fixed")),{zIndex:i.zIndexPopupBase,height:"100%",backgroundColor:i.colorBgMask,pointerEvents:"none",[`${e}-hidden`]:{display:"none"}}),[`${e}-wrap`]:Object.assign(Object.assign({},Kne("fixed")),{zIndex:i.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch",[`&:has(${e}${t}-zoom-enter), &:has(${e}${t}-zoom-appear)`]:{pointerEvents:"none"}})}},{[`${e}-root`]:DWe(i)}]},eVe=i=>{const{componentCls:e}=i;return[{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl"},[`${e}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[e]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${i.screenSMMax}px)`]:{[e]:{maxWidth:"calc(100vw - 16px)",margin:`${rt(i.marginXS)} auto`},[`${e}-centered`]:{[e]:{flex:1}}}}},{[e]:Object.assign(Object.assign({},Pa(i)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${rt(i.calc(i.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:i.paddingLG,[`${e}-title`]:{margin:0,color:i.titleColor,fontWeight:i.fontWeightStrong,fontSize:i.titleFontSize,lineHeight:i.titleLineHeight,wordWrap:"break-word"},[`${e}-content`]:{position:"relative",backgroundColor:i.contentBg,backgroundClip:"padding-box",border:0,borderRadius:i.borderRadiusLG,boxShadow:i.boxShadow,pointerEvents:"auto",padding:i.contentPadding},[`${e}-close`]:Object.assign({position:"absolute",top:i.calc(i.modalHeaderHeight).sub(i.modalCloseBtnSize).div(2).equal(),insetInlineEnd:i.calc(i.modalHeaderHeight).sub(i.modalCloseBtnSize).div(2).equal(),zIndex:i.calc(i.zIndexPopupBase).add(10).equal(),padding:0,color:i.modalCloseIconColor,fontWeight:i.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:i.borderRadiusSM,width:i.modalCloseBtnSize,height:i.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${i.motionDurationMid}, background-color ${i.motionDurationMid}`,"&-x":{display:"flex",fontSize:i.fontSizeLG,fontStyle:"normal",lineHeight:`${rt(i.modalCloseBtnSize)}`,justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:i.modalIconHoverColor,backgroundColor:i.closeBtnHoverBg,textDecoration:"none"},"&:active":{backgroundColor:i.closeBtnActiveBg}},E4(i)),[`${e}-header`]:{color:i.colorText,background:i.headerBg,borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`,marginBottom:i.headerMarginBottom,padding:i.headerPadding,borderBottom:i.headerBorderBottom},[`${e}-body`]:{fontSize:i.fontSize,lineHeight:i.lineHeight,wordWrap:"break-word",padding:i.bodyPadding},[`${e}-footer`]:{textAlign:"end",background:i.footerBg,marginTop:i.footerMarginTop,padding:i.footerPadding,borderTop:i.footerBorderTop,borderRadius:i.footerBorderRadius,[`> ${i.antCls}-btn + ${i.antCls}-btn`]:{marginInlineStart:i.marginXS}},[`${e}-open`]:{overflow:"hidden"}})},{[`${e}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${e}-content, + opacity ${i.motionDurationMid} ${i.motionEaseInOut} !important`}}});var _me=QWe;function qne(i){return{position:i,inset:0}}const JWe=i=>{const{componentCls:e,antCls:t}=i;return[{[`${e}-root`]:{[`${e}${t}-zoom-enter, ${e}${t}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:i.motionDurationSlow,userSelect:"none"},[`${e}${t}-zoom-leave ${e}-content`]:{pointerEvents:"none"},[`${e}-mask`]:Object.assign(Object.assign({},qne("fixed")),{zIndex:i.zIndexPopupBase,height:"100%",backgroundColor:i.colorBgMask,pointerEvents:"none",[`${e}-hidden`]:{display:"none"}}),[`${e}-wrap`]:Object.assign(Object.assign({},qne("fixed")),{zIndex:i.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch",[`&:has(${e}${t}-zoom-enter), &:has(${e}${t}-zoom-appear)`]:{pointerEvents:"none"}})}},{[`${e}-root`]:DWe(i)}]},eVe=i=>{const{componentCls:e}=i;return[{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl"},[`${e}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[e]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${i.screenSMMax}px)`]:{[e]:{maxWidth:"calc(100vw - 16px)",margin:`${rt(i.marginXS)} auto`},[`${e}-centered`]:{[e]:{flex:1}}}}},{[e]:Object.assign(Object.assign({},Pa(i)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${rt(i.calc(i.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:i.paddingLG,[`${e}-title`]:{margin:0,color:i.titleColor,fontWeight:i.fontWeightStrong,fontSize:i.titleFontSize,lineHeight:i.titleLineHeight,wordWrap:"break-word"},[`${e}-content`]:{position:"relative",backgroundColor:i.contentBg,backgroundClip:"padding-box",border:0,borderRadius:i.borderRadiusLG,boxShadow:i.boxShadow,pointerEvents:"auto",padding:i.contentPadding},[`${e}-close`]:Object.assign({position:"absolute",top:i.calc(i.modalHeaderHeight).sub(i.modalCloseBtnSize).div(2).equal(),insetInlineEnd:i.calc(i.modalHeaderHeight).sub(i.modalCloseBtnSize).div(2).equal(),zIndex:i.calc(i.zIndexPopupBase).add(10).equal(),padding:0,color:i.modalCloseIconColor,fontWeight:i.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:i.borderRadiusSM,width:i.modalCloseBtnSize,height:i.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${i.motionDurationMid}, background-color ${i.motionDurationMid}`,"&-x":{display:"flex",fontSize:i.fontSizeLG,fontStyle:"normal",lineHeight:`${rt(i.modalCloseBtnSize)}`,justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:i.modalIconHoverColor,backgroundColor:i.closeBtnHoverBg,textDecoration:"none"},"&:active":{backgroundColor:i.closeBtnActiveBg}},E4(i)),[`${e}-header`]:{color:i.colorText,background:i.headerBg,borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`,marginBottom:i.headerMarginBottom,padding:i.headerPadding,borderBottom:i.headerBorderBottom},[`${e}-body`]:{fontSize:i.fontSize,lineHeight:i.lineHeight,wordWrap:"break-word",padding:i.bodyPadding},[`${e}-footer`]:{textAlign:"end",background:i.footerBg,marginTop:i.footerMarginTop,padding:i.footerPadding,borderTop:i.footerBorderTop,borderRadius:i.footerBorderRadius,[`> ${i.antCls}-btn + ${i.antCls}-btn`]:{marginInlineStart:i.marginXS}},[`${e}-open`]:{overflow:"hidden"}})},{[`${e}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${e}-content, ${e}-body, - ${e}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${e}-confirm-body`]:{marginBottom:"auto"}}}]},tVe=i=>{const{componentCls:e}=i;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},_me=i=>{const e=i.padding,t=i.fontSizeHeading5,n=i.lineHeightHeading5;return lr(i,{modalHeaderHeight:i.calc(i.calc(n).mul(t).equal()).add(i.calc(e).mul(2).equal()).equal(),modalFooterBorderColorSplit:i.colorSplit,modalFooterBorderStyle:i.lineType,modalFooterBorderWidth:i.lineWidth,modalIconHoverColor:i.colorIconHover,modalCloseIconColor:i.colorIcon,modalCloseBtnSize:i.fontHeight,modalConfirmIconSize:i.fontHeight,modalTitleHeight:i.calc(i.titleFontSize).mul(i.titleLineHeight).equal()})},bme=i=>({footerBg:"transparent",headerBg:i.colorBgElevated,titleLineHeight:i.lineHeightHeading5,titleFontSize:i.fontSizeHeading5,contentBg:i.colorBgElevated,titleColor:i.colorTextHeading,closeBtnHoverBg:i.wireframe?"transparent":i.colorFillContent,closeBtnActiveBg:i.wireframe?"transparent":i.colorFillContentHover,contentPadding:i.wireframe?0:`${rt(i.paddingMD)} ${rt(i.paddingContentHorizontalLG)}`,headerPadding:i.wireframe?`${rt(i.padding)} ${rt(i.paddingLG)}`:0,headerBorderBottom:i.wireframe?`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`:"none",headerMarginBottom:i.wireframe?0:i.marginXS,bodyPadding:i.wireframe?i.paddingLG:0,footerPadding:i.wireframe?`${rt(i.paddingXS)} ${rt(i.padding)}`:0,footerBorderTop:i.wireframe?`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`:"none",footerBorderRadius:i.wireframe?`0 0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)}`:0,footerMarginTop:i.wireframe?0:i.marginSM,confirmBodyPadding:i.wireframe?`${rt(i.padding*2)} ${rt(i.padding*2)} ${rt(i.paddingLG)}`:0,confirmIconMarginInlineEnd:i.wireframe?i.margin:i.marginSM,confirmBtnsMarginTop:i.wireframe?i.marginLG:i.marginSM});var Cme=jc("Modal",i=>{const e=_me(i);return[eVe(e),tVe(e),JWe(e),mme(e,"zoom")]},bme,{unitless:{titleLineHeight:!0}}),nVe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{RW={x:i.pageX,y:i.pageY},setTimeout(()=>{RW=null},100)};EBe()&&document.documentElement.addEventListener("click",iVe,!0);const oVe=i=>{var e;const{getPopupContainer:t,getPrefixCls:n,direction:o,modal:r}=x.exports.useContext(Hi),s=G=>{const{onCancel:X}=i;X==null||X(G)},a=G=>{const{onOk:X}=i;X==null||X(G)},{prefixCls:l,className:c,rootClassName:d,open:u,wrapClassName:h,centered:f,getContainer:g,closeIcon:p,closable:v,focusTriggerAfterClose:m=!0,style:_,visible:y,width:w=520,footer:L,classNames:D,styles:E}=i,I=nVe(i,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","closable","focusTriggerAfterClose","style","visible","width","footer","classNames","styles"]),k=n("modal",l),R=n(),A=nh(k),[P,N,M]=Cme(k,A),H=Ue(h,{[`${k}-centered`]:!!f,[`${k}-wrap-rtl`]:o==="rtl"}),B=L!==null&&x.exports.createElement(ume,Object.assign({},i,{onOk:a,onCancel:s})),[F,$]=LBe(v,p,G=>dme(k,G),x.exports.createElement(hS,{className:`${k}-close-icon`}),!0),z=CWe(`.${k}-content`),[K,j]=qK("Modal",I.zIndex);return P(x.exports.createElement(EA,null,x.exports.createElement(NW,{status:!0,override:!0},x.exports.createElement(jK.Provider,{value:j},x.exports.createElement(Jpe,Object.assign({width:w},I,{zIndex:K,getContainer:g===void 0?t:g,prefixCls:k,rootClassName:Ue(N,d,M,A),footer:B,visible:u!=null?u:y,mousePosition:(e=I.mousePosition)!==null&&e!==void 0?e:RW,onClose:s,closable:F,closeIcon:$,focusTriggerAfterClose:m,transitionName:q0(R,"zoom",i.transitionName),maskTransitionName:q0(R,"fade",i.maskTransitionName),className:Ue(N,c,r==null?void 0:r.className),style:Object.assign(Object.assign({},r==null?void 0:r.style),_),classNames:Object.assign(Object.assign(Object.assign({},r==null?void 0:r.classNames),D),{wrapper:Ue(H,D==null?void 0:D.wrapper)}),styles:Object.assign(Object.assign({},r==null?void 0:r.styles),E),panelRef:z}))))))};var yme=oVe;const rVe=i=>{const{componentCls:e,titleFontSize:t,titleLineHeight:n,modalConfirmIconSize:o,fontSize:r,lineHeight:s,modalTitleHeight:a,fontHeight:l,confirmBodyPadding:c}=i,d=`${e}-confirm`;return{[d]:{"&-rtl":{direction:"rtl"},[`${i.antCls}-modal-header`]:{display:"none"},[`${d}-body-wrapper`]:Object.assign({},ipe()),[`&${e} ${e}-body`]:{padding:c},[`${d}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${i.iconCls}`]:{flex:"none",fontSize:o,marginInlineEnd:i.confirmIconMarginInlineEnd,marginTop:i.calc(i.calc(l).sub(o).equal()).div(2).equal()},[`&-has-title > ${i.iconCls}`]:{marginTop:i.calc(i.calc(a).sub(o).equal()).div(2).equal()}},[`${d}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:i.marginXS,maxWidth:`calc(100% - ${rt(i.calc(i.modalConfirmIconSize).add(i.marginSM).equal())})`},[`${d}-title`]:{color:i.colorTextHeading,fontWeight:i.fontWeightStrong,fontSize:t,lineHeight:n},[`${d}-content`]:{color:i.colorText,fontSize:r,lineHeight:s},[`${d}-btns`]:{textAlign:"end",marginTop:i.confirmBtnsMarginTop,[`${i.antCls}-btn + ${i.antCls}-btn`]:{marginBottom:0,marginInlineStart:i.marginXS}}},[`${d}-error ${d}-body > ${i.iconCls}`]:{color:i.colorError},[`${d}-warning ${d}-body > ${i.iconCls}, - ${d}-confirm ${d}-body > ${i.iconCls}`]:{color:i.colorWarning},[`${d}-info ${d}-body > ${i.iconCls}`]:{color:i.colorInfo},[`${d}-success ${d}-body > ${i.iconCls}`]:{color:i.colorSuccess}}};var sVe=WK(["Modal","confirm"],i=>{const e=_me(i);return[rVe(e)]},bme,{order:-1e3}),aVe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o_,_t(Object.values(_))),w=x.exports.createElement(x.exports.Fragment,null,x.exports.createElement(vne,null),x.exports.createElement(_ne,null)),L=i.title!==void 0&&i.title!==null,D=`${r}-body`;return x.exports.createElement("div",{className:`${r}-body-wrapper`},x.exports.createElement("div",{className:Ue(D,{[`${D}-has-title`]:L})},u,x.exports.createElement("div",{className:`${r}-paragraph`},L&&x.exports.createElement("span",{className:`${r}-title`},i.title),x.exports.createElement("div",{className:`${r}-content`},i.content))),l===void 0||typeof l=="function"?x.exports.createElement(qpe,{value:y},x.exports.createElement("div",{className:`${r}-btns`},typeof l=="function"?l(w,{OkBtn:_ne,CancelBtn:vne}):w)):l,x.exports.createElement(sVe,{prefixCls:e}))}const lVe=i=>{const{close:e,zIndex:t,afterClose:n,open:o,keyboard:r,centered:s,getContainer:a,maskStyle:l,direction:c,prefixCls:d,wrapClassName:u,rootPrefixCls:h,bodyStyle:f,closable:g=!1,closeIcon:p,modalRender:v,focusTriggerAfterClose:m,onConfirm:_,styles:y}=i,w=`${d}-confirm`,L=i.width||416,D=i.style||{},E=i.mask===void 0?!0:i.mask,I=i.maskClosable===void 0?!1:i.maskClosable,k=Ue(w,`${w}-${i.type}`,{[`${w}-rtl`]:c==="rtl"},i.className),[,R]=Ba(),A=x.exports.useMemo(()=>t!==void 0?t:R.zIndexPopupBase+KK,[t,R]);return x.exports.createElement(yme,{prefixCls:d,className:k,wrapClassName:Ue({[`${w}-centered`]:!!i.centered},u),onCancel:()=>{e==null||e({triggerCancel:!0}),_==null||_(!1)},open:o,title:"",footer:null,transitionName:q0(h||"","zoom",i.transitionName),maskTransitionName:q0(h||"","fade",i.maskTransitionName),mask:E,maskClosable:I,style:D,styles:Object.assign({body:f,mask:l},y),width:L,zIndex:A,afterClose:n,keyboard:r,centered:s,getContainer:a,closable:g,closeIcon:p,modalRender:v,focusTriggerAfterClose:m},x.exports.createElement(wme,Object.assign({},i,{confirmPrefixCls:w})))},Sme=i=>{const{rootPrefixCls:e,iconPrefixCls:t,direction:n,theme:o}=i;return x.exports.createElement(gp,{prefixCls:e,iconPrefixCls:t,direction:n,theme:o},x.exports.createElement(lVe,Object.assign({},i)))},cVe=[];var a0=cVe;let xme="";function Lme(){return xme}const dVe=i=>{var e,t;const{prefixCls:n,getContainer:o,direction:r}=i,s=jge(),a=x.exports.useContext(Hi),l=Lme()||a.getPrefixCls(),c=n||`${l}-modal`;let d=o;return d===!1&&(d=void 0),he(Sme,{...Object.assign({},i,{rootPrefixCls:l,prefixCls:c,iconPrefixCls:a.iconPrefixCls,theme:a.theme,direction:r!=null?r:a.direction,locale:(t=(e=a.locale)===null||e===void 0?void 0:e.Modal)!==null&&t!==void 0?t:s,getContainer:d})})};function RI(i){const e=HK(),t=document.createDocumentFragment();let n=Object.assign(Object.assign({},i),{close:a,open:!0}),o;function r(){for(var c=arguments.length,d=new Array(c),u=0;uf&&f.triggerCancel);i.onCancel&&h&&i.onCancel.apply(i,[()=>{}].concat(_t(d.slice(1))));for(let f=0;f{const d=e.getPrefixCls(void 0,Lme()),u=e.getIconPrefixCls(),h=e.getTheme(),f=he(dVe,{...Object.assign({},c)});XK(he(gp,{prefixCls:d,iconPrefixCls:u,theme:h,children:e.holderRender?e.holderRender(f):f}),t)})}function a(){for(var c=arguments.length,d=new Array(c),u=0;u{typeof i.afterClose=="function"&&i.afterClose(),r.apply(this,d)}}),n.visible&&delete n.visible,s(n)}function l(c){typeof c=="function"?n=c(n):n=Object.assign(Object.assign({},n),c),s(n)}return s(n),a0.push(a),{destroy:a,update:l}}function Eme(i){return Object.assign(Object.assign({},i),{type:"warning"})}function Dme(i){return Object.assign(Object.assign({},i),{type:"info"})}function kme(i){return Object.assign(Object.assign({},i),{type:"success"})}function Ime(i){return Object.assign(Object.assign({},i),{type:"error"})}function Tme(i){return Object.assign(Object.assign({},i),{type:"confirm"})}function uVe(i){let{rootPrefixCls:e}=i;xme=e}var hVe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,{afterClose:n,config:o}=i,r=hVe(i,["afterClose","config"]);const[s,a]=x.exports.useState(!0),[l,c]=x.exports.useState(o),{direction:d,getPrefixCls:u}=x.exports.useContext(Hi),h=u("modal"),f=u(),g=()=>{var _;n(),(_=l.afterClose)===null||_===void 0||_.call(l)},p=function(){a(!1);for(var _=arguments.length,y=new Array(_),w=0;w<_;w++)y[w]=arguments[w];const L=y.some(D=>D&&D.triggerCancel);l.onCancel&&L&&l.onCancel.apply(l,[()=>{}].concat(_t(y.slice(1))))};x.exports.useImperativeHandle(e,()=>({destroy:p,update:_=>{c(y=>Object.assign(Object.assign({},y),_))}}));const v=(t=l.okCancel)!==null&&t!==void 0?t:l.type==="confirm",[m]=EI("Modal",mv.Modal);return x.exports.createElement(Sme,Object.assign({prefixCls:h,rootPrefixCls:f},l,{close:p,open:s,afterClose:g,okText:l.okText||(v?m==null?void 0:m.okText:m==null?void 0:m.justOkText),direction:l.direction||d,cancelText:l.cancelText||(m==null?void 0:m.cancelText)},r))};var gVe=x.exports.forwardRef(fVe);let qne=0;const pVe=x.exports.memo(x.exports.forwardRef((i,e)=>{const[t,n]=a7e();return x.exports.useImperativeHandle(e,()=>({patchElement:n}),[]),x.exports.createElement(x.exports.Fragment,null,t)}));function mVe(){const i=x.exports.useRef(null),[e,t]=x.exports.useState([]);x.exports.useEffect(()=>{e.length&&(_t(e).forEach(s=>{s()}),t([]))},[e]);const n=x.exports.useCallback(r=>function(a){var l;qne+=1;const c=x.exports.createRef();let d;const u=new Promise(v=>{d=v});let h=!1,f;const g=x.exports.createElement(gVe,{key:`modal-${qne}`,config:r(a),ref:c,afterClose:()=>{f==null||f()},isSilent:()=>h,onConfirm:v=>{d(v)}});return f=(l=i.current)===null||l===void 0?void 0:l.patchElement(g),f&&a0.push(f),{destroy:()=>{function v(){var m;(m=c.current)===null||m===void 0||m.destroy()}c.current?v():t(m=>[].concat(_t(m),[v]))},update:v=>{function m(){var _;(_=c.current)===null||_===void 0||_.update(v)}c.current?m():t(_=>[].concat(_t(_),[m]))},then:v=>(h=!0,u.then(v))}},[]);return[x.exports.useMemo(()=>({info:n(Dme),success:n(kme),error:n(Ime),warning:n(Eme),confirm:n(Tme)}),[]),x.exports.createElement(pVe,{key:"modal-holder",ref:i})]}const vVe=Bt.createContext({});function Nme(i){return e=>x.exports.createElement(gp,{theme:{token:{motion:!1,zIndexPopupBase:0}}},x.exports.createElement(i,Object.assign({},e)))}const _Ve=(i,e,t,n)=>Nme(r=>{const{prefixCls:s,style:a}=r,l=x.exports.useRef(null),[c,d]=x.exports.useState(0),[u,h]=x.exports.useState(0),[f,g]=Kl(!1,{value:r.open}),{getPrefixCls:p}=x.exports.useContext(Hi),v=p(e||"select",s);x.exports.useEffect(()=>{if(g(!0),typeof ResizeObserver!="undefined"){const y=new ResizeObserver(L=>{const D=L[0].target;d(D.offsetHeight+8),h(D.offsetWidth)}),w=setInterval(()=>{var L;const D=t?`.${t(v)}`:`.${v}-dropdown`,E=(L=l.current)===null||L===void 0?void 0:L.querySelector(D);E&&(clearInterval(w),y.observe(E))},10);return()=>{clearInterval(w),y.disconnect()}}},[]);let m=Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},a),{margin:0}),open:f,visible:f,getPopupContainer:()=>l.current});n&&(m=n(m));const _={paddingBottom:c,position:"relative",minWidth:u};return x.exports.createElement("div",{ref:l,style:_},x.exports.createElement(i,Object.assign({},m)))});var bVe=_Ve,sq=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var i=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(i==null?void 0:i.substr(0,4))},M4=function(e){var t=e.className,n=e.customizeIcon,o=e.customizeIconProps,r=e.children,s=e.onMouseDown,a=e.onClick,l=typeof n=="function"?n(o):n;return x.exports.createElement("span",{className:t,onMouseDown:function(d){d.preventDefault(),s==null||s(d)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},l!==void 0?l:x.exports.createElement("span",{className:Ue(t.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},r))},CVe=function(e,t,n,o,r){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,a=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,c=Bt.useMemo(function(){if(qn(o)==="object")return o.clearIcon;if(r)return r},[o,r]),d=Bt.useMemo(function(){return!!(!s&&!!o&&(n.length||a)&&!(l==="combobox"&&a===""))},[o,s,n.length,a,l]);return{allowClear:d,clearIcon:Bt.createElement(M4,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:c},"\xD7")}},Rme=x.exports.createContext(null);function yVe(){return x.exports.useContext(Rme)}function wVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=x.exports.useState(!1),t=Ne(e,2),n=t[0],o=t[1],r=x.exports.useRef(null),s=function(){window.clearTimeout(r.current)};x.exports.useEffect(function(){return s},[]);var a=function(c,d){s(),r.current=window.setTimeout(function(){o(c),d&&d()},i)};return[n,a,s]}function Mme(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=x.exports.useRef(null),t=x.exports.useRef(null);x.exports.useEffect(function(){return function(){window.clearTimeout(t.current)}},[]);function n(o){(o||e.current===null)&&(e.current=o),window.clearTimeout(t.current),t.current=window.setTimeout(function(){e.current=null},i)}return[function(){return e.current},n]}function SVe(i,e,t,n){var o=x.exports.useRef(null);o.current={open:e,triggerOpen:t,customizedTrigger:n},x.exports.useEffect(function(){function r(s){var a;if(!((a=o.current)!==null&&a!==void 0&&a.customizedTrigger)){var l=s.target;l.shadowRoot&&s.composed&&(l=s.composedPath()[0]||l),o.current.open&&i().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&o.current.triggerOpen(!1)}}return window.addEventListener("mousedown",r),function(){return window.removeEventListener("mousedown",r)}},[])}var xVe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],T1=void 0;function LVe(i,e){var t=i.prefixCls,n=i.invalidate,o=i.item,r=i.renderItem,s=i.responsive,a=i.responsiveDisabled,l=i.registerSize,c=i.itemKey,d=i.className,u=i.style,h=i.children,f=i.display,g=i.order,p=i.component,v=p===void 0?"div":p,m=Hn(i,xVe),_=s&&!f;function y(I){l(c,I)}x.exports.useEffect(function(){return function(){y(null)}},[]);var w=r&&o!==T1?r(o):h,L;n||(L={opacity:_?0:1,height:_?0:T1,overflowY:_?"hidden":T1,order:s?g:T1,pointerEvents:_?"none":T1,position:_?"absolute":T1});var D={};_&&(D["aria-hidden"]=!0);var E=x.exports.createElement(v,yt({className:Ue(!n&&t,d),style:Ce(Ce({},L),u)},D,m,{ref:e}),w);return s&&(E=x.exports.createElement(Mu,{onResize:function(k){var R=k.offsetWidth;y(R)},disabled:a},E)),E}var sE=x.exports.forwardRef(LVe);sE.displayName="Item";function EVe(i){if(typeof MessageChannel=="undefined")Xi(i);else{var e=new MessageChannel;e.port1.onmessage=function(){return i()},e.port2.postMessage(void 0)}}function DVe(){var i=x.exports.useRef(null),e=function(n){i.current||(i.current=[],EVe(function(){zu.exports.unstable_batchedUpdates(function(){i.current.forEach(function(o){o()}),i.current=null})})),i.current.push(n)};return e}function Lx(i,e){var t=x.exports.useState(e),n=Ne(t,2),o=n[0],r=n[1],s=tl(function(a){i(function(){r(a)})});return[o,s]}var IA=Bt.createContext(null),kVe=["component"],IVe=["className"],TVe=["className"],NVe=function(e,t){var n=x.exports.useContext(IA);if(!n){var o=e.component,r=o===void 0?"div":o,s=Hn(e,kVe);return x.exports.createElement(r,yt({},s,{ref:t}))}var a=n.className,l=Hn(n,IVe),c=e.className,d=Hn(e,TVe);return x.exports.createElement(IA.Provider,{value:null},x.exports.createElement(sE,yt({ref:t,className:Ue(a,c)},l,d)))},Ame=x.exports.forwardRef(NVe);Ame.displayName="RawItem";var RVe=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Pme="responsive",Ome="invalidate";function MVe(i){return"+ ".concat(i.length," ...")}function AVe(i,e){var t=i.prefixCls,n=t===void 0?"rc-overflow":t,o=i.data,r=o===void 0?[]:o,s=i.renderItem,a=i.renderRawItem,l=i.itemKey,c=i.itemWidth,d=c===void 0?10:c,u=i.ssr,h=i.style,f=i.className,g=i.maxCount,p=i.renderRest,v=i.renderRawRest,m=i.suffix,_=i.component,y=_===void 0?"div":_,w=i.itemComponent,L=i.onVisibleChange,D=Hn(i,RVe),E=u==="full",I=DVe(),k=Lx(I,null),R=Ne(k,2),A=R[0],P=R[1],N=A||0,M=Lx(I,new Map),H=Ne(M,2),B=H[0],F=H[1],$=Lx(I,0),z=Ne($,2),K=z[0],j=z[1],G=Lx(I,0),X=Ne(G,2),ue=X[0],fe=X[1],pe=Lx(I,0),be=Ne(pe,2),Se=be[0],Fe=be[1],De=x.exports.useState(null),ce=Ne(De,2),Pe=ce[0],Oe=ce[1],xe=x.exports.useState(null),Ee=Ne(xe,2),tt=Ee[0],nt=Ee[1],Qe=x.exports.useMemo(function(){return tt===null&&E?Number.MAX_SAFE_INTEGER:tt||0},[tt,A]),Ge=x.exports.useState(!1),re=Ne(Ge,2),ie=re[0],se=re[1],U="".concat(n,"-item"),Y=Math.max(K,ue),oe=g===Pme,te=r.length&&oe,ye=g===Ome,Le=te||typeof g=="number"&&r.length>g,Te=x.exports.useMemo(function(){var Nt=r;return te?A===null&&E?Nt=r:Nt=r.slice(0,Math.min(r.length,N/d)):typeof g=="number"&&(Nt=r.slice(0,g)),Nt},[r,d,A,g,te]),We=x.exports.useMemo(function(){return te?r.slice(Qe+1):r.slice(Te.length)},[r,Te,te,Qe]),je=x.exports.useCallback(function(Nt,jt){var Gt;return typeof l=="function"?l(Nt):(Gt=l&&(Nt==null?void 0:Nt[l]))!==null&&Gt!==void 0?Gt:jt},[l]),mt=x.exports.useCallback(s||function(Nt){return Nt},[s]);function Dt(Nt,jt,Gt){tt===Nt&&(jt===void 0||jt===Pe)||(nt(Nt),Gt||(se(NtN){Dt(It-1,Nt-Ft-Se+ue);break}}m&&Vn(0)+Se>N&&Oe(null)}},[N,B,ue,Se,je,Te]);var Et=ie&&!!We.length,tn={};Pe!==null&&te&&(tn={position:"absolute",left:Pe,top:0});var di={prefixCls:U,responsive:te,component:w,invalidate:ye},cn=a?function(Nt,jt){var Gt=je(Nt,jt);return x.exports.createElement(IA.Provider,{key:Gt,value:Ce(Ce({},di),{},{order:jt,item:Nt,itemKey:Gt,registerSize:Je,display:jt<=Qe})},a(Nt,jt))}:function(Nt,jt){var Gt=je(Nt,jt);return x.exports.createElement(sE,yt({},di,{order:jt,key:Gt,item:Nt,renderItem:mt,itemKey:Gt,registerSize:Je,display:jt<=Qe}))},Gn,bn={order:Et?Qe:Number.MAX_SAFE_INTEGER,className:"".concat(U,"-rest"),registerSize:Lt,display:Et};if(v)v&&(Gn=x.exports.createElement(IA.Provider,{value:Ce(Ce({},di),bn)},v(We)));else{var Pt=p||MVe;Gn=x.exports.createElement(sE,yt({},di,bn),typeof Pt=="function"?Pt(We):Pt)}var qt=x.exports.createElement(y,yt({className:Ue(!ye&&n,f),style:h,ref:e},D),Te.map(cn),Le?Gn:null,m&&x.exports.createElement(sE,yt({},di,{responsive:oe,responsiveDisabled:!te,order:Qe,className:"".concat(U,"-suffix"),registerSize:Ot,display:!0,style:tn}),m));return oe&&(qt=x.exports.createElement(Mu,{onResize:At,disabled:!te},qt)),qt}var sf=x.exports.forwardRef(AVe);sf.displayName="Overflow";sf.Item=Ame;sf.RESPONSIVE=Pme;sf.INVALIDATE=Ome;var PVe=function(e,t){var n,o=e.prefixCls,r=e.id,s=e.inputElement,a=e.disabled,l=e.tabIndex,c=e.autoFocus,d=e.autoComplete,u=e.editable,h=e.activeDescendantId,f=e.value,g=e.maxLength,p=e.onKeyDown,v=e.onMouseDown,m=e.onChange,_=e.onPaste,y=e.onCompositionStart,w=e.onCompositionEnd,L=e.open,D=e.attrs,E=s||x.exports.createElement("input",null),I=E,k=I.ref,R=I.props,A=R.onKeyDown,P=R.onChange,N=R.onMouseDown,M=R.onCompositionStart,H=R.onCompositionEnd,B=R.style;return"maxLength"in E.props,E=x.exports.cloneElement(E,Ce(Ce(Ce({type:"search"},R),{},{id:r,ref:eh(t,k),disabled:a,tabIndex:l,autoComplete:d||"off",autoFocus:c,className:Ue("".concat(o,"-selection-search-input"),(n=E)===null||n===void 0||(n=n.props)===null||n===void 0?void 0:n.className),role:"combobox","aria-expanded":L||!1,"aria-haspopup":"listbox","aria-owns":"".concat(r,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(r,"_list"),"aria-activedescendant":L?h:void 0},D),{},{value:u?f:"",maxLength:g,readOnly:!u,unselectable:u?null:"on",style:Ce(Ce({},B),{},{opacity:u?null:0}),onKeyDown:function($){p($),A&&A($)},onMouseDown:function($){v($),N&&N($)},onChange:function($){m($),P&&P($)},onCompositionStart:function($){y($),M&&M($)},onCompositionEnd:function($){w($),H&&H($)},onPaste:_})),E},Fme=x.exports.forwardRef(PVe);function Bme(i){return Array.isArray(i)?i:i!==void 0?[i]:[]}var OVe=typeof window!="undefined"&&window.document&&window.document.documentElement,FVe=OVe;function BVe(i){return i!=null}function WVe(i){return!i&&i!==0}function Gne(i){return["string","number"].includes(qn(i))}function Wme(i){var e=void 0;return i&&(Gne(i.title)?e=i.title.toString():Gne(i.label)&&(e=i.label.toString())),e}function VVe(i,e){FVe?x.exports.useLayoutEffect(i,e):x.exports.useEffect(i,e)}function HVe(i){var e;return(e=i.key)!==null&&e!==void 0?e:i.value}var Xne=function(e){e.preventDefault(),e.stopPropagation()},$Ve=function(e){var t=e.id,n=e.prefixCls,o=e.values,r=e.open,s=e.searchValue,a=e.autoClearSearchValue,l=e.inputRef,c=e.placeholder,d=e.disabled,u=e.mode,h=e.showSearch,f=e.autoFocus,g=e.autoComplete,p=e.activeDescendantId,v=e.tabIndex,m=e.removeIcon,_=e.maxTagCount,y=e.maxTagTextLength,w=e.maxTagPlaceholder,L=w===void 0?function(Oe){return"+ ".concat(Oe.length," ...")}:w,D=e.tagRender,E=e.onToggleOpen,I=e.onRemove,k=e.onInputChange,R=e.onInputPaste,A=e.onInputKeyDown,P=e.onInputMouseDown,N=e.onInputCompositionStart,M=e.onInputCompositionEnd,H=x.exports.useRef(null),B=x.exports.useState(0),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState(!1),j=Ne(K,2),G=j[0],X=j[1],ue="".concat(n,"-selection"),fe=r||u==="multiple"&&a===!1||u==="tags"?s:"",pe=u==="tags"||u==="multiple"&&a===!1||h&&(r||G);VVe(function(){z(H.current.scrollWidth)},[fe]);var be=function(xe,Ee,tt,nt,Qe){return x.exports.createElement("span",{title:Wme(xe),className:Ue("".concat(ue,"-item"),me({},"".concat(ue,"-item-disabled"),tt))},x.exports.createElement("span",{className:"".concat(ue,"-item-content")},Ee),nt&&x.exports.createElement(M4,{className:"".concat(ue,"-item-remove"),onMouseDown:Xne,onClick:Qe,customizeIcon:m},"\xD7"))},Se=function(xe,Ee,tt,nt,Qe){var Ge=function(ie){Xne(ie),E(!r)};return x.exports.createElement("span",{onMouseDown:Ge},D({label:Ee,value:xe,disabled:tt,closable:nt,onClose:Qe}))},Fe=function(xe){var Ee=xe.disabled,tt=xe.label,nt=xe.value,Qe=!d&&!Ee,Ge=tt;if(typeof y=="number"&&(typeof tt=="string"||typeof tt=="number")){var re=String(Ge);re.length>y&&(Ge="".concat(re.slice(0,y),"..."))}var ie=function(U){U&&U.stopPropagation(),I(xe)};return typeof D=="function"?Se(nt,Ge,Ee,Qe,ie):be(xe,Ge,Ee,Qe,ie)},De=function(xe){var Ee=typeof L=="function"?L(xe):L;return be({title:Ee},Ee,!1)},ce=x.exports.createElement("div",{className:"".concat(ue,"-search"),style:{width:$},onFocus:function(){X(!0)},onBlur:function(){X(!1)}},x.exports.createElement(Fme,{ref:l,open:r,prefixCls:n,id:t,inputElement:null,disabled:d,autoFocus:f,autoComplete:g,editable:pe,activeDescendantId:p,value:fe,onKeyDown:A,onMouseDown:P,onChange:k,onPaste:R,onCompositionStart:N,onCompositionEnd:M,tabIndex:v,attrs:K0(e,!0)}),x.exports.createElement("span",{ref:H,className:"".concat(ue,"-search-mirror"),"aria-hidden":!0},fe,"\xA0")),Pe=x.exports.createElement(sf,{prefixCls:"".concat(ue,"-overflow"),data:o,renderItem:Fe,renderRest:De,suffix:ce,itemKey:HVe,maxCount:_});return x.exports.createElement(x.exports.Fragment,null,Pe,!o.length&&!fe&&x.exports.createElement("span",{className:"".concat(ue,"-placeholder")},c))},zVe=function(e){var t=e.inputElement,n=e.prefixCls,o=e.id,r=e.inputRef,s=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,d=e.mode,u=e.open,h=e.values,f=e.placeholder,g=e.tabIndex,p=e.showSearch,v=e.searchValue,m=e.activeValue,_=e.maxLength,y=e.onInputKeyDown,w=e.onInputMouseDown,L=e.onInputChange,D=e.onInputPaste,E=e.onInputCompositionStart,I=e.onInputCompositionEnd,k=e.title,R=x.exports.useState(!1),A=Ne(R,2),P=A[0],N=A[1],M=d==="combobox",H=M||p,B=h[0],F=v||"";M&&m&&!P&&(F=m),x.exports.useEffect(function(){M&&N(!1)},[M,m]);var $=d!=="combobox"&&!u&&!p?!1:!!F,z=k===void 0?Wme(B):k,K=x.exports.useMemo(function(){return B?null:x.exports.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:$?{visibility:"hidden"}:void 0},f)},[B,$,f,n]);return x.exports.createElement(x.exports.Fragment,null,x.exports.createElement("span",{className:"".concat(n,"-selection-search")},x.exports.createElement(Fme,{ref:r,prefixCls:n,id:o,open:u,inputElement:t,disabled:s,autoFocus:a,autoComplete:l,editable:H,activeDescendantId:c,value:F,onKeyDown:y,onMouseDown:w,onChange:function(G){N(!0),L(G)},onPaste:D,onCompositionStart:E,onCompositionEnd:I,tabIndex:g,attrs:K0(e,!0),maxLength:M?_:void 0})),!M&&B?x.exports.createElement("span",{className:"".concat(n,"-selection-item"),title:z,style:$?{visibility:"hidden"}:void 0},B.label):null,K)};function UVe(i){return![at.ESC,at.SHIFT,at.BACKSPACE,at.TAB,at.WIN_KEY,at.ALT,at.META,at.WIN_KEY_RIGHT,at.CTRL,at.SEMICOLON,at.EQUALS,at.CAPS_LOCK,at.CONTEXT_MENU,at.F1,at.F2,at.F3,at.F4,at.F5,at.F6,at.F7,at.F8,at.F9,at.F10,at.F11,at.F12].includes(i)}var jVe=function(e,t){var n=x.exports.useRef(null),o=x.exports.useRef(!1),r=e.prefixCls,s=e.open,a=e.mode,l=e.showSearch,c=e.tokenWithEnter,d=e.autoClearSearchValue,u=e.onSearch,h=e.onSearchSubmit,f=e.onToggleOpen,g=e.onInputKeyDown,p=e.domRef;x.exports.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var v=Mme(0),m=Ne(v,2),_=m[0],y=m[1],w=function(F){var $=F.which;($===at.UP||$===at.DOWN)&&F.preventDefault(),g&&g(F),$===at.ENTER&&a==="tags"&&!o.current&&!s&&(h==null||h(F.target.value)),UVe($)&&f(!0)},L=function(){y(!0)},D=x.exports.useRef(null),E=function(F){u(F,!0,o.current)!==!1&&f(!0)},I=function(){o.current=!0},k=function(F){o.current=!1,a!=="combobox"&&E(F.target.value)},R=function(F){var $=F.target.value;if(c&&D.current&&/[\r\n]/.test(D.current)){var z=D.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");$=$.replace(z,D.current)}D.current=null,E($)},A=function(F){var $=F.clipboardData,z=$==null?void 0:$.getData("text");D.current=z||""},P=function(F){var $=F.target;if($!==n.current){var z=document.body.style.msTouchAction!==void 0;z?setTimeout(function(){n.current.focus()}):n.current.focus()}},N=function(F){var $=_();F.target!==n.current&&!$&&a!=="combobox"&&F.preventDefault(),(a!=="combobox"&&(!l||!$)||!s)&&(s&&d!==!1&&u("",!0,!1),f())},M={inputRef:n,onInputKeyDown:w,onInputMouseDown:L,onInputChange:R,onInputPaste:A,onInputCompositionStart:I,onInputCompositionEnd:k},H=a==="multiple"||a==="tags"?x.exports.createElement($Ve,yt({},e,M)):x.exports.createElement(zVe,yt({},e,M));return x.exports.createElement("div",{ref:p,className:"".concat(r,"-selector"),onClick:P,onMouseDown:N},H)},KVe=x.exports.forwardRef(jVe);function qVe(i){var e=i.prefixCls,t=i.align,n=i.arrow,o=i.arrowPos,r=n||{},s=r.className,a=r.content,l=o.x,c=l===void 0?0:l,d=o.y,u=d===void 0?0:d,h=x.exports.useRef();if(!t||!t.points)return null;var f={position:"absolute"};if(t.autoArrow!==!1){var g=t.points[0],p=t.points[1],v=g[0],m=g[1],_=p[0],y=p[1];v===_||!["t","b"].includes(v)?f.top=u:v==="t"?f.top=0:f.bottom=0,m===y||!["l","r"].includes(m)?f.left=c:m==="l"?f.left=0:f.right=0}return x.exports.createElement("div",{ref:h,className:Ue("".concat(e,"-arrow"),s),style:f},a)}function GVe(i){var e=i.prefixCls,t=i.open,n=i.zIndex,o=i.mask,r=i.motion;return o?x.exports.createElement(th,yt({},r,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return x.exports.createElement("div",{style:{zIndex:n},className:Ue("".concat(e,"-mask"),a)})}):null}var XVe=x.exports.memo(function(i){var e=i.children;return e},function(i,e){return e.cache}),YVe=x.exports.forwardRef(function(i,e){var t=i.popup,n=i.className,o=i.prefixCls,r=i.style,s=i.target,a=i.onVisibleChanged,l=i.open,c=i.keepDom,d=i.fresh,u=i.onClick,h=i.mask,f=i.arrow,g=i.arrowPos,p=i.align,v=i.motion,m=i.maskMotion,_=i.forceRender,y=i.getPopupContainer,w=i.autoDestroy,L=i.portal,D=i.zIndex,E=i.onMouseEnter,I=i.onMouseLeave,k=i.onPointerEnter,R=i.ready,A=i.offsetX,P=i.offsetY,N=i.offsetR,M=i.offsetB,H=i.onAlign,B=i.onPrepare,F=i.stretch,$=i.targetWidth,z=i.targetHeight,K=typeof t=="function"?t():t,j=l||c,G=(y==null?void 0:y.length)>0,X=x.exports.useState(!y||!G),ue=Ne(X,2),fe=ue[0],pe=ue[1];if(go(function(){!fe&&G&&s&&pe(!0)},[fe,G,s]),!fe)return null;var be="auto",Se={left:"-1000vw",top:"-1000vh",right:be,bottom:be};if(R||!l){var Fe,De=p.points,ce=p.dynamicInset||((Fe=p._experimental)===null||Fe===void 0?void 0:Fe.dynamicInset),Pe=ce&&De[0][1]==="r",Oe=ce&&De[0][0]==="b";Pe?(Se.right=N,Se.left=be):(Se.left=A,Se.right=be),Oe?(Se.bottom=M,Se.top=be):(Se.top=P,Se.bottom=be)}var xe={};return F&&(F.includes("height")&&z?xe.height=z:F.includes("minHeight")&&z&&(xe.minHeight=z),F.includes("width")&&$?xe.width=$:F.includes("minWidth")&&$&&(xe.minWidth=$)),l||(xe.pointerEvents="none"),x.exports.createElement(L,{open:_||j,getContainer:y&&function(){return y(s)},autoDestroy:w},x.exports.createElement(GVe,{prefixCls:o,open:l,zIndex:D,mask:h,motion:m}),x.exports.createElement(Mu,{onResize:H,disabled:!l},function(Ee){return x.exports.createElement(th,yt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:_,leavedClassName:"".concat(o,"-hidden")},v,{onAppearPrepare:B,onEnterPrepare:B,visible:l,onVisibleChanged:function(nt){var Qe;v==null||(Qe=v.onVisibleChanged)===null||Qe===void 0||Qe.call(v,nt),a(nt)}}),function(tt,nt){var Qe=tt.className,Ge=tt.style,re=Ue(o,Qe,n);return x.exports.createElement("div",{ref:eh(Ee,e,nt),className:re,style:Ce(Ce(Ce(Ce({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},Se),xe),Ge),{},{boxSizing:"border-box",zIndex:D},r),onMouseEnter:E,onMouseLeave:I,onPointerEnter:k,onClick:u},f&&x.exports.createElement(qVe,{prefixCls:o,arrow:f,arrowPos:g,align:p}),x.exports.createElement(XVe,{cache:!l&&!d},K))})}))}),ZVe=x.exports.forwardRef(function(i,e){var t=i.children,n=i.getTriggerDOMNode,o=Gv(t),r=x.exports.useCallback(function(a){xK(e,n?n(a):a)},[n]),s=Pb(r,t.ref);return o?x.exports.cloneElement(t,{ref:s}):t}),Yne=x.exports.createContext(null);function Zne(i){return i?Array.isArray(i)?i:[i]:[]}function QVe(i,e,t,n){return x.exports.useMemo(function(){var o=Zne(t!=null?t:e),r=Zne(n!=null?n:e),s=new Set(o),a=new Set(r);return i&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[i,e,t,n])}function JVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0;return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function eHe(i,e,t,n){for(var o=t.points,r=Object.keys(i),s=0;s1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(i)?e:i}function Ex(i){return bD(parseFloat(i),0)}function Jne(i,e){var t=Ce({},i);return(e||[]).forEach(function(n){if(!(n instanceof HTMLBodyElement||n instanceof HTMLHtmlElement)){var o=MI(n).getComputedStyle(n),r=o.overflow,s=o.overflowClipMargin,a=o.borderTopWidth,l=o.borderBottomWidth,c=o.borderLeftWidth,d=o.borderRightWidth,u=n.getBoundingClientRect(),h=n.offsetHeight,f=n.clientHeight,g=n.offsetWidth,p=n.clientWidth,v=Ex(a),m=Ex(l),_=Ex(c),y=Ex(d),w=bD(Math.round(u.width/g*1e3)/1e3),L=bD(Math.round(u.height/h*1e3)/1e3),D=(g-p-_-y)*w,E=(h-f-v-m)*L,I=v*L,k=m*L,R=_*w,A=y*w,P=0,N=0;if(r==="clip"){var M=Ex(s);P=M*w,N=M*L}var H=u.x+R-P,B=u.y+I-N,F=H+u.width+2*P-R-A-D,$=B+u.height+2*N-I-k-E;t.left=Math.max(t.left,H),t.top=Math.max(t.top,B),t.right=Math.min(t.right,F),t.bottom=Math.min(t.bottom,$)}}),t}function eie(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t="".concat(e),n=t.match(/^(.*)\%$/);return n?i*(parseFloat(n[1])/100):parseFloat(t)}function tie(i,e){var t=e||[],n=Ne(t,2),o=n[0],r=n[1];return[eie(i.width,o),eie(i.height,r)]}function nie(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[i[0],i[1]]}function N1(i,e){var t=e[0],n=e[1],o,r;return t==="t"?r=i.y:t==="b"?r=i.y+i.height:r=i.y+i.height/2,n==="l"?o=i.x:n==="r"?o=i.x+i.width:o=i.x+i.width/2,{x:o,y:r}}function Op(i,e){var t={t:"b",b:"t",l:"r",r:"l"};return i.map(function(n,o){return o===e?t[n]||"c":n}).join("")}function tHe(i,e,t,n,o,r,s){var a=x.exports.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:o[n]||{}}),l=Ne(a,2),c=l[0],d=l[1],u=x.exports.useRef(0),h=x.exports.useMemo(function(){return e?MW(e):[]},[e]),f=x.exports.useRef({}),g=function(){f.current={}};i||g();var p=tl(function(){if(e&&t&&i){let er=function(Qc,Mf){var Af=arguments.length>2&&arguments[2]!==void 0?arguments[2]:re,Pf=K.x+Qc,xp=K.y+Mf,Lp=Pf+Fe,r1=xp+Se,WS=Math.max(Pf,Af.left),VS=Math.max(xp,Af.top),s1=Math.min(Lp,Af.right),HS=Math.min(r1,Af.bottom);return Math.max(0,(s1-WS)*(HS-VS))},l_=function(){Zi=K.y+Pt,an=Zi+Se,Xt=K.x+bn,oi=Xt+Fe};var _,y,w=e,L=w.ownerDocument,D=MI(w),E=D.getComputedStyle(w),I=E.width,k=E.height,R=E.position,A=w.style.left,P=w.style.top,N=w.style.right,M=w.style.bottom,H=w.style.overflow,B=Ce(Ce({},o[n]),r),F=L.createElement("div");(_=w.parentElement)===null||_===void 0||_.appendChild(F),F.style.left="".concat(w.offsetLeft,"px"),F.style.top="".concat(w.offsetTop,"px"),F.style.position=R,F.style.height="".concat(w.offsetHeight,"px"),F.style.width="".concat(w.offsetWidth,"px"),w.style.left="0",w.style.top="0",w.style.right="auto",w.style.bottom="auto",w.style.overflow="hidden";var $;if(Array.isArray(t))$={x:t[0],y:t[1],width:0,height:0};else{var z=t.getBoundingClientRect();$={x:z.x,y:z.y,width:z.width,height:z.height}}var K=w.getBoundingClientRect(),j=L.documentElement,G=j.clientWidth,X=j.clientHeight,ue=j.scrollWidth,fe=j.scrollHeight,pe=j.scrollTop,be=j.scrollLeft,Se=K.height,Fe=K.width,De=$.height,ce=$.width,Pe={left:0,top:0,right:G,bottom:X},Oe={left:-be,top:-pe,right:ue-be,bottom:fe-pe},xe=B.htmlRegion,Ee="visible",tt="visibleFirst";xe!=="scroll"&&xe!==tt&&(xe=Ee);var nt=xe===tt,Qe=Jne(Oe,h),Ge=Jne(Pe,h),re=xe===Ee?Ge:Qe,ie=nt?Ge:re;w.style.left="auto",w.style.top="auto",w.style.right="0",w.style.bottom="0";var se=w.getBoundingClientRect();w.style.left=A,w.style.top=P,w.style.right=N,w.style.bottom=M,w.style.overflow=H,(y=w.parentElement)===null||y===void 0||y.removeChild(F);var U=bD(Math.round(Fe/parseFloat(I)*1e3)/1e3),Y=bD(Math.round(Se/parseFloat(k)*1e3)/1e3);if(U===0||Y===0||_A(t)&&!T4(t))return;var oe=B.offset,te=B.targetOffset,ye=tie(K,oe),Le=Ne(ye,2),Te=Le[0],We=Le[1],je=tie($,te),mt=Ne(je,2),Dt=mt[0],At=mt[1];$.x-=Dt,$.y-=At;var Je=B.points||[],Lt=Ne(Je,2),Ot=Lt[0],Vn=Lt[1],Et=nie(Vn),tn=nie(Ot),di=N1($,Et),cn=N1(K,tn),Gn=Ce({},B),bn=di.x-cn.x+Te,Pt=di.y-cn.y+We,qt=er(bn,Pt),Nt=er(bn,Pt,Ge),jt=N1($,["t","l"]),Gt=N1(K,["t","l"]),It=N1($,["b","r"]),Ft=N1(K,["b","r"]),Ct=B.overflow||{},Zt=Ct.adjustX,wn=Ct.adjustY,Dn=Ct.shiftX,Xn=Ct.shiftY,jn=function(Mf){return typeof Mf=="boolean"?Mf:Mf>=0},Zi,an,Xt,oi;l_();var Ze=jn(wn),de=tn[0]===Et[0];if(Ze&&tn[0]==="t"&&(an>ie.bottom||f.current.bt)){var Ve=Pt;de?Ve-=Se-De:Ve=jt.y-Ft.y-We;var ot=er(bn,Ve),Sn=er(bn,Ve,Ge);ot>qt||ot===qt&&(!nt||Sn>=Nt)?(f.current.bt=!0,Pt=Ve,We=-We,Gn.points=[Op(tn,0),Op(Et,0)]):f.current.bt=!1}if(Ze&&tn[0]==="b"&&(Ziqt||Ci===qt&&(!nt||An>=Nt)?(f.current.tb=!0,Pt=$n,We=-We,Gn.points=[Op(tn,0),Op(Et,0)]):f.current.tb=!1}var lo=jn(Zt),Qo=tn[1]===Et[1];if(lo&&tn[1]==="l"&&(oi>ie.right||f.current.rl)){var zo=bn;Qo?zo-=Fe-ce:zo=jt.x-Ft.x-Te;var oc=er(zo,Pt),Yc=er(zo,Pt,Ge);oc>qt||oc===qt&&(!nt||Yc>=Nt)?(f.current.rl=!0,bn=zo,Te=-Te,Gn.points=[Op(tn,1),Op(Et,1)]):f.current.rl=!1}if(lo&&tn[1]==="r"&&(Xtqt||Ua===qt&&(!nt||vl>=Nt)?(f.current.lr=!0,bn=Gr,Te=-Te,Gn.points=[Op(tn,1),Op(Et,1)]):f.current.lr=!1}l_();var ba=Dn===!0?0:Dn;typeof ba=="number"&&(XtGe.right&&(bn-=oi-Ge.right-Te,$.x>Ge.right-ba&&(bn+=$.x-Ge.right+ba)));var _l=Xn===!0?0:Xn;typeof _l=="number"&&(ZiGe.bottom&&(Pt-=an-Ge.bottom-We,$.y>Ge.bottom-_l&&(Pt+=$.y-Ge.bottom+_l)));var rc=K.x+bn,Zc=rc+Fe,Ca=K.y+Pt,Yd=Ca+Se,bl=$.x,mi=bl+ce,gi=$.y,Kt=gi+De,on=Math.max(rc,bl),vi=Math.min(Zc,mi),Uo=(on+vi)/2,Qi=Uo-rc,Jo=Math.max(Ca,gi),_r=Math.min(Yd,Kt),zs=(Jo+_r)/2,Tr=zs-Ca;s==null||s(e,Gn);var ds=se.right-K.x-(bn+K.width),Ts=se.bottom-K.y-(Pt+K.height);d({ready:!0,offsetX:bn/U,offsetY:Pt/Y,offsetR:ds/U,offsetB:Ts/Y,arrowX:Qi/U,arrowY:Tr/Y,scaleX:U,scaleY:Y,align:Gn})}}),v=function(){u.current+=1;var y=u.current;Promise.resolve().then(function(){u.current===y&&p()})},m=function(){d(function(y){return Ce(Ce({},y),{},{ready:!1})})};return go(m,[n]),go(function(){i||m()},[i]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function nHe(i,e,t,n,o){go(function(){if(i&&e&&t){let u=function(){n(),o()};var r=e,s=t,a=MW(r),l=MW(s),c=MI(s),d=new Set([c].concat(_t(a),_t(l)));return d.forEach(function(h){h.addEventListener("scroll",u,{passive:!0})}),c.addEventListener("resize",u,{passive:!0}),n(),function(){d.forEach(function(h){h.removeEventListener("scroll",u),c.removeEventListener("resize",u)})}}},[i,e,t])}function iHe(i,e,t,n,o,r,s,a){var l=x.exports.useRef(i),c=x.exports.useRef(!1);l.current!==i&&(c.current=!0,l.current=i),x.exports.useEffect(function(){var d=Xi(function(){c.current=!1});return function(){Xi.cancel(d)}},[i]),x.exports.useEffect(function(){if(e&&n&&(!o||r)){var d=function(){var D=!1,E=function(R){var A=R.target;D=s(A)},I=function(R){var A=R.target;!c.current&&l.current&&!D&&!s(A)&&a(!1)};return[E,I]},u=d(),h=Ne(u,2),f=h[0],g=h[1],p=d(),v=Ne(p,2),m=v[0],_=v[1],y=MI(n);y.addEventListener("mousedown",f,!0),y.addEventListener("click",g,!0),y.addEventListener("contextmenu",g,!0);var w=xA(t);return w&&(w.addEventListener("mousedown",m,!0),w.addEventListener("click",_,!0),w.addEventListener("contextmenu",_,!0)),function(){y.removeEventListener("mousedown",f,!0),y.removeEventListener("click",g,!0),y.removeEventListener("contextmenu",g,!0),w&&(w.removeEventListener("mousedown",m,!0),w.removeEventListener("click",_,!0),w.removeEventListener("contextmenu",_,!0))}}},[e,t,n,o,r])}var oHe=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function rHe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:eq,e=x.exports.forwardRef(function(t,n){var o=t.prefixCls,r=o===void 0?"rc-trigger-popup":o,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,d=t.hideAction,u=t.popupVisible,h=t.defaultPopupVisible,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,p=t.mouseEnterDelay,v=t.mouseLeaveDelay,m=v===void 0?.1:v,_=t.focusDelay,y=t.blurDelay,w=t.mask,L=t.maskClosable,D=L===void 0?!0:L,E=t.getPopupContainer,I=t.forceRender,k=t.autoDestroy,R=t.destroyPopupOnHide,A=t.popup,P=t.popupClassName,N=t.popupStyle,M=t.popupPlacement,H=t.builtinPlacements,B=H===void 0?{}:H,F=t.popupAlign,$=t.zIndex,z=t.stretch,K=t.getPopupClassNameFromAlign,j=t.fresh,G=t.alignPoint,X=t.onPopupClick,ue=t.onPopupAlign,fe=t.arrow,pe=t.popupMotion,be=t.maskMotion,Se=t.popupTransitionName,Fe=t.popupAnimation,De=t.maskTransitionName,ce=t.maskAnimation,Pe=t.className,Oe=t.getTriggerDOMNode,xe=Hn(t,oHe),Ee=k||R||!1,tt=x.exports.useState(!1),nt=Ne(tt,2),Qe=nt[0],Ge=nt[1];go(function(){Ge(sq())},[]);var re=x.exports.useRef({}),ie=x.exports.useContext(Yne),se=x.exports.useMemo(function(){return{registerSubPopup:function(zn,tr){re.current[zn]=tr,ie==null||ie.registerSubPopup(zn,tr)}}},[ie]),U=Ype(),Y=x.exports.useState(null),oe=Ne(Y,2),te=oe[0],ye=oe[1],Le=tl(function(rn){_A(rn)&&te!==rn&&ye(rn),ie==null||ie.registerSubPopup(U,rn)}),Te=x.exports.useState(null),We=Ne(Te,2),je=We[0],mt=We[1],Dt=x.exports.useRef(null),At=tl(function(rn){_A(rn)&&je!==rn&&(mt(rn),Dt.current=rn)}),Je=x.exports.Children.only(s),Lt=(Je==null?void 0:Je.props)||{},Ot={},Vn=tl(function(rn){var zn,tr,dr=je;return(dr==null?void 0:dr.contains(rn))||((zn=xA(dr))===null||zn===void 0?void 0:zn.host)===rn||rn===dr||(te==null?void 0:te.contains(rn))||((tr=xA(te))===null||tr===void 0?void 0:tr.host)===rn||rn===te||Object.values(re.current).some(function(nr){return(nr==null?void 0:nr.contains(rn))||rn===nr})}),Et=Qne(r,pe,Fe,Se),tn=Qne(r,be,ce,De),di=x.exports.useState(h||!1),cn=Ne(di,2),Gn=cn[0],bn=cn[1],Pt=u!=null?u:Gn,qt=tl(function(rn){u===void 0&&bn(rn)});go(function(){bn(u||!1)},[u]);var Nt=x.exports.useRef(Pt);Nt.current=Pt;var jt=x.exports.useRef([]);jt.current=[];var Gt=tl(function(rn){var zn;qt(rn),((zn=jt.current[jt.current.length-1])!==null&&zn!==void 0?zn:Pt)!==rn&&(jt.current.push(rn),f==null||f(rn))}),It=x.exports.useRef(),Ft=function(){clearTimeout(It.current)},Ct=function(zn){var tr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ft(),tr===0?Gt(zn):It.current=setTimeout(function(){Gt(zn)},tr*1e3)};x.exports.useEffect(function(){return Ft},[]);var Zt=x.exports.useState(!1),wn=Ne(Zt,2),Dn=wn[0],Xn=wn[1];go(function(rn){(!rn||Pt)&&Xn(!0)},[Pt]);var jn=x.exports.useState(null),Zi=Ne(jn,2),an=Zi[0],Xt=Zi[1],oi=x.exports.useState([0,0]),Ze=Ne(oi,2),de=Ze[0],Ve=Ze[1],ot=function(zn){Ve([zn.clientX,zn.clientY])},Sn=tHe(Pt,te,G?de:je,M,B,F,ue),$n=Ne(Sn,11),Ci=$n[0],An=$n[1],lo=$n[2],Qo=$n[3],zo=$n[4],oc=$n[5],Yc=$n[6],Gr=$n[7],Ua=$n[8],vl=$n[9],ba=$n[10],_l=QVe(Qe,l,c,d),rc=Ne(_l,2),Zc=rc[0],Ca=rc[1],Yd=Zc.has("click"),bl=Ca.has("click")||Ca.has("contextMenu"),mi=tl(function(){Dn||ba()}),gi=function(){Nt.current&&G&&bl&&Ct(!1)};nHe(Pt,je,te,mi,gi),go(function(){mi()},[de,M]),go(function(){Pt&&!(B!=null&&B[M])&&mi()},[JSON.stringify(F)]);var Kt=x.exports.useMemo(function(){var rn=eHe(B,r,vl,G);return Ue(rn,K==null?void 0:K(vl))},[vl,K,B,r,G]);x.exports.useImperativeHandle(n,function(){return{nativeElement:Dt.current,forceAlign:mi}});var on=x.exports.useState(0),vi=Ne(on,2),Uo=vi[0],Qi=vi[1],Jo=x.exports.useState(0),_r=Ne(Jo,2),zs=_r[0],Tr=_r[1],ds=function(){if(z&&je){var zn=je.getBoundingClientRect();Qi(zn.width),Tr(zn.height)}},Ts=function(){ds(),mi()},er=function(zn){Xn(!1),ba(),g==null||g(zn)},l_=function(){return new Promise(function(zn){ds(),Xt(function(){return zn})})};go(function(){an&&(ba(),an(),Xt(null))},[an]);function Qc(rn,zn,tr,dr){Ot[rn]=function(nr){var a1;dr==null||dr(nr),Ct(zn,tr);for(var $S=arguments.length,RT=new Array($S>1?$S-1:0),l1=1;l1<$S;l1++)RT[l1-1]=arguments[l1];(a1=Lt[rn])===null||a1===void 0||a1.call.apply(a1,[Lt,nr].concat(RT))}}(Yd||bl)&&(Ot.onClick=function(rn){var zn;Nt.current&&bl?Ct(!1):!Nt.current&&Yd&&(ot(rn),Ct(!0));for(var tr=arguments.length,dr=new Array(tr>1?tr-1:0),nr=1;nr1?tr-1:0),nr=1;nr1&&arguments[1]!==void 0?arguments[1]:{},t=e.fieldNames,n=e.childrenAsData,o=[],r=Vme(t,!1),s=r.label,a=r.value,l=r.options,c=r.groupLabel;function d(u,h){!Array.isArray(u)||u.forEach(function(f){if(h||!(l in f)){var g=f[a];o.push({key:iie(f,o.length),groupOption:h,data:f,label:f[s],value:g})}else{var p=f[c];p===void 0&&n&&(p=f.label),o.push({key:iie(f,o.length),group:!0,data:f,label:p}),d(f[l],!0)}})}return d(i,!1),o}function AW(i){var e=Ce({},i);return"props"in e||Object.defineProperty(e,"props",{get:function(){return rr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var uHe=function(e,t,n){if(!t||!t.length)return null;var o=!1,r=function a(l,c){var d=Hge(c),u=d[0],h=d.slice(1);if(!u)return[l];var f=l.split(u);return o=o||f.length>1,f.reduce(function(g,p){return[].concat(_t(g),_t(a(p,h)))},[]).filter(Boolean)},s=r(e,t);return o?typeof n!="undefined"?s.slice(0,n):s:null},aq=x.exports.createContext(null),hHe=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],fHe=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],PW=function(e){return e==="tags"||e==="multiple"},gHe=x.exports.forwardRef(function(i,e){var t,n,o=i.id,r=i.prefixCls,s=i.className,a=i.showSearch,l=i.tagRender,c=i.direction,d=i.omitDomProps,u=i.displayValues,h=i.onDisplayValuesChange,f=i.emptyOptions,g=i.notFoundContent,p=g===void 0?"Not Found":g,v=i.onClear,m=i.mode,_=i.disabled,y=i.loading,w=i.getInputElement,L=i.getRawInputElement,D=i.open,E=i.defaultOpen,I=i.onDropdownVisibleChange,k=i.activeValue,R=i.onActiveValueChange,A=i.activeDescendantId,P=i.searchValue,N=i.autoClearSearchValue,M=i.onSearch,H=i.onSearchSplit,B=i.tokenSeparators,F=i.allowClear,$=i.suffixIcon,z=i.clearIcon,K=i.OptionList,j=i.animation,G=i.transitionName,X=i.dropdownStyle,ue=i.dropdownClassName,fe=i.dropdownMatchSelectWidth,pe=i.dropdownRender,be=i.dropdownAlign,Se=i.placement,Fe=i.builtinPlacements,De=i.getPopupContainer,ce=i.showAction,Pe=ce===void 0?[]:ce,Oe=i.onFocus,xe=i.onBlur,Ee=i.onKeyUp,tt=i.onKeyDown,nt=i.onMouseDown,Qe=Hn(i,hHe),Ge=PW(m),re=(a!==void 0?a:Ge)||m==="combobox",ie=Ce({},Qe);fHe.forEach(function(Kt){delete ie[Kt]}),d==null||d.forEach(function(Kt){delete ie[Kt]});var se=x.exports.useState(!1),U=Ne(se,2),Y=U[0],oe=U[1];x.exports.useEffect(function(){oe(sq())},[]);var te=x.exports.useRef(null),ye=x.exports.useRef(null),Le=x.exports.useRef(null),Te=x.exports.useRef(null),We=x.exports.useRef(null),je=x.exports.useRef(!1),mt=wVe(),Dt=Ne(mt,3),At=Dt[0],Je=Dt[1],Lt=Dt[2];x.exports.useImperativeHandle(e,function(){var Kt,on;return{focus:(Kt=Te.current)===null||Kt===void 0?void 0:Kt.focus,blur:(on=Te.current)===null||on===void 0?void 0:on.blur,scrollTo:function(Uo){var Qi;return(Qi=We.current)===null||Qi===void 0?void 0:Qi.scrollTo(Uo)}}});var Ot=x.exports.useMemo(function(){var Kt;if(m!=="combobox")return P;var on=(Kt=u[0])===null||Kt===void 0?void 0:Kt.value;return typeof on=="string"||typeof on=="number"?String(on):""},[P,m,u]),Vn=m==="combobox"&&typeof w=="function"&&w()||null,Et=typeof L=="function"&&L(),tn=Pb(ye,Et==null||(t=Et.props)===null||t===void 0?void 0:t.ref),di=x.exports.useState(!1),cn=Ne(di,2),Gn=cn[0],bn=cn[1];go(function(){bn(!0)},[]);var Pt=Kl(!1,{defaultValue:E,value:D}),qt=Ne(Pt,2),Nt=qt[0],jt=qt[1],Gt=Gn?Nt:!1,It=!p&&f;(_||It&&Gt&&m==="combobox")&&(Gt=!1);var Ft=It?!1:Gt,Ct=x.exports.useCallback(function(Kt){var on=Kt!==void 0?Kt:!Gt;_||(jt(on),Gt!==on&&(I==null||I(on)))},[_,Gt,jt,I]),Zt=x.exports.useMemo(function(){return(B||[]).some(function(Kt){return[` + ${e}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${e}-confirm-body`]:{marginBottom:"auto"}}}]},tVe=i=>{const{componentCls:e}=i;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},bme=i=>{const e=i.padding,t=i.fontSizeHeading5,n=i.lineHeightHeading5;return lr(i,{modalHeaderHeight:i.calc(i.calc(n).mul(t).equal()).add(i.calc(e).mul(2).equal()).equal(),modalFooterBorderColorSplit:i.colorSplit,modalFooterBorderStyle:i.lineType,modalFooterBorderWidth:i.lineWidth,modalIconHoverColor:i.colorIconHover,modalCloseIconColor:i.colorIcon,modalCloseBtnSize:i.fontHeight,modalConfirmIconSize:i.fontHeight,modalTitleHeight:i.calc(i.titleFontSize).mul(i.titleLineHeight).equal()})},Cme=i=>({footerBg:"transparent",headerBg:i.colorBgElevated,titleLineHeight:i.lineHeightHeading5,titleFontSize:i.fontSizeHeading5,contentBg:i.colorBgElevated,titleColor:i.colorTextHeading,closeBtnHoverBg:i.wireframe?"transparent":i.colorFillContent,closeBtnActiveBg:i.wireframe?"transparent":i.colorFillContentHover,contentPadding:i.wireframe?0:`${rt(i.paddingMD)} ${rt(i.paddingContentHorizontalLG)}`,headerPadding:i.wireframe?`${rt(i.padding)} ${rt(i.paddingLG)}`:0,headerBorderBottom:i.wireframe?`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`:"none",headerMarginBottom:i.wireframe?0:i.marginXS,bodyPadding:i.wireframe?i.paddingLG:0,footerPadding:i.wireframe?`${rt(i.paddingXS)} ${rt(i.padding)}`:0,footerBorderTop:i.wireframe?`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`:"none",footerBorderRadius:i.wireframe?`0 0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)}`:0,footerMarginTop:i.wireframe?0:i.marginSM,confirmBodyPadding:i.wireframe?`${rt(i.padding*2)} ${rt(i.padding*2)} ${rt(i.paddingLG)}`:0,confirmIconMarginInlineEnd:i.wireframe?i.margin:i.marginSM,confirmBtnsMarginTop:i.wireframe?i.marginLG:i.marginSM});var yme=jc("Modal",i=>{const e=bme(i);return[eVe(e),tVe(e),JWe(e),vme(e,"zoom")]},Cme,{unitless:{titleLineHeight:!0}}),nVe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{MW={x:i.pageX,y:i.pageY},setTimeout(()=>{MW=null},100)};EBe()&&document.documentElement.addEventListener("click",iVe,!0);const oVe=i=>{var e;const{getPopupContainer:t,getPrefixCls:n,direction:o,modal:r}=x.exports.useContext(Hi),s=G=>{const{onCancel:X}=i;X==null||X(G)},a=G=>{const{onOk:X}=i;X==null||X(G)},{prefixCls:l,className:c,rootClassName:d,open:u,wrapClassName:h,centered:f,getContainer:g,closeIcon:p,closable:v,focusTriggerAfterClose:m=!0,style:_,visible:y,width:w=520,footer:L,classNames:D,styles:E}=i,I=nVe(i,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","closable","focusTriggerAfterClose","style","visible","width","footer","classNames","styles"]),k=n("modal",l),R=n(),A=nh(k),[P,N,M]=yme(k,A),H=Ue(h,{[`${k}-centered`]:!!f,[`${k}-wrap-rtl`]:o==="rtl"}),B=L!==null&&x.exports.createElement(hme,Object.assign({},i,{onOk:a,onCancel:s})),[F,$]=LBe(v,p,G=>ume(k,G),x.exports.createElement(hS,{className:`${k}-close-icon`}),!0),z=CWe(`.${k}-content`),[K,j]=GK("Modal",I.zIndex);return P(x.exports.createElement(EA,null,x.exports.createElement(RW,{status:!0,override:!0},x.exports.createElement(KK.Provider,{value:j},x.exports.createElement(eme,Object.assign({width:w},I,{zIndex:K,getContainer:g===void 0?t:g,prefixCls:k,rootClassName:Ue(N,d,M,A),footer:B,visible:u!=null?u:y,mousePosition:(e=I.mousePosition)!==null&&e!==void 0?e:MW,onClose:s,closable:F,closeIcon:$,focusTriggerAfterClose:m,transitionName:q0(R,"zoom",i.transitionName),maskTransitionName:q0(R,"fade",i.maskTransitionName),className:Ue(N,c,r==null?void 0:r.className),style:Object.assign(Object.assign({},r==null?void 0:r.style),_),classNames:Object.assign(Object.assign(Object.assign({},r==null?void 0:r.classNames),D),{wrapper:Ue(H,D==null?void 0:D.wrapper)}),styles:Object.assign(Object.assign({},r==null?void 0:r.styles),E),panelRef:z}))))))};var wme=oVe;const rVe=i=>{const{componentCls:e,titleFontSize:t,titleLineHeight:n,modalConfirmIconSize:o,fontSize:r,lineHeight:s,modalTitleHeight:a,fontHeight:l,confirmBodyPadding:c}=i,d=`${e}-confirm`;return{[d]:{"&-rtl":{direction:"rtl"},[`${i.antCls}-modal-header`]:{display:"none"},[`${d}-body-wrapper`]:Object.assign({},ope()),[`&${e} ${e}-body`]:{padding:c},[`${d}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${i.iconCls}`]:{flex:"none",fontSize:o,marginInlineEnd:i.confirmIconMarginInlineEnd,marginTop:i.calc(i.calc(l).sub(o).equal()).div(2).equal()},[`&-has-title > ${i.iconCls}`]:{marginTop:i.calc(i.calc(a).sub(o).equal()).div(2).equal()}},[`${d}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:i.marginXS,maxWidth:`calc(100% - ${rt(i.calc(i.modalConfirmIconSize).add(i.marginSM).equal())})`},[`${d}-title`]:{color:i.colorTextHeading,fontWeight:i.fontWeightStrong,fontSize:t,lineHeight:n},[`${d}-content`]:{color:i.colorText,fontSize:r,lineHeight:s},[`${d}-btns`]:{textAlign:"end",marginTop:i.confirmBtnsMarginTop,[`${i.antCls}-btn + ${i.antCls}-btn`]:{marginBottom:0,marginInlineStart:i.marginXS}}},[`${d}-error ${d}-body > ${i.iconCls}`]:{color:i.colorError},[`${d}-warning ${d}-body > ${i.iconCls}, + ${d}-confirm ${d}-body > ${i.iconCls}`]:{color:i.colorWarning},[`${d}-info ${d}-body > ${i.iconCls}`]:{color:i.colorInfo},[`${d}-success ${d}-body > ${i.iconCls}`]:{color:i.colorSuccess}}};var sVe=VK(["Modal","confirm"],i=>{const e=bme(i);return[rVe(e)]},Cme,{order:-1e3}),aVe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o_,_t(Object.values(_))),w=x.exports.createElement(x.exports.Fragment,null,x.exports.createElement(_ne,null),x.exports.createElement(bne,null)),L=i.title!==void 0&&i.title!==null,D=`${r}-body`;return x.exports.createElement("div",{className:`${r}-body-wrapper`},x.exports.createElement("div",{className:Ue(D,{[`${D}-has-title`]:L})},u,x.exports.createElement("div",{className:`${r}-paragraph`},L&&x.exports.createElement("span",{className:`${r}-title`},i.title),x.exports.createElement("div",{className:`${r}-content`},i.content))),l===void 0||typeof l=="function"?x.exports.createElement(Gpe,{value:y},x.exports.createElement("div",{className:`${r}-btns`},typeof l=="function"?l(w,{OkBtn:bne,CancelBtn:_ne}):w)):l,x.exports.createElement(sVe,{prefixCls:e}))}const lVe=i=>{const{close:e,zIndex:t,afterClose:n,open:o,keyboard:r,centered:s,getContainer:a,maskStyle:l,direction:c,prefixCls:d,wrapClassName:u,rootPrefixCls:h,bodyStyle:f,closable:g=!1,closeIcon:p,modalRender:v,focusTriggerAfterClose:m,onConfirm:_,styles:y}=i,w=`${d}-confirm`,L=i.width||416,D=i.style||{},E=i.mask===void 0?!0:i.mask,I=i.maskClosable===void 0?!1:i.maskClosable,k=Ue(w,`${w}-${i.type}`,{[`${w}-rtl`]:c==="rtl"},i.className),[,R]=Ba(),A=x.exports.useMemo(()=>t!==void 0?t:R.zIndexPopupBase+qK,[t,R]);return x.exports.createElement(wme,{prefixCls:d,className:k,wrapClassName:Ue({[`${w}-centered`]:!!i.centered},u),onCancel:()=>{e==null||e({triggerCancel:!0}),_==null||_(!1)},open:o,title:"",footer:null,transitionName:q0(h||"","zoom",i.transitionName),maskTransitionName:q0(h||"","fade",i.maskTransitionName),mask:E,maskClosable:I,style:D,styles:Object.assign({body:f,mask:l},y),width:L,zIndex:A,afterClose:n,keyboard:r,centered:s,getContainer:a,closable:g,closeIcon:p,modalRender:v,focusTriggerAfterClose:m},x.exports.createElement(Sme,Object.assign({},i,{confirmPrefixCls:w})))},xme=i=>{const{rootPrefixCls:e,iconPrefixCls:t,direction:n,theme:o}=i;return x.exports.createElement(pp,{prefixCls:e,iconPrefixCls:t,direction:n,theme:o},x.exports.createElement(lVe,Object.assign({},i)))},cVe=[];var a0=cVe;let Lme="";function Eme(){return Lme}const dVe=i=>{var e,t;const{prefixCls:n,getContainer:o,direction:r}=i,s=Kge(),a=x.exports.useContext(Hi),l=Eme()||a.getPrefixCls(),c=n||`${l}-modal`;let d=o;return d===!1&&(d=void 0),he(xme,{...Object.assign({},i,{rootPrefixCls:l,prefixCls:c,iconPrefixCls:a.iconPrefixCls,theme:a.theme,direction:r!=null?r:a.direction,locale:(t=(e=a.locale)===null||e===void 0?void 0:e.Modal)!==null&&t!==void 0?t:s,getContainer:d})})};function RI(i){const e=$K(),t=document.createDocumentFragment();let n=Object.assign(Object.assign({},i),{close:a,open:!0}),o;function r(){for(var c=arguments.length,d=new Array(c),u=0;uf&&f.triggerCancel);i.onCancel&&h&&i.onCancel.apply(i,[()=>{}].concat(_t(d.slice(1))));for(let f=0;f{const d=e.getPrefixCls(void 0,Eme()),u=e.getIconPrefixCls(),h=e.getTheme(),f=he(dVe,{...Object.assign({},c)});YK(he(pp,{prefixCls:d,iconPrefixCls:u,theme:h,children:e.holderRender?e.holderRender(f):f}),t)})}function a(){for(var c=arguments.length,d=new Array(c),u=0;u{typeof i.afterClose=="function"&&i.afterClose(),r.apply(this,d)}}),n.visible&&delete n.visible,s(n)}function l(c){typeof c=="function"?n=c(n):n=Object.assign(Object.assign({},n),c),s(n)}return s(n),a0.push(a),{destroy:a,update:l}}function Dme(i){return Object.assign(Object.assign({},i),{type:"warning"})}function kme(i){return Object.assign(Object.assign({},i),{type:"info"})}function Ime(i){return Object.assign(Object.assign({},i),{type:"success"})}function Tme(i){return Object.assign(Object.assign({},i),{type:"error"})}function Nme(i){return Object.assign(Object.assign({},i),{type:"confirm"})}function uVe(i){let{rootPrefixCls:e}=i;Lme=e}var hVe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,{afterClose:n,config:o}=i,r=hVe(i,["afterClose","config"]);const[s,a]=x.exports.useState(!0),[l,c]=x.exports.useState(o),{direction:d,getPrefixCls:u}=x.exports.useContext(Hi),h=u("modal"),f=u(),g=()=>{var _;n(),(_=l.afterClose)===null||_===void 0||_.call(l)},p=function(){a(!1);for(var _=arguments.length,y=new Array(_),w=0;w<_;w++)y[w]=arguments[w];const L=y.some(D=>D&&D.triggerCancel);l.onCancel&&L&&l.onCancel.apply(l,[()=>{}].concat(_t(y.slice(1))))};x.exports.useImperativeHandle(e,()=>({destroy:p,update:_=>{c(y=>Object.assign(Object.assign({},y),_))}}));const v=(t=l.okCancel)!==null&&t!==void 0?t:l.type==="confirm",[m]=EI("Modal",vv.Modal);return x.exports.createElement(xme,Object.assign({prefixCls:h,rootPrefixCls:f},l,{close:p,open:s,afterClose:g,okText:l.okText||(v?m==null?void 0:m.okText:m==null?void 0:m.justOkText),direction:l.direction||d,cancelText:l.cancelText||(m==null?void 0:m.cancelText)},r))};var gVe=x.exports.forwardRef(fVe);let Gne=0;const pVe=x.exports.memo(x.exports.forwardRef((i,e)=>{const[t,n]=a7e();return x.exports.useImperativeHandle(e,()=>({patchElement:n}),[]),x.exports.createElement(x.exports.Fragment,null,t)}));function mVe(){const i=x.exports.useRef(null),[e,t]=x.exports.useState([]);x.exports.useEffect(()=>{e.length&&(_t(e).forEach(s=>{s()}),t([]))},[e]);const n=x.exports.useCallback(r=>function(a){var l;Gne+=1;const c=x.exports.createRef();let d;const u=new Promise(v=>{d=v});let h=!1,f;const g=x.exports.createElement(gVe,{key:`modal-${Gne}`,config:r(a),ref:c,afterClose:()=>{f==null||f()},isSilent:()=>h,onConfirm:v=>{d(v)}});return f=(l=i.current)===null||l===void 0?void 0:l.patchElement(g),f&&a0.push(f),{destroy:()=>{function v(){var m;(m=c.current)===null||m===void 0||m.destroy()}c.current?v():t(m=>[].concat(_t(m),[v]))},update:v=>{function m(){var _;(_=c.current)===null||_===void 0||_.update(v)}c.current?m():t(_=>[].concat(_t(_),[m]))},then:v=>(h=!0,u.then(v))}},[]);return[x.exports.useMemo(()=>({info:n(kme),success:n(Ime),error:n(Tme),warning:n(Dme),confirm:n(Nme)}),[]),x.exports.createElement(pVe,{key:"modal-holder",ref:i})]}const vVe=Bt.createContext({});function Rme(i){return e=>x.exports.createElement(pp,{theme:{token:{motion:!1,zIndexPopupBase:0}}},x.exports.createElement(i,Object.assign({},e)))}const _Ve=(i,e,t,n)=>Rme(r=>{const{prefixCls:s,style:a}=r,l=x.exports.useRef(null),[c,d]=x.exports.useState(0),[u,h]=x.exports.useState(0),[f,g]=Kl(!1,{value:r.open}),{getPrefixCls:p}=x.exports.useContext(Hi),v=p(e||"select",s);x.exports.useEffect(()=>{if(g(!0),typeof ResizeObserver!="undefined"){const y=new ResizeObserver(L=>{const D=L[0].target;d(D.offsetHeight+8),h(D.offsetWidth)}),w=setInterval(()=>{var L;const D=t?`.${t(v)}`:`.${v}-dropdown`,E=(L=l.current)===null||L===void 0?void 0:L.querySelector(D);E&&(clearInterval(w),y.observe(E))},10);return()=>{clearInterval(w),y.disconnect()}}},[]);let m=Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},a),{margin:0}),open:f,visible:f,getPopupContainer:()=>l.current});n&&(m=n(m));const _={paddingBottom:c,position:"relative",minWidth:u};return x.exports.createElement("div",{ref:l,style:_},x.exports.createElement(i,Object.assign({},m)))});var bVe=_Ve,aq=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var i=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(i==null?void 0:i.substr(0,4))},M4=function(e){var t=e.className,n=e.customizeIcon,o=e.customizeIconProps,r=e.children,s=e.onMouseDown,a=e.onClick,l=typeof n=="function"?n(o):n;return x.exports.createElement("span",{className:t,onMouseDown:function(d){d.preventDefault(),s==null||s(d)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},l!==void 0?l:x.exports.createElement("span",{className:Ue(t.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},r))},CVe=function(e,t,n,o,r){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,a=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,c=Bt.useMemo(function(){if(qn(o)==="object")return o.clearIcon;if(r)return r},[o,r]),d=Bt.useMemo(function(){return!!(!s&&!!o&&(n.length||a)&&!(l==="combobox"&&a===""))},[o,s,n.length,a,l]);return{allowClear:d,clearIcon:Bt.createElement(M4,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:c},"\xD7")}},Mme=x.exports.createContext(null);function yVe(){return x.exports.useContext(Mme)}function wVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=x.exports.useState(!1),t=Ne(e,2),n=t[0],o=t[1],r=x.exports.useRef(null),s=function(){window.clearTimeout(r.current)};x.exports.useEffect(function(){return s},[]);var a=function(c,d){s(),r.current=window.setTimeout(function(){o(c),d&&d()},i)};return[n,a,s]}function Ame(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=x.exports.useRef(null),t=x.exports.useRef(null);x.exports.useEffect(function(){return function(){window.clearTimeout(t.current)}},[]);function n(o){(o||e.current===null)&&(e.current=o),window.clearTimeout(t.current),t.current=window.setTimeout(function(){e.current=null},i)}return[function(){return e.current},n]}function SVe(i,e,t,n){var o=x.exports.useRef(null);o.current={open:e,triggerOpen:t,customizedTrigger:n},x.exports.useEffect(function(){function r(s){var a;if(!((a=o.current)!==null&&a!==void 0&&a.customizedTrigger)){var l=s.target;l.shadowRoot&&s.composed&&(l=s.composedPath()[0]||l),o.current.open&&i().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&o.current.triggerOpen(!1)}}return window.addEventListener("mousedown",r),function(){return window.removeEventListener("mousedown",r)}},[])}var xVe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],T1=void 0;function LVe(i,e){var t=i.prefixCls,n=i.invalidate,o=i.item,r=i.renderItem,s=i.responsive,a=i.responsiveDisabled,l=i.registerSize,c=i.itemKey,d=i.className,u=i.style,h=i.children,f=i.display,g=i.order,p=i.component,v=p===void 0?"div":p,m=Hn(i,xVe),_=s&&!f;function y(I){l(c,I)}x.exports.useEffect(function(){return function(){y(null)}},[]);var w=r&&o!==T1?r(o):h,L;n||(L={opacity:_?0:1,height:_?0:T1,overflowY:_?"hidden":T1,order:s?g:T1,pointerEvents:_?"none":T1,position:_?"absolute":T1});var D={};_&&(D["aria-hidden"]=!0);var E=x.exports.createElement(v,yt({className:Ue(!n&&t,d),style:Ce(Ce({},L),u)},D,m,{ref:e}),w);return s&&(E=x.exports.createElement(Mu,{onResize:function(k){var R=k.offsetWidth;y(R)},disabled:a},E)),E}var sE=x.exports.forwardRef(LVe);sE.displayName="Item";function EVe(i){if(typeof MessageChannel=="undefined")Xi(i);else{var e=new MessageChannel;e.port1.onmessage=function(){return i()},e.port2.postMessage(void 0)}}function DVe(){var i=x.exports.useRef(null),e=function(n){i.current||(i.current=[],EVe(function(){zu.exports.unstable_batchedUpdates(function(){i.current.forEach(function(o){o()}),i.current=null})})),i.current.push(n)};return e}function Lx(i,e){var t=x.exports.useState(e),n=Ne(t,2),o=n[0],r=n[1],s=tl(function(a){i(function(){r(a)})});return[o,s]}var IA=Bt.createContext(null),kVe=["component"],IVe=["className"],TVe=["className"],NVe=function(e,t){var n=x.exports.useContext(IA);if(!n){var o=e.component,r=o===void 0?"div":o,s=Hn(e,kVe);return x.exports.createElement(r,yt({},s,{ref:t}))}var a=n.className,l=Hn(n,IVe),c=e.className,d=Hn(e,TVe);return x.exports.createElement(IA.Provider,{value:null},x.exports.createElement(sE,yt({ref:t,className:Ue(a,c)},l,d)))},Pme=x.exports.forwardRef(NVe);Pme.displayName="RawItem";var RVe=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Ome="responsive",Fme="invalidate";function MVe(i){return"+ ".concat(i.length," ...")}function AVe(i,e){var t=i.prefixCls,n=t===void 0?"rc-overflow":t,o=i.data,r=o===void 0?[]:o,s=i.renderItem,a=i.renderRawItem,l=i.itemKey,c=i.itemWidth,d=c===void 0?10:c,u=i.ssr,h=i.style,f=i.className,g=i.maxCount,p=i.renderRest,v=i.renderRawRest,m=i.suffix,_=i.component,y=_===void 0?"div":_,w=i.itemComponent,L=i.onVisibleChange,D=Hn(i,RVe),E=u==="full",I=DVe(),k=Lx(I,null),R=Ne(k,2),A=R[0],P=R[1],N=A||0,M=Lx(I,new Map),H=Ne(M,2),B=H[0],F=H[1],$=Lx(I,0),z=Ne($,2),K=z[0],j=z[1],G=Lx(I,0),X=Ne(G,2),ue=X[0],fe=X[1],pe=Lx(I,0),be=Ne(pe,2),Se=be[0],Fe=be[1],De=x.exports.useState(null),ce=Ne(De,2),Pe=ce[0],Oe=ce[1],xe=x.exports.useState(null),Ee=Ne(xe,2),tt=Ee[0],nt=Ee[1],Qe=x.exports.useMemo(function(){return tt===null&&E?Number.MAX_SAFE_INTEGER:tt||0},[tt,A]),Ge=x.exports.useState(!1),re=Ne(Ge,2),ie=re[0],se=re[1],U="".concat(n,"-item"),Y=Math.max(K,ue),oe=g===Ome,te=r.length&&oe,ye=g===Fme,Le=te||typeof g=="number"&&r.length>g,Te=x.exports.useMemo(function(){var Nt=r;return te?A===null&&E?Nt=r:Nt=r.slice(0,Math.min(r.length,N/d)):typeof g=="number"&&(Nt=r.slice(0,g)),Nt},[r,d,A,g,te]),We=x.exports.useMemo(function(){return te?r.slice(Qe+1):r.slice(Te.length)},[r,Te,te,Qe]),je=x.exports.useCallback(function(Nt,jt){var Gt;return typeof l=="function"?l(Nt):(Gt=l&&(Nt==null?void 0:Nt[l]))!==null&&Gt!==void 0?Gt:jt},[l]),mt=x.exports.useCallback(s||function(Nt){return Nt},[s]);function Dt(Nt,jt,Gt){tt===Nt&&(jt===void 0||jt===Pe)||(nt(Nt),Gt||(se(NtN){Dt(It-1,Nt-Ft-Se+ue);break}}m&&Vn(0)+Se>N&&Oe(null)}},[N,B,ue,Se,je,Te]);var Et=ie&&!!We.length,tn={};Pe!==null&&te&&(tn={position:"absolute",left:Pe,top:0});var di={prefixCls:U,responsive:te,component:w,invalidate:ye},cn=a?function(Nt,jt){var Gt=je(Nt,jt);return x.exports.createElement(IA.Provider,{key:Gt,value:Ce(Ce({},di),{},{order:jt,item:Nt,itemKey:Gt,registerSize:Je,display:jt<=Qe})},a(Nt,jt))}:function(Nt,jt){var Gt=je(Nt,jt);return x.exports.createElement(sE,yt({},di,{order:jt,key:Gt,item:Nt,renderItem:mt,itemKey:Gt,registerSize:Je,display:jt<=Qe}))},Gn,bn={order:Et?Qe:Number.MAX_SAFE_INTEGER,className:"".concat(U,"-rest"),registerSize:Lt,display:Et};if(v)v&&(Gn=x.exports.createElement(IA.Provider,{value:Ce(Ce({},di),bn)},v(We)));else{var Pt=p||MVe;Gn=x.exports.createElement(sE,yt({},di,bn),typeof Pt=="function"?Pt(We):Pt)}var qt=x.exports.createElement(y,yt({className:Ue(!ye&&n,f),style:h,ref:e},D),Te.map(cn),Le?Gn:null,m&&x.exports.createElement(sE,yt({},di,{responsive:oe,responsiveDisabled:!te,order:Qe,className:"".concat(U,"-suffix"),registerSize:Ot,display:!0,style:tn}),m));return oe&&(qt=x.exports.createElement(Mu,{onResize:At,disabled:!te},qt)),qt}var sf=x.exports.forwardRef(AVe);sf.displayName="Overflow";sf.Item=Pme;sf.RESPONSIVE=Ome;sf.INVALIDATE=Fme;var PVe=function(e,t){var n,o=e.prefixCls,r=e.id,s=e.inputElement,a=e.disabled,l=e.tabIndex,c=e.autoFocus,d=e.autoComplete,u=e.editable,h=e.activeDescendantId,f=e.value,g=e.maxLength,p=e.onKeyDown,v=e.onMouseDown,m=e.onChange,_=e.onPaste,y=e.onCompositionStart,w=e.onCompositionEnd,L=e.open,D=e.attrs,E=s||x.exports.createElement("input",null),I=E,k=I.ref,R=I.props,A=R.onKeyDown,P=R.onChange,N=R.onMouseDown,M=R.onCompositionStart,H=R.onCompositionEnd,B=R.style;return"maxLength"in E.props,E=x.exports.cloneElement(E,Ce(Ce(Ce({type:"search"},R),{},{id:r,ref:eh(t,k),disabled:a,tabIndex:l,autoComplete:d||"off",autoFocus:c,className:Ue("".concat(o,"-selection-search-input"),(n=E)===null||n===void 0||(n=n.props)===null||n===void 0?void 0:n.className),role:"combobox","aria-expanded":L||!1,"aria-haspopup":"listbox","aria-owns":"".concat(r,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(r,"_list"),"aria-activedescendant":L?h:void 0},D),{},{value:u?f:"",maxLength:g,readOnly:!u,unselectable:u?null:"on",style:Ce(Ce({},B),{},{opacity:u?null:0}),onKeyDown:function($){p($),A&&A($)},onMouseDown:function($){v($),N&&N($)},onChange:function($){m($),P&&P($)},onCompositionStart:function($){y($),M&&M($)},onCompositionEnd:function($){w($),H&&H($)},onPaste:_})),E},Bme=x.exports.forwardRef(PVe);function Wme(i){return Array.isArray(i)?i:i!==void 0?[i]:[]}var OVe=typeof window!="undefined"&&window.document&&window.document.documentElement,FVe=OVe;function BVe(i){return i!=null}function WVe(i){return!i&&i!==0}function Xne(i){return["string","number"].includes(qn(i))}function Vme(i){var e=void 0;return i&&(Xne(i.title)?e=i.title.toString():Xne(i.label)&&(e=i.label.toString())),e}function VVe(i,e){FVe?x.exports.useLayoutEffect(i,e):x.exports.useEffect(i,e)}function HVe(i){var e;return(e=i.key)!==null&&e!==void 0?e:i.value}var Yne=function(e){e.preventDefault(),e.stopPropagation()},$Ve=function(e){var t=e.id,n=e.prefixCls,o=e.values,r=e.open,s=e.searchValue,a=e.autoClearSearchValue,l=e.inputRef,c=e.placeholder,d=e.disabled,u=e.mode,h=e.showSearch,f=e.autoFocus,g=e.autoComplete,p=e.activeDescendantId,v=e.tabIndex,m=e.removeIcon,_=e.maxTagCount,y=e.maxTagTextLength,w=e.maxTagPlaceholder,L=w===void 0?function(Oe){return"+ ".concat(Oe.length," ...")}:w,D=e.tagRender,E=e.onToggleOpen,I=e.onRemove,k=e.onInputChange,R=e.onInputPaste,A=e.onInputKeyDown,P=e.onInputMouseDown,N=e.onInputCompositionStart,M=e.onInputCompositionEnd,H=x.exports.useRef(null),B=x.exports.useState(0),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState(!1),j=Ne(K,2),G=j[0],X=j[1],ue="".concat(n,"-selection"),fe=r||u==="multiple"&&a===!1||u==="tags"?s:"",pe=u==="tags"||u==="multiple"&&a===!1||h&&(r||G);VVe(function(){z(H.current.scrollWidth)},[fe]);var be=function(xe,Ee,tt,nt,Qe){return x.exports.createElement("span",{title:Vme(xe),className:Ue("".concat(ue,"-item"),me({},"".concat(ue,"-item-disabled"),tt))},x.exports.createElement("span",{className:"".concat(ue,"-item-content")},Ee),nt&&x.exports.createElement(M4,{className:"".concat(ue,"-item-remove"),onMouseDown:Yne,onClick:Qe,customizeIcon:m},"\xD7"))},Se=function(xe,Ee,tt,nt,Qe){var Ge=function(ie){Yne(ie),E(!r)};return x.exports.createElement("span",{onMouseDown:Ge},D({label:Ee,value:xe,disabled:tt,closable:nt,onClose:Qe}))},Fe=function(xe){var Ee=xe.disabled,tt=xe.label,nt=xe.value,Qe=!d&&!Ee,Ge=tt;if(typeof y=="number"&&(typeof tt=="string"||typeof tt=="number")){var re=String(Ge);re.length>y&&(Ge="".concat(re.slice(0,y),"..."))}var ie=function(U){U&&U.stopPropagation(),I(xe)};return typeof D=="function"?Se(nt,Ge,Ee,Qe,ie):be(xe,Ge,Ee,Qe,ie)},De=function(xe){var Ee=typeof L=="function"?L(xe):L;return be({title:Ee},Ee,!1)},ce=x.exports.createElement("div",{className:"".concat(ue,"-search"),style:{width:$},onFocus:function(){X(!0)},onBlur:function(){X(!1)}},x.exports.createElement(Bme,{ref:l,open:r,prefixCls:n,id:t,inputElement:null,disabled:d,autoFocus:f,autoComplete:g,editable:pe,activeDescendantId:p,value:fe,onKeyDown:A,onMouseDown:P,onChange:k,onPaste:R,onCompositionStart:N,onCompositionEnd:M,tabIndex:v,attrs:K0(e,!0)}),x.exports.createElement("span",{ref:H,className:"".concat(ue,"-search-mirror"),"aria-hidden":!0},fe,"\xA0")),Pe=x.exports.createElement(sf,{prefixCls:"".concat(ue,"-overflow"),data:o,renderItem:Fe,renderRest:De,suffix:ce,itemKey:HVe,maxCount:_});return x.exports.createElement(x.exports.Fragment,null,Pe,!o.length&&!fe&&x.exports.createElement("span",{className:"".concat(ue,"-placeholder")},c))},zVe=function(e){var t=e.inputElement,n=e.prefixCls,o=e.id,r=e.inputRef,s=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,d=e.mode,u=e.open,h=e.values,f=e.placeholder,g=e.tabIndex,p=e.showSearch,v=e.searchValue,m=e.activeValue,_=e.maxLength,y=e.onInputKeyDown,w=e.onInputMouseDown,L=e.onInputChange,D=e.onInputPaste,E=e.onInputCompositionStart,I=e.onInputCompositionEnd,k=e.title,R=x.exports.useState(!1),A=Ne(R,2),P=A[0],N=A[1],M=d==="combobox",H=M||p,B=h[0],F=v||"";M&&m&&!P&&(F=m),x.exports.useEffect(function(){M&&N(!1)},[M,m]);var $=d!=="combobox"&&!u&&!p?!1:!!F,z=k===void 0?Vme(B):k,K=x.exports.useMemo(function(){return B?null:x.exports.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:$?{visibility:"hidden"}:void 0},f)},[B,$,f,n]);return x.exports.createElement(x.exports.Fragment,null,x.exports.createElement("span",{className:"".concat(n,"-selection-search")},x.exports.createElement(Bme,{ref:r,prefixCls:n,id:o,open:u,inputElement:t,disabled:s,autoFocus:a,autoComplete:l,editable:H,activeDescendantId:c,value:F,onKeyDown:y,onMouseDown:w,onChange:function(G){N(!0),L(G)},onPaste:D,onCompositionStart:E,onCompositionEnd:I,tabIndex:g,attrs:K0(e,!0),maxLength:M?_:void 0})),!M&&B?x.exports.createElement("span",{className:"".concat(n,"-selection-item"),title:z,style:$?{visibility:"hidden"}:void 0},B.label):null,K)};function UVe(i){return![at.ESC,at.SHIFT,at.BACKSPACE,at.TAB,at.WIN_KEY,at.ALT,at.META,at.WIN_KEY_RIGHT,at.CTRL,at.SEMICOLON,at.EQUALS,at.CAPS_LOCK,at.CONTEXT_MENU,at.F1,at.F2,at.F3,at.F4,at.F5,at.F6,at.F7,at.F8,at.F9,at.F10,at.F11,at.F12].includes(i)}var jVe=function(e,t){var n=x.exports.useRef(null),o=x.exports.useRef(!1),r=e.prefixCls,s=e.open,a=e.mode,l=e.showSearch,c=e.tokenWithEnter,d=e.autoClearSearchValue,u=e.onSearch,h=e.onSearchSubmit,f=e.onToggleOpen,g=e.onInputKeyDown,p=e.domRef;x.exports.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var v=Ame(0),m=Ne(v,2),_=m[0],y=m[1],w=function(F){var $=F.which;($===at.UP||$===at.DOWN)&&F.preventDefault(),g&&g(F),$===at.ENTER&&a==="tags"&&!o.current&&!s&&(h==null||h(F.target.value)),UVe($)&&f(!0)},L=function(){y(!0)},D=x.exports.useRef(null),E=function(F){u(F,!0,o.current)!==!1&&f(!0)},I=function(){o.current=!0},k=function(F){o.current=!1,a!=="combobox"&&E(F.target.value)},R=function(F){var $=F.target.value;if(c&&D.current&&/[\r\n]/.test(D.current)){var z=D.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");$=$.replace(z,D.current)}D.current=null,E($)},A=function(F){var $=F.clipboardData,z=$==null?void 0:$.getData("text");D.current=z||""},P=function(F){var $=F.target;if($!==n.current){var z=document.body.style.msTouchAction!==void 0;z?setTimeout(function(){n.current.focus()}):n.current.focus()}},N=function(F){var $=_();F.target!==n.current&&!$&&a!=="combobox"&&F.preventDefault(),(a!=="combobox"&&(!l||!$)||!s)&&(s&&d!==!1&&u("",!0,!1),f())},M={inputRef:n,onInputKeyDown:w,onInputMouseDown:L,onInputChange:R,onInputPaste:A,onInputCompositionStart:I,onInputCompositionEnd:k},H=a==="multiple"||a==="tags"?x.exports.createElement($Ve,yt({},e,M)):x.exports.createElement(zVe,yt({},e,M));return x.exports.createElement("div",{ref:p,className:"".concat(r,"-selector"),onClick:P,onMouseDown:N},H)},KVe=x.exports.forwardRef(jVe);function qVe(i){var e=i.prefixCls,t=i.align,n=i.arrow,o=i.arrowPos,r=n||{},s=r.className,a=r.content,l=o.x,c=l===void 0?0:l,d=o.y,u=d===void 0?0:d,h=x.exports.useRef();if(!t||!t.points)return null;var f={position:"absolute"};if(t.autoArrow!==!1){var g=t.points[0],p=t.points[1],v=g[0],m=g[1],_=p[0],y=p[1];v===_||!["t","b"].includes(v)?f.top=u:v==="t"?f.top=0:f.bottom=0,m===y||!["l","r"].includes(m)?f.left=c:m==="l"?f.left=0:f.right=0}return x.exports.createElement("div",{ref:h,className:Ue("".concat(e,"-arrow"),s),style:f},a)}function GVe(i){var e=i.prefixCls,t=i.open,n=i.zIndex,o=i.mask,r=i.motion;return o?x.exports.createElement(th,yt({},r,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return x.exports.createElement("div",{style:{zIndex:n},className:Ue("".concat(e,"-mask"),a)})}):null}var XVe=x.exports.memo(function(i){var e=i.children;return e},function(i,e){return e.cache}),YVe=x.exports.forwardRef(function(i,e){var t=i.popup,n=i.className,o=i.prefixCls,r=i.style,s=i.target,a=i.onVisibleChanged,l=i.open,c=i.keepDom,d=i.fresh,u=i.onClick,h=i.mask,f=i.arrow,g=i.arrowPos,p=i.align,v=i.motion,m=i.maskMotion,_=i.forceRender,y=i.getPopupContainer,w=i.autoDestroy,L=i.portal,D=i.zIndex,E=i.onMouseEnter,I=i.onMouseLeave,k=i.onPointerEnter,R=i.ready,A=i.offsetX,P=i.offsetY,N=i.offsetR,M=i.offsetB,H=i.onAlign,B=i.onPrepare,F=i.stretch,$=i.targetWidth,z=i.targetHeight,K=typeof t=="function"?t():t,j=l||c,G=(y==null?void 0:y.length)>0,X=x.exports.useState(!y||!G),ue=Ne(X,2),fe=ue[0],pe=ue[1];if(go(function(){!fe&&G&&s&&pe(!0)},[fe,G,s]),!fe)return null;var be="auto",Se={left:"-1000vw",top:"-1000vh",right:be,bottom:be};if(R||!l){var Fe,De=p.points,ce=p.dynamicInset||((Fe=p._experimental)===null||Fe===void 0?void 0:Fe.dynamicInset),Pe=ce&&De[0][1]==="r",Oe=ce&&De[0][0]==="b";Pe?(Se.right=N,Se.left=be):(Se.left=A,Se.right=be),Oe?(Se.bottom=M,Se.top=be):(Se.top=P,Se.bottom=be)}var xe={};return F&&(F.includes("height")&&z?xe.height=z:F.includes("minHeight")&&z&&(xe.minHeight=z),F.includes("width")&&$?xe.width=$:F.includes("minWidth")&&$&&(xe.minWidth=$)),l||(xe.pointerEvents="none"),x.exports.createElement(L,{open:_||j,getContainer:y&&function(){return y(s)},autoDestroy:w},x.exports.createElement(GVe,{prefixCls:o,open:l,zIndex:D,mask:h,motion:m}),x.exports.createElement(Mu,{onResize:H,disabled:!l},function(Ee){return x.exports.createElement(th,yt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:_,leavedClassName:"".concat(o,"-hidden")},v,{onAppearPrepare:B,onEnterPrepare:B,visible:l,onVisibleChanged:function(nt){var Qe;v==null||(Qe=v.onVisibleChanged)===null||Qe===void 0||Qe.call(v,nt),a(nt)}}),function(tt,nt){var Qe=tt.className,Ge=tt.style,re=Ue(o,Qe,n);return x.exports.createElement("div",{ref:eh(Ee,e,nt),className:re,style:Ce(Ce(Ce(Ce({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},Se),xe),Ge),{},{boxSizing:"border-box",zIndex:D},r),onMouseEnter:E,onMouseLeave:I,onPointerEnter:k,onClick:u},f&&x.exports.createElement(qVe,{prefixCls:o,arrow:f,arrowPos:g,align:p}),x.exports.createElement(XVe,{cache:!l&&!d},K))})}))}),ZVe=x.exports.forwardRef(function(i,e){var t=i.children,n=i.getTriggerDOMNode,o=Gv(t),r=x.exports.useCallback(function(a){LK(e,n?n(a):a)},[n]),s=Pb(r,t.ref);return o?x.exports.cloneElement(t,{ref:s}):t}),Zne=x.exports.createContext(null);function Qne(i){return i?Array.isArray(i)?i:[i]:[]}function QVe(i,e,t,n){return x.exports.useMemo(function(){var o=Qne(t!=null?t:e),r=Qne(n!=null?n:e),s=new Set(o),a=new Set(r);return i&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[i,e,t,n])}function JVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0;return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function eHe(i,e,t,n){for(var o=t.points,r=Object.keys(i),s=0;s1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(i)?e:i}function Ex(i){return bD(parseFloat(i),0)}function eie(i,e){var t=Ce({},i);return(e||[]).forEach(function(n){if(!(n instanceof HTMLBodyElement||n instanceof HTMLHtmlElement)){var o=MI(n).getComputedStyle(n),r=o.overflow,s=o.overflowClipMargin,a=o.borderTopWidth,l=o.borderBottomWidth,c=o.borderLeftWidth,d=o.borderRightWidth,u=n.getBoundingClientRect(),h=n.offsetHeight,f=n.clientHeight,g=n.offsetWidth,p=n.clientWidth,v=Ex(a),m=Ex(l),_=Ex(c),y=Ex(d),w=bD(Math.round(u.width/g*1e3)/1e3),L=bD(Math.round(u.height/h*1e3)/1e3),D=(g-p-_-y)*w,E=(h-f-v-m)*L,I=v*L,k=m*L,R=_*w,A=y*w,P=0,N=0;if(r==="clip"){var M=Ex(s);P=M*w,N=M*L}var H=u.x+R-P,B=u.y+I-N,F=H+u.width+2*P-R-A-D,$=B+u.height+2*N-I-k-E;t.left=Math.max(t.left,H),t.top=Math.max(t.top,B),t.right=Math.min(t.right,F),t.bottom=Math.min(t.bottom,$)}}),t}function tie(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t="".concat(e),n=t.match(/^(.*)\%$/);return n?i*(parseFloat(n[1])/100):parseFloat(t)}function nie(i,e){var t=e||[],n=Ne(t,2),o=n[0],r=n[1];return[tie(i.width,o),tie(i.height,r)]}function iie(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[i[0],i[1]]}function N1(i,e){var t=e[0],n=e[1],o,r;return t==="t"?r=i.y:t==="b"?r=i.y+i.height:r=i.y+i.height/2,n==="l"?o=i.x:n==="r"?o=i.x+i.width:o=i.x+i.width/2,{x:o,y:r}}function Fp(i,e){var t={t:"b",b:"t",l:"r",r:"l"};return i.map(function(n,o){return o===e?t[n]||"c":n}).join("")}function tHe(i,e,t,n,o,r,s){var a=x.exports.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:o[n]||{}}),l=Ne(a,2),c=l[0],d=l[1],u=x.exports.useRef(0),h=x.exports.useMemo(function(){return e?AW(e):[]},[e]),f=x.exports.useRef({}),g=function(){f.current={}};i||g();var p=tl(function(){if(e&&t&&i){let er=function(Qc,Mf){var Af=arguments.length>2&&arguments[2]!==void 0?arguments[2]:re,Pf=K.x+Qc,Lp=K.y+Mf,Ep=Pf+Fe,r1=Lp+Se,WS=Math.max(Pf,Af.left),VS=Math.max(Lp,Af.top),s1=Math.min(Ep,Af.right),HS=Math.min(r1,Af.bottom);return Math.max(0,(s1-WS)*(HS-VS))},l_=function(){Zi=K.y+Pt,an=Zi+Se,Xt=K.x+bn,oi=Xt+Fe};var _,y,w=e,L=w.ownerDocument,D=MI(w),E=D.getComputedStyle(w),I=E.width,k=E.height,R=E.position,A=w.style.left,P=w.style.top,N=w.style.right,M=w.style.bottom,H=w.style.overflow,B=Ce(Ce({},o[n]),r),F=L.createElement("div");(_=w.parentElement)===null||_===void 0||_.appendChild(F),F.style.left="".concat(w.offsetLeft,"px"),F.style.top="".concat(w.offsetTop,"px"),F.style.position=R,F.style.height="".concat(w.offsetHeight,"px"),F.style.width="".concat(w.offsetWidth,"px"),w.style.left="0",w.style.top="0",w.style.right="auto",w.style.bottom="auto",w.style.overflow="hidden";var $;if(Array.isArray(t))$={x:t[0],y:t[1],width:0,height:0};else{var z=t.getBoundingClientRect();$={x:z.x,y:z.y,width:z.width,height:z.height}}var K=w.getBoundingClientRect(),j=L.documentElement,G=j.clientWidth,X=j.clientHeight,ue=j.scrollWidth,fe=j.scrollHeight,pe=j.scrollTop,be=j.scrollLeft,Se=K.height,Fe=K.width,De=$.height,ce=$.width,Pe={left:0,top:0,right:G,bottom:X},Oe={left:-be,top:-pe,right:ue-be,bottom:fe-pe},xe=B.htmlRegion,Ee="visible",tt="visibleFirst";xe!=="scroll"&&xe!==tt&&(xe=Ee);var nt=xe===tt,Qe=eie(Oe,h),Ge=eie(Pe,h),re=xe===Ee?Ge:Qe,ie=nt?Ge:re;w.style.left="auto",w.style.top="auto",w.style.right="0",w.style.bottom="0";var se=w.getBoundingClientRect();w.style.left=A,w.style.top=P,w.style.right=N,w.style.bottom=M,w.style.overflow=H,(y=w.parentElement)===null||y===void 0||y.removeChild(F);var U=bD(Math.round(Fe/parseFloat(I)*1e3)/1e3),Y=bD(Math.round(Se/parseFloat(k)*1e3)/1e3);if(U===0||Y===0||_A(t)&&!T4(t))return;var oe=B.offset,te=B.targetOffset,ye=nie(K,oe),Le=Ne(ye,2),Te=Le[0],We=Le[1],je=nie($,te),mt=Ne(je,2),Dt=mt[0],At=mt[1];$.x-=Dt,$.y-=At;var Je=B.points||[],Lt=Ne(Je,2),Ot=Lt[0],Vn=Lt[1],Et=iie(Vn),tn=iie(Ot),di=N1($,Et),cn=N1(K,tn),Gn=Ce({},B),bn=di.x-cn.x+Te,Pt=di.y-cn.y+We,qt=er(bn,Pt),Nt=er(bn,Pt,Ge),jt=N1($,["t","l"]),Gt=N1(K,["t","l"]),It=N1($,["b","r"]),Ft=N1(K,["b","r"]),Ct=B.overflow||{},Zt=Ct.adjustX,wn=Ct.adjustY,Dn=Ct.shiftX,Xn=Ct.shiftY,jn=function(Mf){return typeof Mf=="boolean"?Mf:Mf>=0},Zi,an,Xt,oi;l_();var Ze=jn(wn),de=tn[0]===Et[0];if(Ze&&tn[0]==="t"&&(an>ie.bottom||f.current.bt)){var Ve=Pt;de?Ve-=Se-De:Ve=jt.y-Ft.y-We;var ot=er(bn,Ve),Sn=er(bn,Ve,Ge);ot>qt||ot===qt&&(!nt||Sn>=Nt)?(f.current.bt=!0,Pt=Ve,We=-We,Gn.points=[Fp(tn,0),Fp(Et,0)]):f.current.bt=!1}if(Ze&&tn[0]==="b"&&(Ziqt||Ci===qt&&(!nt||An>=Nt)?(f.current.tb=!0,Pt=$n,We=-We,Gn.points=[Fp(tn,0),Fp(Et,0)]):f.current.tb=!1}var lo=jn(Zt),Qo=tn[1]===Et[1];if(lo&&tn[1]==="l"&&(oi>ie.right||f.current.rl)){var zo=bn;Qo?zo-=Fe-ce:zo=jt.x-Ft.x-Te;var oc=er(zo,Pt),Yc=er(zo,Pt,Ge);oc>qt||oc===qt&&(!nt||Yc>=Nt)?(f.current.rl=!0,bn=zo,Te=-Te,Gn.points=[Fp(tn,1),Fp(Et,1)]):f.current.rl=!1}if(lo&&tn[1]==="r"&&(Xtqt||Ua===qt&&(!nt||vl>=Nt)?(f.current.lr=!0,bn=Gr,Te=-Te,Gn.points=[Fp(tn,1),Fp(Et,1)]):f.current.lr=!1}l_();var ba=Dn===!0?0:Dn;typeof ba=="number"&&(XtGe.right&&(bn-=oi-Ge.right-Te,$.x>Ge.right-ba&&(bn+=$.x-Ge.right+ba)));var _l=Xn===!0?0:Xn;typeof _l=="number"&&(ZiGe.bottom&&(Pt-=an-Ge.bottom-We,$.y>Ge.bottom-_l&&(Pt+=$.y-Ge.bottom+_l)));var rc=K.x+bn,Zc=rc+Fe,Ca=K.y+Pt,Yd=Ca+Se,bl=$.x,mi=bl+ce,gi=$.y,Kt=gi+De,on=Math.max(rc,bl),vi=Math.min(Zc,mi),Uo=(on+vi)/2,Qi=Uo-rc,Jo=Math.max(Ca,gi),_r=Math.min(Yd,Kt),zs=(Jo+_r)/2,Tr=zs-Ca;s==null||s(e,Gn);var ds=se.right-K.x-(bn+K.width),Ts=se.bottom-K.y-(Pt+K.height);d({ready:!0,offsetX:bn/U,offsetY:Pt/Y,offsetR:ds/U,offsetB:Ts/Y,arrowX:Qi/U,arrowY:Tr/Y,scaleX:U,scaleY:Y,align:Gn})}}),v=function(){u.current+=1;var y=u.current;Promise.resolve().then(function(){u.current===y&&p()})},m=function(){d(function(y){return Ce(Ce({},y),{},{ready:!1})})};return go(m,[n]),go(function(){i||m()},[i]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function nHe(i,e,t,n,o){go(function(){if(i&&e&&t){let u=function(){n(),o()};var r=e,s=t,a=AW(r),l=AW(s),c=MI(s),d=new Set([c].concat(_t(a),_t(l)));return d.forEach(function(h){h.addEventListener("scroll",u,{passive:!0})}),c.addEventListener("resize",u,{passive:!0}),n(),function(){d.forEach(function(h){h.removeEventListener("scroll",u),c.removeEventListener("resize",u)})}}},[i,e,t])}function iHe(i,e,t,n,o,r,s,a){var l=x.exports.useRef(i),c=x.exports.useRef(!1);l.current!==i&&(c.current=!0,l.current=i),x.exports.useEffect(function(){var d=Xi(function(){c.current=!1});return function(){Xi.cancel(d)}},[i]),x.exports.useEffect(function(){if(e&&n&&(!o||r)){var d=function(){var D=!1,E=function(R){var A=R.target;D=s(A)},I=function(R){var A=R.target;!c.current&&l.current&&!D&&!s(A)&&a(!1)};return[E,I]},u=d(),h=Ne(u,2),f=h[0],g=h[1],p=d(),v=Ne(p,2),m=v[0],_=v[1],y=MI(n);y.addEventListener("mousedown",f,!0),y.addEventListener("click",g,!0),y.addEventListener("contextmenu",g,!0);var w=xA(t);return w&&(w.addEventListener("mousedown",m,!0),w.addEventListener("click",_,!0),w.addEventListener("contextmenu",_,!0)),function(){y.removeEventListener("mousedown",f,!0),y.removeEventListener("click",g,!0),y.removeEventListener("contextmenu",g,!0),w&&(w.removeEventListener("mousedown",m,!0),w.removeEventListener("click",_,!0),w.removeEventListener("contextmenu",_,!0))}}},[e,t,n,o,r])}var oHe=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function rHe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tq,e=x.exports.forwardRef(function(t,n){var o=t.prefixCls,r=o===void 0?"rc-trigger-popup":o,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,d=t.hideAction,u=t.popupVisible,h=t.defaultPopupVisible,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,p=t.mouseEnterDelay,v=t.mouseLeaveDelay,m=v===void 0?.1:v,_=t.focusDelay,y=t.blurDelay,w=t.mask,L=t.maskClosable,D=L===void 0?!0:L,E=t.getPopupContainer,I=t.forceRender,k=t.autoDestroy,R=t.destroyPopupOnHide,A=t.popup,P=t.popupClassName,N=t.popupStyle,M=t.popupPlacement,H=t.builtinPlacements,B=H===void 0?{}:H,F=t.popupAlign,$=t.zIndex,z=t.stretch,K=t.getPopupClassNameFromAlign,j=t.fresh,G=t.alignPoint,X=t.onPopupClick,ue=t.onPopupAlign,fe=t.arrow,pe=t.popupMotion,be=t.maskMotion,Se=t.popupTransitionName,Fe=t.popupAnimation,De=t.maskTransitionName,ce=t.maskAnimation,Pe=t.className,Oe=t.getTriggerDOMNode,xe=Hn(t,oHe),Ee=k||R||!1,tt=x.exports.useState(!1),nt=Ne(tt,2),Qe=nt[0],Ge=nt[1];go(function(){Ge(aq())},[]);var re=x.exports.useRef({}),ie=x.exports.useContext(Zne),se=x.exports.useMemo(function(){return{registerSubPopup:function(zn,tr){re.current[zn]=tr,ie==null||ie.registerSubPopup(zn,tr)}}},[ie]),U=Zpe(),Y=x.exports.useState(null),oe=Ne(Y,2),te=oe[0],ye=oe[1],Le=tl(function(rn){_A(rn)&&te!==rn&&ye(rn),ie==null||ie.registerSubPopup(U,rn)}),Te=x.exports.useState(null),We=Ne(Te,2),je=We[0],mt=We[1],Dt=x.exports.useRef(null),At=tl(function(rn){_A(rn)&&je!==rn&&(mt(rn),Dt.current=rn)}),Je=x.exports.Children.only(s),Lt=(Je==null?void 0:Je.props)||{},Ot={},Vn=tl(function(rn){var zn,tr,dr=je;return(dr==null?void 0:dr.contains(rn))||((zn=xA(dr))===null||zn===void 0?void 0:zn.host)===rn||rn===dr||(te==null?void 0:te.contains(rn))||((tr=xA(te))===null||tr===void 0?void 0:tr.host)===rn||rn===te||Object.values(re.current).some(function(nr){return(nr==null?void 0:nr.contains(rn))||rn===nr})}),Et=Jne(r,pe,Fe,Se),tn=Jne(r,be,ce,De),di=x.exports.useState(h||!1),cn=Ne(di,2),Gn=cn[0],bn=cn[1],Pt=u!=null?u:Gn,qt=tl(function(rn){u===void 0&&bn(rn)});go(function(){bn(u||!1)},[u]);var Nt=x.exports.useRef(Pt);Nt.current=Pt;var jt=x.exports.useRef([]);jt.current=[];var Gt=tl(function(rn){var zn;qt(rn),((zn=jt.current[jt.current.length-1])!==null&&zn!==void 0?zn:Pt)!==rn&&(jt.current.push(rn),f==null||f(rn))}),It=x.exports.useRef(),Ft=function(){clearTimeout(It.current)},Ct=function(zn){var tr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ft(),tr===0?Gt(zn):It.current=setTimeout(function(){Gt(zn)},tr*1e3)};x.exports.useEffect(function(){return Ft},[]);var Zt=x.exports.useState(!1),wn=Ne(Zt,2),Dn=wn[0],Xn=wn[1];go(function(rn){(!rn||Pt)&&Xn(!0)},[Pt]);var jn=x.exports.useState(null),Zi=Ne(jn,2),an=Zi[0],Xt=Zi[1],oi=x.exports.useState([0,0]),Ze=Ne(oi,2),de=Ze[0],Ve=Ze[1],ot=function(zn){Ve([zn.clientX,zn.clientY])},Sn=tHe(Pt,te,G?de:je,M,B,F,ue),$n=Ne(Sn,11),Ci=$n[0],An=$n[1],lo=$n[2],Qo=$n[3],zo=$n[4],oc=$n[5],Yc=$n[6],Gr=$n[7],Ua=$n[8],vl=$n[9],ba=$n[10],_l=QVe(Qe,l,c,d),rc=Ne(_l,2),Zc=rc[0],Ca=rc[1],Yd=Zc.has("click"),bl=Ca.has("click")||Ca.has("contextMenu"),mi=tl(function(){Dn||ba()}),gi=function(){Nt.current&&G&&bl&&Ct(!1)};nHe(Pt,je,te,mi,gi),go(function(){mi()},[de,M]),go(function(){Pt&&!(B!=null&&B[M])&&mi()},[JSON.stringify(F)]);var Kt=x.exports.useMemo(function(){var rn=eHe(B,r,vl,G);return Ue(rn,K==null?void 0:K(vl))},[vl,K,B,r,G]);x.exports.useImperativeHandle(n,function(){return{nativeElement:Dt.current,forceAlign:mi}});var on=x.exports.useState(0),vi=Ne(on,2),Uo=vi[0],Qi=vi[1],Jo=x.exports.useState(0),_r=Ne(Jo,2),zs=_r[0],Tr=_r[1],ds=function(){if(z&&je){var zn=je.getBoundingClientRect();Qi(zn.width),Tr(zn.height)}},Ts=function(){ds(),mi()},er=function(zn){Xn(!1),ba(),g==null||g(zn)},l_=function(){return new Promise(function(zn){ds(),Xt(function(){return zn})})};go(function(){an&&(ba(),an(),Xt(null))},[an]);function Qc(rn,zn,tr,dr){Ot[rn]=function(nr){var a1;dr==null||dr(nr),Ct(zn,tr);for(var $S=arguments.length,RT=new Array($S>1?$S-1:0),l1=1;l1<$S;l1++)RT[l1-1]=arguments[l1];(a1=Lt[rn])===null||a1===void 0||a1.call.apply(a1,[Lt,nr].concat(RT))}}(Yd||bl)&&(Ot.onClick=function(rn){var zn;Nt.current&&bl?Ct(!1):!Nt.current&&Yd&&(ot(rn),Ct(!0));for(var tr=arguments.length,dr=new Array(tr>1?tr-1:0),nr=1;nr1?tr-1:0),nr=1;nr1&&arguments[1]!==void 0?arguments[1]:{},t=e.fieldNames,n=e.childrenAsData,o=[],r=Hme(t,!1),s=r.label,a=r.value,l=r.options,c=r.groupLabel;function d(u,h){!Array.isArray(u)||u.forEach(function(f){if(h||!(l in f)){var g=f[a];o.push({key:oie(f,o.length),groupOption:h,data:f,label:f[s],value:g})}else{var p=f[c];p===void 0&&n&&(p=f.label),o.push({key:oie(f,o.length),group:!0,data:f,label:p}),d(f[l],!0)}})}return d(i,!1),o}function PW(i){var e=Ce({},i);return"props"in e||Object.defineProperty(e,"props",{get:function(){return rr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var uHe=function(e,t,n){if(!t||!t.length)return null;var o=!1,r=function a(l,c){var d=$ge(c),u=d[0],h=d.slice(1);if(!u)return[l];var f=l.split(u);return o=o||f.length>1,f.reduce(function(g,p){return[].concat(_t(g),_t(a(p,h)))},[]).filter(Boolean)},s=r(e,t);return o?typeof n!="undefined"?s.slice(0,n):s:null},lq=x.exports.createContext(null),hHe=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],fHe=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],OW=function(e){return e==="tags"||e==="multiple"},gHe=x.exports.forwardRef(function(i,e){var t,n,o=i.id,r=i.prefixCls,s=i.className,a=i.showSearch,l=i.tagRender,c=i.direction,d=i.omitDomProps,u=i.displayValues,h=i.onDisplayValuesChange,f=i.emptyOptions,g=i.notFoundContent,p=g===void 0?"Not Found":g,v=i.onClear,m=i.mode,_=i.disabled,y=i.loading,w=i.getInputElement,L=i.getRawInputElement,D=i.open,E=i.defaultOpen,I=i.onDropdownVisibleChange,k=i.activeValue,R=i.onActiveValueChange,A=i.activeDescendantId,P=i.searchValue,N=i.autoClearSearchValue,M=i.onSearch,H=i.onSearchSplit,B=i.tokenSeparators,F=i.allowClear,$=i.suffixIcon,z=i.clearIcon,K=i.OptionList,j=i.animation,G=i.transitionName,X=i.dropdownStyle,ue=i.dropdownClassName,fe=i.dropdownMatchSelectWidth,pe=i.dropdownRender,be=i.dropdownAlign,Se=i.placement,Fe=i.builtinPlacements,De=i.getPopupContainer,ce=i.showAction,Pe=ce===void 0?[]:ce,Oe=i.onFocus,xe=i.onBlur,Ee=i.onKeyUp,tt=i.onKeyDown,nt=i.onMouseDown,Qe=Hn(i,hHe),Ge=OW(m),re=(a!==void 0?a:Ge)||m==="combobox",ie=Ce({},Qe);fHe.forEach(function(Kt){delete ie[Kt]}),d==null||d.forEach(function(Kt){delete ie[Kt]});var se=x.exports.useState(!1),U=Ne(se,2),Y=U[0],oe=U[1];x.exports.useEffect(function(){oe(aq())},[]);var te=x.exports.useRef(null),ye=x.exports.useRef(null),Le=x.exports.useRef(null),Te=x.exports.useRef(null),We=x.exports.useRef(null),je=x.exports.useRef(!1),mt=wVe(),Dt=Ne(mt,3),At=Dt[0],Je=Dt[1],Lt=Dt[2];x.exports.useImperativeHandle(e,function(){var Kt,on;return{focus:(Kt=Te.current)===null||Kt===void 0?void 0:Kt.focus,blur:(on=Te.current)===null||on===void 0?void 0:on.blur,scrollTo:function(Uo){var Qi;return(Qi=We.current)===null||Qi===void 0?void 0:Qi.scrollTo(Uo)}}});var Ot=x.exports.useMemo(function(){var Kt;if(m!=="combobox")return P;var on=(Kt=u[0])===null||Kt===void 0?void 0:Kt.value;return typeof on=="string"||typeof on=="number"?String(on):""},[P,m,u]),Vn=m==="combobox"&&typeof w=="function"&&w()||null,Et=typeof L=="function"&&L(),tn=Pb(ye,Et==null||(t=Et.props)===null||t===void 0?void 0:t.ref),di=x.exports.useState(!1),cn=Ne(di,2),Gn=cn[0],bn=cn[1];go(function(){bn(!0)},[]);var Pt=Kl(!1,{defaultValue:E,value:D}),qt=Ne(Pt,2),Nt=qt[0],jt=qt[1],Gt=Gn?Nt:!1,It=!p&&f;(_||It&&Gt&&m==="combobox")&&(Gt=!1);var Ft=It?!1:Gt,Ct=x.exports.useCallback(function(Kt){var on=Kt!==void 0?Kt:!Gt;_||(jt(on),Gt!==on&&(I==null||I(on)))},[_,Gt,jt,I]),Zt=x.exports.useMemo(function(){return(B||[]).some(function(Kt){return[` `,`\r -`].includes(Kt)})},[B]),wn=x.exports.useContext(aq)||{},Dn=wn.maxCount,Xn=wn.rawValues,jn=function(on,vi,Uo){if(!((Xn==null?void 0:Xn.size)>=Dn)){var Qi=!0,Jo=on;R==null||R(null);var _r=uHe(on,B,Dn&&Dn-Xn.size),zs=Uo?null:_r;return m!=="combobox"&&zs&&(Jo="",H==null||H(zs),Ct(!1),Qi=!1),M&&Ot!==Jo&&M(Jo,{source:vi?"typing":"effect"}),Qi}},Zi=function(on){!on||!on.trim()||M(on,{source:"submit"})};x.exports.useEffect(function(){!Gt&&!Ge&&m!=="combobox"&&jn("",!1,!1)},[Gt]),x.exports.useEffect(function(){Nt&&_&&jt(!1),_&&!je.current&&Je(!1)},[_]);var an=Mme(),Xt=Ne(an,2),oi=Xt[0],Ze=Xt[1],de=function(on){var vi=oi(),Uo=on.which;if(Uo===at.ENTER&&(m!=="combobox"&&on.preventDefault(),Gt||Ct(!0)),Ze(!!Ot),Uo===at.BACKSPACE&&!vi&&Ge&&!Ot&&u.length){for(var Qi=_t(u),Jo=null,_r=Qi.length-1;_r>=0;_r-=1){var zs=Qi[_r];if(!zs.disabled){Qi.splice(_r,1),Jo=zs;break}}Jo&&h(Qi,{type:"remove",values:[Jo]})}for(var Tr=arguments.length,ds=new Array(Tr>1?Tr-1:0),Ts=1;Ts1?vi-1:0),Qi=1;Qi1?_r-1:0),Tr=1;Tr<_r;Tr++)zs[Tr-1]=arguments[Tr];nt==null||nt.apply(void 0,[on].concat(zs))},Qo=x.exports.useState({}),zo=Ne(Qo,2),oc=zo[1];function Yc(){oc({})}var Gr;Et&&(Gr=function(on){Ct(on)}),SVe(function(){var Kt;return[te.current,(Kt=Le.current)===null||Kt===void 0?void 0:Kt.getPopupElement()]},Ft,Ct,!!Et);var Ua=x.exports.useMemo(function(){return Ce(Ce({},i),{},{notFoundContent:p,open:Gt,triggerOpen:Ft,id:o,showSearch:re,multiple:Ge,toggleOpen:Ct})},[i,p,Ft,Gt,o,re,Ge,Ct]),vl=!!$||y,ba;vl&&(ba=x.exports.createElement(M4,{className:Ue("".concat(r,"-arrow"),me({},"".concat(r,"-arrow-loading"),y)),customizeIcon:$,customizeIconProps:{loading:y,searchValue:Ot,open:Gt,focused:At,showSearch:re}}));var _l=function(){var on;v==null||v(),(on=Te.current)===null||on===void 0||on.focus(),h([],{type:"clear",values:u}),jn("",!1,!1)},rc=CVe(r,_l,u,F,z,_,Ot,m),Zc=rc.allowClear,Ca=rc.clearIcon,Yd=x.exports.createElement(K,{ref:We}),bl=Ue(r,s,(n={},me(n,"".concat(r,"-focused"),At),me(n,"".concat(r,"-multiple"),Ge),me(n,"".concat(r,"-single"),!Ge),me(n,"".concat(r,"-allow-clear"),F),me(n,"".concat(r,"-show-arrow"),vl),me(n,"".concat(r,"-disabled"),_),me(n,"".concat(r,"-loading"),y),me(n,"".concat(r,"-open"),Gt),me(n,"".concat(r,"-customize-input"),Vn),me(n,"".concat(r,"-show-search"),re),n)),mi=x.exports.createElement(cHe,{ref:Le,disabled:_,prefixCls:r,visible:Ft,popupElement:Yd,animation:j,transitionName:G,dropdownStyle:X,dropdownClassName:ue,direction:c,dropdownMatchSelectWidth:fe,dropdownRender:pe,dropdownAlign:be,placement:Se,builtinPlacements:Fe,getPopupContainer:De,empty:f,getTriggerDOMNode:function(){return ye.current},onPopupVisibleChange:Gr,onPopupMouseEnter:Yc},Et?x.exports.cloneElement(Et,{ref:tn}):x.exports.createElement(KVe,yt({},i,{domRef:ye,prefixCls:r,inputElement:Vn,ref:Te,id:o,showSearch:re,autoClearSearchValue:N,mode:m,activeDescendantId:A,tagRender:l,values:u,open:Gt,onToggleOpen:Ct,activeValue:k,searchValue:Ot,onSearch:jn,onSearchSubmit:Zi,onRemove:ot,tokenWithEnter:Zt}))),gi;return Et?gi=mi:gi=x.exports.createElement("div",yt({className:bl},ie,{ref:te,onMouseDown:lo,onKeyDown:de,onKeyUp:Ve,onFocus:$n,onBlur:Ci}),At&&!Gt&&x.exports.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(u.map(function(Kt){var on=Kt.label,vi=Kt.value;return["number","string"].includes(qn(on))?on:vi}).join(", "))),mi,ba,Zc&&Ca),x.exports.createElement(Rme.Provider,{value:Ua},gi)}),lq=function(){return null};lq.isSelectOptGroup=!0;var cq=function(){return null};cq.isSelectOption=!0;var Hme=x.exports.forwardRef(function(i,e){var t=i.height,n=i.offsetY,o=i.offsetX,r=i.children,s=i.prefixCls,a=i.onInnerResize,l=i.innerProps,c=i.rtl,d=i.extra,u={},h={display:"flex",flexDirection:"column"};if(n!==void 0){var f;u={height:t,position:"relative",overflow:"hidden"},h=Ce(Ce({},h),{},(f={transform:"translateY(".concat(n,"px)")},me(f,c?"marginRight":"marginLeft",-o),me(f,"position","absolute"),me(f,"left",0),me(f,"right",0),me(f,"top",0),f))}return x.exports.createElement("div",{style:u},x.exports.createElement(Mu,{onResize:function(p){var v=p.offsetHeight;v&&a&&a()}},x.exports.createElement("div",yt({style:h,className:Ue(me({},"".concat(s,"-holder-inner"),s)),ref:e},l),r,d)))});Hme.displayName="Filler";function oie(i,e){var t="touches"in i?i.touches[0]:i;return t[e?"pageX":"pageY"]}var rie=x.exports.forwardRef(function(i,e){var t,n=i.prefixCls,o=i.rtl,r=i.scrollOffset,s=i.scrollRange,a=i.onStartMove,l=i.onStopMove,c=i.onScroll,d=i.horizontal,u=i.spinSize,h=i.containerSize,f=i.style,g=i.thumbStyle,p=x.exports.useState(!1),v=Ne(p,2),m=v[0],_=v[1],y=x.exports.useState(null),w=Ne(y,2),L=w[0],D=w[1],E=x.exports.useState(null),I=Ne(E,2),k=I[0],R=I[1],A=!o,P=x.exports.useRef(),N=x.exports.useRef(),M=x.exports.useState(!1),H=Ne(M,2),B=H[0],F=H[1],$=x.exports.useRef(),z=function(){clearTimeout($.current),F(!0),$.current=setTimeout(function(){F(!1)},3e3)},K=s-h||0,j=h-u||0,G=K>0,X=x.exports.useMemo(function(){if(r===0||K===0)return 0;var Pe=r/K;return Pe*j},[r,K,j]),ue=function(Oe){Oe.stopPropagation(),Oe.preventDefault()},fe=x.exports.useRef({top:X,dragging:m,pageY:L,startTop:k});fe.current={top:X,dragging:m,pageY:L,startTop:k};var pe=function(Oe){_(!0),D(oie(Oe,d)),R(fe.current.top),a(),Oe.stopPropagation(),Oe.preventDefault()};x.exports.useEffect(function(){var Pe=function(tt){tt.preventDefault()},Oe=P.current,xe=N.current;return Oe.addEventListener("touchstart",Pe),xe.addEventListener("touchstart",pe),function(){Oe.removeEventListener("touchstart",Pe),xe.removeEventListener("touchstart",pe)}},[]);var be=x.exports.useRef();be.current=K;var Se=x.exports.useRef();Se.current=j,x.exports.useEffect(function(){if(m){var Pe,Oe=function(tt){var nt=fe.current,Qe=nt.dragging,Ge=nt.pageY,re=nt.startTop;if(Xi.cancel(Pe),Qe){var ie=oie(tt,d)-Ge,se=re;!A&&d?se-=ie:se+=ie;var U=be.current,Y=Se.current,oe=Y?se/Y:0,te=Math.ceil(oe*U);te=Math.max(te,0),te=Math.min(te,U),Pe=Xi(function(){c(te,d)})}},xe=function(){_(!1),l()};return window.addEventListener("mousemove",Oe),window.addEventListener("touchmove",Oe),window.addEventListener("mouseup",xe),window.addEventListener("touchend",xe),function(){window.removeEventListener("mousemove",Oe),window.removeEventListener("touchmove",Oe),window.removeEventListener("mouseup",xe),window.removeEventListener("touchend",xe),Xi.cancel(Pe)}}},[m]),x.exports.useEffect(function(){z()},[r]),x.exports.useImperativeHandle(e,function(){return{delayHidden:z}});var Fe="".concat(n,"-scrollbar"),De={position:"absolute",visibility:B&&G?null:"hidden"},ce={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return d?(De.height=8,De.left=0,De.right=0,De.bottom=0,ce.height="100%",ce.width=u,A?ce.left=X:ce.right=X):(De.width=8,De.top=0,De.bottom=0,A?De.right=0:De.left=0,ce.width="100%",ce.height=u,ce.top=X),x.exports.createElement("div",{ref:P,className:Ue(Fe,(t={},me(t,"".concat(Fe,"-horizontal"),d),me(t,"".concat(Fe,"-vertical"),!d),me(t,"".concat(Fe,"-visible"),B),t)),style:Ce(Ce({},De),f),onMouseDown:ue,onMouseMove:z},x.exports.createElement("div",{ref:N,className:Ue("".concat(Fe,"-thumb"),me({},"".concat(Fe,"-thumb-moving"),m)),style:Ce(Ce({},ce),g),onMouseDown:pe}))});function pHe(i){var e=i.children,t=i.setRef,n=x.exports.useCallback(function(o){t(o)},[]);return x.exports.cloneElement(e,{ref:n})}function mHe(i,e,t,n,o,r,s){var a=s.getKey;return i.slice(e,t+1).map(function(l,c){var d=e+c,u=r(l,d,{style:{width:n}}),h=a(l);return x.exports.createElement(pHe,{key:h,setRef:function(g){return o(l,g)}},u)})}var vHe=function(){function i(){ga(this,i),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return pa(i,[{key:"set",value:function(t,n){this.maps[t]=n,this.id+=1}},{key:"get",value:function(t){return this.maps[t]}}]),i}();function _He(i,e,t){var n=x.exports.useState(0),o=Ne(n,2),r=o[0],s=o[1],a=x.exports.useRef(new Map),l=x.exports.useRef(new vHe),c=x.exports.useRef();function d(){Xi.cancel(c.current)}function u(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;d();var g=function(){a.current.forEach(function(v,m){if(v&&v.offsetParent){var _=tE(v),y=_.offsetHeight;l.current.get(m)!==y&&l.current.set(m,_.offsetHeight)}}),s(function(v){return v+1})};f?g():c.current=Xi(g)}function h(f,g){var p=i(f),v=a.current.get(p);g?(a.current.set(p,g),u()):a.current.delete(p),!v!=!g&&(g?e==null||e(f):t==null||t(f))}return x.exports.useEffect(function(){return d},[]),[h,u,l.current,r]}var bHe=10;function CHe(i,e,t,n,o,r,s,a){var l=x.exports.useRef(),c=x.exports.useState(null),d=Ne(c,2),u=d[0],h=d[1];return go(function(){if(u&&u.times=0;M-=1){var H=o(e[M]),B=t.get(H);if(B===void 0){_=!0;break}if(N-=B,N<=0)break}switch(L){case"top":w=E-v;break;case"bottom":w=I-m+v;break;default:{var F=i.current.scrollTop,$=F+m;E$&&(y="bottom")}}w!==null&&s(w),w!==u.lastTop&&(_=!0)}_&&h(Ce(Ce({},u),{},{times:u.times+1,targetAlign:y,lastTop:w}))}},[u,i.current]),function(f){if(f==null){a();return}if(Xi.cancel(l.current),typeof f=="number")s(f);else if(f&&qn(f)==="object"){var g,p=f.align;"index"in f?g=f.index:g=e.findIndex(function(_){return o(_)===f.key});var v=f.offset,m=v===void 0?0:v;h({times:0,index:g,offset:m,originAlign:p})}}}function yHe(i,e,t){var n=i.length,o=e.length,r,s;if(n===0&&o===0)return null;n1&&arguments[1]!==void 0?arguments[1]:!1,l=s<0&&r.current.top||s>0&&r.current.bottom;return a&&l?(clearTimeout(n.current),t.current=!1):(!l||t.current)&&o(),!t.current&&l}};function SHe(i,e,t,n,o){var r=x.exports.useRef(0),s=x.exports.useRef(null),a=x.exports.useRef(null),l=x.exports.useRef(!1),c=$me(e,t);function d(v,m){Xi.cancel(s.current),r.current+=m,a.current=m,!c(m)&&(sie||v.preventDefault(),s.current=Xi(function(){var _=l.current?10:1;o(r.current*_),r.current=0}))}function u(v,m){o(m,!0),sie||v.preventDefault()}var h=x.exports.useRef(null),f=x.exports.useRef(null);function g(v){if(!!i){Xi.cancel(f.current),f.current=Xi(function(){h.current=null},2);var m=v.deltaX,_=v.deltaY,y=v.shiftKey,w=m,L=_;(h.current==="sx"||!h.current&&(y||!1)&&_&&!m)&&(w=_,L=0,h.current="sx");var D=Math.abs(w),E=Math.abs(L);h.current===null&&(h.current=n&&D>E?"x":"y"),h.current==="y"?d(v,L):u(v,w)}}function p(v){!i||(l.current=v.detail===a.current)}return[g,p]}var xHe=14/15;function LHe(i,e,t){var n=x.exports.useRef(!1),o=x.exports.useRef(0),r=x.exports.useRef(null),s=x.exports.useRef(null),a,l=function(h){if(n.current){var f=Math.ceil(h.touches[0].pageY),g=o.current-f;o.current=f,t(g)&&h.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){g*=xHe,(!t(g,!0)||Math.abs(g)<=.1)&&clearInterval(s.current)},16)}},c=function(){n.current=!1,a()},d=function(h){a(),h.touches.length===1&&!n.current&&(n.current=!0,o.current=Math.ceil(h.touches[0].pageY),r.current=h.target,r.current.addEventListener("touchmove",l),r.current.addEventListener("touchend",c))};a=function(){r.current&&(r.current.removeEventListener("touchmove",l),r.current.removeEventListener("touchend",c))},go(function(){return i&&e.current.addEventListener("touchstart",d),function(){var u;(u=e.current)===null||u===void 0||u.removeEventListener("touchstart",d),a(),clearInterval(s.current)}},[i])}var EHe=20;function aie(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=i/e*100;return isNaN(t)&&(t=0),t=Math.max(t,EHe),t=Math.min(t,i/2),Math.floor(t)}function DHe(i,e,t,n){var o=x.exports.useMemo(function(){return[new Map,[]]},[i,t.id,n]),r=Ne(o,2),s=r[0],a=r[1],l=function(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,h=s.get(d),f=s.get(u);if(h===void 0||f===void 0)for(var g=i.length,p=a.length;pr||!!p),A=g==="rtl",P=Ue(n,me({},"".concat(n,"-rtl"),A),o),N=d||IHe,M=x.exports.useRef(),H=x.exports.useRef(),B=x.exports.useState(0),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState(0),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useState(!1),fe=Ne(ue,2),pe=fe[0],be=fe[1],Se=function(){be(!0)},Fe=function(){be(!1)},De=x.exports.useCallback(function(Ze){return typeof h=="function"?h(Ze):Ze==null?void 0:Ze[h]},[h]),ce={getKey:De};function Pe(Ze){z(function(de){var Ve;typeof Ze=="function"?Ve=Ze(de):Ve=Ze;var ot=tn(Ve);return M.current.scrollTop=ot,ot})}var Oe=x.exports.useRef({start:0,end:N.length}),xe=x.exports.useRef(),Ee=wHe(N,De),tt=Ne(Ee,1),nt=tt[0];xe.current=nt;var Qe=_He(De,null,null),Ge=Ne(Qe,4),re=Ge[0],ie=Ge[1],se=Ge[2],U=Ge[3],Y=x.exports.useMemo(function(){if(!k)return{scrollHeight:void 0,start:0,end:N.length-1,offset:void 0};if(!R){var Ze;return{scrollHeight:((Ze=H.current)===null||Ze===void 0?void 0:Ze.offsetHeight)||0,start:0,end:N.length-1,offset:void 0}}for(var de=0,Ve,ot,Sn,$n=N.length,Ci=0;Ci<$n;Ci+=1){var An=N[Ci],lo=De(An),Qo=se.get(lo),zo=de+(Qo===void 0?s:Qo);zo>=$&&Ve===void 0&&(Ve=Ci,ot=de),zo>$+r&&Sn===void 0&&(Sn=Ci),de=zo}return Ve===void 0&&(Ve=0,ot=0,Sn=Math.ceil(r/s)),Sn===void 0&&(Sn=N.length-1),Sn=Math.min(Sn+1,N.length-1),{scrollHeight:de,start:Ve,end:Sn,offset:ot}},[R,k,$,N,U,r]),oe=Y.scrollHeight,te=Y.start,ye=Y.end,Le=Y.offset;Oe.current.start=te,Oe.current.end=ye;var Te=x.exports.useState({width:0,height:r}),We=Ne(Te,2),je=We[0],mt=We[1],Dt=function(de){mt({width:de.width||de.offsetWidth,height:de.height||de.offsetHeight})},At=x.exports.useRef(),Je=x.exports.useRef(),Lt=x.exports.useMemo(function(){return aie(je.width,p)},[je.width,p]),Ot=x.exports.useMemo(function(){return aie(je.height,oe)},[je.height,oe]),Vn=oe-r,Et=x.exports.useRef(Vn);Et.current=Vn;function tn(Ze){var de=Ze;return Number.isNaN(Et.current)||(de=Math.min(de,Et.current)),de=Math.max(de,0),de}var di=$<=0,cn=$>=Vn,Gn=$me(di,cn),bn=function(){return{x:A?-G:G,y:$}},Pt=x.exports.useRef(bn()),qt=tl(function(){if(y){var Ze=bn();(Pt.current.x!==Ze.x||Pt.current.y!==Ze.y)&&(y(Ze),Pt.current=Ze)}});function Nt(Ze,de){var Ve=Ze;de?(zu.exports.flushSync(function(){X(Ve)}),qt()):Pe(Ve)}function jt(Ze){var de=Ze.currentTarget.scrollTop;de!==$&&Pe(de),_==null||_(Ze),qt()}var Gt=function(de){var Ve=de,ot=p-je.width;return Ve=Math.max(Ve,0),Ve=Math.min(Ve,ot),Ve},It=tl(function(Ze,de){de?(zu.exports.flushSync(function(){X(function(Ve){var ot=Ve+(A?-Ze:Ze);return Gt(ot)})}),qt()):Pe(function(Ve){var ot=Ve+Ze;return ot})}),Ft=SHe(k,di,cn,!!p,It),Ct=Ne(Ft,2),Zt=Ct[0],wn=Ct[1];LHe(k,M,function(Ze,de){return Gn(Ze,de)?!1:(Zt({preventDefault:function(){},deltaY:Ze}),!0)}),go(function(){function Ze(Ve){k&&Ve.preventDefault()}var de=M.current;return de.addEventListener("wheel",Zt),de.addEventListener("DOMMouseScroll",wn),de.addEventListener("MozMousePixelScroll",Ze),function(){de.removeEventListener("wheel",Zt),de.removeEventListener("DOMMouseScroll",wn),de.removeEventListener("MozMousePixelScroll",Ze)}},[k]),go(function(){p&&X(function(Ze){return Gt(Ze)})},[je.width,p]);var Dn=function(){var de,Ve;(de=At.current)===null||de===void 0||de.delayHidden(),(Ve=Je.current)===null||Ve===void 0||Ve.delayHidden()},Xn=CHe(M,N,se,s,De,function(){return ie(!0)},Pe,Dn);x.exports.useImperativeHandle(e,function(){return{getScrollInfo:bn,scrollTo:function(de){function Ve(ot){return ot&&qn(ot)==="object"&&("left"in ot||"top"in ot)}Ve(de)?(de.left!==void 0&&X(Gt(de.left)),Xn(de.top)):Xn(de)}}}),go(function(){if(w){var Ze=N.slice(te,ye+1);w(Ze,N)}},[te,ye,N]);var jn=DHe(N,De,se,s),Zi=D==null?void 0:D({start:te,end:ye,virtual:R,offsetX:G,offsetY:Le,rtl:A,getSize:jn}),an=mHe(N,te,ye,p,re,u,ce),Xt=null;r&&(Xt=Ce(me({},l?"height":"maxHeight",r),THe),k&&(Xt.overflowY="hidden",p&&(Xt.overflowX="hidden"),pe&&(Xt.pointerEvents="none")));var oi={};return A&&(oi.dir="rtl"),x.exports.createElement("div",yt({style:Ce(Ce({},c),{},{position:"relative"}),className:P},oi,I),x.exports.createElement(Mu,{onResize:Dt},x.exports.createElement(m,{className:"".concat(n,"-holder"),style:Xt,ref:M,onScroll:jt,onMouseEnter:Dn},x.exports.createElement(Hme,{prefixCls:n,height:oe,offsetX:G,offsetY:Le,scrollWidth:p,onInnerResize:ie,ref:H,innerProps:L,rtl:A,extra:Zi},an))),R&&oe>r&&x.exports.createElement(rie,{ref:At,prefixCls:n,scrollOffset:$,scrollRange:oe,rtl:A,onScroll:Nt,onStartMove:Se,onStopMove:Fe,spinSize:Ot,containerSize:je.height,style:E==null?void 0:E.verticalScrollBar,thumbStyle:E==null?void 0:E.verticalScrollBarThumb}),R&&p&&x.exports.createElement(rie,{ref:Je,prefixCls:n,scrollOffset:G,scrollRange:p,rtl:A,onScroll:Nt,onStartMove:Se,onStopMove:Fe,spinSize:Lt,containerSize:je.width,horizontal:!0,style:E==null?void 0:E.horizontalScrollBar,thumbStyle:E==null?void 0:E.horizontalScrollBarThumb}))}var dq=x.exports.forwardRef(NHe);dq.displayName="List";function RHe(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var MHe=["disabled","title","children","style","className"];function lie(i){return typeof i=="string"||typeof i=="number"}var AHe=function(e,t){var n=yVe(),o=n.prefixCls,r=n.id,s=n.open,a=n.multiple,l=n.mode,c=n.searchValue,d=n.toggleOpen,u=n.notFoundContent,h=n.onPopupScroll,f=x.exports.useContext(aq),g=f.maxCount,p=f.flattenOptions,v=f.onActiveValue,m=f.defaultActiveFirstOption,_=f.onSelect,y=f.menuItemSelectedIcon,w=f.rawValues,L=f.fieldNames,D=f.virtual,E=f.direction,I=f.listHeight,k=f.listItemHeight,R=f.optionRender,A="".concat(o,"-item"),P=LI(function(){return p},[s,p],function(De,ce){return ce[0]&&De[1]!==ce[1]}),N=x.exports.useRef(null),M=x.exports.useMemo(function(){return a&&typeof g!="undefined"&&(w==null?void 0:w.size)>=g},[a,g,w==null?void 0:w.size]),H=function(ce){ce.preventDefault()},B=function(ce){var Pe;(Pe=N.current)===null||Pe===void 0||Pe.scrollTo(typeof ce=="number"?{index:ce}:ce)},F=function(ce){for(var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Oe=P.length,xe=0;xe1&&arguments[1]!==void 0?arguments[1]:!1;j(ce);var Oe={source:Pe?"keyboard":"mouse"},xe=P[ce];if(!xe){v(null,-1,Oe);return}v(xe.value,ce,Oe)};x.exports.useEffect(function(){G(m!==!1?F(0):-1)},[P.length,c]);var X=x.exports.useCallback(function(De){return w.has(De)&&l!=="combobox"},[l,_t(w).toString(),w.size]);x.exports.useEffect(function(){var De=setTimeout(function(){if(!a&&s&&w.size===1){var Pe=Array.from(w)[0],Oe=P.findIndex(function(xe){var Ee=xe.data;return Ee.value===Pe});Oe!==-1&&(G(Oe),B(Oe))}});if(s){var ce;(ce=N.current)===null||ce===void 0||ce.scrollTo(void 0)}return function(){return clearTimeout(De)}},[s,c]);var ue=function(ce){ce!==void 0&&_(ce,{selected:!w.has(ce)}),a||d(!1)};if(x.exports.useImperativeHandle(t,function(){return{onKeyDown:function(ce){var Pe=ce.which,Oe=ce.ctrlKey;switch(Pe){case at.N:case at.P:case at.UP:case at.DOWN:{var xe=0;if(Pe===at.UP?xe=-1:Pe===at.DOWN?xe=1:RHe()&&Oe&&(Pe===at.N?xe=1:Pe===at.P&&(xe=-1)),xe!==0){var Ee=F(K+xe,xe);B(Ee),G(Ee,!0)}break}case at.ENTER:{var tt,nt=P[K];nt&&!(nt!=null&&(tt=nt.data)!==null&&tt!==void 0&&tt.disabled)&&!M?ue(nt.value):ue(void 0),s&&ce.preventDefault();break}case at.ESC:d(!1),s&&ce.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ce){B(ce)}}}),P.length===0)return x.exports.createElement("div",{role:"listbox",id:"".concat(r,"_list"),className:"".concat(A,"-empty"),onMouseDown:H},u);var fe=Object.keys(L).map(function(De){return L[De]}),pe=function(ce){return ce.label};function be(De,ce){var Pe=De.group;return{role:Pe?"presentation":"option",id:"".concat(r,"_list_").concat(ce)}}var Se=function(ce){var Pe=P[ce];if(!Pe)return null;var Oe=Pe.data||{},xe=Oe.value,Ee=Pe.group,tt=K0(Oe,!0),nt=pe(Pe);return Pe?x.exports.createElement("div",yt({"aria-label":typeof nt=="string"&&!Ee?nt:null},tt,{key:ce},be(Pe,ce),{"aria-selected":X(xe)}),xe):null},Fe={role:"listbox",id:"".concat(r,"_list")};return x.exports.createElement(x.exports.Fragment,null,D&&x.exports.createElement("div",yt({},Fe,{style:{height:0,width:0,overflow:"hidden"}}),Se(K-1),Se(K),Se(K+1)),x.exports.createElement(dq,{itemKey:"key",ref:N,data:P,height:I,itemHeight:k,fullHeight:!1,onMouseDown:H,onScroll:h,virtual:D,direction:E,innerProps:D?null:Fe},function(De,ce){var Pe,Oe=De.group,xe=De.groupOption,Ee=De.data,tt=De.label,nt=De.value,Qe=Ee.key;if(Oe){var Ge,re=(Ge=Ee.title)!==null&&Ge!==void 0?Ge:lie(tt)?tt.toString():void 0;return x.exports.createElement("div",{className:Ue(A,"".concat(A,"-group")),title:re},tt!==void 0?tt:Qe)}var ie=Ee.disabled,se=Ee.title;Ee.children;var U=Ee.style,Y=Ee.className,oe=Hn(Ee,MHe),te=kf(oe,fe),ye=X(nt),Le=ie||!ye&&M,Te="".concat(A,"-option"),We=Ue(A,Te,Y,(Pe={},me(Pe,"".concat(Te,"-grouped"),xe),me(Pe,"".concat(Te,"-active"),K===ce&&!Le),me(Pe,"".concat(Te,"-disabled"),Le),me(Pe,"".concat(Te,"-selected"),ye),Pe)),je=pe(De),mt=!y||typeof y=="function"||ye,Dt=typeof je=="number"?je:je||nt,At=lie(Dt)?Dt.toString():void 0;return se!==void 0&&(At=se),x.exports.createElement("div",yt({},K0(te),D?{}:be(De,ce),{"aria-selected":ye,className:We,title:At,onMouseMove:function(){K===ce||Le||G(ce)},onClick:function(){Le||ue(nt)},style:U}),x.exports.createElement("div",{className:"".concat(Te,"-content")},typeof R=="function"?R(De,{index:ce}):Dt),x.exports.isValidElement(y)||ye,mt&&x.exports.createElement(M4,{className:"".concat(A,"-option-state"),customizeIcon:y,customizeIconProps:{value:nt,disabled:Le,isSelected:ye}},ye?"\u2713":null))}))},PHe=x.exports.forwardRef(AHe),OHe=function(i,e){var t=x.exports.useRef({values:new Map,options:new Map}),n=x.exports.useMemo(function(){var r=t.current,s=r.values,a=r.options,l=i.map(function(u){if(u.label===void 0){var h;return Ce(Ce({},u),{},{label:(h=s.get(u.value))===null||h===void 0?void 0:h.label})}return u}),c=new Map,d=new Map;return l.forEach(function(u){c.set(u.value,u),d.set(u.value,e.get(u.value)||a.get(u.value))}),t.current.values=c,t.current.options=d,l},[i,e]),o=x.exports.useCallback(function(r){return e.get(r)||t.current.options.get(r)},[e]);return[n,o]};function p6(i,e){return Bme(i).join("").toUpperCase().includes(e)}var FHe=function(i,e,t,n,o){return x.exports.useMemo(function(){if(!t||n===!1)return i;var r=e.options,s=e.label,a=e.value,l=[],c=typeof n=="function",d=t.toUpperCase(),u=c?n:function(f,g){return o?p6(g[o],d):g[r]?p6(g[s!=="children"?s:"label"],d):p6(g[a],d)},h=c?function(f){return AW(f)}:function(f){return f};return i.forEach(function(f){if(f[r]){var g=u(t,h(f));if(g)l.push(f);else{var p=f[r].filter(function(v){return u(t,h(v))});p.length&&l.push(Ce(Ce({},f),{},me({},r,p)))}return}u(t,h(f))&&l.push(f)}),l},[i,n,o,t,e])},cie=0,BHe=Fa();function WHe(){var i;return BHe?(i=cie,cie+=1):i="TEST_OR_SSR",i}function VHe(i){var e=x.exports.useState(),t=Ne(e,2),n=t[0],o=t[1];return x.exports.useEffect(function(){o("rc_select_".concat(WHe()))},[]),i||n}var HHe=["children","value"],$He=["children"];function zHe(i){var e=i,t=e.key,n=e.props,o=n.children,r=n.value,s=Hn(n,HHe);return Ce({key:t,value:r!==void 0?r:t,children:o},s)}function zme(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return op(i).map(function(t,n){if(!x.exports.isValidElement(t)||!t.type)return null;var o=t,r=o.type.isSelectOptGroup,s=o.key,a=o.props,l=a.children,c=Hn(a,$He);return e||!r?zHe(t):Ce(Ce({key:"__RC_SELECT_GRP__".concat(s===null?n:s,"__"),label:s},c),{},{options:zme(l)})}).filter(function(t){return t})}var UHe=function(e,t,n,o,r){return x.exports.useMemo(function(){var s=e,a=!e;a&&(s=zme(t));var l=new Map,c=new Map,d=function(f,g,p){p&&typeof p=="string"&&f.set(g[p],g)},u=function h(f){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p=0;p2&&arguments[2]!==void 0?arguments[2]:{},Zt=Ct.source,wn=Zt===void 0?"keyboard":Zt;di(Ft),s&&n==="combobox"&&It!==null&&wn==="keyboard"&&Ot(String(It))},[s,n]),bn=function(Ft,Ct,Zt){var wn=function(){var Ve,ot=Y(Ft);return[$?{label:ot==null?void 0:ot[pe.label],value:Ft,key:(Ve=ot==null?void 0:ot.key)!==null&&Ve!==void 0?Ve:Ft}:Ft,AW(ot)]};if(Ct&&f){var Dn=wn(),Xn=Ne(Dn,2),jn=Xn[0],Zi=Xn[1];f(jn,Zi)}else if(!Ct&&g&&Zt!=="clear"){var an=wn(),Xt=Ne(an,2),oi=Xt[0],Ze=Xt[1];g(oi,Ze)}},Pt=die(function(It,Ft){var Ct,Zt=X?Ft.selected:!0;Zt?Ct=X?[].concat(_t(U),[It]):[It]:Ct=U.filter(function(wn){return wn.value!==It}),Dt(Ct),bn(It,Zt),n==="combobox"?Ot(""):(!PW||h)&&(De(""),Ot(""))}),qt=function(Ft,Ct){Dt(Ft);var Zt=Ct.type,wn=Ct.values;(Zt==="remove"||Zt==="clear")&&wn.forEach(function(Dn){bn(Dn.value,!1,Zt)})},Nt=function(Ft,Ct){if(De(Ft),Ot(null),Ct.source==="submit"){var Zt=(Ft||"").trim();if(Zt){var wn=Array.from(new Set([].concat(_t(te),[Zt])));Dt(wn),bn(Zt,!0),De("")}return}Ct.source!=="blur"&&(n==="combobox"&&Dt(Ft),d==null||d(Ft))},jt=function(Ft){var Ct=Ft;n!=="tags"&&(Ct=Ft.map(function(wn){var Dn=Oe.get(wn);return Dn==null?void 0:Dn.value}).filter(function(wn){return wn!==void 0}));var Zt=Array.from(new Set([].concat(_t(te),_t(Ct))));Dt(Zt),Zt.forEach(function(wn){bn(wn,!0)})},Gt=x.exports.useMemo(function(){var It=R!==!1&&v!==!1;return Ce(Ce({},ce),{},{flattenOptions:mt,onActiveValue:Gn,defaultActiveFirstOption:cn,onSelect:Pt,menuItemSelectedIcon:k,rawValues:te,fieldNames:pe,virtual:It,direction:A,listHeight:N,listItemHeight:H,childrenAsData:ue,maxCount:K,optionRender:D})},[K,ce,mt,Gn,cn,Pt,k,te,pe,R,v,A,N,H,ue,D]);return x.exports.createElement(aq.Provider,{value:Gt},x.exports.createElement(gHe,yt({},j,{id:G,prefixCls:r,ref:e,omitDomProps:KHe,mode:n,displayValues:oe,onDisplayValuesChange:qt,direction:A,searchValue:Fe,onSearch:Nt,autoClearSearchValue:h,onSearchSplit:jt,dropdownMatchSelectWidth:v,OptionList:PHe,emptyOptions:!mt.length,activeValue:Lt,activeDescendantId:"".concat(G,"_list_").concat(tn)})))}),uq=GHe;uq.Option=cq;uq.OptGroup=lq;function TA(i,e,t){return Ue({[`${i}-status-success`]:e==="success",[`${i}-status-warning`]:e==="warning",[`${i}-status-error`]:e==="error",[`${i}-status-validating`]:e==="validating",[`${i}-has-feedback`]:t})}const hq=(i,e)=>e||i,XHe=()=>{const[,i]=Ba(),t=new na(i.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return x.exports.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},x.exports.createElement("g",{fill:"none",fillRule:"evenodd"},x.exports.createElement("g",{transform:"translate(24 31.67)"},x.exports.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),x.exports.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),x.exports.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),x.exports.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),x.exports.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),x.exports.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),x.exports.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},x.exports.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),x.exports.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))};var YHe=XHe;const ZHe=()=>{const[,i]=Ba(),{colorFill:e,colorFillTertiary:t,colorFillQuaternary:n,colorBgContainer:o}=i,{borderColor:r,shadowColor:s,contentColor:a}=x.exports.useMemo(()=>({borderColor:new na(e).onBackground(o).toHexShortString(),shadowColor:new na(t).onBackground(o).toHexShortString(),contentColor:new na(n).onBackground(o).toHexShortString()}),[e,t,n,o]);return x.exports.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},x.exports.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},x.exports.createElement("ellipse",{fill:s,cx:"32",cy:"33",rx:"32",ry:"7"}),x.exports.createElement("g",{fillRule:"nonzero",stroke:r},x.exports.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),x.exports.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:a}))))};var QHe=ZHe;const JHe=i=>{const{componentCls:e,margin:t,marginXS:n,marginXL:o,fontSize:r,lineHeight:s}=i;return{[e]:{marginInline:n,fontSize:r,lineHeight:s,textAlign:"center",[`${e}-image`]:{height:i.emptyImgHeight,marginBottom:n,opacity:i.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:i.colorText},[`${e}-footer`]:{marginTop:t},"&-normal":{marginBlock:o,color:i.colorTextDisabled,[`${e}-description`]:{color:i.colorTextDisabled},[`${e}-image`]:{height:i.emptyImgHeightMD}},"&-small":{marginBlock:n,color:i.colorTextDisabled,[`${e}-image`]:{height:i.emptyImgHeightSM}}}}};var e$e=jc("Empty",i=>{const{componentCls:e,controlHeightLG:t,calc:n}=i,o=lr(i,{emptyImgCls:`${e}-img`,emptyImgHeight:n(t).mul(2.5).equal(),emptyImgHeightMD:t,emptyImgHeightSM:n(t).mul(.875).equal()});return[JHe(o)]}),t$e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var{className:e,rootClassName:t,prefixCls:n,image:o=Ume,description:r,children:s,imageStyle:a,style:l}=i,c=t$e(i,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:d,direction:u,empty:h}=x.exports.useContext(Hi),f=d("empty",n),[g,p,v]=e$e(f),[m]=EI("Empty"),_=typeof r!="undefined"?r:m==null?void 0:m.description,y=typeof _=="string"?_:"empty";let w=null;return typeof o=="string"?w=x.exports.createElement("img",{alt:y,src:o}):w=o,g(x.exports.createElement("div",Object.assign({className:Ue(p,v,f,h==null?void 0:h.className,{[`${f}-normal`]:o===jme,[`${f}-rtl`]:u==="rtl"},e,t),style:Object.assign(Object.assign({},h==null?void 0:h.style),l)},c),x.exports.createElement("div",{className:`${f}-image`,style:a},w),_&&x.exports.createElement("div",{className:`${f}-description`},_),s&&x.exports.createElement("div",{className:`${f}-footer`},s)))};fq.PRESENTED_IMAGE_DEFAULT=Ume;fq.PRESENTED_IMAGE_SIMPLE=jme;var Dx=fq;const n$e=i=>{const{componentName:e}=i,{getPrefixCls:t}=x.exports.useContext(Hi),n=t("empty");switch(e){case"Table":case"List":return he(Dx,{image:Dx.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return he(Dx,{image:Dx.PRESENTED_IMAGE_SIMPLE,className:`${n}-small`});default:return he(Dx,{})}};var i$e=n$e;const o$e=["outlined","borderless","filled"],r$e=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const t=x.exports.useContext(cme);let n;typeof i!="undefined"?n=i:e===!1?n="borderless":n=t!=null?t:"outlined";const o=o$e.includes(n);return[n,o]};var gq=r$e;const s$e=i=>{const t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:i==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}};function a$e(i,e){return i||s$e(e)}const uie=i=>{const{optionHeight:e,optionFontSize:t,optionLineHeight:n,optionPadding:o}=i;return{position:"relative",display:"block",minHeight:e,padding:o,color:i.colorText,fontWeight:"normal",fontSize:t,lineHeight:n,boxSizing:"border-box"}},l$e=i=>{const{antCls:e,componentCls:t}=i,n=`${t}-item`,o=`&${e}-slide-up-enter${e}-slide-up-enter-active`,r=`&${e}-slide-up-appear${e}-slide-up-appear-active`,s=`&${e}-slide-up-leave${e}-slide-up-leave-active`,a=`${t}-dropdown-placement-`;return[{[`${t}-dropdown`]:Object.assign(Object.assign({},Pa(i)),{position:"absolute",top:-9999,zIndex:i.zIndexPopup,boxSizing:"border-box",padding:i.paddingXXS,overflow:"hidden",fontSize:i.fontSize,fontVariant:"initial",backgroundColor:i.colorBgElevated,borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,[` +`].includes(Kt)})},[B]),wn=x.exports.useContext(lq)||{},Dn=wn.maxCount,Xn=wn.rawValues,jn=function(on,vi,Uo){if(!((Xn==null?void 0:Xn.size)>=Dn)){var Qi=!0,Jo=on;R==null||R(null);var _r=uHe(on,B,Dn&&Dn-Xn.size),zs=Uo?null:_r;return m!=="combobox"&&zs&&(Jo="",H==null||H(zs),Ct(!1),Qi=!1),M&&Ot!==Jo&&M(Jo,{source:vi?"typing":"effect"}),Qi}},Zi=function(on){!on||!on.trim()||M(on,{source:"submit"})};x.exports.useEffect(function(){!Gt&&!Ge&&m!=="combobox"&&jn("",!1,!1)},[Gt]),x.exports.useEffect(function(){Nt&&_&&jt(!1),_&&!je.current&&Je(!1)},[_]);var an=Ame(),Xt=Ne(an,2),oi=Xt[0],Ze=Xt[1],de=function(on){var vi=oi(),Uo=on.which;if(Uo===at.ENTER&&(m!=="combobox"&&on.preventDefault(),Gt||Ct(!0)),Ze(!!Ot),Uo===at.BACKSPACE&&!vi&&Ge&&!Ot&&u.length){for(var Qi=_t(u),Jo=null,_r=Qi.length-1;_r>=0;_r-=1){var zs=Qi[_r];if(!zs.disabled){Qi.splice(_r,1),Jo=zs;break}}Jo&&h(Qi,{type:"remove",values:[Jo]})}for(var Tr=arguments.length,ds=new Array(Tr>1?Tr-1:0),Ts=1;Ts1?vi-1:0),Qi=1;Qi1?_r-1:0),Tr=1;Tr<_r;Tr++)zs[Tr-1]=arguments[Tr];nt==null||nt.apply(void 0,[on].concat(zs))},Qo=x.exports.useState({}),zo=Ne(Qo,2),oc=zo[1];function Yc(){oc({})}var Gr;Et&&(Gr=function(on){Ct(on)}),SVe(function(){var Kt;return[te.current,(Kt=Le.current)===null||Kt===void 0?void 0:Kt.getPopupElement()]},Ft,Ct,!!Et);var Ua=x.exports.useMemo(function(){return Ce(Ce({},i),{},{notFoundContent:p,open:Gt,triggerOpen:Ft,id:o,showSearch:re,multiple:Ge,toggleOpen:Ct})},[i,p,Ft,Gt,o,re,Ge,Ct]),vl=!!$||y,ba;vl&&(ba=x.exports.createElement(M4,{className:Ue("".concat(r,"-arrow"),me({},"".concat(r,"-arrow-loading"),y)),customizeIcon:$,customizeIconProps:{loading:y,searchValue:Ot,open:Gt,focused:At,showSearch:re}}));var _l=function(){var on;v==null||v(),(on=Te.current)===null||on===void 0||on.focus(),h([],{type:"clear",values:u}),jn("",!1,!1)},rc=CVe(r,_l,u,F,z,_,Ot,m),Zc=rc.allowClear,Ca=rc.clearIcon,Yd=x.exports.createElement(K,{ref:We}),bl=Ue(r,s,(n={},me(n,"".concat(r,"-focused"),At),me(n,"".concat(r,"-multiple"),Ge),me(n,"".concat(r,"-single"),!Ge),me(n,"".concat(r,"-allow-clear"),F),me(n,"".concat(r,"-show-arrow"),vl),me(n,"".concat(r,"-disabled"),_),me(n,"".concat(r,"-loading"),y),me(n,"".concat(r,"-open"),Gt),me(n,"".concat(r,"-customize-input"),Vn),me(n,"".concat(r,"-show-search"),re),n)),mi=x.exports.createElement(cHe,{ref:Le,disabled:_,prefixCls:r,visible:Ft,popupElement:Yd,animation:j,transitionName:G,dropdownStyle:X,dropdownClassName:ue,direction:c,dropdownMatchSelectWidth:fe,dropdownRender:pe,dropdownAlign:be,placement:Se,builtinPlacements:Fe,getPopupContainer:De,empty:f,getTriggerDOMNode:function(){return ye.current},onPopupVisibleChange:Gr,onPopupMouseEnter:Yc},Et?x.exports.cloneElement(Et,{ref:tn}):x.exports.createElement(KVe,yt({},i,{domRef:ye,prefixCls:r,inputElement:Vn,ref:Te,id:o,showSearch:re,autoClearSearchValue:N,mode:m,activeDescendantId:A,tagRender:l,values:u,open:Gt,onToggleOpen:Ct,activeValue:k,searchValue:Ot,onSearch:jn,onSearchSubmit:Zi,onRemove:ot,tokenWithEnter:Zt}))),gi;return Et?gi=mi:gi=x.exports.createElement("div",yt({className:bl},ie,{ref:te,onMouseDown:lo,onKeyDown:de,onKeyUp:Ve,onFocus:$n,onBlur:Ci}),At&&!Gt&&x.exports.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(u.map(function(Kt){var on=Kt.label,vi=Kt.value;return["number","string"].includes(qn(on))?on:vi}).join(", "))),mi,ba,Zc&&Ca),x.exports.createElement(Mme.Provider,{value:Ua},gi)}),cq=function(){return null};cq.isSelectOptGroup=!0;var dq=function(){return null};dq.isSelectOption=!0;var $me=x.exports.forwardRef(function(i,e){var t=i.height,n=i.offsetY,o=i.offsetX,r=i.children,s=i.prefixCls,a=i.onInnerResize,l=i.innerProps,c=i.rtl,d=i.extra,u={},h={display:"flex",flexDirection:"column"};if(n!==void 0){var f;u={height:t,position:"relative",overflow:"hidden"},h=Ce(Ce({},h),{},(f={transform:"translateY(".concat(n,"px)")},me(f,c?"marginRight":"marginLeft",-o),me(f,"position","absolute"),me(f,"left",0),me(f,"right",0),me(f,"top",0),f))}return x.exports.createElement("div",{style:u},x.exports.createElement(Mu,{onResize:function(p){var v=p.offsetHeight;v&&a&&a()}},x.exports.createElement("div",yt({style:h,className:Ue(me({},"".concat(s,"-holder-inner"),s)),ref:e},l),r,d)))});$me.displayName="Filler";function rie(i,e){var t="touches"in i?i.touches[0]:i;return t[e?"pageX":"pageY"]}var sie=x.exports.forwardRef(function(i,e){var t,n=i.prefixCls,o=i.rtl,r=i.scrollOffset,s=i.scrollRange,a=i.onStartMove,l=i.onStopMove,c=i.onScroll,d=i.horizontal,u=i.spinSize,h=i.containerSize,f=i.style,g=i.thumbStyle,p=x.exports.useState(!1),v=Ne(p,2),m=v[0],_=v[1],y=x.exports.useState(null),w=Ne(y,2),L=w[0],D=w[1],E=x.exports.useState(null),I=Ne(E,2),k=I[0],R=I[1],A=!o,P=x.exports.useRef(),N=x.exports.useRef(),M=x.exports.useState(!1),H=Ne(M,2),B=H[0],F=H[1],$=x.exports.useRef(),z=function(){clearTimeout($.current),F(!0),$.current=setTimeout(function(){F(!1)},3e3)},K=s-h||0,j=h-u||0,G=K>0,X=x.exports.useMemo(function(){if(r===0||K===0)return 0;var Pe=r/K;return Pe*j},[r,K,j]),ue=function(Oe){Oe.stopPropagation(),Oe.preventDefault()},fe=x.exports.useRef({top:X,dragging:m,pageY:L,startTop:k});fe.current={top:X,dragging:m,pageY:L,startTop:k};var pe=function(Oe){_(!0),D(rie(Oe,d)),R(fe.current.top),a(),Oe.stopPropagation(),Oe.preventDefault()};x.exports.useEffect(function(){var Pe=function(tt){tt.preventDefault()},Oe=P.current,xe=N.current;return Oe.addEventListener("touchstart",Pe),xe.addEventListener("touchstart",pe),function(){Oe.removeEventListener("touchstart",Pe),xe.removeEventListener("touchstart",pe)}},[]);var be=x.exports.useRef();be.current=K;var Se=x.exports.useRef();Se.current=j,x.exports.useEffect(function(){if(m){var Pe,Oe=function(tt){var nt=fe.current,Qe=nt.dragging,Ge=nt.pageY,re=nt.startTop;if(Xi.cancel(Pe),Qe){var ie=rie(tt,d)-Ge,se=re;!A&&d?se-=ie:se+=ie;var U=be.current,Y=Se.current,oe=Y?se/Y:0,te=Math.ceil(oe*U);te=Math.max(te,0),te=Math.min(te,U),Pe=Xi(function(){c(te,d)})}},xe=function(){_(!1),l()};return window.addEventListener("mousemove",Oe),window.addEventListener("touchmove",Oe),window.addEventListener("mouseup",xe),window.addEventListener("touchend",xe),function(){window.removeEventListener("mousemove",Oe),window.removeEventListener("touchmove",Oe),window.removeEventListener("mouseup",xe),window.removeEventListener("touchend",xe),Xi.cancel(Pe)}}},[m]),x.exports.useEffect(function(){z()},[r]),x.exports.useImperativeHandle(e,function(){return{delayHidden:z}});var Fe="".concat(n,"-scrollbar"),De={position:"absolute",visibility:B&&G?null:"hidden"},ce={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return d?(De.height=8,De.left=0,De.right=0,De.bottom=0,ce.height="100%",ce.width=u,A?ce.left=X:ce.right=X):(De.width=8,De.top=0,De.bottom=0,A?De.right=0:De.left=0,ce.width="100%",ce.height=u,ce.top=X),x.exports.createElement("div",{ref:P,className:Ue(Fe,(t={},me(t,"".concat(Fe,"-horizontal"),d),me(t,"".concat(Fe,"-vertical"),!d),me(t,"".concat(Fe,"-visible"),B),t)),style:Ce(Ce({},De),f),onMouseDown:ue,onMouseMove:z},x.exports.createElement("div",{ref:N,className:Ue("".concat(Fe,"-thumb"),me({},"".concat(Fe,"-thumb-moving"),m)),style:Ce(Ce({},ce),g),onMouseDown:pe}))});function pHe(i){var e=i.children,t=i.setRef,n=x.exports.useCallback(function(o){t(o)},[]);return x.exports.cloneElement(e,{ref:n})}function mHe(i,e,t,n,o,r,s){var a=s.getKey;return i.slice(e,t+1).map(function(l,c){var d=e+c,u=r(l,d,{style:{width:n}}),h=a(l);return x.exports.createElement(pHe,{key:h,setRef:function(g){return o(l,g)}},u)})}var vHe=function(){function i(){ga(this,i),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return pa(i,[{key:"set",value:function(t,n){this.maps[t]=n,this.id+=1}},{key:"get",value:function(t){return this.maps[t]}}]),i}();function _He(i,e,t){var n=x.exports.useState(0),o=Ne(n,2),r=o[0],s=o[1],a=x.exports.useRef(new Map),l=x.exports.useRef(new vHe),c=x.exports.useRef();function d(){Xi.cancel(c.current)}function u(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;d();var g=function(){a.current.forEach(function(v,m){if(v&&v.offsetParent){var _=tE(v),y=_.offsetHeight;l.current.get(m)!==y&&l.current.set(m,_.offsetHeight)}}),s(function(v){return v+1})};f?g():c.current=Xi(g)}function h(f,g){var p=i(f),v=a.current.get(p);g?(a.current.set(p,g),u()):a.current.delete(p),!v!=!g&&(g?e==null||e(f):t==null||t(f))}return x.exports.useEffect(function(){return d},[]),[h,u,l.current,r]}var bHe=10;function CHe(i,e,t,n,o,r,s,a){var l=x.exports.useRef(),c=x.exports.useState(null),d=Ne(c,2),u=d[0],h=d[1];return go(function(){if(u&&u.times=0;M-=1){var H=o(e[M]),B=t.get(H);if(B===void 0){_=!0;break}if(N-=B,N<=0)break}switch(L){case"top":w=E-v;break;case"bottom":w=I-m+v;break;default:{var F=i.current.scrollTop,$=F+m;E$&&(y="bottom")}}w!==null&&s(w),w!==u.lastTop&&(_=!0)}_&&h(Ce(Ce({},u),{},{times:u.times+1,targetAlign:y,lastTop:w}))}},[u,i.current]),function(f){if(f==null){a();return}if(Xi.cancel(l.current),typeof f=="number")s(f);else if(f&&qn(f)==="object"){var g,p=f.align;"index"in f?g=f.index:g=e.findIndex(function(_){return o(_)===f.key});var v=f.offset,m=v===void 0?0:v;h({times:0,index:g,offset:m,originAlign:p})}}}function yHe(i,e,t){var n=i.length,o=e.length,r,s;if(n===0&&o===0)return null;n1&&arguments[1]!==void 0?arguments[1]:!1,l=s<0&&r.current.top||s>0&&r.current.bottom;return a&&l?(clearTimeout(n.current),t.current=!1):(!l||t.current)&&o(),!t.current&&l}};function SHe(i,e,t,n,o){var r=x.exports.useRef(0),s=x.exports.useRef(null),a=x.exports.useRef(null),l=x.exports.useRef(!1),c=zme(e,t);function d(v,m){Xi.cancel(s.current),r.current+=m,a.current=m,!c(m)&&(aie||v.preventDefault(),s.current=Xi(function(){var _=l.current?10:1;o(r.current*_),r.current=0}))}function u(v,m){o(m,!0),aie||v.preventDefault()}var h=x.exports.useRef(null),f=x.exports.useRef(null);function g(v){if(!!i){Xi.cancel(f.current),f.current=Xi(function(){h.current=null},2);var m=v.deltaX,_=v.deltaY,y=v.shiftKey,w=m,L=_;(h.current==="sx"||!h.current&&(y||!1)&&_&&!m)&&(w=_,L=0,h.current="sx");var D=Math.abs(w),E=Math.abs(L);h.current===null&&(h.current=n&&D>E?"x":"y"),h.current==="y"?d(v,L):u(v,w)}}function p(v){!i||(l.current=v.detail===a.current)}return[g,p]}var xHe=14/15;function LHe(i,e,t){var n=x.exports.useRef(!1),o=x.exports.useRef(0),r=x.exports.useRef(null),s=x.exports.useRef(null),a,l=function(h){if(n.current){var f=Math.ceil(h.touches[0].pageY),g=o.current-f;o.current=f,t(g)&&h.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){g*=xHe,(!t(g,!0)||Math.abs(g)<=.1)&&clearInterval(s.current)},16)}},c=function(){n.current=!1,a()},d=function(h){a(),h.touches.length===1&&!n.current&&(n.current=!0,o.current=Math.ceil(h.touches[0].pageY),r.current=h.target,r.current.addEventListener("touchmove",l),r.current.addEventListener("touchend",c))};a=function(){r.current&&(r.current.removeEventListener("touchmove",l),r.current.removeEventListener("touchend",c))},go(function(){return i&&e.current.addEventListener("touchstart",d),function(){var u;(u=e.current)===null||u===void 0||u.removeEventListener("touchstart",d),a(),clearInterval(s.current)}},[i])}var EHe=20;function lie(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=i/e*100;return isNaN(t)&&(t=0),t=Math.max(t,EHe),t=Math.min(t,i/2),Math.floor(t)}function DHe(i,e,t,n){var o=x.exports.useMemo(function(){return[new Map,[]]},[i,t.id,n]),r=Ne(o,2),s=r[0],a=r[1],l=function(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,h=s.get(d),f=s.get(u);if(h===void 0||f===void 0)for(var g=i.length,p=a.length;pr||!!p),A=g==="rtl",P=Ue(n,me({},"".concat(n,"-rtl"),A),o),N=d||IHe,M=x.exports.useRef(),H=x.exports.useRef(),B=x.exports.useState(0),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState(0),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useState(!1),fe=Ne(ue,2),pe=fe[0],be=fe[1],Se=function(){be(!0)},Fe=function(){be(!1)},De=x.exports.useCallback(function(Ze){return typeof h=="function"?h(Ze):Ze==null?void 0:Ze[h]},[h]),ce={getKey:De};function Pe(Ze){z(function(de){var Ve;typeof Ze=="function"?Ve=Ze(de):Ve=Ze;var ot=tn(Ve);return M.current.scrollTop=ot,ot})}var Oe=x.exports.useRef({start:0,end:N.length}),xe=x.exports.useRef(),Ee=wHe(N,De),tt=Ne(Ee,1),nt=tt[0];xe.current=nt;var Qe=_He(De,null,null),Ge=Ne(Qe,4),re=Ge[0],ie=Ge[1],se=Ge[2],U=Ge[3],Y=x.exports.useMemo(function(){if(!k)return{scrollHeight:void 0,start:0,end:N.length-1,offset:void 0};if(!R){var Ze;return{scrollHeight:((Ze=H.current)===null||Ze===void 0?void 0:Ze.offsetHeight)||0,start:0,end:N.length-1,offset:void 0}}for(var de=0,Ve,ot,Sn,$n=N.length,Ci=0;Ci<$n;Ci+=1){var An=N[Ci],lo=De(An),Qo=se.get(lo),zo=de+(Qo===void 0?s:Qo);zo>=$&&Ve===void 0&&(Ve=Ci,ot=de),zo>$+r&&Sn===void 0&&(Sn=Ci),de=zo}return Ve===void 0&&(Ve=0,ot=0,Sn=Math.ceil(r/s)),Sn===void 0&&(Sn=N.length-1),Sn=Math.min(Sn+1,N.length-1),{scrollHeight:de,start:Ve,end:Sn,offset:ot}},[R,k,$,N,U,r]),oe=Y.scrollHeight,te=Y.start,ye=Y.end,Le=Y.offset;Oe.current.start=te,Oe.current.end=ye;var Te=x.exports.useState({width:0,height:r}),We=Ne(Te,2),je=We[0],mt=We[1],Dt=function(de){mt({width:de.width||de.offsetWidth,height:de.height||de.offsetHeight})},At=x.exports.useRef(),Je=x.exports.useRef(),Lt=x.exports.useMemo(function(){return lie(je.width,p)},[je.width,p]),Ot=x.exports.useMemo(function(){return lie(je.height,oe)},[je.height,oe]),Vn=oe-r,Et=x.exports.useRef(Vn);Et.current=Vn;function tn(Ze){var de=Ze;return Number.isNaN(Et.current)||(de=Math.min(de,Et.current)),de=Math.max(de,0),de}var di=$<=0,cn=$>=Vn,Gn=zme(di,cn),bn=function(){return{x:A?-G:G,y:$}},Pt=x.exports.useRef(bn()),qt=tl(function(){if(y){var Ze=bn();(Pt.current.x!==Ze.x||Pt.current.y!==Ze.y)&&(y(Ze),Pt.current=Ze)}});function Nt(Ze,de){var Ve=Ze;de?(zu.exports.flushSync(function(){X(Ve)}),qt()):Pe(Ve)}function jt(Ze){var de=Ze.currentTarget.scrollTop;de!==$&&Pe(de),_==null||_(Ze),qt()}var Gt=function(de){var Ve=de,ot=p-je.width;return Ve=Math.max(Ve,0),Ve=Math.min(Ve,ot),Ve},It=tl(function(Ze,de){de?(zu.exports.flushSync(function(){X(function(Ve){var ot=Ve+(A?-Ze:Ze);return Gt(ot)})}),qt()):Pe(function(Ve){var ot=Ve+Ze;return ot})}),Ft=SHe(k,di,cn,!!p,It),Ct=Ne(Ft,2),Zt=Ct[0],wn=Ct[1];LHe(k,M,function(Ze,de){return Gn(Ze,de)?!1:(Zt({preventDefault:function(){},deltaY:Ze}),!0)}),go(function(){function Ze(Ve){k&&Ve.preventDefault()}var de=M.current;return de.addEventListener("wheel",Zt),de.addEventListener("DOMMouseScroll",wn),de.addEventListener("MozMousePixelScroll",Ze),function(){de.removeEventListener("wheel",Zt),de.removeEventListener("DOMMouseScroll",wn),de.removeEventListener("MozMousePixelScroll",Ze)}},[k]),go(function(){p&&X(function(Ze){return Gt(Ze)})},[je.width,p]);var Dn=function(){var de,Ve;(de=At.current)===null||de===void 0||de.delayHidden(),(Ve=Je.current)===null||Ve===void 0||Ve.delayHidden()},Xn=CHe(M,N,se,s,De,function(){return ie(!0)},Pe,Dn);x.exports.useImperativeHandle(e,function(){return{getScrollInfo:bn,scrollTo:function(de){function Ve(ot){return ot&&qn(ot)==="object"&&("left"in ot||"top"in ot)}Ve(de)?(de.left!==void 0&&X(Gt(de.left)),Xn(de.top)):Xn(de)}}}),go(function(){if(w){var Ze=N.slice(te,ye+1);w(Ze,N)}},[te,ye,N]);var jn=DHe(N,De,se,s),Zi=D==null?void 0:D({start:te,end:ye,virtual:R,offsetX:G,offsetY:Le,rtl:A,getSize:jn}),an=mHe(N,te,ye,p,re,u,ce),Xt=null;r&&(Xt=Ce(me({},l?"height":"maxHeight",r),THe),k&&(Xt.overflowY="hidden",p&&(Xt.overflowX="hidden"),pe&&(Xt.pointerEvents="none")));var oi={};return A&&(oi.dir="rtl"),x.exports.createElement("div",yt({style:Ce(Ce({},c),{},{position:"relative"}),className:P},oi,I),x.exports.createElement(Mu,{onResize:Dt},x.exports.createElement(m,{className:"".concat(n,"-holder"),style:Xt,ref:M,onScroll:jt,onMouseEnter:Dn},x.exports.createElement($me,{prefixCls:n,height:oe,offsetX:G,offsetY:Le,scrollWidth:p,onInnerResize:ie,ref:H,innerProps:L,rtl:A,extra:Zi},an))),R&&oe>r&&x.exports.createElement(sie,{ref:At,prefixCls:n,scrollOffset:$,scrollRange:oe,rtl:A,onScroll:Nt,onStartMove:Se,onStopMove:Fe,spinSize:Ot,containerSize:je.height,style:E==null?void 0:E.verticalScrollBar,thumbStyle:E==null?void 0:E.verticalScrollBarThumb}),R&&p&&x.exports.createElement(sie,{ref:Je,prefixCls:n,scrollOffset:G,scrollRange:p,rtl:A,onScroll:Nt,onStartMove:Se,onStopMove:Fe,spinSize:Lt,containerSize:je.width,horizontal:!0,style:E==null?void 0:E.horizontalScrollBar,thumbStyle:E==null?void 0:E.horizontalScrollBarThumb}))}var uq=x.exports.forwardRef(NHe);uq.displayName="List";function RHe(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var MHe=["disabled","title","children","style","className"];function cie(i){return typeof i=="string"||typeof i=="number"}var AHe=function(e,t){var n=yVe(),o=n.prefixCls,r=n.id,s=n.open,a=n.multiple,l=n.mode,c=n.searchValue,d=n.toggleOpen,u=n.notFoundContent,h=n.onPopupScroll,f=x.exports.useContext(lq),g=f.maxCount,p=f.flattenOptions,v=f.onActiveValue,m=f.defaultActiveFirstOption,_=f.onSelect,y=f.menuItemSelectedIcon,w=f.rawValues,L=f.fieldNames,D=f.virtual,E=f.direction,I=f.listHeight,k=f.listItemHeight,R=f.optionRender,A="".concat(o,"-item"),P=LI(function(){return p},[s,p],function(De,ce){return ce[0]&&De[1]!==ce[1]}),N=x.exports.useRef(null),M=x.exports.useMemo(function(){return a&&typeof g!="undefined"&&(w==null?void 0:w.size)>=g},[a,g,w==null?void 0:w.size]),H=function(ce){ce.preventDefault()},B=function(ce){var Pe;(Pe=N.current)===null||Pe===void 0||Pe.scrollTo(typeof ce=="number"?{index:ce}:ce)},F=function(ce){for(var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Oe=P.length,xe=0;xe1&&arguments[1]!==void 0?arguments[1]:!1;j(ce);var Oe={source:Pe?"keyboard":"mouse"},xe=P[ce];if(!xe){v(null,-1,Oe);return}v(xe.value,ce,Oe)};x.exports.useEffect(function(){G(m!==!1?F(0):-1)},[P.length,c]);var X=x.exports.useCallback(function(De){return w.has(De)&&l!=="combobox"},[l,_t(w).toString(),w.size]);x.exports.useEffect(function(){var De=setTimeout(function(){if(!a&&s&&w.size===1){var Pe=Array.from(w)[0],Oe=P.findIndex(function(xe){var Ee=xe.data;return Ee.value===Pe});Oe!==-1&&(G(Oe),B(Oe))}});if(s){var ce;(ce=N.current)===null||ce===void 0||ce.scrollTo(void 0)}return function(){return clearTimeout(De)}},[s,c]);var ue=function(ce){ce!==void 0&&_(ce,{selected:!w.has(ce)}),a||d(!1)};if(x.exports.useImperativeHandle(t,function(){return{onKeyDown:function(ce){var Pe=ce.which,Oe=ce.ctrlKey;switch(Pe){case at.N:case at.P:case at.UP:case at.DOWN:{var xe=0;if(Pe===at.UP?xe=-1:Pe===at.DOWN?xe=1:RHe()&&Oe&&(Pe===at.N?xe=1:Pe===at.P&&(xe=-1)),xe!==0){var Ee=F(K+xe,xe);B(Ee),G(Ee,!0)}break}case at.ENTER:{var tt,nt=P[K];nt&&!(nt!=null&&(tt=nt.data)!==null&&tt!==void 0&&tt.disabled)&&!M?ue(nt.value):ue(void 0),s&&ce.preventDefault();break}case at.ESC:d(!1),s&&ce.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ce){B(ce)}}}),P.length===0)return x.exports.createElement("div",{role:"listbox",id:"".concat(r,"_list"),className:"".concat(A,"-empty"),onMouseDown:H},u);var fe=Object.keys(L).map(function(De){return L[De]}),pe=function(ce){return ce.label};function be(De,ce){var Pe=De.group;return{role:Pe?"presentation":"option",id:"".concat(r,"_list_").concat(ce)}}var Se=function(ce){var Pe=P[ce];if(!Pe)return null;var Oe=Pe.data||{},xe=Oe.value,Ee=Pe.group,tt=K0(Oe,!0),nt=pe(Pe);return Pe?x.exports.createElement("div",yt({"aria-label":typeof nt=="string"&&!Ee?nt:null},tt,{key:ce},be(Pe,ce),{"aria-selected":X(xe)}),xe):null},Fe={role:"listbox",id:"".concat(r,"_list")};return x.exports.createElement(x.exports.Fragment,null,D&&x.exports.createElement("div",yt({},Fe,{style:{height:0,width:0,overflow:"hidden"}}),Se(K-1),Se(K),Se(K+1)),x.exports.createElement(uq,{itemKey:"key",ref:N,data:P,height:I,itemHeight:k,fullHeight:!1,onMouseDown:H,onScroll:h,virtual:D,direction:E,innerProps:D?null:Fe},function(De,ce){var Pe,Oe=De.group,xe=De.groupOption,Ee=De.data,tt=De.label,nt=De.value,Qe=Ee.key;if(Oe){var Ge,re=(Ge=Ee.title)!==null&&Ge!==void 0?Ge:cie(tt)?tt.toString():void 0;return x.exports.createElement("div",{className:Ue(A,"".concat(A,"-group")),title:re},tt!==void 0?tt:Qe)}var ie=Ee.disabled,se=Ee.title;Ee.children;var U=Ee.style,Y=Ee.className,oe=Hn(Ee,MHe),te=kf(oe,fe),ye=X(nt),Le=ie||!ye&&M,Te="".concat(A,"-option"),We=Ue(A,Te,Y,(Pe={},me(Pe,"".concat(Te,"-grouped"),xe),me(Pe,"".concat(Te,"-active"),K===ce&&!Le),me(Pe,"".concat(Te,"-disabled"),Le),me(Pe,"".concat(Te,"-selected"),ye),Pe)),je=pe(De),mt=!y||typeof y=="function"||ye,Dt=typeof je=="number"?je:je||nt,At=cie(Dt)?Dt.toString():void 0;return se!==void 0&&(At=se),x.exports.createElement("div",yt({},K0(te),D?{}:be(De,ce),{"aria-selected":ye,className:We,title:At,onMouseMove:function(){K===ce||Le||G(ce)},onClick:function(){Le||ue(nt)},style:U}),x.exports.createElement("div",{className:"".concat(Te,"-content")},typeof R=="function"?R(De,{index:ce}):Dt),x.exports.isValidElement(y)||ye,mt&&x.exports.createElement(M4,{className:"".concat(A,"-option-state"),customizeIcon:y,customizeIconProps:{value:nt,disabled:Le,isSelected:ye}},ye?"\u2713":null))}))},PHe=x.exports.forwardRef(AHe),OHe=function(i,e){var t=x.exports.useRef({values:new Map,options:new Map}),n=x.exports.useMemo(function(){var r=t.current,s=r.values,a=r.options,l=i.map(function(u){if(u.label===void 0){var h;return Ce(Ce({},u),{},{label:(h=s.get(u.value))===null||h===void 0?void 0:h.label})}return u}),c=new Map,d=new Map;return l.forEach(function(u){c.set(u.value,u),d.set(u.value,e.get(u.value)||a.get(u.value))}),t.current.values=c,t.current.options=d,l},[i,e]),o=x.exports.useCallback(function(r){return e.get(r)||t.current.options.get(r)},[e]);return[n,o]};function m6(i,e){return Wme(i).join("").toUpperCase().includes(e)}var FHe=function(i,e,t,n,o){return x.exports.useMemo(function(){if(!t||n===!1)return i;var r=e.options,s=e.label,a=e.value,l=[],c=typeof n=="function",d=t.toUpperCase(),u=c?n:function(f,g){return o?m6(g[o],d):g[r]?m6(g[s!=="children"?s:"label"],d):m6(g[a],d)},h=c?function(f){return PW(f)}:function(f){return f};return i.forEach(function(f){if(f[r]){var g=u(t,h(f));if(g)l.push(f);else{var p=f[r].filter(function(v){return u(t,h(v))});p.length&&l.push(Ce(Ce({},f),{},me({},r,p)))}return}u(t,h(f))&&l.push(f)}),l},[i,n,o,t,e])},die=0,BHe=Fa();function WHe(){var i;return BHe?(i=die,die+=1):i="TEST_OR_SSR",i}function VHe(i){var e=x.exports.useState(),t=Ne(e,2),n=t[0],o=t[1];return x.exports.useEffect(function(){o("rc_select_".concat(WHe()))},[]),i||n}var HHe=["children","value"],$He=["children"];function zHe(i){var e=i,t=e.key,n=e.props,o=n.children,r=n.value,s=Hn(n,HHe);return Ce({key:t,value:r!==void 0?r:t,children:o},s)}function Ume(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return op(i).map(function(t,n){if(!x.exports.isValidElement(t)||!t.type)return null;var o=t,r=o.type.isSelectOptGroup,s=o.key,a=o.props,l=a.children,c=Hn(a,$He);return e||!r?zHe(t):Ce(Ce({key:"__RC_SELECT_GRP__".concat(s===null?n:s,"__"),label:s},c),{},{options:Ume(l)})}).filter(function(t){return t})}var UHe=function(e,t,n,o,r){return x.exports.useMemo(function(){var s=e,a=!e;a&&(s=Ume(t));var l=new Map,c=new Map,d=function(f,g,p){p&&typeof p=="string"&&f.set(g[p],g)},u=function h(f){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p=0;p2&&arguments[2]!==void 0?arguments[2]:{},Zt=Ct.source,wn=Zt===void 0?"keyboard":Zt;di(Ft),s&&n==="combobox"&&It!==null&&wn==="keyboard"&&Ot(String(It))},[s,n]),bn=function(Ft,Ct,Zt){var wn=function(){var Ve,ot=Y(Ft);return[$?{label:ot==null?void 0:ot[pe.label],value:Ft,key:(Ve=ot==null?void 0:ot.key)!==null&&Ve!==void 0?Ve:Ft}:Ft,PW(ot)]};if(Ct&&f){var Dn=wn(),Xn=Ne(Dn,2),jn=Xn[0],Zi=Xn[1];f(jn,Zi)}else if(!Ct&&g&&Zt!=="clear"){var an=wn(),Xt=Ne(an,2),oi=Xt[0],Ze=Xt[1];g(oi,Ze)}},Pt=uie(function(It,Ft){var Ct,Zt=X?Ft.selected:!0;Zt?Ct=X?[].concat(_t(U),[It]):[It]:Ct=U.filter(function(wn){return wn.value!==It}),Dt(Ct),bn(It,Zt),n==="combobox"?Ot(""):(!OW||h)&&(De(""),Ot(""))}),qt=function(Ft,Ct){Dt(Ft);var Zt=Ct.type,wn=Ct.values;(Zt==="remove"||Zt==="clear")&&wn.forEach(function(Dn){bn(Dn.value,!1,Zt)})},Nt=function(Ft,Ct){if(De(Ft),Ot(null),Ct.source==="submit"){var Zt=(Ft||"").trim();if(Zt){var wn=Array.from(new Set([].concat(_t(te),[Zt])));Dt(wn),bn(Zt,!0),De("")}return}Ct.source!=="blur"&&(n==="combobox"&&Dt(Ft),d==null||d(Ft))},jt=function(Ft){var Ct=Ft;n!=="tags"&&(Ct=Ft.map(function(wn){var Dn=Oe.get(wn);return Dn==null?void 0:Dn.value}).filter(function(wn){return wn!==void 0}));var Zt=Array.from(new Set([].concat(_t(te),_t(Ct))));Dt(Zt),Zt.forEach(function(wn){bn(wn,!0)})},Gt=x.exports.useMemo(function(){var It=R!==!1&&v!==!1;return Ce(Ce({},ce),{},{flattenOptions:mt,onActiveValue:Gn,defaultActiveFirstOption:cn,onSelect:Pt,menuItemSelectedIcon:k,rawValues:te,fieldNames:pe,virtual:It,direction:A,listHeight:N,listItemHeight:H,childrenAsData:ue,maxCount:K,optionRender:D})},[K,ce,mt,Gn,cn,Pt,k,te,pe,R,v,A,N,H,ue,D]);return x.exports.createElement(lq.Provider,{value:Gt},x.exports.createElement(gHe,yt({},j,{id:G,prefixCls:r,ref:e,omitDomProps:KHe,mode:n,displayValues:oe,onDisplayValuesChange:qt,direction:A,searchValue:Fe,onSearch:Nt,autoClearSearchValue:h,onSearchSplit:jt,dropdownMatchSelectWidth:v,OptionList:PHe,emptyOptions:!mt.length,activeValue:Lt,activeDescendantId:"".concat(G,"_list_").concat(tn)})))}),hq=GHe;hq.Option=dq;hq.OptGroup=cq;function TA(i,e,t){return Ue({[`${i}-status-success`]:e==="success",[`${i}-status-warning`]:e==="warning",[`${i}-status-error`]:e==="error",[`${i}-status-validating`]:e==="validating",[`${i}-has-feedback`]:t})}const fq=(i,e)=>e||i,XHe=()=>{const[,i]=Ba(),t=new na(i.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return x.exports.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},x.exports.createElement("g",{fill:"none",fillRule:"evenodd"},x.exports.createElement("g",{transform:"translate(24 31.67)"},x.exports.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),x.exports.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),x.exports.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),x.exports.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),x.exports.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),x.exports.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),x.exports.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},x.exports.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),x.exports.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))};var YHe=XHe;const ZHe=()=>{const[,i]=Ba(),{colorFill:e,colorFillTertiary:t,colorFillQuaternary:n,colorBgContainer:o}=i,{borderColor:r,shadowColor:s,contentColor:a}=x.exports.useMemo(()=>({borderColor:new na(e).onBackground(o).toHexShortString(),shadowColor:new na(t).onBackground(o).toHexShortString(),contentColor:new na(n).onBackground(o).toHexShortString()}),[e,t,n,o]);return x.exports.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},x.exports.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},x.exports.createElement("ellipse",{fill:s,cx:"32",cy:"33",rx:"32",ry:"7"}),x.exports.createElement("g",{fillRule:"nonzero",stroke:r},x.exports.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),x.exports.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:a}))))};var QHe=ZHe;const JHe=i=>{const{componentCls:e,margin:t,marginXS:n,marginXL:o,fontSize:r,lineHeight:s}=i;return{[e]:{marginInline:n,fontSize:r,lineHeight:s,textAlign:"center",[`${e}-image`]:{height:i.emptyImgHeight,marginBottom:n,opacity:i.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:i.colorText},[`${e}-footer`]:{marginTop:t},"&-normal":{marginBlock:o,color:i.colorTextDisabled,[`${e}-description`]:{color:i.colorTextDisabled},[`${e}-image`]:{height:i.emptyImgHeightMD}},"&-small":{marginBlock:n,color:i.colorTextDisabled,[`${e}-image`]:{height:i.emptyImgHeightSM}}}}};var e$e=jc("Empty",i=>{const{componentCls:e,controlHeightLG:t,calc:n}=i,o=lr(i,{emptyImgCls:`${e}-img`,emptyImgHeight:n(t).mul(2.5).equal(),emptyImgHeightMD:t,emptyImgHeightSM:n(t).mul(.875).equal()});return[JHe(o)]}),t$e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var{className:e,rootClassName:t,prefixCls:n,image:o=jme,description:r,children:s,imageStyle:a,style:l}=i,c=t$e(i,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:d,direction:u,empty:h}=x.exports.useContext(Hi),f=d("empty",n),[g,p,v]=e$e(f),[m]=EI("Empty"),_=typeof r!="undefined"?r:m==null?void 0:m.description,y=typeof _=="string"?_:"empty";let w=null;return typeof o=="string"?w=x.exports.createElement("img",{alt:y,src:o}):w=o,g(x.exports.createElement("div",Object.assign({className:Ue(p,v,f,h==null?void 0:h.className,{[`${f}-normal`]:o===Kme,[`${f}-rtl`]:u==="rtl"},e,t),style:Object.assign(Object.assign({},h==null?void 0:h.style),l)},c),x.exports.createElement("div",{className:`${f}-image`,style:a},w),_&&x.exports.createElement("div",{className:`${f}-description`},_),s&&x.exports.createElement("div",{className:`${f}-footer`},s)))};gq.PRESENTED_IMAGE_DEFAULT=jme;gq.PRESENTED_IMAGE_SIMPLE=Kme;var Dx=gq;const n$e=i=>{const{componentName:e}=i,{getPrefixCls:t}=x.exports.useContext(Hi),n=t("empty");switch(e){case"Table":case"List":return he(Dx,{image:Dx.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return he(Dx,{image:Dx.PRESENTED_IMAGE_SIMPLE,className:`${n}-small`});default:return he(Dx,{})}};var i$e=n$e;const o$e=["outlined","borderless","filled"],r$e=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const t=x.exports.useContext(dme);let n;typeof i!="undefined"?n=i:e===!1?n="borderless":n=t!=null?t:"outlined";const o=o$e.includes(n);return[n,o]};var pq=r$e;const s$e=i=>{const t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:i==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}};function a$e(i,e){return i||s$e(e)}const hie=i=>{const{optionHeight:e,optionFontSize:t,optionLineHeight:n,optionPadding:o}=i;return{position:"relative",display:"block",minHeight:e,padding:o,color:i.colorText,fontWeight:"normal",fontSize:t,lineHeight:n,boxSizing:"border-box"}},l$e=i=>{const{antCls:e,componentCls:t}=i,n=`${t}-item`,o=`&${e}-slide-up-enter${e}-slide-up-enter-active`,r=`&${e}-slide-up-appear${e}-slide-up-appear-active`,s=`&${e}-slide-up-leave${e}-slide-up-leave-active`,a=`${t}-dropdown-placement-`;return[{[`${t}-dropdown`]:Object.assign(Object.assign({},Pa(i)),{position:"absolute",top:-9999,zIndex:i.zIndexPopup,boxSizing:"border-box",padding:i.paddingXXS,overflow:"hidden",fontSize:i.fontSize,fontVariant:"initial",backgroundColor:i.colorBgElevated,borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,[` ${o}${a}bottomLeft, ${r}${a}bottomLeft - `]:{animationName:hme},[` + `]:{animationName:fme},[` ${o}${a}topLeft, ${r}${a}topLeft, ${o}${a}topRight, ${r}${a}topRight - `]:{animationName:gme},[`${s}${a}bottomLeft`]:{animationName:fme},[` + `]:{animationName:pme},[`${s}${a}bottomLeft`]:{animationName:gme},[` ${s}${a}topLeft, ${s}${a}topRight - `]:{animationName:pme},"&-hidden":{display:"none"},[`${n}`]:Object.assign(Object.assign({},uie(i)),{cursor:"pointer",transition:`background ${i.motionDurationSlow} ease`,borderRadius:i.borderRadiusSM,"&-group":{color:i.colorTextDescription,fontSize:i.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},wA),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:i.optionActiveBg},[`&-selected:not(${n}-option-disabled)`]:{color:i.optionSelectedColor,fontWeight:i.optionSelectedFontWeight,backgroundColor:i.optionSelectedBg,[`${n}-option-state`]:{color:i.colorPrimary},[`&:has(+ ${n}-option-selected:not(${n}-option-disabled))`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${n}-option-selected:not(${n}-option-disabled)`]:{borderStartStartRadius:0,borderStartEndRadius:0}}},"&-disabled":{[`&${n}-option-selected`]:{backgroundColor:i.colorBgContainerDisabled},color:i.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:i.calc(i.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},uie(i)),{color:i.colorTextDisabled})}),"&-rtl":{direction:"rtl"}})},kA(i,"slide-up"),kA(i,"slide-down"),zne(i,"move-up"),zne(i,"move-down")]};var c$e=l$e;const R1=2,d$e=i=>{const{multipleSelectItemHeight:e,selectHeight:t,lineWidth:n}=i;return i.calc(t).sub(e).div(2).sub(n).equal()};function m6(i,e){const{componentCls:t,iconCls:n}=i,o=`${t}-selection-overflow`,r=i.multipleSelectItemHeight,s=d$e(i),a=e?`${t}-${e}`:"";return{[`${t}-multiple${a}`]:{fontSize:i.fontSize,[o]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${t}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",height:"100%",paddingInline:i.calc(R1).mul(2).equal(),paddingBlock:i.calc(s).sub(R1).equal(),borderRadius:i.borderRadius,[`${t}-show-search&`]:{cursor:"text"},[`${t}-disabled&`]:{background:i.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${rt(R1)} 0`,lineHeight:rt(r),visibility:"hidden",content:'"\\a0"'}},[` + `]:{animationName:mme},"&-hidden":{display:"none"},[`${n}`]:Object.assign(Object.assign({},hie(i)),{cursor:"pointer",transition:`background ${i.motionDurationSlow} ease`,borderRadius:i.borderRadiusSM,"&-group":{color:i.colorTextDescription,fontSize:i.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},wA),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:i.optionActiveBg},[`&-selected:not(${n}-option-disabled)`]:{color:i.optionSelectedColor,fontWeight:i.optionSelectedFontWeight,backgroundColor:i.optionSelectedBg,[`${n}-option-state`]:{color:i.colorPrimary},[`&:has(+ ${n}-option-selected:not(${n}-option-disabled))`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${n}-option-selected:not(${n}-option-disabled)`]:{borderStartStartRadius:0,borderStartEndRadius:0}}},"&-disabled":{[`&${n}-option-selected`]:{backgroundColor:i.colorBgContainerDisabled},color:i.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:i.calc(i.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},hie(i)),{color:i.colorTextDisabled})}),"&-rtl":{direction:"rtl"}})},kA(i,"slide-up"),kA(i,"slide-down"),Une(i,"move-up"),Une(i,"move-down")]};var c$e=l$e;const R1=2,d$e=i=>{const{multipleSelectItemHeight:e,selectHeight:t,lineWidth:n}=i;return i.calc(t).sub(e).div(2).sub(n).equal()};function v6(i,e){const{componentCls:t,iconCls:n}=i,o=`${t}-selection-overflow`,r=i.multipleSelectItemHeight,s=d$e(i),a=e?`${t}-${e}`:"";return{[`${t}-multiple${a}`]:{fontSize:i.fontSize,[o]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${t}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",height:"100%",paddingInline:i.calc(R1).mul(2).equal(),paddingBlock:i.calc(s).sub(R1).equal(),borderRadius:i.borderRadius,[`${t}-show-search&`]:{cursor:"text"},[`${t}-disabled&`]:{background:i.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${rt(R1)} 0`,lineHeight:rt(r),visibility:"hidden",content:'"\\a0"'}},[` &${t}-show-arrow ${t}-selector, &${t}-allow-clear ${t}-selector - `]:{paddingInlineEnd:i.calc(i.fontSizeIcon).add(i.controlPaddingHorizontal).equal()},[`${t}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:r,marginTop:R1,marginBottom:R1,lineHeight:rt(i.calc(r).sub(i.calc(i.lineWidth).mul(2)).equal()),borderRadius:i.borderRadiusSM,cursor:"default",transition:`font-size ${i.motionDurationSlow}, line-height ${i.motionDurationSlow}, height ${i.motionDurationSlow}`,marginInlineEnd:i.calc(R1).mul(2).equal(),paddingInlineStart:i.paddingXS,paddingInlineEnd:i.calc(i.paddingXS).div(2).equal(),[`${t}-disabled&`]:{color:i.multipleItemColorDisabled,borderColor:i.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:i.calc(i.paddingXS).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},OK()),{display:"inline-flex",alignItems:"center",color:i.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:i.colorIconHover}})},[`${o}-item + ${o}-item`]:{[`${t}-selection-search`]:{marginInlineStart:0}},[`${o}-item-suffix`]:{height:"100%"},[`${t}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:i.calc(i.inputPaddingHorizontalBase).sub(s).equal(),[` + `]:{paddingInlineEnd:i.calc(i.fontSizeIcon).add(i.controlPaddingHorizontal).equal()},[`${t}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:r,marginTop:R1,marginBottom:R1,lineHeight:rt(i.calc(r).sub(i.calc(i.lineWidth).mul(2)).equal()),borderRadius:i.borderRadiusSM,cursor:"default",transition:`font-size ${i.motionDurationSlow}, line-height ${i.motionDurationSlow}, height ${i.motionDurationSlow}`,marginInlineEnd:i.calc(R1).mul(2).equal(),paddingInlineStart:i.paddingXS,paddingInlineEnd:i.calc(i.paddingXS).div(2).equal(),[`${t}-disabled&`]:{color:i.multipleItemColorDisabled,borderColor:i.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:i.calc(i.paddingXS).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},FK()),{display:"inline-flex",alignItems:"center",color:i.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:i.colorIconHover}})},[`${o}-item + ${o}-item`]:{[`${t}-selection-search`]:{marginInlineStart:0}},[`${o}-item-suffix`]:{height:"100%"},[`${t}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:i.calc(i.inputPaddingHorizontalBase).sub(s).equal(),[` &-input, &-mirror - `]:{height:r,fontFamily:i.fontFamily,lineHeight:rt(r),transition:`all ${i.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${t}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:i.inputPaddingHorizontalBase,insetInlineEnd:i.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${i.motionDurationSlow}`}}}}const u$e=i=>{const{componentCls:e}=i,t=lr(i,{selectHeight:i.controlHeightSM,multipleSelectItemHeight:i.controlHeightXS,borderRadius:i.borderRadiusSM,borderRadiusSM:i.borderRadiusXS}),n=lr(i,{fontSize:i.fontSizeLG,selectHeight:i.controlHeightLG,multipleSelectItemHeight:i.multipleItemHeightLG,borderRadius:i.borderRadiusLG,borderRadiusSM:i.borderRadius});return[m6(i),m6(t,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}-selection-placeholder`]:{insetInline:i.calc(i.controlPaddingHorizontalSM).sub(i.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},m6(n,"lg")]};var h$e=u$e;function v6(i,e){const{componentCls:t,inputPaddingHorizontalBase:n,borderRadius:o}=i,r=i.calc(i.controlHeight).sub(i.calc(i.lineWidth).mul(2)).equal(),s=e?`${t}-${e}`:"";return{[`${t}-single${s}`]:{fontSize:i.fontSize,height:i.controlHeight,[`${t}-selector`]:Object.assign(Object.assign({},Pa(i,!0)),{display:"flex",borderRadius:o,[`${t}-selection-search`]:{position:"absolute",top:0,insetInlineStart:n,insetInlineEnd:n,bottom:0,"&-input":{width:"100%",WebkitAppearance:"textfield"}},[` + `]:{height:r,fontFamily:i.fontFamily,lineHeight:rt(r),transition:`all ${i.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${t}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:i.inputPaddingHorizontalBase,insetInlineEnd:i.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${i.motionDurationSlow}`}}}}const u$e=i=>{const{componentCls:e}=i,t=lr(i,{selectHeight:i.controlHeightSM,multipleSelectItemHeight:i.controlHeightXS,borderRadius:i.borderRadiusSM,borderRadiusSM:i.borderRadiusXS}),n=lr(i,{fontSize:i.fontSizeLG,selectHeight:i.controlHeightLG,multipleSelectItemHeight:i.multipleItemHeightLG,borderRadius:i.borderRadiusLG,borderRadiusSM:i.borderRadius});return[v6(i),v6(t,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}-selection-placeholder`]:{insetInline:i.calc(i.controlPaddingHorizontalSM).sub(i.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},v6(n,"lg")]};var h$e=u$e;function _6(i,e){const{componentCls:t,inputPaddingHorizontalBase:n,borderRadius:o}=i,r=i.calc(i.controlHeight).sub(i.calc(i.lineWidth).mul(2)).equal(),s=e?`${t}-${e}`:"";return{[`${t}-single${s}`]:{fontSize:i.fontSize,height:i.controlHeight,[`${t}-selector`]:Object.assign(Object.assign({},Pa(i,!0)),{display:"flex",borderRadius:o,[`${t}-selection-search`]:{position:"absolute",top:0,insetInlineStart:n,insetInlineEnd:n,bottom:0,"&-input":{width:"100%",WebkitAppearance:"textfield"}},[` ${t}-selection-item, ${t}-selection-placeholder `]:{padding:0,lineHeight:rt(r),transition:`all ${i.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${t}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${t}-selection-item:empty:after`,`${t}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[` &${t}-show-arrow ${t}-selection-item, &${t}-show-arrow ${t}-selection-placeholder - `]:{paddingInlineEnd:i.showArrowPaddingInlineEnd},[`&${t}-open ${t}-selection-item`]:{color:i.colorTextPlaceholder},[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{width:"100%",height:"100%",padding:`0 ${rt(n)}`,[`${t}-selection-search-input`]:{height:r},"&:after":{lineHeight:rt(r)}}},[`&${t}-customize-input`]:{[`${t}-selector`]:{"&:after":{display:"none"},[`${t}-selection-search`]:{position:"static",width:"100%"},[`${t}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${rt(n)}`,"&:after":{display:"none"}}}}}}}function f$e(i){const{componentCls:e}=i,t=i.calc(i.controlPaddingHorizontalSM).sub(i.lineWidth).equal();return[v6(i),v6(lr(i,{controlHeight:i.controlHeightSM,borderRadius:i.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selection-search`]:{insetInlineStart:t,insetInlineEnd:t},[`${e}-selector`]:{padding:`0 ${rt(t)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:i.calc(t).add(i.calc(i.fontSize).mul(1.5)).equal()},[` + `]:{paddingInlineEnd:i.showArrowPaddingInlineEnd},[`&${t}-open ${t}-selection-item`]:{color:i.colorTextPlaceholder},[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{width:"100%",height:"100%",padding:`0 ${rt(n)}`,[`${t}-selection-search-input`]:{height:r},"&:after":{lineHeight:rt(r)}}},[`&${t}-customize-input`]:{[`${t}-selector`]:{"&:after":{display:"none"},[`${t}-selection-search`]:{position:"static",width:"100%"},[`${t}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${rt(n)}`,"&:after":{display:"none"}}}}}}}function f$e(i){const{componentCls:e}=i,t=i.calc(i.controlPaddingHorizontalSM).sub(i.lineWidth).equal();return[_6(i),_6(lr(i,{controlHeight:i.controlHeightSM,borderRadius:i.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selection-search`]:{insetInlineStart:t,insetInlineEnd:t},[`${e}-selector`]:{padding:`0 ${rt(t)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:i.calc(t).add(i.calc(i.fontSize).mul(1.5)).equal()},[` &${e}-show-arrow ${e}-selection-item, &${e}-show-arrow ${e}-selection-placeholder - `]:{paddingInlineEnd:i.calc(i.fontSize).mul(1.5).equal()}}}},v6(lr(i,{controlHeight:i.singleItemHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG}),"lg")]}const g$e=i=>{const{fontSize:e,lineHeight:t,controlHeight:n,controlPaddingHorizontal:o,zIndexPopupBase:r,colorText:s,fontWeightStrong:a,controlItemBgActive:l,controlItemBgHover:c,colorBgContainer:d,colorFillSecondary:u,controlHeightLG:h,controlHeightSM:f,colorBgContainerDisabled:g,colorTextDisabled:p}=i;return{zIndexPopup:r+50,optionSelectedColor:s,optionSelectedFontWeight:a,optionSelectedBg:l,optionActiveBg:c,optionPadding:`${(n-e*t)/2}px ${o}px`,optionFontSize:e,optionLineHeight:t,optionHeight:n,selectorBg:d,clearBg:d,singleItemHeightLG:h,multipleItemBg:u,multipleItemBorderColor:"transparent",multipleItemHeight:f,multipleItemHeightLG:n,multipleSelectorBgDisabled:g,multipleItemColorDisabled:p,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(i.fontSize*1.25)}},Kme=(i,e)=>{const{componentCls:t,antCls:n,controlOutlineWidth:o}=i;return{[`&:not(${t}-customize-input) ${t}-selector`]:{border:`${rt(i.lineWidth)} ${i.lineType} ${e.borderColor}`,background:i.selectorBg},[`&:not(${t}-disabled):not(${t}-customize-input):not(${n}-pagination-size-changer)`]:{[`&:hover ${t}-selector`]:{borderColor:e.hoverBorderHover},[`${t}-focused& ${t}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${rt(o)} ${e.activeShadowColor}`,outline:0}}}},hie=(i,e)=>({[`&${i.componentCls}-status-${e.status}`]:Object.assign({},Kme(i,e))}),p$e=i=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Kme(i,{borderColor:i.colorBorder,hoverBorderHover:i.colorPrimaryHover,activeBorderColor:i.colorPrimary,activeShadowColor:i.controlOutline})),hie(i,{status:"error",borderColor:i.colorError,hoverBorderHover:i.colorErrorHover,activeBorderColor:i.colorError,activeShadowColor:i.colorErrorOutline})),hie(i,{status:"warning",borderColor:i.colorWarning,hoverBorderHover:i.colorWarningHover,activeBorderColor:i.colorWarning,activeShadowColor:i.colorWarningOutline})),{[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{background:i.colorBgContainerDisabled,color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.multipleItemBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.multipleItemBorderColor}`}})}),qme=(i,e)=>{const{componentCls:t,antCls:n}=i;return{[`&:not(${t}-customize-input) ${t}-selector`]:{background:e.bg,border:`${rt(i.lineWidth)} ${i.lineType} transparent`,color:e.color},[`&:not(${t}-disabled):not(${t}-customize-input):not(${n}-pagination-size-changer)`]:{[`&:hover ${t}-selector`]:{background:e.hoverBg},[`${t}-focused& ${t}-selector`]:{background:i.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},fie=(i,e)=>({[`&${i.componentCls}-status-${e.status}`]:Object.assign({},qme(i,e))}),m$e=i=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},qme(i,{bg:i.colorFillTertiary,hoverBg:i.colorFillSecondary,activeBorderColor:i.colorPrimary,color:i.colorText})),fie(i,{status:"error",bg:i.colorErrorBg,hoverBg:i.colorErrorBgHover,activeBorderColor:i.colorError,color:i.colorError})),fie(i,{status:"warning",bg:i.colorWarningBg,hoverBg:i.colorWarningBgHover,activeBorderColor:i.colorWarning,color:i.colorWarning})),{[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{borderColor:i.colorBorder,background:i.colorBgContainerDisabled,color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.colorBgContainer,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`}})}),v$e=i=>({"&-borderless":{[`${i.componentCls}-selector`]:{background:"transparent",borderColor:"transparent"},[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.multipleItemBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.multipleItemBorderColor}`}}}),_$e=i=>({[i.componentCls]:Object.assign(Object.assign(Object.assign({},p$e(i)),m$e(i)),v$e(i))});var b$e=_$e;const C$e=i=>{const{componentCls:e}=i;return{position:"relative",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},y$e=i=>{const{componentCls:e}=i;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},w$e=i=>{const{antCls:e,componentCls:t,inputPaddingHorizontalBase:n,iconCls:o}=i;return{[t]:Object.assign(Object.assign({},Pa(i)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${t}-customize-input) ${t}-selector`]:Object.assign(Object.assign({},C$e(i)),y$e(i)),[`${t}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},wA),{[`> ${e}-typography`]:{display:"inline"}}),[`${t}-selection-placeholder`]:Object.assign(Object.assign({},wA),{flex:1,color:i.colorTextPlaceholder,pointerEvents:"none"}),[`${t}-arrow`]:Object.assign(Object.assign({},OK()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,height:i.fontSizeIcon,marginTop:i.calc(i.fontSizeIcon).mul(-1).div(2).equal(),color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${i.motionDurationSlow} ease`,[o]:{verticalAlign:"top",transition:`transform ${i.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${t}-suffix)`]:{pointerEvents:"auto"}},[`${t}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${t}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,zIndex:1,display:"inline-block",width:i.fontSizeIcon,height:i.fontSizeIcon,marginTop:i.calc(i.fontSizeIcon).mul(-1).div(2).equal(),color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${i.motionDurationMid} ease, opacity ${i.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:i.colorTextTertiary}},"&:hover":{[`${t}-clear`]:{opacity:1},[`${t}-arrow:not(:last-child)`]:{opacity:0}}}),[`${t}-has-feedback`]:{[`${t}-clear`]:{insetInlineEnd:i.calc(n).add(i.fontSize).add(i.paddingXS).equal()}}}},S$e=i=>{const{componentCls:e}=i;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},w$e(i),f$e(i),h$e(i),c$e(i),{[`${e}-rtl`]:{direction:"rtl"}},QK(i,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]};var x$e=jc("Select",(i,e)=>{let{rootPrefixCls:t}=e;const n=lr(i,{rootPrefixCls:t,inputPaddingHorizontalBase:i.calc(i.paddingSM).sub(1).equal(),multipleSelectItemHeight:i.multipleItemHeight,selectHeight:i.controlHeight});return[S$e(n),b$e(n)]},g$e,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),L$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},E$e=L$e,D$e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:E$e}))},k$e=x.exports.forwardRef(D$e),I$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},T$e=I$e,N$e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:T$e}))},R$e=x.exports.forwardRef(N$e),M$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},A$e=M$e,P$e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:A$e}))},Gme=x.exports.forwardRef(P$e);function O$e(i){let{suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:o,loading:r,multiple:s,hasFeedback:a,prefixCls:l,showSuffixIcon:c,feedbackIcon:d,showArrow:u,componentName:h}=i;const f=t!=null?t:x.exports.createElement(uS,null),g=_=>e===null&&!a&&!u?null:x.exports.createElement(x.exports.Fragment,null,c!==!1&&_,a&&d);let p=null;if(e!==void 0)p=g(e);else if(r)p=g(x.exports.createElement(kI,{spin:!0}));else{const _=`${l}-suffix`;p=y=>{let{open:w,showSearch:L}=y;return g(w&&L?x.exports.createElement(Gme,{className:_}):x.exports.createElement(R$e,{className:_}))}}let v=null;n!==void 0?v=n:s?v=x.exports.createElement(k$e,null):v=null;let m=null;return o!==void 0?m=o:m=x.exports.createElement(hS,null),{clearIcon:f,suffixIcon:p,itemIcon:v,removeIcon:m}}function F$e(i,e){return e!==void 0?e:i!==null}var B$e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o,className:r,rootClassName:s,getPopupContainer:a,popupClassName:l,dropdownClassName:c,listHeight:d=256,placement:u,listItemHeight:h,size:f,disabled:g,notFoundContent:p,status:v,builtinPlacements:m,dropdownMatchSelectWidth:_,popupMatchSelectWidth:y,direction:w,style:L,allowClear:D,variant:E,dropdownStyle:I,transitionName:k,tagRender:R,maxCount:A}=i,P=B$e(i,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount"]),{getPopupContainer:N,getPrefixCls:M,renderEmpty:H,direction:B,virtual:F,popupMatchSelectWidth:$,popupOverflow:z,select:K}=x.exports.useContext(Hi),[,j]=Ba(),G=h!=null?h:j==null?void 0:j.controlHeight,X=M("select",n),ue=M(),fe=w!=null?w:B,{compactSize:pe,compactItemClassnames:be}=N4(X,fe),[Se,Fe]=gq(E,o),De=nh(X),[ce,Pe,Oe]=x$e(X,De),xe=x.exports.useMemo(()=>{const{mode:Ot}=i;if(Ot!=="combobox")return Ot===Xme?"combobox":Ot},[i.mode]),Ee=xe==="multiple"||xe==="tags",tt=F$e(i.suffixIcon,i.showArrow),nt=(t=y!=null?y:_)!==null&&t!==void 0?t:$,{status:Qe,hasFeedback:Ge,isFormItemInput:re,feedbackIcon:ie}=x.exports.useContext(Uu),se=hq(Qe,v);let U;p!==void 0?U=p:xe==="combobox"?U=null:U=(H==null?void 0:H("Select"))||x.exports.createElement(i$e,{componentName:"Select"});const{suffixIcon:Y,itemIcon:oe,removeIcon:te,clearIcon:ye}=O$e(Object.assign(Object.assign({},P),{multiple:Ee,hasFeedback:Ge,feedbackIcon:ie,showSuffixIcon:tt,prefixCls:X,componentName:"Select"})),Le=D===!0?{clearIcon:ye}:D,Te=kf(P,["suffixIcon","itemIcon"]),We=Ue(l||c,{[`${X}-dropdown-${fe}`]:fe==="rtl"},s,Oe,De,Pe),je=Bb(Ot=>{var Vn;return(Vn=f!=null?f:pe)!==null&&Vn!==void 0?Vn:Ot}),mt=x.exports.useContext(dS),Dt=g!=null?g:mt,At=Ue({[`${X}-lg`]:je==="large",[`${X}-sm`]:je==="small",[`${X}-rtl`]:fe==="rtl",[`${X}-${Se}`]:Fe,[`${X}-in-form-item`]:re},TA(X,se,Ge),be,K==null?void 0:K.className,r,s,Oe,De,Pe),Je=x.exports.useMemo(()=>u!==void 0?u:fe==="rtl"?"bottomRight":"bottomLeft",[u,fe]),[Lt]=qK("SelectLike",I==null?void 0:I.zIndex);return ce(x.exports.createElement(uq,Object.assign({ref:e,virtual:F,showSearch:K==null?void 0:K.showSearch},Te,{style:Object.assign(Object.assign({},K==null?void 0:K.style),L),dropdownMatchSelectWidth:nt,transitionName:q0(ue,"slide-up",k),builtinPlacements:a$e(m,z),listHeight:d,listItemHeight:G,mode:xe,prefixCls:X,placement:Je,direction:fe,suffixIcon:Y,menuItemSelectedIcon:oe,removeIcon:te,allowClear:Le,notFoundContent:U,className:At,getPopupContainer:a||N,dropdownClassName:We,disabled:Dt,dropdownStyle:Object.assign(Object.assign({},I),{zIndex:Lt}),maxCount:Ee?A:void 0,tagRender:Ee?R:void 0})))},gS=x.exports.forwardRef(W$e),V$e=bVe(gS);gS.SECRET_COMBOBOX_MODE_DO_NOT_USE=Xme;gS.Option=cq;gS.OptGroup=lq;gS._InternalPanelDoNotUseOrYouWillBeFired=V$e;var H$e=gS;const CD=["xxl","xl","lg","md","sm","xs"],$$e=i=>({xs:`(max-width: ${i.screenXSMax}px)`,sm:`(min-width: ${i.screenSM}px)`,md:`(min-width: ${i.screenMD}px)`,lg:`(min-width: ${i.screenLG}px)`,xl:`(min-width: ${i.screenXL}px)`,xxl:`(min-width: ${i.screenXXL}px)`}),z$e=i=>{const e=i,t=[].concat(CD).reverse();return t.forEach((n,o)=>{const r=n.toUpperCase(),s=`screen${r}Min`,a=`screen${r}`;if(!(e[s]<=e[a]))throw new Error(`${s}<=${a} fails : !(${e[s]}<=${e[a]})`);if(o{const t=new Map;let n=-1,o={};return{matchHandlers:{},dispatch(r){return o=r,t.forEach(s=>s(o)),t.size>=1},subscribe(r){return t.size||this.register(),n+=1,t.set(n,r),r(o),n},unsubscribe(r){t.delete(r),t.size||this.unregister()},unregister(){Object.keys(e).forEach(r=>{const s=e[r],a=this.matchHandlers[s];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),t.clear()},register(){Object.keys(e).forEach(r=>{const s=e[r],a=c=>{let{matches:d}=c;this.dispatch(Object.assign(Object.assign({},o),{[r]:d}))},l=window.matchMedia(s);l.addListener(a),this.matchHandlers[s]={mql:l,listener:a},a(l)})},responsiveMap:e}},[i])}function Yme(i){var e=i.children,t=i.prefixCls,n=i.id,o=i.overlayInnerStyle,r=i.className,s=i.style;return x.exports.createElement("div",{className:Ue("".concat(t,"-content"),r),style:s},x.exports.createElement("div",{className:"".concat(t,"-inner"),id:n,role:"tooltip",style:o},typeof e=="function"?e():e))}var M1={shiftX:64,adjustY:1},A1={adjustX:1,shiftY:!0},cd=[0,0],j$e={left:{points:["cr","cl"],overflow:A1,offset:[-4,0],targetOffset:cd},right:{points:["cl","cr"],overflow:A1,offset:[4,0],targetOffset:cd},top:{points:["bc","tc"],overflow:M1,offset:[0,-4],targetOffset:cd},bottom:{points:["tc","bc"],overflow:M1,offset:[0,4],targetOffset:cd},topLeft:{points:["bl","tl"],overflow:M1,offset:[0,-4],targetOffset:cd},leftTop:{points:["tr","tl"],overflow:A1,offset:[-4,0],targetOffset:cd},topRight:{points:["br","tr"],overflow:M1,offset:[0,-4],targetOffset:cd},rightTop:{points:["tl","tr"],overflow:A1,offset:[4,0],targetOffset:cd},bottomRight:{points:["tr","br"],overflow:M1,offset:[0,4],targetOffset:cd},rightBottom:{points:["bl","br"],overflow:A1,offset:[4,0],targetOffset:cd},bottomLeft:{points:["tl","bl"],overflow:M1,offset:[0,4],targetOffset:cd},leftBottom:{points:["br","bl"],overflow:A1,offset:[-4,0],targetOffset:cd}},K$e=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],q$e=function(e,t){var n=e.overlayClassName,o=e.trigger,r=o===void 0?["hover"]:o,s=e.mouseEnterDelay,a=s===void 0?0:s,l=e.mouseLeaveDelay,c=l===void 0?.1:l,d=e.overlayStyle,u=e.prefixCls,h=u===void 0?"rc-tooltip":u,f=e.children,g=e.onVisibleChange,p=e.afterVisibleChange,v=e.transitionName,m=e.animation,_=e.motion,y=e.placement,w=y===void 0?"right":y,L=e.align,D=L===void 0?{}:L,E=e.destroyTooltipOnHide,I=E===void 0?!1:E,k=e.defaultVisible,R=e.getTooltipContainer,A=e.overlayInnerStyle;e.arrowContent;var P=e.overlay,N=e.id,M=e.showArrow,H=M===void 0?!0:M,B=Hn(e,K$e),F=x.exports.useRef(null);x.exports.useImperativeHandle(t,function(){return F.current});var $=Ce({},B);"visible"in e&&($.popupVisible=e.visible);var z=function(){return x.exports.createElement(Yme,{key:"content",prefixCls:h,id:N,overlayInnerStyle:A},P)};return x.exports.createElement(A4,yt({popupClassName:n,prefixCls:h,popup:z,action:r,builtinPlacements:j$e,popupPlacement:w,ref:F,popupAlign:D,getPopupContainer:R,onPopupVisibleChange:g,afterPopupVisibleChange:p,popupTransitionName:v,popupAnimation:m,popupMotion:_,defaultPopupVisible:k,autoDestroy:I,mouseLeaveDelay:c,popupStyle:d,mouseEnterDelay:a,arrow:H},$),f)},G$e=x.exports.forwardRef(q$e);function X$e(i){const{sizePopupArrow:e,borderRadiusXS:t,borderRadiusOuter:n}=i,o=e/2,r=0,s=o,a=n*1/Math.sqrt(2),l=o-n*(1-1/Math.sqrt(2)),c=o-t*(1/Math.sqrt(2)),d=n*(Math.sqrt(2)-1)+t*(1/Math.sqrt(2)),u=2*o-c,h=d,f=2*o-a,g=l,p=2*o-r,v=s,m=o*Math.sqrt(2)+n*(Math.sqrt(2)-2),_=n*(Math.sqrt(2)-1),y=`polygon(${_}px 100%, 50% ${_}px, ${2*o-_}px 100%, ${_}px 100%)`,w=`path('M ${r} ${s} A ${n} ${n} 0 0 0 ${a} ${l} L ${c} ${d} A ${t} ${t} 0 0 1 ${u} ${h} L ${f} ${g} A ${n} ${n} 0 0 0 ${p} ${v} Z')`;return{arrowShadowWidth:m,arrowPath:w,arrowPolygon:y}}const Y$e=(i,e,t)=>{const{sizePopupArrow:n,arrowPolygon:o,arrowPath:r,arrowShadowWidth:s,borderRadiusXS:a,calc:l}=i;return{pointerEvents:"none",width:n,height:n,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:n,height:l(n).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[o,r]},content:'""'},"&::after":{content:'""',position:"absolute",width:s,height:s,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${rt(a)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:t,zIndex:0,background:"transparent"}}},Zme=8;function Qme(i){const{contentRadius:e,limitVerticalRadius:t}=i,n=e>12?e+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:t?Zme:n}}function QN(i,e){return i?e:{}}function Z$e(i,e,t){const{componentCls:n,boxShadowPopoverArrow:o,arrowOffsetVertical:r,arrowOffsetHorizontal:s}=i,{arrowDistance:a=0,arrowPlacement:l={left:!0,right:!0,top:!0,bottom:!0}}=t||{};return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({[`${n}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},Y$e(i,e,o)),{"&:before":{background:e}})]},QN(!!l.top,{[[`&-placement-top > ${n}-arrow`,`&-placement-topLeft > ${n}-arrow`,`&-placement-topRight > ${n}-arrow`].join(",")]:{bottom:a,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft > ${n}-arrow`]:{left:{_skip_check_:!0,value:s}},[`&-placement-topRight > ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}})),QN(!!l.bottom,{[[`&-placement-bottom > ${n}-arrow`,`&-placement-bottomLeft > ${n}-arrow`,`&-placement-bottomRight > ${n}-arrow`].join(",")]:{top:a,transform:"translateY(-100%)"},[`&-placement-bottom > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft > ${n}-arrow`]:{left:{_skip_check_:!0,value:s}},[`&-placement-bottomRight > ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}})),QN(!!l.left,{[[`&-placement-left > ${n}-arrow`,`&-placement-leftTop > ${n}-arrow`,`&-placement-leftBottom > ${n}-arrow`].join(",")]:{right:{_skip_check_:!0,value:a},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${n}-arrow`]:{top:r},[`&-placement-leftBottom > ${n}-arrow`]:{bottom:r}})),QN(!!l.right,{[[`&-placement-right > ${n}-arrow`,`&-placement-rightTop > ${n}-arrow`,`&-placement-rightBottom > ${n}-arrow`].join(",")]:{left:{_skip_check_:!0,value:a},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${n}-arrow`]:{top:r},[`&-placement-rightBottom > ${n}-arrow`]:{bottom:r}}))}}function Q$e(i,e,t,n){if(n===!1)return{adjustX:!1,adjustY:!1};const o=n&&typeof n=="object"?n:{},r={};switch(i){case"top":case"bottom":r.shiftX=e.arrowOffsetHorizontal*2+t,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=e.arrowOffsetVertical*2+t,r.shiftX=!0,r.adjustX=!0;break}const s=Object.assign(Object.assign({},r),o);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const gie={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},J$e={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},eze=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function tze(i){const{arrowWidth:e,autoAdjustOverflow:t,arrowPointAtCenter:n,offset:o,borderRadius:r,visibleFirst:s}=i,a=e/2,l={};return Object.keys(gie).forEach(c=>{const d=n&&J$e[c]||gie[c],u=Object.assign(Object.assign({},d),{offset:[0,0],dynamicInset:!0});switch(l[c]=u,eze.has(c)&&(u.autoArrow=!1),c){case"top":case"topLeft":case"topRight":u.offset[1]=-a-o;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=a+o;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-a-o;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=a+o;break}const h=Qme({contentRadius:r,limitVerticalRadius:!0});if(n)switch(c){case"topLeft":case"bottomLeft":u.offset[0]=-h.arrowOffsetHorizontal-a;break;case"topRight":case"bottomRight":u.offset[0]=h.arrowOffsetHorizontal+a;break;case"leftTop":case"rightTop":u.offset[1]=-h.arrowOffsetHorizontal-a;break;case"leftBottom":case"rightBottom":u.offset[1]=h.arrowOffsetHorizontal+a;break}u.overflow=Q$e(c,h,e,t),s&&(u.htmlRegion="visibleFirst")}),l}const nze=i=>{const{componentCls:e,tooltipMaxWidth:t,tooltipColor:n,tooltipBg:o,tooltipBorderRadius:r,zIndexPopup:s,controlHeight:a,boxShadowSecondary:l,paddingSM:c,paddingXS:d}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Pa(i)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:t,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":o,[`${e}-inner`]:{minWidth:a,minHeight:a,padding:`${rt(i.calc(c).div(2).equal())} ${rt(d)}`,color:n,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:o,borderRadius:r,boxShadow:l,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:i.min(r,Zme)}},[`${e}-content`]:{position:"relative"}}),p6e(i,(u,h)=>{let{darkColor:f}=h;return{[`&${e}-${u}`]:{[`${e}-inner`]:{backgroundColor:f},[`${e}-arrow`]:{"--antd-arrow-background-color":f}}}})),{"&-rtl":{direction:"rtl"}})},Z$e(i,"var(--antd-arrow-background-color)"),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow}}]},ize=i=>Object.assign(Object.assign({zIndexPopup:i.zIndexPopupBase+70},Qme({contentRadius:i.borderRadius,limitVerticalRadius:!0})),X$e(lr(i,{borderRadiusOuter:Math.min(i.borderRadiusOuter,4)})));var Jme=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return jc("Tooltip",n=>{const{borderRadius:o,colorTextLightSolid:r,colorBgSpotlight:s}=n,a=lr(n,{tooltipMaxWidth:250,tooltipColor:r,tooltipBorderRadius:o,tooltipBg:s});return[nze(a),mme(n,"zoom-big-fast")]},ize,{resetStyle:!1,injectStyle:e})(i)};const oze=yA.map(i=>`${i}-inverse`);function rze(i){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(_t(oze),_t(yA)).includes(i):yA.includes(i)}function eve(i,e){const t=rze(e),n=Ue({[`${i}-${e}`]:e&&t}),o={},r={};return e&&!t&&(o.background=e,r["--antd-arrow-background-color"]=e),{className:n,overlayStyle:o,arrowStyle:r}}const sze=i=>{const{prefixCls:e,className:t,placement:n="top",title:o,color:r,overlayInnerStyle:s}=i,{getPrefixCls:a}=x.exports.useContext(Hi),l=a("tooltip",e),[c,d,u]=Jme(l),h=eve(l,r),f=h.arrowStyle,g=Object.assign(Object.assign({},s),h.overlayStyle),p=Ue(d,u,l,`${l}-pure`,`${l}-placement-${n}`,t,h.className);return c(x.exports.createElement("div",{className:p,style:f},x.exports.createElement("div",{className:`${l}-arrow`}),x.exports.createElement(Yme,Object.assign({},i,{className:d,prefixCls:l,overlayInnerStyle:g}),o)))};var aze=sze,lze=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,n;const{prefixCls:o,openClassName:r,getTooltipContainer:s,overlayClassName:a,color:l,overlayInnerStyle:c,children:d,afterOpenChange:u,afterVisibleChange:h,destroyTooltipOnHide:f,arrow:g=!0,title:p,overlay:v,builtinPlacements:m,arrowPointAtCenter:_=!1,autoAdjustOverflow:y=!0}=i,w=!!g,[,L]=Ba(),{getPopupContainer:D,getPrefixCls:E,direction:I}=x.exports.useContext(Hi),k=L4(),R=x.exports.useRef(null),A=()=>{var U;(U=R.current)===null||U===void 0||U.forceAlign()};x.exports.useImperativeHandle(e,()=>({forceAlign:A,forcePopupAlign:()=>{k.deprecated(!1,"forcePopupAlign","forceAlign"),A()}}));const[P,N]=Kl(!1,{value:(t=i.open)!==null&&t!==void 0?t:i.visible,defaultValue:(n=i.defaultOpen)!==null&&n!==void 0?n:i.defaultVisible}),M=!p&&!v&&p!==0,H=U=>{var Y,oe;N(M?!1:U),M||((Y=i.onOpenChange)===null||Y===void 0||Y.call(i,U),(oe=i.onVisibleChange)===null||oe===void 0||oe.call(i,U))},B=x.exports.useMemo(()=>{var U,Y;let oe=_;return typeof g=="object"&&(oe=(Y=(U=g.pointAtCenter)!==null&&U!==void 0?U:g.arrowPointAtCenter)!==null&&Y!==void 0?Y:_),m||tze({arrowPointAtCenter:oe,autoAdjustOverflow:y,arrowWidth:w?L.sizePopupArrow:0,borderRadius:L.borderRadius,offset:L.marginXXS,visibleFirst:!0})},[_,g,m,L]),F=x.exports.useMemo(()=>p===0?p:v||p||"",[v,p]),$=x.exports.createElement(EA,null,typeof F=="function"?F():F),{getPopupContainer:z,placement:K="top",mouseEnterDelay:j=.1,mouseLeaveDelay:G=.1,overlayStyle:X,rootClassName:ue}=i,fe=lze(i,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),pe=E("tooltip",o),be=E(),Se=i["data-popover-inject"];let Fe=P;!("open"in i)&&!("visible"in i)&&M&&(Fe=!1);const De=lw(d)&&!Ipe(d)?d:x.exports.createElement("span",null,d),ce=De.props,Pe=!ce.className||typeof ce.className=="string"?Ue(ce.className,r||`${pe}-open`):ce.className,[Oe,xe,Ee]=Jme(pe,!Se),tt=eve(pe,l),nt=tt.arrowStyle,Qe=Object.assign(Object.assign({},c),tt.overlayStyle),Ge=Ue(a,{[`${pe}-rtl`]:I==="rtl"},tt.className,ue,xe,Ee),[re,ie]=qK("Tooltip",fe.zIndex),se=x.exports.createElement(G$e,Object.assign({},fe,{zIndex:re,showArrow:w,placement:K,mouseEnterDelay:j,mouseLeaveDelay:G,prefixCls:pe,overlayClassName:Ge,overlayStyle:Object.assign(Object.assign({},nt),X),getTooltipContainer:z||s||D,ref:R,builtinPlacements:B,overlay:$,visible:Fe,onVisibleChange:H,afterVisibleChange:u!=null?u:h,overlayInnerStyle:Qe,arrowContent:x.exports.createElement("span",{className:`${pe}-arrow-content`}),motion:{motionName:q0(be,"zoom-big-fast",i.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!f}),Fe?vv(De,{className:Pe}):De);return Oe(x.exports.createElement(jK.Provider,{value:ie},se))});tve._InternalPanelDoNotUseOrYouWillBeFired=aze;var cze=tve,dze=at.ESC,uze=at.TAB;function hze(i){var e=i.visible,t=i.triggerRef,n=i.onVisibleChange,o=i.autoFocus,r=i.overlayRef,s=x.exports.useRef(!1),a=function(){if(e){var u,h;(u=t.current)===null||u===void 0||(h=u.focus)===null||h===void 0||h.call(u),n==null||n(!1)}},l=function(){var u;return(u=r.current)!==null&&u!==void 0&&u.focus?(r.current.focus(),s.current=!0,!0):!1},c=function(u){switch(u.keyCode){case dze:a();break;case uze:{var h=!1;s.current||(h=l()),h?u.preventDefault():a();break}}};x.exports.useEffect(function(){return e?(window.addEventListener("keydown",c),o&&Xi(l,3),function(){window.removeEventListener("keydown",c),s.current=!1}):function(){s.current=!1}},[e])}var fze=x.exports.forwardRef(function(i,e){var t=i.overlay,n=i.arrow,o=i.prefixCls,r=x.exports.useMemo(function(){var a;return typeof t=="function"?a=t():a=t,a},[t]),s=eh(e,r==null?void 0:r.ref);return fn(ks,{children:[n&&he("div",{className:"".concat(o,"-arrow")}),Bt.cloneElement(r,{ref:Gv(r)?s:void 0})]})}),P1={adjustX:1,adjustY:1},O1=[0,0],gze={topLeft:{points:["bl","tl"],overflow:P1,offset:[0,-4],targetOffset:O1},top:{points:["bc","tc"],overflow:P1,offset:[0,-4],targetOffset:O1},topRight:{points:["br","tr"],overflow:P1,offset:[0,-4],targetOffset:O1},bottomLeft:{points:["tl","bl"],overflow:P1,offset:[0,4],targetOffset:O1},bottom:{points:["tc","bc"],overflow:P1,offset:[0,4],targetOffset:O1},bottomRight:{points:["tr","br"],overflow:P1,offset:[0,4],targetOffset:O1}},pze=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function mze(i,e){var t,n=i.arrow,o=n===void 0?!1:n,r=i.prefixCls,s=r===void 0?"rc-dropdown":r,a=i.transitionName,l=i.animation,c=i.align,d=i.placement,u=d===void 0?"bottomLeft":d,h=i.placements,f=h===void 0?gze:h,g=i.getPopupContainer,p=i.showAction,v=i.hideAction,m=i.overlayClassName,_=i.overlayStyle,y=i.visible,w=i.trigger,L=w===void 0?["hover"]:w,D=i.autoFocus,E=i.overlay,I=i.children,k=i.onVisibleChange,R=Hn(i,pze),A=Bt.useState(),P=Ne(A,2),N=P[0],M=P[1],H="visible"in i?y:N,B=Bt.useRef(null),F=Bt.useRef(null),$=Bt.useRef(null);Bt.useImperativeHandle(e,function(){return B.current});var z=function(Se){M(Se),k==null||k(Se)};hze({visible:H,triggerRef:$,onVisibleChange:z,autoFocus:D,overlayRef:F});var K=function(Se){var Fe=i.onOverlayClick;M(!1),Fe&&Fe(Se)},j=function(){return Bt.createElement(fze,{ref:F,overlay:E,prefixCls:s,arrow:o})},G=function(){return typeof E=="function"?j:j()},X=function(){var Se=i.minOverlayWidthMatchTrigger,Fe=i.alignPoint;return"minOverlayWidthMatchTrigger"in i?Se:!Fe},ue=function(){var Se=i.openClassName;return Se!==void 0?Se:"".concat(s,"-open")},fe=Bt.cloneElement(I,{className:Ue((t=I.props)===null||t===void 0?void 0:t.className,H&&ue()),ref:Gv(I)?eh($,I.ref):void 0}),pe=v;return!pe&&L.indexOf("contextMenu")!==-1&&(pe=["click"]),Bt.createElement(A4,yt({builtinPlacements:f},R,{prefixCls:s,ref:B,popupClassName:Ue(m,me({},"".concat(s,"-show-arrow"),o)),popupStyle:_,action:L,showAction:p,hideAction:pe,popupPlacement:u,popupAlign:c,popupTransitionName:a,popupAnimation:l,popupVisible:H,stretch:X()?"minWidth":"",popup:G(),onPopupVisibleChange:z,onPopupClick:K,getPopupContainer:g}),fe)}var vze=Bt.forwardRef(mze),nve=x.exports.createContext(null);function ive(i,e){return i===void 0?null:"".concat(i,"-").concat(e)}function ove(i){var e=x.exports.useContext(nve);return ive(e,i)}var _ze=["children","locked"],ju=x.exports.createContext(null);function bze(i,e){var t=Ce({},i);return Object.keys(e).forEach(function(n){var o=e[n];o!==void 0&&(t[n]=o)}),t}function yD(i){var e=i.children,t=i.locked,n=Hn(i,_ze),o=x.exports.useContext(ju),r=LI(function(){return bze(o,n)},[o,n],function(s,a){return!t&&(s[0]!==a[0]||!y4(s[1],a[1],!0))});return x.exports.createElement(ju.Provider,{value:r},e)}var Cze=[],rve=x.exports.createContext(null);function P4(){return x.exports.useContext(rve)}var sve=x.exports.createContext(Cze);function AI(i){var e=x.exports.useContext(sve);return x.exports.useMemo(function(){return i!==void 0?[].concat(_t(e),[i]):e},[e,i])}var ave=x.exports.createContext(null),pq=x.exports.createContext({});function pie(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(T4(i)){var t=i.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(t)||i.isContentEditable||t==="a"&&!!i.getAttribute("href"),o=i.getAttribute("tabindex"),r=Number(o),s=null;return o&&!Number.isNaN(r)?s=r:n&&s===null&&(s=0),n&&i.disabled&&(s=null),s!==null&&(s>=0||e&&s<0)}return!1}function yze(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=_t(i.querySelectorAll("*")).filter(function(n){return pie(n,e)});return pie(i,e)&&t.unshift(i),t}var OW=at.LEFT,FW=at.RIGHT,BW=at.UP,GR=at.DOWN,XR=at.ENTER,lve=at.ESC,kx=at.HOME,Ix=at.END,mie=[BW,GR,OW,FW];function wze(i,e,t,n){var o,r,s,a,l="prev",c="next",d="children",u="parent";if(i==="inline"&&n===XR)return{inlineTrigger:!0};var h=(o={},me(o,BW,l),me(o,GR,c),o),f=(r={},me(r,OW,t?c:l),me(r,FW,t?l:c),me(r,GR,d),me(r,XR,d),r),g=(s={},me(s,BW,l),me(s,GR,c),me(s,XR,d),me(s,lve,u),me(s,OW,t?d:u),me(s,FW,t?u:d),s),p={inline:h,horizontal:f,vertical:g,inlineSub:h,horizontalSub:g,verticalSub:g},v=(a=p["".concat(i).concat(e?"":"Sub")])===null||a===void 0?void 0:a[n];switch(v){case l:return{offset:-1,sibling:!0};case c:return{offset:1,sibling:!0};case u:return{offset:-1,sibling:!1};case d:return{offset:1,sibling:!1};default:return null}}function Sze(i){for(var e=i;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function xze(i,e){for(var t=i||document.activeElement;t;){if(e.has(t))return t;t=t.parentElement}return null}function mq(i,e){var t=yze(i,!0);return t.filter(function(n){return e.has(n)})}function vie(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!i)return null;var o=mq(i,e),r=o.length,s=o.findIndex(function(a){return t===a});return n<0?s===-1?s=r-1:s-=1:n>0&&(s+=1),s=(s+r)%r,o[s]}var WW=function(e,t){var n=new Set,o=new Map,r=new Map;return e.forEach(function(s){var a=document.querySelector("[data-menu-id='".concat(ive(t,s),"']"));a&&(n.add(a),r.set(a,s),o.set(s,a))}),{elements:n,key2element:o,element2key:r}};function Lze(i,e,t,n,o,r,s,a,l,c){var d=x.exports.useRef(),u=x.exports.useRef();u.current=e;var h=function(){Xi.cancel(d.current)};return x.exports.useEffect(function(){return function(){h()}},[]),function(f){var g=f.which;if([].concat(mie,[XR,lve,kx,Ix]).includes(g)){var p=r(),v=WW(p,n),m=v,_=m.elements,y=m.key2element,w=m.element2key,L=y.get(e),D=xze(L,_),E=w.get(D),I=wze(i,s(E,!0).length===1,t,g);if(!I&&g!==kx&&g!==Ix)return;(mie.includes(g)||[kx,Ix].includes(g))&&f.preventDefault();var k=function(F){if(F){var $=F,z=F.querySelector("a");z!=null&&z.getAttribute("href")&&($=z);var K=w.get(F);a(K),h(),d.current=Xi(function(){u.current===K&&$.focus()})}};if([kx,Ix].includes(g)||I.sibling||!D){var R;!D||i==="inline"?R=o.current:R=Sze(D);var A,P=mq(R,_);g===kx?A=P[0]:g===Ix?A=P[P.length-1]:A=vie(R,_,D,I.offset),k(A)}else if(I.inlineTrigger)l(E);else if(I.offset>0)l(E,!0),h(),d.current=Xi(function(){v=WW(p,n);var B=D.getAttribute("aria-controls"),F=document.getElementById(B),$=vie(F,v.elements);k($)},5);else if(I.offset<0){var N=s(E,!0),M=N[N.length-2],H=y.get(M);l(M,!1),k(H)}}c==null||c(f)}}function Eze(i){Promise.resolve().then(i)}var vq="__RC_UTIL_PATH_SPLIT__",_ie=function(e){return e.join(vq)},Dze=function(e){return e.split(vq)},VW="rc-menu-more";function kze(){var i=x.exports.useState({}),e=Ne(i,2),t=e[1],n=x.exports.useRef(new Map),o=x.exports.useRef(new Map),r=x.exports.useState([]),s=Ne(r,2),a=s[0],l=s[1],c=x.exports.useRef(0),d=x.exports.useRef(!1),u=function(){d.current||t({})},h=x.exports.useCallback(function(y,w){var L=_ie(w);o.current.set(L,y),n.current.set(y,L),c.current+=1;var D=c.current;Eze(function(){D===c.current&&u()})},[]),f=x.exports.useCallback(function(y,w){var L=_ie(w);o.current.delete(L),n.current.delete(y)},[]),g=x.exports.useCallback(function(y){l(y)},[]),p=x.exports.useCallback(function(y,w){var L=n.current.get(y)||"",D=Dze(L);return w&&a.includes(D[0])&&D.unshift(VW),D},[a]),v=x.exports.useCallback(function(y,w){return y.some(function(L){var D=p(L,!0);return D.includes(w)})},[p]),m=function(){var w=_t(n.current.keys());return a.length&&w.push(VW),w},_=x.exports.useCallback(function(y){var w="".concat(n.current.get(y)).concat(vq),L=new Set;return _t(o.current.keys()).forEach(function(D){D.startsWith(w)&&L.add(o.current.get(D))}),L},[]);return x.exports.useEffect(function(){return function(){d.current=!0}},[]),{registerPath:h,unregisterPath:f,refreshOverflowKeys:g,isSubPathKey:v,getKeyPath:p,getKeys:m,getSubPathKeys:_}}function _L(i){var e=x.exports.useRef(i);e.current=i;var t=x.exports.useCallback(function(){for(var n,o=arguments.length,r=new Array(o),s=0;s1&&(_.motionAppear=!1);var y=_.onVisibleChanged;return _.onVisibleChanged=function(w){return!h.current&&!w&&v(!0),y==null?void 0:y(w)},p?null:x.exports.createElement(yD,{mode:r,locked:!h.current},x.exports.createElement(th,yt({visible:m},_,{forceRender:l,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden")}),function(w){var L=w.className,D=w.style;return x.exports.createElement(_q,{id:e,className:L,style:D},o)}))}var jze=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Kze=["active"],qze=function(e){var t,n=e.style,o=e.className,r=e.title,s=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,c=e.children,d=e.itemIcon,u=e.expandIcon,h=e.popupClassName,f=e.popupOffset,g=e.popupStyle,p=e.onClick,v=e.onMouseEnter,m=e.onMouseLeave,_=e.onTitleClick,y=e.onTitleMouseEnter,w=e.onTitleMouseLeave,L=Hn(e,jze),D=ove(s),E=x.exports.useContext(ju),I=E.prefixCls,k=E.mode,R=E.openKeys,A=E.disabled,P=E.overflowDisabled,N=E.activeKey,M=E.selectedKeys,H=E.itemIcon,B=E.expandIcon,F=E.onItemClick,$=E.onOpenChange,z=E.onActive,K=x.exports.useContext(pq),j=K._internalRenderSubMenuItem,G=x.exports.useContext(ave),X=G.isSubPathKey,ue=AI(),fe="".concat(I,"-submenu"),pe=A||a,be=x.exports.useRef(),Se=x.exports.useRef(),Fe=d!=null?d:H,De=u!=null?u:B,ce=R.includes(s),Pe=!P&&ce,Oe=X(M,s),xe=cve(s,pe,y,w),Ee=xe.active,tt=Hn(xe,Kze),nt=x.exports.useState(!1),Qe=Ne(nt,2),Ge=Qe[0],re=Qe[1],ie=function(Lt){pe||re(Lt)},se=function(Lt){ie(!0),v==null||v({key:s,domEvent:Lt})},U=function(Lt){ie(!1),m==null||m({key:s,domEvent:Lt})},Y=x.exports.useMemo(function(){return Ee||(k!=="inline"?Ge||X([N],s):!1)},[k,Ee,N,Ge,s,X]),oe=dve(ue.length),te=function(Lt){pe||(_==null||_({key:s,domEvent:Lt}),k==="inline"&&$(s,!ce))},ye=_L(function(Je){p==null||p(NA(Je)),F(Je)}),Le=function(Lt){k!=="inline"&&$(s,Lt)},Te=function(){z(s)},We=D&&"".concat(D,"-popup"),je=x.exports.createElement("div",yt({role:"menuitem",style:oe,className:"".concat(fe,"-title"),tabIndex:pe?null:-1,ref:be,title:typeof r=="string"?r:null,"data-menu-id":P&&D?null:D,"aria-expanded":Pe,"aria-haspopup":!0,"aria-controls":We,"aria-disabled":pe,onClick:te,onFocus:Te},tt),r,x.exports.createElement(uve,{icon:k!=="horizontal"?De:void 0,props:Ce(Ce({},e),{},{isOpen:Pe,isSubMenu:!0})},x.exports.createElement("i",{className:"".concat(fe,"-arrow")}))),mt=x.exports.useRef(k);if(k!=="inline"&&ue.length>1?mt.current="vertical":mt.current=k,!P){var Dt=mt.current;je=x.exports.createElement(zze,{mode:Dt,prefixCls:fe,visible:!l&&Pe&&k!=="inline",popupClassName:h,popupOffset:f,popupStyle:g,popup:x.exports.createElement(yD,{mode:Dt==="horizontal"?"vertical":Dt},x.exports.createElement(_q,{id:We,ref:Se},c)),disabled:pe,onVisibleChange:Le},je)}var At=x.exports.createElement(sf.Item,yt({role:"none"},L,{component:"li",style:n,className:Ue(fe,"".concat(fe,"-").concat(k),o,(t={},me(t,"".concat(fe,"-open"),Pe),me(t,"".concat(fe,"-active"),Y),me(t,"".concat(fe,"-selected"),Oe),me(t,"".concat(fe,"-disabled"),pe),t)),onMouseEnter:se,onMouseLeave:U}),je,!P&&x.exports.createElement(Uze,{id:We,open:Pe,keyPath:ue},c));return j&&(At=j(At,e,{selected:Oe,active:Y,open:Pe,disabled:pe})),x.exports.createElement(yD,{onItemClick:ye,mode:k==="horizontal"?"vertical":k,itemIcon:Fe,expandIcon:De},At)};function Cq(i){var e=i.eventKey,t=i.children,n=AI(e),o=bq(t,n),r=P4();x.exports.useEffect(function(){if(r)return r.registerPath(e,n),function(){r.unregisterPath(e,n)}},[n]);var s;return r?s=o:s=x.exports.createElement(qze,i,o),x.exports.createElement(sve.Provider,{value:n},s)}var Gze=["className","title","eventKey","children"],Xze=["children"],Yze=function(e){var t=e.className,n=e.title;e.eventKey;var o=e.children,r=Hn(e,Gze),s=x.exports.useContext(ju),a=s.prefixCls,l="".concat(a,"-item-group");return x.exports.createElement("li",yt({role:"presentation"},r,{onClick:function(d){return d.stopPropagation()},className:Ue(l,t)}),x.exports.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:typeof n=="string"?n:void 0},n),x.exports.createElement("ul",{role:"group",className:"".concat(l,"-list")},o))};function fve(i){var e=i.children,t=Hn(i,Xze),n=AI(t.eventKey),o=bq(e,n),r=P4();return r?o:x.exports.createElement(Yze,kf(t,["warnKey"]),o)}function gve(i){var e=i.className,t=i.style,n=x.exports.useContext(ju),o=n.prefixCls,r=P4();return r?null:x.exports.createElement("li",{role:"separator",className:Ue("".concat(o,"-item-divider"),e),style:t})}var Zze=["label","children","key","type"];function HW(i){return(i||[]).map(function(e,t){if(e&&qn(e)==="object"){var n=e,o=n.label,r=n.children,s=n.key,a=n.type,l=Hn(n,Zze),c=s!=null?s:"tmp-".concat(t);return r||a==="group"?a==="group"?x.exports.createElement(fve,yt({key:c},l,{title:o}),HW(r)):x.exports.createElement(Cq,yt({key:c},l,{title:o}),HW(r)):a==="divider"?x.exports.createElement(gve,yt({key:c},l)):x.exports.createElement(O4,yt({key:c},l),o)}return null}).filter(function(e){return e})}function Qze(i,e,t){var n=i;return e&&(n=HW(e)),bq(n,t)}var Jze=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],F1=[],eUe=x.exports.forwardRef(function(i,e){var t,n,o=i,r=o.prefixCls,s=r===void 0?"rc-menu":r,a=o.rootClassName,l=o.style,c=o.className,d=o.tabIndex,u=d===void 0?0:d,h=o.items,f=o.children,g=o.direction,p=o.id,v=o.mode,m=v===void 0?"vertical":v,_=o.inlineCollapsed,y=o.disabled,w=o.disabledOverflow,L=o.subMenuOpenDelay,D=L===void 0?.1:L,E=o.subMenuCloseDelay,I=E===void 0?.1:E,k=o.forceSubMenuRender,R=o.defaultOpenKeys,A=o.openKeys,P=o.activeKey,N=o.defaultActiveFirst,M=o.selectable,H=M===void 0?!0:M,B=o.multiple,F=B===void 0?!1:B,$=o.defaultSelectedKeys,z=o.selectedKeys,K=o.onSelect,j=o.onDeselect,G=o.inlineIndent,X=G===void 0?24:G,ue=o.motion,fe=o.defaultMotions,pe=o.triggerSubMenuAction,be=pe===void 0?"hover":pe,Se=o.builtinPlacements,Fe=o.itemIcon,De=o.expandIcon,ce=o.overflowedIndicator,Pe=ce===void 0?"...":ce,Oe=o.overflowedIndicatorPopupClassName,xe=o.getPopupContainer,Ee=o.onClick,tt=o.onOpenChange,nt=o.onKeyDown;o.openAnimation,o.openTransitionName;var Qe=o._internalRenderMenuItem,Ge=o._internalRenderSubMenuItem,re=Hn(o,Jze),ie=x.exports.useMemo(function(){return Qze(f,h,F1)},[f,h]),se=x.exports.useState(!1),U=Ne(se,2),Y=U[0],oe=U[1],te=x.exports.useRef(),ye=Tze(p),Le=g==="rtl",Te=Kl(R,{value:A,postState:function(gi){return gi||F1}}),We=Ne(Te,2),je=We[0],mt=We[1],Dt=function(gi){var Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function on(){mt(gi),tt==null||tt(gi)}Kt?zu.exports.flushSync(on):on()},At=x.exports.useState(je),Je=Ne(At,2),Lt=Je[0],Ot=Je[1],Vn=x.exports.useRef(!1),Et=x.exports.useMemo(function(){return(m==="inline"||m==="vertical")&&_?["vertical",_]:[m,!1]},[m,_]),tn=Ne(Et,2),di=tn[0],cn=tn[1],Gn=di==="inline",bn=x.exports.useState(di),Pt=Ne(bn,2),qt=Pt[0],Nt=Pt[1],jt=x.exports.useState(cn),Gt=Ne(jt,2),It=Gt[0],Ft=Gt[1];x.exports.useEffect(function(){Nt(di),Ft(cn),Vn.current&&(Gn?mt(Lt):Dt(F1))},[di,cn]);var Ct=x.exports.useState(0),Zt=Ne(Ct,2),wn=Zt[0],Dn=Zt[1],Xn=wn>=ie.length-1||qt!=="horizontal"||w;x.exports.useEffect(function(){Gn&&Ot(je)},[je]),x.exports.useEffect(function(){return Vn.current=!0,function(){Vn.current=!1}},[]);var jn=kze(),Zi=jn.registerPath,an=jn.unregisterPath,Xt=jn.refreshOverflowKeys,oi=jn.isSubPathKey,Ze=jn.getKeyPath,de=jn.getKeys,Ve=jn.getSubPathKeys,ot=x.exports.useMemo(function(){return{registerPath:Zi,unregisterPath:an}},[Zi,an]),Sn=x.exports.useMemo(function(){return{isSubPathKey:oi}},[oi]);x.exports.useEffect(function(){Xt(Xn?F1:ie.slice(wn+1).map(function(mi){return mi.key}))},[wn,Xn]);var $n=Kl(P||N&&((t=ie[0])===null||t===void 0?void 0:t.key),{value:P}),Ci=Ne($n,2),An=Ci[0],lo=Ci[1],Qo=_L(function(mi){lo(mi)}),zo=_L(function(){lo(void 0)});x.exports.useImperativeHandle(e,function(){return{list:te.current,focus:function(gi){var Kt,on=de(),vi=WW(on,ye),Uo=vi.elements,Qi=vi.key2element,Jo=vi.element2key,_r=mq(te.current,Uo),zs=An!=null?An:_r[0]?Jo.get(_r[0]):(Kt=ie.find(function(Ts){return!Ts.props.disabled}))===null||Kt===void 0?void 0:Kt.key,Tr=Qi.get(zs);if(zs&&Tr){var ds;Tr==null||(ds=Tr.focus)===null||ds===void 0||ds.call(Tr,gi)}}}});var oc=Kl($||[],{value:z,postState:function(gi){return Array.isArray(gi)?gi:gi==null?F1:[gi]}}),Yc=Ne(oc,2),Gr=Yc[0],Ua=Yc[1],vl=function(gi){if(H){var Kt=gi.key,on=Gr.includes(Kt),vi;F?on?vi=Gr.filter(function(Qi){return Qi!==Kt}):vi=[].concat(_t(Gr),[Kt]):vi=[Kt],Ua(vi);var Uo=Ce(Ce({},gi),{},{selectedKeys:vi});on?j==null||j(Uo):K==null||K(Uo)}!F&&je.length&&qt!=="inline"&&Dt(F1)},ba=_L(function(mi){Ee==null||Ee(NA(mi)),vl(mi)}),_l=_L(function(mi,gi){var Kt=je.filter(function(vi){return vi!==mi});if(gi)Kt.push(mi);else if(qt!=="inline"){var on=Ve(mi);Kt=Kt.filter(function(vi){return!on.has(vi)})}y4(je,Kt,!0)||Dt(Kt,!0)}),rc=function(gi,Kt){var on=Kt!=null?Kt:!je.includes(gi);_l(gi,on)},Zc=Lze(qt,An,Le,ye,te,de,Ze,lo,rc,nt);x.exports.useEffect(function(){oe(!0)},[]);var Ca=x.exports.useMemo(function(){return{_internalRenderMenuItem:Qe,_internalRenderSubMenuItem:Ge}},[Qe,Ge]),Yd=qt!=="horizontal"||w?ie:ie.map(function(mi,gi){return x.exports.createElement(yD,{key:mi.key,overflowDisabled:gi>wn},mi)}),bl=x.exports.createElement(sf,yt({id:p,ref:te,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:O4,className:Ue(s,"".concat(s,"-root"),"".concat(s,"-").concat(qt),c,(n={},me(n,"".concat(s,"-inline-collapsed"),It),me(n,"".concat(s,"-rtl"),Le),n),a),dir:g,style:l,role:"menu",tabIndex:u,data:Yd,renderRawItem:function(gi){return gi},renderRawRest:function(gi){var Kt=gi.length,on=Kt?ie.slice(-Kt):null;return x.exports.createElement(Cq,{eventKey:VW,title:Pe,disabled:Xn,internalPopupClose:Kt===0,popupClassName:Oe},on)},maxCount:qt!=="horizontal"||w?sf.INVALIDATE:sf.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(gi){Dn(gi)},onKeyDown:Zc},re));return x.exports.createElement(pq.Provider,{value:Ca},x.exports.createElement(nve.Provider,{value:ye},x.exports.createElement(yD,{prefixCls:s,rootClassName:a,mode:qt,openKeys:je,rtl:Le,disabled:y,motion:Y?ue:null,defaultMotions:Y?fe:null,activeKey:An,onActive:Qo,onInactive:zo,selectedKeys:Gr,inlineIndent:X,subMenuOpenDelay:D,subMenuCloseDelay:I,forceSubMenuRender:k,builtinPlacements:Se,triggerSubMenuAction:be,getPopupContainer:xe,itemIcon:Fe,expandIcon:De,onItemClick:ba,onOpenChange:_l},x.exports.createElement(ave.Provider,{value:Sn},bl),x.exports.createElement("div",{style:{display:"none"},"aria-hidden":!0},x.exports.createElement(rve.Provider,{value:ot},ie)))))}),PI=eUe;PI.Item=O4;PI.SubMenu=Cq;PI.ItemGroup=fve;PI.Divider=gve;var tUe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},nUe=tUe,iUe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:nUe}))},oUe=x.exports.forwardRef(iUe);function rUe(i){return lr(i,{inputAffixPadding:i.paddingXXS})}const sUe=i=>{const{controlHeight:e,fontSize:t,lineHeight:n,lineWidth:o,controlHeightSM:r,controlHeightLG:s,fontSizeLG:a,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:d,controlPaddingHorizontal:u,colorFillAlter:h,colorPrimaryHover:f,colorPrimary:g,controlOutlineWidth:p,controlOutline:v,colorErrorOutline:m,colorWarningOutline:_,colorBgContainer:y}=i;return{paddingBlock:Math.max(Math.round((e-t*n)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((r-t*n)/2*10)/10-o,0),paddingBlockLG:Math.ceil((s-a*l)/2*10)/10-o,paddingInline:c-o,paddingInlineSM:d-o,paddingInlineLG:u-o,addonBg:h,activeBorderColor:g,hoverBorderColor:f,activeShadow:`0 0 0 ${p}px ${v}`,errorActiveShadow:`0 0 0 ${p}px ${m}`,warningActiveShadow:`0 0 0 ${p}px ${_}`,hoverBg:y,activeBg:y,inputFontSize:t,inputFontSizeLG:a,inputFontSizeSM:t}},aUe=i=>({borderColor:i.hoverBorderColor,backgroundColor:i.hoverBg}),yq=i=>({color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover:not([disabled])":Object.assign({},aUe(lr(i,{hoverBorderColor:i.colorBorder,hoverBg:i.colorBgContainerDisabled})))}),pve=(i,e)=>({background:i.colorBgContainer,borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:e.borderColor,"&:hover":{borderColor:e.hoverBorderColor,backgroundColor:i.hoverBg},"&:focus, &:focus-within":{borderColor:e.activeBorderColor,boxShadow:e.activeShadow,outline:0,backgroundColor:i.activeBg}}),Cie=(i,e)=>({[`&${i.componentCls}-status-${e.status}:not(${i.componentCls}-disabled)`]:Object.assign(Object.assign({},pve(i,e)),{[`${i.componentCls}-prefix, ${i.componentCls}-suffix`]:{color:e.affixColor}})}),lUe=(i,e)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},pve(i,{borderColor:i.colorBorder,hoverBorderColor:i.colorPrimaryHover,activeBorderColor:i.colorPrimary,activeShadow:i.activeShadow})),{[`&${i.componentCls}-disabled, &[disabled]`]:Object.assign({},yq(i))}),Cie(i,{status:"error",borderColor:i.colorError,hoverBorderColor:i.colorErrorBorderHover,activeBorderColor:i.colorError,activeShadow:i.errorActiveShadow,affixColor:i.colorError})),Cie(i,{status:"warning",borderColor:i.colorWarning,hoverBorderColor:i.colorWarningBorderHover,activeBorderColor:i.colorWarning,activeShadow:i.warningActiveShadow,affixColor:i.colorWarning})),e)}),yie=(i,e)=>({[`&${i.componentCls}-group-wrapper-status-${e.status}`]:{[`${i.componentCls}-group-addon`]:{borderColor:e.addonBorderColor,color:e.addonColor}}}),cUe=i=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${i.componentCls}-group`]:{"&-addon":{background:i.addonBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},yie(i,{status:"error",addonBorderColor:i.colorError,addonColor:i.colorErrorText})),yie(i,{status:"warning",addonBorderColor:i.colorWarning,addonColor:i.colorWarningText})),{[`&${i.componentCls}-group-wrapper-disabled`]:{[`${i.componentCls}-group-addon`]:Object.assign({},yq(i))}})}),dUe=(i,e)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${i.componentCls}-disabled, &[disabled]`]:{color:i.colorTextDisabled}},e)}),mve=(i,e)=>({background:e.bg,borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:"transparent",["input&, & input, textarea&, & textarea"]:{color:e==null?void 0:e.inputColor},"&:hover":{background:e.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:e.activeBorderColor,backgroundColor:i.activeBg}}),wie=(i,e)=>({[`&${i.componentCls}-status-${e.status}:not(${i.componentCls}-disabled)`]:Object.assign(Object.assign({},mve(i,e)),{[`${i.componentCls}-prefix, ${i.componentCls}-suffix`]:{color:e.affixColor}})}),uUe=(i,e)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},mve(i,{bg:i.colorFillTertiary,hoverBg:i.colorFillSecondary,activeBorderColor:i.colorPrimary})),{[`&${i.componentCls}-disabled, &[disabled]`]:Object.assign({},yq(i))}),wie(i,{status:"error",bg:i.colorErrorBg,hoverBg:i.colorErrorBgHover,activeBorderColor:i.colorError,inputColor:i.colorErrorText,affixColor:i.colorError})),wie(i,{status:"warning",bg:i.colorWarningBg,hoverBg:i.colorWarningBgHover,activeBorderColor:i.colorWarning,inputColor:i.colorWarningText,affixColor:i.colorWarning})),e)}),Sie=(i,e)=>({[`&${i.componentCls}-group-wrapper-status-${e.status}`]:{[`${i.componentCls}-group-addon`]:{background:e.addonBg,color:e.addonColor}}}),hUe=i=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${i.componentCls}-group`]:{"&-addon":{background:i.colorFillTertiary},[`${i.componentCls}-filled:not(:focus):not(:focus-within)`]:{"&:not(:first-child)":{borderInlineStart:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`},"&:not(:last-child)":{borderInlineEnd:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`}}}},Sie(i,{status:"error",addonBg:i.colorErrorBg,addonColor:i.colorErrorText})),Sie(i,{status:"warning",addonBg:i.colorWarningBg,addonColor:i.colorWarningText})),{[`&${i.componentCls}-group-wrapper-disabled`]:{[`${i.componentCls}-group`]:{"&-addon":{background:i.colorFillTertiary,color:i.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderTop:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderTop:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`}}}})}),fUe=i=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:i,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),vve=i=>{const{paddingBlockLG:e,lineHeightLG:t,borderRadiusLG:n,paddingInlineLG:o}=i;return{padding:`${rt(e)} ${rt(o)}`,fontSize:i.inputFontSizeLG,lineHeight:t,borderRadius:n}},_ve=i=>({padding:`${rt(i.paddingBlockSM)} ${rt(i.paddingInlineSM)}`,fontSize:i.inputFontSizeSM,borderRadius:i.borderRadiusSM}),bve=i=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${rt(i.paddingBlock)} ${rt(i.paddingInline)}`,color:i.colorText,fontSize:i.inputFontSize,lineHeight:i.lineHeight,borderRadius:i.borderRadius,transition:`all ${i.motionDurationMid}`},fUe(i.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:i.controlHeight,lineHeight:i.lineHeight,verticalAlign:"bottom",transition:`all ${i.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},vve(i)),"&-sm":Object.assign({},_ve(i)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),gUe=i=>{const{componentCls:e,antCls:t}=i;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,["&[class*='col-']"]:{paddingInlineEnd:i.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},vve(i)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},_ve(i)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{["&-addon, &-wrap"]:{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${rt(i.paddingInline)}`,color:i.colorText,fontWeight:"normal",fontSize:i.inputFontSize,textAlign:"center",borderRadius:i.borderRadius,transition:`all ${i.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`${rt(i.calc(i.paddingBlock).add(1).mul(-1).equal())} ${rt(i.calc(i.paddingInline).mul(-1).equal())}`,[`&${t}-select-single:not(${t}-select-customize-input):not(${t}-pagination-size-changer)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${rt(i.lineWidth)} ${i.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:i.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px ${rt(i.calc(i.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},ipe()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:i.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[` + `]:{paddingInlineEnd:i.calc(i.fontSize).mul(1.5).equal()}}}},_6(lr(i,{controlHeight:i.singleItemHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG}),"lg")]}const g$e=i=>{const{fontSize:e,lineHeight:t,controlHeight:n,controlPaddingHorizontal:o,zIndexPopupBase:r,colorText:s,fontWeightStrong:a,controlItemBgActive:l,controlItemBgHover:c,colorBgContainer:d,colorFillSecondary:u,controlHeightLG:h,controlHeightSM:f,colorBgContainerDisabled:g,colorTextDisabled:p}=i;return{zIndexPopup:r+50,optionSelectedColor:s,optionSelectedFontWeight:a,optionSelectedBg:l,optionActiveBg:c,optionPadding:`${(n-e*t)/2}px ${o}px`,optionFontSize:e,optionLineHeight:t,optionHeight:n,selectorBg:d,clearBg:d,singleItemHeightLG:h,multipleItemBg:u,multipleItemBorderColor:"transparent",multipleItemHeight:f,multipleItemHeightLG:n,multipleSelectorBgDisabled:g,multipleItemColorDisabled:p,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(i.fontSize*1.25)}},qme=(i,e)=>{const{componentCls:t,antCls:n,controlOutlineWidth:o}=i;return{[`&:not(${t}-customize-input) ${t}-selector`]:{border:`${rt(i.lineWidth)} ${i.lineType} ${e.borderColor}`,background:i.selectorBg},[`&:not(${t}-disabled):not(${t}-customize-input):not(${n}-pagination-size-changer)`]:{[`&:hover ${t}-selector`]:{borderColor:e.hoverBorderHover},[`${t}-focused& ${t}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${rt(o)} ${e.activeShadowColor}`,outline:0}}}},fie=(i,e)=>({[`&${i.componentCls}-status-${e.status}`]:Object.assign({},qme(i,e))}),p$e=i=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},qme(i,{borderColor:i.colorBorder,hoverBorderHover:i.colorPrimaryHover,activeBorderColor:i.colorPrimary,activeShadowColor:i.controlOutline})),fie(i,{status:"error",borderColor:i.colorError,hoverBorderHover:i.colorErrorHover,activeBorderColor:i.colorError,activeShadowColor:i.colorErrorOutline})),fie(i,{status:"warning",borderColor:i.colorWarning,hoverBorderHover:i.colorWarningHover,activeBorderColor:i.colorWarning,activeShadowColor:i.colorWarningOutline})),{[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{background:i.colorBgContainerDisabled,color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.multipleItemBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.multipleItemBorderColor}`}})}),Gme=(i,e)=>{const{componentCls:t,antCls:n}=i;return{[`&:not(${t}-customize-input) ${t}-selector`]:{background:e.bg,border:`${rt(i.lineWidth)} ${i.lineType} transparent`,color:e.color},[`&:not(${t}-disabled):not(${t}-customize-input):not(${n}-pagination-size-changer)`]:{[`&:hover ${t}-selector`]:{background:e.hoverBg},[`${t}-focused& ${t}-selector`]:{background:i.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},gie=(i,e)=>({[`&${i.componentCls}-status-${e.status}`]:Object.assign({},Gme(i,e))}),m$e=i=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},Gme(i,{bg:i.colorFillTertiary,hoverBg:i.colorFillSecondary,activeBorderColor:i.colorPrimary,color:i.colorText})),gie(i,{status:"error",bg:i.colorErrorBg,hoverBg:i.colorErrorBgHover,activeBorderColor:i.colorError,color:i.colorError})),gie(i,{status:"warning",bg:i.colorWarningBg,hoverBg:i.colorWarningBgHover,activeBorderColor:i.colorWarning,color:i.colorWarning})),{[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{borderColor:i.colorBorder,background:i.colorBgContainerDisabled,color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.colorBgContainer,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`}})}),v$e=i=>({"&-borderless":{[`${i.componentCls}-selector`]:{background:"transparent",borderColor:"transparent"},[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.multipleItemBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.multipleItemBorderColor}`}}}),_$e=i=>({[i.componentCls]:Object.assign(Object.assign(Object.assign({},p$e(i)),m$e(i)),v$e(i))});var b$e=_$e;const C$e=i=>{const{componentCls:e}=i;return{position:"relative",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},y$e=i=>{const{componentCls:e}=i;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},w$e=i=>{const{antCls:e,componentCls:t,inputPaddingHorizontalBase:n,iconCls:o}=i;return{[t]:Object.assign(Object.assign({},Pa(i)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${t}-customize-input) ${t}-selector`]:Object.assign(Object.assign({},C$e(i)),y$e(i)),[`${t}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},wA),{[`> ${e}-typography`]:{display:"inline"}}),[`${t}-selection-placeholder`]:Object.assign(Object.assign({},wA),{flex:1,color:i.colorTextPlaceholder,pointerEvents:"none"}),[`${t}-arrow`]:Object.assign(Object.assign({},FK()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,height:i.fontSizeIcon,marginTop:i.calc(i.fontSizeIcon).mul(-1).div(2).equal(),color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${i.motionDurationSlow} ease`,[o]:{verticalAlign:"top",transition:`transform ${i.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${t}-suffix)`]:{pointerEvents:"auto"}},[`${t}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${t}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,zIndex:1,display:"inline-block",width:i.fontSizeIcon,height:i.fontSizeIcon,marginTop:i.calc(i.fontSizeIcon).mul(-1).div(2).equal(),color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${i.motionDurationMid} ease, opacity ${i.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:i.colorTextTertiary}},"&:hover":{[`${t}-clear`]:{opacity:1},[`${t}-arrow:not(:last-child)`]:{opacity:0}}}),[`${t}-has-feedback`]:{[`${t}-clear`]:{insetInlineEnd:i.calc(n).add(i.fontSize).add(i.paddingXS).equal()}}}},S$e=i=>{const{componentCls:e}=i;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},w$e(i),f$e(i),h$e(i),c$e(i),{[`${e}-rtl`]:{direction:"rtl"}},JK(i,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]};var x$e=jc("Select",(i,e)=>{let{rootPrefixCls:t}=e;const n=lr(i,{rootPrefixCls:t,inputPaddingHorizontalBase:i.calc(i.paddingSM).sub(1).equal(),multipleSelectItemHeight:i.multipleItemHeight,selectHeight:i.controlHeight});return[S$e(n),b$e(n)]},g$e,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),L$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},E$e=L$e,D$e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:E$e}))},k$e=x.exports.forwardRef(D$e),I$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},T$e=I$e,N$e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:T$e}))},R$e=x.exports.forwardRef(N$e),M$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},A$e=M$e,P$e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:A$e}))},Xme=x.exports.forwardRef(P$e);function O$e(i){let{suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:o,loading:r,multiple:s,hasFeedback:a,prefixCls:l,showSuffixIcon:c,feedbackIcon:d,showArrow:u,componentName:h}=i;const f=t!=null?t:x.exports.createElement(uS,null),g=_=>e===null&&!a&&!u?null:x.exports.createElement(x.exports.Fragment,null,c!==!1&&_,a&&d);let p=null;if(e!==void 0)p=g(e);else if(r)p=g(x.exports.createElement(kI,{spin:!0}));else{const _=`${l}-suffix`;p=y=>{let{open:w,showSearch:L}=y;return g(w&&L?x.exports.createElement(Xme,{className:_}):x.exports.createElement(R$e,{className:_}))}}let v=null;n!==void 0?v=n:s?v=x.exports.createElement(k$e,null):v=null;let m=null;return o!==void 0?m=o:m=x.exports.createElement(hS,null),{clearIcon:f,suffixIcon:p,itemIcon:v,removeIcon:m}}function F$e(i,e){return e!==void 0?e:i!==null}var B$e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o,className:r,rootClassName:s,getPopupContainer:a,popupClassName:l,dropdownClassName:c,listHeight:d=256,placement:u,listItemHeight:h,size:f,disabled:g,notFoundContent:p,status:v,builtinPlacements:m,dropdownMatchSelectWidth:_,popupMatchSelectWidth:y,direction:w,style:L,allowClear:D,variant:E,dropdownStyle:I,transitionName:k,tagRender:R,maxCount:A}=i,P=B$e(i,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount"]),{getPopupContainer:N,getPrefixCls:M,renderEmpty:H,direction:B,virtual:F,popupMatchSelectWidth:$,popupOverflow:z,select:K}=x.exports.useContext(Hi),[,j]=Ba(),G=h!=null?h:j==null?void 0:j.controlHeight,X=M("select",n),ue=M(),fe=w!=null?w:B,{compactSize:pe,compactItemClassnames:be}=N4(X,fe),[Se,Fe]=pq(E,o),De=nh(X),[ce,Pe,Oe]=x$e(X,De),xe=x.exports.useMemo(()=>{const{mode:Ot}=i;if(Ot!=="combobox")return Ot===Yme?"combobox":Ot},[i.mode]),Ee=xe==="multiple"||xe==="tags",tt=F$e(i.suffixIcon,i.showArrow),nt=(t=y!=null?y:_)!==null&&t!==void 0?t:$,{status:Qe,hasFeedback:Ge,isFormItemInput:re,feedbackIcon:ie}=x.exports.useContext(Uu),se=fq(Qe,v);let U;p!==void 0?U=p:xe==="combobox"?U=null:U=(H==null?void 0:H("Select"))||x.exports.createElement(i$e,{componentName:"Select"});const{suffixIcon:Y,itemIcon:oe,removeIcon:te,clearIcon:ye}=O$e(Object.assign(Object.assign({},P),{multiple:Ee,hasFeedback:Ge,feedbackIcon:ie,showSuffixIcon:tt,prefixCls:X,componentName:"Select"})),Le=D===!0?{clearIcon:ye}:D,Te=kf(P,["suffixIcon","itemIcon"]),We=Ue(l||c,{[`${X}-dropdown-${fe}`]:fe==="rtl"},s,Oe,De,Pe),je=Bb(Ot=>{var Vn;return(Vn=f!=null?f:pe)!==null&&Vn!==void 0?Vn:Ot}),mt=x.exports.useContext(dS),Dt=g!=null?g:mt,At=Ue({[`${X}-lg`]:je==="large",[`${X}-sm`]:je==="small",[`${X}-rtl`]:fe==="rtl",[`${X}-${Se}`]:Fe,[`${X}-in-form-item`]:re},TA(X,se,Ge),be,K==null?void 0:K.className,r,s,Oe,De,Pe),Je=x.exports.useMemo(()=>u!==void 0?u:fe==="rtl"?"bottomRight":"bottomLeft",[u,fe]),[Lt]=GK("SelectLike",I==null?void 0:I.zIndex);return ce(x.exports.createElement(hq,Object.assign({ref:e,virtual:F,showSearch:K==null?void 0:K.showSearch},Te,{style:Object.assign(Object.assign({},K==null?void 0:K.style),L),dropdownMatchSelectWidth:nt,transitionName:q0(ue,"slide-up",k),builtinPlacements:a$e(m,z),listHeight:d,listItemHeight:G,mode:xe,prefixCls:X,placement:Je,direction:fe,suffixIcon:Y,menuItemSelectedIcon:oe,removeIcon:te,allowClear:Le,notFoundContent:U,className:At,getPopupContainer:a||N,dropdownClassName:We,disabled:Dt,dropdownStyle:Object.assign(Object.assign({},I),{zIndex:Lt}),maxCount:Ee?A:void 0,tagRender:Ee?R:void 0})))},gS=x.exports.forwardRef(W$e),V$e=bVe(gS);gS.SECRET_COMBOBOX_MODE_DO_NOT_USE=Yme;gS.Option=dq;gS.OptGroup=cq;gS._InternalPanelDoNotUseOrYouWillBeFired=V$e;var H$e=gS;const CD=["xxl","xl","lg","md","sm","xs"],$$e=i=>({xs:`(max-width: ${i.screenXSMax}px)`,sm:`(min-width: ${i.screenSM}px)`,md:`(min-width: ${i.screenMD}px)`,lg:`(min-width: ${i.screenLG}px)`,xl:`(min-width: ${i.screenXL}px)`,xxl:`(min-width: ${i.screenXXL}px)`}),z$e=i=>{const e=i,t=[].concat(CD).reverse();return t.forEach((n,o)=>{const r=n.toUpperCase(),s=`screen${r}Min`,a=`screen${r}`;if(!(e[s]<=e[a]))throw new Error(`${s}<=${a} fails : !(${e[s]}<=${e[a]})`);if(o{const t=new Map;let n=-1,o={};return{matchHandlers:{},dispatch(r){return o=r,t.forEach(s=>s(o)),t.size>=1},subscribe(r){return t.size||this.register(),n+=1,t.set(n,r),r(o),n},unsubscribe(r){t.delete(r),t.size||this.unregister()},unregister(){Object.keys(e).forEach(r=>{const s=e[r],a=this.matchHandlers[s];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),t.clear()},register(){Object.keys(e).forEach(r=>{const s=e[r],a=c=>{let{matches:d}=c;this.dispatch(Object.assign(Object.assign({},o),{[r]:d}))},l=window.matchMedia(s);l.addListener(a),this.matchHandlers[s]={mql:l,listener:a},a(l)})},responsiveMap:e}},[i])}function Zme(i){var e=i.children,t=i.prefixCls,n=i.id,o=i.overlayInnerStyle,r=i.className,s=i.style;return x.exports.createElement("div",{className:Ue("".concat(t,"-content"),r),style:s},x.exports.createElement("div",{className:"".concat(t,"-inner"),id:n,role:"tooltip",style:o},typeof e=="function"?e():e))}var M1={shiftX:64,adjustY:1},A1={adjustX:1,shiftY:!0},cd=[0,0],j$e={left:{points:["cr","cl"],overflow:A1,offset:[-4,0],targetOffset:cd},right:{points:["cl","cr"],overflow:A1,offset:[4,0],targetOffset:cd},top:{points:["bc","tc"],overflow:M1,offset:[0,-4],targetOffset:cd},bottom:{points:["tc","bc"],overflow:M1,offset:[0,4],targetOffset:cd},topLeft:{points:["bl","tl"],overflow:M1,offset:[0,-4],targetOffset:cd},leftTop:{points:["tr","tl"],overflow:A1,offset:[-4,0],targetOffset:cd},topRight:{points:["br","tr"],overflow:M1,offset:[0,-4],targetOffset:cd},rightTop:{points:["tl","tr"],overflow:A1,offset:[4,0],targetOffset:cd},bottomRight:{points:["tr","br"],overflow:M1,offset:[0,4],targetOffset:cd},rightBottom:{points:["bl","br"],overflow:A1,offset:[4,0],targetOffset:cd},bottomLeft:{points:["tl","bl"],overflow:M1,offset:[0,4],targetOffset:cd},leftBottom:{points:["br","bl"],overflow:A1,offset:[-4,0],targetOffset:cd}},K$e=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],q$e=function(e,t){var n=e.overlayClassName,o=e.trigger,r=o===void 0?["hover"]:o,s=e.mouseEnterDelay,a=s===void 0?0:s,l=e.mouseLeaveDelay,c=l===void 0?.1:l,d=e.overlayStyle,u=e.prefixCls,h=u===void 0?"rc-tooltip":u,f=e.children,g=e.onVisibleChange,p=e.afterVisibleChange,v=e.transitionName,m=e.animation,_=e.motion,y=e.placement,w=y===void 0?"right":y,L=e.align,D=L===void 0?{}:L,E=e.destroyTooltipOnHide,I=E===void 0?!1:E,k=e.defaultVisible,R=e.getTooltipContainer,A=e.overlayInnerStyle;e.arrowContent;var P=e.overlay,N=e.id,M=e.showArrow,H=M===void 0?!0:M,B=Hn(e,K$e),F=x.exports.useRef(null);x.exports.useImperativeHandle(t,function(){return F.current});var $=Ce({},B);"visible"in e&&($.popupVisible=e.visible);var z=function(){return x.exports.createElement(Zme,{key:"content",prefixCls:h,id:N,overlayInnerStyle:A},P)};return x.exports.createElement(A4,yt({popupClassName:n,prefixCls:h,popup:z,action:r,builtinPlacements:j$e,popupPlacement:w,ref:F,popupAlign:D,getPopupContainer:R,onPopupVisibleChange:g,afterPopupVisibleChange:p,popupTransitionName:v,popupAnimation:m,popupMotion:_,defaultPopupVisible:k,autoDestroy:I,mouseLeaveDelay:c,popupStyle:d,mouseEnterDelay:a,arrow:H},$),f)},G$e=x.exports.forwardRef(q$e);function X$e(i){const{sizePopupArrow:e,borderRadiusXS:t,borderRadiusOuter:n}=i,o=e/2,r=0,s=o,a=n*1/Math.sqrt(2),l=o-n*(1-1/Math.sqrt(2)),c=o-t*(1/Math.sqrt(2)),d=n*(Math.sqrt(2)-1)+t*(1/Math.sqrt(2)),u=2*o-c,h=d,f=2*o-a,g=l,p=2*o-r,v=s,m=o*Math.sqrt(2)+n*(Math.sqrt(2)-2),_=n*(Math.sqrt(2)-1),y=`polygon(${_}px 100%, 50% ${_}px, ${2*o-_}px 100%, ${_}px 100%)`,w=`path('M ${r} ${s} A ${n} ${n} 0 0 0 ${a} ${l} L ${c} ${d} A ${t} ${t} 0 0 1 ${u} ${h} L ${f} ${g} A ${n} ${n} 0 0 0 ${p} ${v} Z')`;return{arrowShadowWidth:m,arrowPath:w,arrowPolygon:y}}const Y$e=(i,e,t)=>{const{sizePopupArrow:n,arrowPolygon:o,arrowPath:r,arrowShadowWidth:s,borderRadiusXS:a,calc:l}=i;return{pointerEvents:"none",width:n,height:n,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:n,height:l(n).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[o,r]},content:'""'},"&::after":{content:'""',position:"absolute",width:s,height:s,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${rt(a)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:t,zIndex:0,background:"transparent"}}},Qme=8;function Jme(i){const{contentRadius:e,limitVerticalRadius:t}=i,n=e>12?e+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:t?Qme:n}}function QN(i,e){return i?e:{}}function Z$e(i,e,t){const{componentCls:n,boxShadowPopoverArrow:o,arrowOffsetVertical:r,arrowOffsetHorizontal:s}=i,{arrowDistance:a=0,arrowPlacement:l={left:!0,right:!0,top:!0,bottom:!0}}=t||{};return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({[`${n}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},Y$e(i,e,o)),{"&:before":{background:e}})]},QN(!!l.top,{[[`&-placement-top > ${n}-arrow`,`&-placement-topLeft > ${n}-arrow`,`&-placement-topRight > ${n}-arrow`].join(",")]:{bottom:a,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft > ${n}-arrow`]:{left:{_skip_check_:!0,value:s}},[`&-placement-topRight > ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}})),QN(!!l.bottom,{[[`&-placement-bottom > ${n}-arrow`,`&-placement-bottomLeft > ${n}-arrow`,`&-placement-bottomRight > ${n}-arrow`].join(",")]:{top:a,transform:"translateY(-100%)"},[`&-placement-bottom > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft > ${n}-arrow`]:{left:{_skip_check_:!0,value:s}},[`&-placement-bottomRight > ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}})),QN(!!l.left,{[[`&-placement-left > ${n}-arrow`,`&-placement-leftTop > ${n}-arrow`,`&-placement-leftBottom > ${n}-arrow`].join(",")]:{right:{_skip_check_:!0,value:a},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${n}-arrow`]:{top:r},[`&-placement-leftBottom > ${n}-arrow`]:{bottom:r}})),QN(!!l.right,{[[`&-placement-right > ${n}-arrow`,`&-placement-rightTop > ${n}-arrow`,`&-placement-rightBottom > ${n}-arrow`].join(",")]:{left:{_skip_check_:!0,value:a},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${n}-arrow`]:{top:r},[`&-placement-rightBottom > ${n}-arrow`]:{bottom:r}}))}}function Q$e(i,e,t,n){if(n===!1)return{adjustX:!1,adjustY:!1};const o=n&&typeof n=="object"?n:{},r={};switch(i){case"top":case"bottom":r.shiftX=e.arrowOffsetHorizontal*2+t,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=e.arrowOffsetVertical*2+t,r.shiftX=!0,r.adjustX=!0;break}const s=Object.assign(Object.assign({},r),o);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const pie={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},J$e={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},eze=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function tze(i){const{arrowWidth:e,autoAdjustOverflow:t,arrowPointAtCenter:n,offset:o,borderRadius:r,visibleFirst:s}=i,a=e/2,l={};return Object.keys(pie).forEach(c=>{const d=n&&J$e[c]||pie[c],u=Object.assign(Object.assign({},d),{offset:[0,0],dynamicInset:!0});switch(l[c]=u,eze.has(c)&&(u.autoArrow=!1),c){case"top":case"topLeft":case"topRight":u.offset[1]=-a-o;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=a+o;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-a-o;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=a+o;break}const h=Jme({contentRadius:r,limitVerticalRadius:!0});if(n)switch(c){case"topLeft":case"bottomLeft":u.offset[0]=-h.arrowOffsetHorizontal-a;break;case"topRight":case"bottomRight":u.offset[0]=h.arrowOffsetHorizontal+a;break;case"leftTop":case"rightTop":u.offset[1]=-h.arrowOffsetHorizontal-a;break;case"leftBottom":case"rightBottom":u.offset[1]=h.arrowOffsetHorizontal+a;break}u.overflow=Q$e(c,h,e,t),s&&(u.htmlRegion="visibleFirst")}),l}const nze=i=>{const{componentCls:e,tooltipMaxWidth:t,tooltipColor:n,tooltipBg:o,tooltipBorderRadius:r,zIndexPopup:s,controlHeight:a,boxShadowSecondary:l,paddingSM:c,paddingXS:d}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Pa(i)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:t,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":o,[`${e}-inner`]:{minWidth:a,minHeight:a,padding:`${rt(i.calc(c).div(2).equal())} ${rt(d)}`,color:n,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:o,borderRadius:r,boxShadow:l,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:i.min(r,Qme)}},[`${e}-content`]:{position:"relative"}}),p6e(i,(u,h)=>{let{darkColor:f}=h;return{[`&${e}-${u}`]:{[`${e}-inner`]:{backgroundColor:f},[`${e}-arrow`]:{"--antd-arrow-background-color":f}}}})),{"&-rtl":{direction:"rtl"}})},Z$e(i,"var(--antd-arrow-background-color)"),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow}}]},ize=i=>Object.assign(Object.assign({zIndexPopup:i.zIndexPopupBase+70},Jme({contentRadius:i.borderRadius,limitVerticalRadius:!0})),X$e(lr(i,{borderRadiusOuter:Math.min(i.borderRadiusOuter,4)})));var eve=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return jc("Tooltip",n=>{const{borderRadius:o,colorTextLightSolid:r,colorBgSpotlight:s}=n,a=lr(n,{tooltipMaxWidth:250,tooltipColor:r,tooltipBorderRadius:o,tooltipBg:s});return[nze(a),vme(n,"zoom-big-fast")]},ize,{resetStyle:!1,injectStyle:e})(i)};const oze=yA.map(i=>`${i}-inverse`);function rze(i){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(_t(oze),_t(yA)).includes(i):yA.includes(i)}function tve(i,e){const t=rze(e),n=Ue({[`${i}-${e}`]:e&&t}),o={},r={};return e&&!t&&(o.background=e,r["--antd-arrow-background-color"]=e),{className:n,overlayStyle:o,arrowStyle:r}}const sze=i=>{const{prefixCls:e,className:t,placement:n="top",title:o,color:r,overlayInnerStyle:s}=i,{getPrefixCls:a}=x.exports.useContext(Hi),l=a("tooltip",e),[c,d,u]=eve(l),h=tve(l,r),f=h.arrowStyle,g=Object.assign(Object.assign({},s),h.overlayStyle),p=Ue(d,u,l,`${l}-pure`,`${l}-placement-${n}`,t,h.className);return c(x.exports.createElement("div",{className:p,style:f},x.exports.createElement("div",{className:`${l}-arrow`}),x.exports.createElement(Zme,Object.assign({},i,{className:d,prefixCls:l,overlayInnerStyle:g}),o)))};var aze=sze,lze=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,n;const{prefixCls:o,openClassName:r,getTooltipContainer:s,overlayClassName:a,color:l,overlayInnerStyle:c,children:d,afterOpenChange:u,afterVisibleChange:h,destroyTooltipOnHide:f,arrow:g=!0,title:p,overlay:v,builtinPlacements:m,arrowPointAtCenter:_=!1,autoAdjustOverflow:y=!0}=i,w=!!g,[,L]=Ba(),{getPopupContainer:D,getPrefixCls:E,direction:I}=x.exports.useContext(Hi),k=L4(),R=x.exports.useRef(null),A=()=>{var U;(U=R.current)===null||U===void 0||U.forceAlign()};x.exports.useImperativeHandle(e,()=>({forceAlign:A,forcePopupAlign:()=>{k.deprecated(!1,"forcePopupAlign","forceAlign"),A()}}));const[P,N]=Kl(!1,{value:(t=i.open)!==null&&t!==void 0?t:i.visible,defaultValue:(n=i.defaultOpen)!==null&&n!==void 0?n:i.defaultVisible}),M=!p&&!v&&p!==0,H=U=>{var Y,oe;N(M?!1:U),M||((Y=i.onOpenChange)===null||Y===void 0||Y.call(i,U),(oe=i.onVisibleChange)===null||oe===void 0||oe.call(i,U))},B=x.exports.useMemo(()=>{var U,Y;let oe=_;return typeof g=="object"&&(oe=(Y=(U=g.pointAtCenter)!==null&&U!==void 0?U:g.arrowPointAtCenter)!==null&&Y!==void 0?Y:_),m||tze({arrowPointAtCenter:oe,autoAdjustOverflow:y,arrowWidth:w?L.sizePopupArrow:0,borderRadius:L.borderRadius,offset:L.marginXXS,visibleFirst:!0})},[_,g,m,L]),F=x.exports.useMemo(()=>p===0?p:v||p||"",[v,p]),$=x.exports.createElement(EA,null,typeof F=="function"?F():F),{getPopupContainer:z,placement:K="top",mouseEnterDelay:j=.1,mouseLeaveDelay:G=.1,overlayStyle:X,rootClassName:ue}=i,fe=lze(i,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),pe=E("tooltip",o),be=E(),Se=i["data-popover-inject"];let Fe=P;!("open"in i)&&!("visible"in i)&&M&&(Fe=!1);const De=lw(d)&&!Tpe(d)?d:x.exports.createElement("span",null,d),ce=De.props,Pe=!ce.className||typeof ce.className=="string"?Ue(ce.className,r||`${pe}-open`):ce.className,[Oe,xe,Ee]=eve(pe,!Se),tt=tve(pe,l),nt=tt.arrowStyle,Qe=Object.assign(Object.assign({},c),tt.overlayStyle),Ge=Ue(a,{[`${pe}-rtl`]:I==="rtl"},tt.className,ue,xe,Ee),[re,ie]=GK("Tooltip",fe.zIndex),se=x.exports.createElement(G$e,Object.assign({},fe,{zIndex:re,showArrow:w,placement:K,mouseEnterDelay:j,mouseLeaveDelay:G,prefixCls:pe,overlayClassName:Ge,overlayStyle:Object.assign(Object.assign({},nt),X),getTooltipContainer:z||s||D,ref:R,builtinPlacements:B,overlay:$,visible:Fe,onVisibleChange:H,afterVisibleChange:u!=null?u:h,overlayInnerStyle:Qe,arrowContent:x.exports.createElement("span",{className:`${pe}-arrow-content`}),motion:{motionName:q0(be,"zoom-big-fast",i.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!f}),Fe?_v(De,{className:Pe}):De);return Oe(x.exports.createElement(KK.Provider,{value:ie},se))});nve._InternalPanelDoNotUseOrYouWillBeFired=aze;var cze=nve,dze=at.ESC,uze=at.TAB;function hze(i){var e=i.visible,t=i.triggerRef,n=i.onVisibleChange,o=i.autoFocus,r=i.overlayRef,s=x.exports.useRef(!1),a=function(){if(e){var u,h;(u=t.current)===null||u===void 0||(h=u.focus)===null||h===void 0||h.call(u),n==null||n(!1)}},l=function(){var u;return(u=r.current)!==null&&u!==void 0&&u.focus?(r.current.focus(),s.current=!0,!0):!1},c=function(u){switch(u.keyCode){case dze:a();break;case uze:{var h=!1;s.current||(h=l()),h?u.preventDefault():a();break}}};x.exports.useEffect(function(){return e?(window.addEventListener("keydown",c),o&&Xi(l,3),function(){window.removeEventListener("keydown",c),s.current=!1}):function(){s.current=!1}},[e])}var fze=x.exports.forwardRef(function(i,e){var t=i.overlay,n=i.arrow,o=i.prefixCls,r=x.exports.useMemo(function(){var a;return typeof t=="function"?a=t():a=t,a},[t]),s=eh(e,r==null?void 0:r.ref);return fn(ks,{children:[n&&he("div",{className:"".concat(o,"-arrow")}),Bt.cloneElement(r,{ref:Gv(r)?s:void 0})]})}),P1={adjustX:1,adjustY:1},O1=[0,0],gze={topLeft:{points:["bl","tl"],overflow:P1,offset:[0,-4],targetOffset:O1},top:{points:["bc","tc"],overflow:P1,offset:[0,-4],targetOffset:O1},topRight:{points:["br","tr"],overflow:P1,offset:[0,-4],targetOffset:O1},bottomLeft:{points:["tl","bl"],overflow:P1,offset:[0,4],targetOffset:O1},bottom:{points:["tc","bc"],overflow:P1,offset:[0,4],targetOffset:O1},bottomRight:{points:["tr","br"],overflow:P1,offset:[0,4],targetOffset:O1}},pze=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function mze(i,e){var t,n=i.arrow,o=n===void 0?!1:n,r=i.prefixCls,s=r===void 0?"rc-dropdown":r,a=i.transitionName,l=i.animation,c=i.align,d=i.placement,u=d===void 0?"bottomLeft":d,h=i.placements,f=h===void 0?gze:h,g=i.getPopupContainer,p=i.showAction,v=i.hideAction,m=i.overlayClassName,_=i.overlayStyle,y=i.visible,w=i.trigger,L=w===void 0?["hover"]:w,D=i.autoFocus,E=i.overlay,I=i.children,k=i.onVisibleChange,R=Hn(i,pze),A=Bt.useState(),P=Ne(A,2),N=P[0],M=P[1],H="visible"in i?y:N,B=Bt.useRef(null),F=Bt.useRef(null),$=Bt.useRef(null);Bt.useImperativeHandle(e,function(){return B.current});var z=function(Se){M(Se),k==null||k(Se)};hze({visible:H,triggerRef:$,onVisibleChange:z,autoFocus:D,overlayRef:F});var K=function(Se){var Fe=i.onOverlayClick;M(!1),Fe&&Fe(Se)},j=function(){return Bt.createElement(fze,{ref:F,overlay:E,prefixCls:s,arrow:o})},G=function(){return typeof E=="function"?j:j()},X=function(){var Se=i.minOverlayWidthMatchTrigger,Fe=i.alignPoint;return"minOverlayWidthMatchTrigger"in i?Se:!Fe},ue=function(){var Se=i.openClassName;return Se!==void 0?Se:"".concat(s,"-open")},fe=Bt.cloneElement(I,{className:Ue((t=I.props)===null||t===void 0?void 0:t.className,H&&ue()),ref:Gv(I)?eh($,I.ref):void 0}),pe=v;return!pe&&L.indexOf("contextMenu")!==-1&&(pe=["click"]),Bt.createElement(A4,yt({builtinPlacements:f},R,{prefixCls:s,ref:B,popupClassName:Ue(m,me({},"".concat(s,"-show-arrow"),o)),popupStyle:_,action:L,showAction:p,hideAction:pe,popupPlacement:u,popupAlign:c,popupTransitionName:a,popupAnimation:l,popupVisible:H,stretch:X()?"minWidth":"",popup:G(),onPopupVisibleChange:z,onPopupClick:K,getPopupContainer:g}),fe)}var vze=Bt.forwardRef(mze),ive=x.exports.createContext(null);function ove(i,e){return i===void 0?null:"".concat(i,"-").concat(e)}function rve(i){var e=x.exports.useContext(ive);return ove(e,i)}var _ze=["children","locked"],ju=x.exports.createContext(null);function bze(i,e){var t=Ce({},i);return Object.keys(e).forEach(function(n){var o=e[n];o!==void 0&&(t[n]=o)}),t}function yD(i){var e=i.children,t=i.locked,n=Hn(i,_ze),o=x.exports.useContext(ju),r=LI(function(){return bze(o,n)},[o,n],function(s,a){return!t&&(s[0]!==a[0]||!y4(s[1],a[1],!0))});return x.exports.createElement(ju.Provider,{value:r},e)}var Cze=[],sve=x.exports.createContext(null);function P4(){return x.exports.useContext(sve)}var ave=x.exports.createContext(Cze);function AI(i){var e=x.exports.useContext(ave);return x.exports.useMemo(function(){return i!==void 0?[].concat(_t(e),[i]):e},[e,i])}var lve=x.exports.createContext(null),mq=x.exports.createContext({});function mie(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(T4(i)){var t=i.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(t)||i.isContentEditable||t==="a"&&!!i.getAttribute("href"),o=i.getAttribute("tabindex"),r=Number(o),s=null;return o&&!Number.isNaN(r)?s=r:n&&s===null&&(s=0),n&&i.disabled&&(s=null),s!==null&&(s>=0||e&&s<0)}return!1}function yze(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=_t(i.querySelectorAll("*")).filter(function(n){return mie(n,e)});return mie(i,e)&&t.unshift(i),t}var FW=at.LEFT,BW=at.RIGHT,WW=at.UP,GR=at.DOWN,XR=at.ENTER,cve=at.ESC,kx=at.HOME,Ix=at.END,vie=[WW,GR,FW,BW];function wze(i,e,t,n){var o,r,s,a,l="prev",c="next",d="children",u="parent";if(i==="inline"&&n===XR)return{inlineTrigger:!0};var h=(o={},me(o,WW,l),me(o,GR,c),o),f=(r={},me(r,FW,t?c:l),me(r,BW,t?l:c),me(r,GR,d),me(r,XR,d),r),g=(s={},me(s,WW,l),me(s,GR,c),me(s,XR,d),me(s,cve,u),me(s,FW,t?d:u),me(s,BW,t?u:d),s),p={inline:h,horizontal:f,vertical:g,inlineSub:h,horizontalSub:g,verticalSub:g},v=(a=p["".concat(i).concat(e?"":"Sub")])===null||a===void 0?void 0:a[n];switch(v){case l:return{offset:-1,sibling:!0};case c:return{offset:1,sibling:!0};case u:return{offset:-1,sibling:!1};case d:return{offset:1,sibling:!1};default:return null}}function Sze(i){for(var e=i;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function xze(i,e){for(var t=i||document.activeElement;t;){if(e.has(t))return t;t=t.parentElement}return null}function vq(i,e){var t=yze(i,!0);return t.filter(function(n){return e.has(n)})}function _ie(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!i)return null;var o=vq(i,e),r=o.length,s=o.findIndex(function(a){return t===a});return n<0?s===-1?s=r-1:s-=1:n>0&&(s+=1),s=(s+r)%r,o[s]}var VW=function(e,t){var n=new Set,o=new Map,r=new Map;return e.forEach(function(s){var a=document.querySelector("[data-menu-id='".concat(ove(t,s),"']"));a&&(n.add(a),r.set(a,s),o.set(s,a))}),{elements:n,key2element:o,element2key:r}};function Lze(i,e,t,n,o,r,s,a,l,c){var d=x.exports.useRef(),u=x.exports.useRef();u.current=e;var h=function(){Xi.cancel(d.current)};return x.exports.useEffect(function(){return function(){h()}},[]),function(f){var g=f.which;if([].concat(vie,[XR,cve,kx,Ix]).includes(g)){var p=r(),v=VW(p,n),m=v,_=m.elements,y=m.key2element,w=m.element2key,L=y.get(e),D=xze(L,_),E=w.get(D),I=wze(i,s(E,!0).length===1,t,g);if(!I&&g!==kx&&g!==Ix)return;(vie.includes(g)||[kx,Ix].includes(g))&&f.preventDefault();var k=function(F){if(F){var $=F,z=F.querySelector("a");z!=null&&z.getAttribute("href")&&($=z);var K=w.get(F);a(K),h(),d.current=Xi(function(){u.current===K&&$.focus()})}};if([kx,Ix].includes(g)||I.sibling||!D){var R;!D||i==="inline"?R=o.current:R=Sze(D);var A,P=vq(R,_);g===kx?A=P[0]:g===Ix?A=P[P.length-1]:A=_ie(R,_,D,I.offset),k(A)}else if(I.inlineTrigger)l(E);else if(I.offset>0)l(E,!0),h(),d.current=Xi(function(){v=VW(p,n);var B=D.getAttribute("aria-controls"),F=document.getElementById(B),$=_ie(F,v.elements);k($)},5);else if(I.offset<0){var N=s(E,!0),M=N[N.length-2],H=y.get(M);l(M,!1),k(H)}}c==null||c(f)}}function Eze(i){Promise.resolve().then(i)}var _q="__RC_UTIL_PATH_SPLIT__",bie=function(e){return e.join(_q)},Dze=function(e){return e.split(_q)},HW="rc-menu-more";function kze(){var i=x.exports.useState({}),e=Ne(i,2),t=e[1],n=x.exports.useRef(new Map),o=x.exports.useRef(new Map),r=x.exports.useState([]),s=Ne(r,2),a=s[0],l=s[1],c=x.exports.useRef(0),d=x.exports.useRef(!1),u=function(){d.current||t({})},h=x.exports.useCallback(function(y,w){var L=bie(w);o.current.set(L,y),n.current.set(y,L),c.current+=1;var D=c.current;Eze(function(){D===c.current&&u()})},[]),f=x.exports.useCallback(function(y,w){var L=bie(w);o.current.delete(L),n.current.delete(y)},[]),g=x.exports.useCallback(function(y){l(y)},[]),p=x.exports.useCallback(function(y,w){var L=n.current.get(y)||"",D=Dze(L);return w&&a.includes(D[0])&&D.unshift(HW),D},[a]),v=x.exports.useCallback(function(y,w){return y.some(function(L){var D=p(L,!0);return D.includes(w)})},[p]),m=function(){var w=_t(n.current.keys());return a.length&&w.push(HW),w},_=x.exports.useCallback(function(y){var w="".concat(n.current.get(y)).concat(_q),L=new Set;return _t(o.current.keys()).forEach(function(D){D.startsWith(w)&&L.add(o.current.get(D))}),L},[]);return x.exports.useEffect(function(){return function(){d.current=!0}},[]),{registerPath:h,unregisterPath:f,refreshOverflowKeys:g,isSubPathKey:v,getKeyPath:p,getKeys:m,getSubPathKeys:_}}function _L(i){var e=x.exports.useRef(i);e.current=i;var t=x.exports.useCallback(function(){for(var n,o=arguments.length,r=new Array(o),s=0;s1&&(_.motionAppear=!1);var y=_.onVisibleChanged;return _.onVisibleChanged=function(w){return!h.current&&!w&&v(!0),y==null?void 0:y(w)},p?null:x.exports.createElement(yD,{mode:r,locked:!h.current},x.exports.createElement(th,yt({visible:m},_,{forceRender:l,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden")}),function(w){var L=w.className,D=w.style;return x.exports.createElement(bq,{id:e,className:L,style:D},o)}))}var jze=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Kze=["active"],qze=function(e){var t,n=e.style,o=e.className,r=e.title,s=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,c=e.children,d=e.itemIcon,u=e.expandIcon,h=e.popupClassName,f=e.popupOffset,g=e.popupStyle,p=e.onClick,v=e.onMouseEnter,m=e.onMouseLeave,_=e.onTitleClick,y=e.onTitleMouseEnter,w=e.onTitleMouseLeave,L=Hn(e,jze),D=rve(s),E=x.exports.useContext(ju),I=E.prefixCls,k=E.mode,R=E.openKeys,A=E.disabled,P=E.overflowDisabled,N=E.activeKey,M=E.selectedKeys,H=E.itemIcon,B=E.expandIcon,F=E.onItemClick,$=E.onOpenChange,z=E.onActive,K=x.exports.useContext(mq),j=K._internalRenderSubMenuItem,G=x.exports.useContext(lve),X=G.isSubPathKey,ue=AI(),fe="".concat(I,"-submenu"),pe=A||a,be=x.exports.useRef(),Se=x.exports.useRef(),Fe=d!=null?d:H,De=u!=null?u:B,ce=R.includes(s),Pe=!P&&ce,Oe=X(M,s),xe=dve(s,pe,y,w),Ee=xe.active,tt=Hn(xe,Kze),nt=x.exports.useState(!1),Qe=Ne(nt,2),Ge=Qe[0],re=Qe[1],ie=function(Lt){pe||re(Lt)},se=function(Lt){ie(!0),v==null||v({key:s,domEvent:Lt})},U=function(Lt){ie(!1),m==null||m({key:s,domEvent:Lt})},Y=x.exports.useMemo(function(){return Ee||(k!=="inline"?Ge||X([N],s):!1)},[k,Ee,N,Ge,s,X]),oe=uve(ue.length),te=function(Lt){pe||(_==null||_({key:s,domEvent:Lt}),k==="inline"&&$(s,!ce))},ye=_L(function(Je){p==null||p(NA(Je)),F(Je)}),Le=function(Lt){k!=="inline"&&$(s,Lt)},Te=function(){z(s)},We=D&&"".concat(D,"-popup"),je=x.exports.createElement("div",yt({role:"menuitem",style:oe,className:"".concat(fe,"-title"),tabIndex:pe?null:-1,ref:be,title:typeof r=="string"?r:null,"data-menu-id":P&&D?null:D,"aria-expanded":Pe,"aria-haspopup":!0,"aria-controls":We,"aria-disabled":pe,onClick:te,onFocus:Te},tt),r,x.exports.createElement(hve,{icon:k!=="horizontal"?De:void 0,props:Ce(Ce({},e),{},{isOpen:Pe,isSubMenu:!0})},x.exports.createElement("i",{className:"".concat(fe,"-arrow")}))),mt=x.exports.useRef(k);if(k!=="inline"&&ue.length>1?mt.current="vertical":mt.current=k,!P){var Dt=mt.current;je=x.exports.createElement(zze,{mode:Dt,prefixCls:fe,visible:!l&&Pe&&k!=="inline",popupClassName:h,popupOffset:f,popupStyle:g,popup:x.exports.createElement(yD,{mode:Dt==="horizontal"?"vertical":Dt},x.exports.createElement(bq,{id:We,ref:Se},c)),disabled:pe,onVisibleChange:Le},je)}var At=x.exports.createElement(sf.Item,yt({role:"none"},L,{component:"li",style:n,className:Ue(fe,"".concat(fe,"-").concat(k),o,(t={},me(t,"".concat(fe,"-open"),Pe),me(t,"".concat(fe,"-active"),Y),me(t,"".concat(fe,"-selected"),Oe),me(t,"".concat(fe,"-disabled"),pe),t)),onMouseEnter:se,onMouseLeave:U}),je,!P&&x.exports.createElement(Uze,{id:We,open:Pe,keyPath:ue},c));return j&&(At=j(At,e,{selected:Oe,active:Y,open:Pe,disabled:pe})),x.exports.createElement(yD,{onItemClick:ye,mode:k==="horizontal"?"vertical":k,itemIcon:Fe,expandIcon:De},At)};function yq(i){var e=i.eventKey,t=i.children,n=AI(e),o=Cq(t,n),r=P4();x.exports.useEffect(function(){if(r)return r.registerPath(e,n),function(){r.unregisterPath(e,n)}},[n]);var s;return r?s=o:s=x.exports.createElement(qze,i,o),x.exports.createElement(ave.Provider,{value:n},s)}var Gze=["className","title","eventKey","children"],Xze=["children"],Yze=function(e){var t=e.className,n=e.title;e.eventKey;var o=e.children,r=Hn(e,Gze),s=x.exports.useContext(ju),a=s.prefixCls,l="".concat(a,"-item-group");return x.exports.createElement("li",yt({role:"presentation"},r,{onClick:function(d){return d.stopPropagation()},className:Ue(l,t)}),x.exports.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:typeof n=="string"?n:void 0},n),x.exports.createElement("ul",{role:"group",className:"".concat(l,"-list")},o))};function gve(i){var e=i.children,t=Hn(i,Xze),n=AI(t.eventKey),o=Cq(e,n),r=P4();return r?o:x.exports.createElement(Yze,kf(t,["warnKey"]),o)}function pve(i){var e=i.className,t=i.style,n=x.exports.useContext(ju),o=n.prefixCls,r=P4();return r?null:x.exports.createElement("li",{role:"separator",className:Ue("".concat(o,"-item-divider"),e),style:t})}var Zze=["label","children","key","type"];function $W(i){return(i||[]).map(function(e,t){if(e&&qn(e)==="object"){var n=e,o=n.label,r=n.children,s=n.key,a=n.type,l=Hn(n,Zze),c=s!=null?s:"tmp-".concat(t);return r||a==="group"?a==="group"?x.exports.createElement(gve,yt({key:c},l,{title:o}),$W(r)):x.exports.createElement(yq,yt({key:c},l,{title:o}),$W(r)):a==="divider"?x.exports.createElement(pve,yt({key:c},l)):x.exports.createElement(O4,yt({key:c},l),o)}return null}).filter(function(e){return e})}function Qze(i,e,t){var n=i;return e&&(n=$W(e)),Cq(n,t)}var Jze=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],F1=[],eUe=x.exports.forwardRef(function(i,e){var t,n,o=i,r=o.prefixCls,s=r===void 0?"rc-menu":r,a=o.rootClassName,l=o.style,c=o.className,d=o.tabIndex,u=d===void 0?0:d,h=o.items,f=o.children,g=o.direction,p=o.id,v=o.mode,m=v===void 0?"vertical":v,_=o.inlineCollapsed,y=o.disabled,w=o.disabledOverflow,L=o.subMenuOpenDelay,D=L===void 0?.1:L,E=o.subMenuCloseDelay,I=E===void 0?.1:E,k=o.forceSubMenuRender,R=o.defaultOpenKeys,A=o.openKeys,P=o.activeKey,N=o.defaultActiveFirst,M=o.selectable,H=M===void 0?!0:M,B=o.multiple,F=B===void 0?!1:B,$=o.defaultSelectedKeys,z=o.selectedKeys,K=o.onSelect,j=o.onDeselect,G=o.inlineIndent,X=G===void 0?24:G,ue=o.motion,fe=o.defaultMotions,pe=o.triggerSubMenuAction,be=pe===void 0?"hover":pe,Se=o.builtinPlacements,Fe=o.itemIcon,De=o.expandIcon,ce=o.overflowedIndicator,Pe=ce===void 0?"...":ce,Oe=o.overflowedIndicatorPopupClassName,xe=o.getPopupContainer,Ee=o.onClick,tt=o.onOpenChange,nt=o.onKeyDown;o.openAnimation,o.openTransitionName;var Qe=o._internalRenderMenuItem,Ge=o._internalRenderSubMenuItem,re=Hn(o,Jze),ie=x.exports.useMemo(function(){return Qze(f,h,F1)},[f,h]),se=x.exports.useState(!1),U=Ne(se,2),Y=U[0],oe=U[1],te=x.exports.useRef(),ye=Tze(p),Le=g==="rtl",Te=Kl(R,{value:A,postState:function(gi){return gi||F1}}),We=Ne(Te,2),je=We[0],mt=We[1],Dt=function(gi){var Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function on(){mt(gi),tt==null||tt(gi)}Kt?zu.exports.flushSync(on):on()},At=x.exports.useState(je),Je=Ne(At,2),Lt=Je[0],Ot=Je[1],Vn=x.exports.useRef(!1),Et=x.exports.useMemo(function(){return(m==="inline"||m==="vertical")&&_?["vertical",_]:[m,!1]},[m,_]),tn=Ne(Et,2),di=tn[0],cn=tn[1],Gn=di==="inline",bn=x.exports.useState(di),Pt=Ne(bn,2),qt=Pt[0],Nt=Pt[1],jt=x.exports.useState(cn),Gt=Ne(jt,2),It=Gt[0],Ft=Gt[1];x.exports.useEffect(function(){Nt(di),Ft(cn),Vn.current&&(Gn?mt(Lt):Dt(F1))},[di,cn]);var Ct=x.exports.useState(0),Zt=Ne(Ct,2),wn=Zt[0],Dn=Zt[1],Xn=wn>=ie.length-1||qt!=="horizontal"||w;x.exports.useEffect(function(){Gn&&Ot(je)},[je]),x.exports.useEffect(function(){return Vn.current=!0,function(){Vn.current=!1}},[]);var jn=kze(),Zi=jn.registerPath,an=jn.unregisterPath,Xt=jn.refreshOverflowKeys,oi=jn.isSubPathKey,Ze=jn.getKeyPath,de=jn.getKeys,Ve=jn.getSubPathKeys,ot=x.exports.useMemo(function(){return{registerPath:Zi,unregisterPath:an}},[Zi,an]),Sn=x.exports.useMemo(function(){return{isSubPathKey:oi}},[oi]);x.exports.useEffect(function(){Xt(Xn?F1:ie.slice(wn+1).map(function(mi){return mi.key}))},[wn,Xn]);var $n=Kl(P||N&&((t=ie[0])===null||t===void 0?void 0:t.key),{value:P}),Ci=Ne($n,2),An=Ci[0],lo=Ci[1],Qo=_L(function(mi){lo(mi)}),zo=_L(function(){lo(void 0)});x.exports.useImperativeHandle(e,function(){return{list:te.current,focus:function(gi){var Kt,on=de(),vi=VW(on,ye),Uo=vi.elements,Qi=vi.key2element,Jo=vi.element2key,_r=vq(te.current,Uo),zs=An!=null?An:_r[0]?Jo.get(_r[0]):(Kt=ie.find(function(Ts){return!Ts.props.disabled}))===null||Kt===void 0?void 0:Kt.key,Tr=Qi.get(zs);if(zs&&Tr){var ds;Tr==null||(ds=Tr.focus)===null||ds===void 0||ds.call(Tr,gi)}}}});var oc=Kl($||[],{value:z,postState:function(gi){return Array.isArray(gi)?gi:gi==null?F1:[gi]}}),Yc=Ne(oc,2),Gr=Yc[0],Ua=Yc[1],vl=function(gi){if(H){var Kt=gi.key,on=Gr.includes(Kt),vi;F?on?vi=Gr.filter(function(Qi){return Qi!==Kt}):vi=[].concat(_t(Gr),[Kt]):vi=[Kt],Ua(vi);var Uo=Ce(Ce({},gi),{},{selectedKeys:vi});on?j==null||j(Uo):K==null||K(Uo)}!F&&je.length&&qt!=="inline"&&Dt(F1)},ba=_L(function(mi){Ee==null||Ee(NA(mi)),vl(mi)}),_l=_L(function(mi,gi){var Kt=je.filter(function(vi){return vi!==mi});if(gi)Kt.push(mi);else if(qt!=="inline"){var on=Ve(mi);Kt=Kt.filter(function(vi){return!on.has(vi)})}y4(je,Kt,!0)||Dt(Kt,!0)}),rc=function(gi,Kt){var on=Kt!=null?Kt:!je.includes(gi);_l(gi,on)},Zc=Lze(qt,An,Le,ye,te,de,Ze,lo,rc,nt);x.exports.useEffect(function(){oe(!0)},[]);var Ca=x.exports.useMemo(function(){return{_internalRenderMenuItem:Qe,_internalRenderSubMenuItem:Ge}},[Qe,Ge]),Yd=qt!=="horizontal"||w?ie:ie.map(function(mi,gi){return x.exports.createElement(yD,{key:mi.key,overflowDisabled:gi>wn},mi)}),bl=x.exports.createElement(sf,yt({id:p,ref:te,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:O4,className:Ue(s,"".concat(s,"-root"),"".concat(s,"-").concat(qt),c,(n={},me(n,"".concat(s,"-inline-collapsed"),It),me(n,"".concat(s,"-rtl"),Le),n),a),dir:g,style:l,role:"menu",tabIndex:u,data:Yd,renderRawItem:function(gi){return gi},renderRawRest:function(gi){var Kt=gi.length,on=Kt?ie.slice(-Kt):null;return x.exports.createElement(yq,{eventKey:HW,title:Pe,disabled:Xn,internalPopupClose:Kt===0,popupClassName:Oe},on)},maxCount:qt!=="horizontal"||w?sf.INVALIDATE:sf.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(gi){Dn(gi)},onKeyDown:Zc},re));return x.exports.createElement(mq.Provider,{value:Ca},x.exports.createElement(ive.Provider,{value:ye},x.exports.createElement(yD,{prefixCls:s,rootClassName:a,mode:qt,openKeys:je,rtl:Le,disabled:y,motion:Y?ue:null,defaultMotions:Y?fe:null,activeKey:An,onActive:Qo,onInactive:zo,selectedKeys:Gr,inlineIndent:X,subMenuOpenDelay:D,subMenuCloseDelay:I,forceSubMenuRender:k,builtinPlacements:Se,triggerSubMenuAction:be,getPopupContainer:xe,itemIcon:Fe,expandIcon:De,onItemClick:ba,onOpenChange:_l},x.exports.createElement(lve.Provider,{value:Sn},bl),x.exports.createElement("div",{style:{display:"none"},"aria-hidden":!0},x.exports.createElement(sve.Provider,{value:ot},ie)))))}),PI=eUe;PI.Item=O4;PI.SubMenu=yq;PI.ItemGroup=gve;PI.Divider=pve;var tUe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},nUe=tUe,iUe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:nUe}))},oUe=x.exports.forwardRef(iUe);function rUe(i){return lr(i,{inputAffixPadding:i.paddingXXS})}const sUe=i=>{const{controlHeight:e,fontSize:t,lineHeight:n,lineWidth:o,controlHeightSM:r,controlHeightLG:s,fontSizeLG:a,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:d,controlPaddingHorizontal:u,colorFillAlter:h,colorPrimaryHover:f,colorPrimary:g,controlOutlineWidth:p,controlOutline:v,colorErrorOutline:m,colorWarningOutline:_,colorBgContainer:y}=i;return{paddingBlock:Math.max(Math.round((e-t*n)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((r-t*n)/2*10)/10-o,0),paddingBlockLG:Math.ceil((s-a*l)/2*10)/10-o,paddingInline:c-o,paddingInlineSM:d-o,paddingInlineLG:u-o,addonBg:h,activeBorderColor:g,hoverBorderColor:f,activeShadow:`0 0 0 ${p}px ${v}`,errorActiveShadow:`0 0 0 ${p}px ${m}`,warningActiveShadow:`0 0 0 ${p}px ${_}`,hoverBg:y,activeBg:y,inputFontSize:t,inputFontSizeLG:a,inputFontSizeSM:t}},aUe=i=>({borderColor:i.hoverBorderColor,backgroundColor:i.hoverBg}),wq=i=>({color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover:not([disabled])":Object.assign({},aUe(lr(i,{hoverBorderColor:i.colorBorder,hoverBg:i.colorBgContainerDisabled})))}),mve=(i,e)=>({background:i.colorBgContainer,borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:e.borderColor,"&:hover":{borderColor:e.hoverBorderColor,backgroundColor:i.hoverBg},"&:focus, &:focus-within":{borderColor:e.activeBorderColor,boxShadow:e.activeShadow,outline:0,backgroundColor:i.activeBg}}),yie=(i,e)=>({[`&${i.componentCls}-status-${e.status}:not(${i.componentCls}-disabled)`]:Object.assign(Object.assign({},mve(i,e)),{[`${i.componentCls}-prefix, ${i.componentCls}-suffix`]:{color:e.affixColor}})}),lUe=(i,e)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},mve(i,{borderColor:i.colorBorder,hoverBorderColor:i.colorPrimaryHover,activeBorderColor:i.colorPrimary,activeShadow:i.activeShadow})),{[`&${i.componentCls}-disabled, &[disabled]`]:Object.assign({},wq(i))}),yie(i,{status:"error",borderColor:i.colorError,hoverBorderColor:i.colorErrorBorderHover,activeBorderColor:i.colorError,activeShadow:i.errorActiveShadow,affixColor:i.colorError})),yie(i,{status:"warning",borderColor:i.colorWarning,hoverBorderColor:i.colorWarningBorderHover,activeBorderColor:i.colorWarning,activeShadow:i.warningActiveShadow,affixColor:i.colorWarning})),e)}),wie=(i,e)=>({[`&${i.componentCls}-group-wrapper-status-${e.status}`]:{[`${i.componentCls}-group-addon`]:{borderColor:e.addonBorderColor,color:e.addonColor}}}),cUe=i=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${i.componentCls}-group`]:{"&-addon":{background:i.addonBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},wie(i,{status:"error",addonBorderColor:i.colorError,addonColor:i.colorErrorText})),wie(i,{status:"warning",addonBorderColor:i.colorWarning,addonColor:i.colorWarningText})),{[`&${i.componentCls}-group-wrapper-disabled`]:{[`${i.componentCls}-group-addon`]:Object.assign({},wq(i))}})}),dUe=(i,e)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${i.componentCls}-disabled, &[disabled]`]:{color:i.colorTextDisabled}},e)}),vve=(i,e)=>({background:e.bg,borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:"transparent",["input&, & input, textarea&, & textarea"]:{color:e==null?void 0:e.inputColor},"&:hover":{background:e.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:e.activeBorderColor,backgroundColor:i.activeBg}}),Sie=(i,e)=>({[`&${i.componentCls}-status-${e.status}:not(${i.componentCls}-disabled)`]:Object.assign(Object.assign({},vve(i,e)),{[`${i.componentCls}-prefix, ${i.componentCls}-suffix`]:{color:e.affixColor}})}),uUe=(i,e)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},vve(i,{bg:i.colorFillTertiary,hoverBg:i.colorFillSecondary,activeBorderColor:i.colorPrimary})),{[`&${i.componentCls}-disabled, &[disabled]`]:Object.assign({},wq(i))}),Sie(i,{status:"error",bg:i.colorErrorBg,hoverBg:i.colorErrorBgHover,activeBorderColor:i.colorError,inputColor:i.colorErrorText,affixColor:i.colorError})),Sie(i,{status:"warning",bg:i.colorWarningBg,hoverBg:i.colorWarningBgHover,activeBorderColor:i.colorWarning,inputColor:i.colorWarningText,affixColor:i.colorWarning})),e)}),xie=(i,e)=>({[`&${i.componentCls}-group-wrapper-status-${e.status}`]:{[`${i.componentCls}-group-addon`]:{background:e.addonBg,color:e.addonColor}}}),hUe=i=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${i.componentCls}-group`]:{"&-addon":{background:i.colorFillTertiary},[`${i.componentCls}-filled:not(:focus):not(:focus-within)`]:{"&:not(:first-child)":{borderInlineStart:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`},"&:not(:last-child)":{borderInlineEnd:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`}}}},xie(i,{status:"error",addonBg:i.colorErrorBg,addonColor:i.colorErrorText})),xie(i,{status:"warning",addonBg:i.colorWarningBg,addonColor:i.colorWarningText})),{[`&${i.componentCls}-group-wrapper-disabled`]:{[`${i.componentCls}-group`]:{"&-addon":{background:i.colorFillTertiary,color:i.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderTop:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderTop:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`}}}})}),fUe=i=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:i,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),_ve=i=>{const{paddingBlockLG:e,lineHeightLG:t,borderRadiusLG:n,paddingInlineLG:o}=i;return{padding:`${rt(e)} ${rt(o)}`,fontSize:i.inputFontSizeLG,lineHeight:t,borderRadius:n}},bve=i=>({padding:`${rt(i.paddingBlockSM)} ${rt(i.paddingInlineSM)}`,fontSize:i.inputFontSizeSM,borderRadius:i.borderRadiusSM}),Cve=i=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${rt(i.paddingBlock)} ${rt(i.paddingInline)}`,color:i.colorText,fontSize:i.inputFontSize,lineHeight:i.lineHeight,borderRadius:i.borderRadius,transition:`all ${i.motionDurationMid}`},fUe(i.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:i.controlHeight,lineHeight:i.lineHeight,verticalAlign:"bottom",transition:`all ${i.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},_ve(i)),"&-sm":Object.assign({},bve(i)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),gUe=i=>{const{componentCls:e,antCls:t}=i;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,["&[class*='col-']"]:{paddingInlineEnd:i.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},_ve(i)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},bve(i)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{["&-addon, &-wrap"]:{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${rt(i.paddingInline)}`,color:i.colorText,fontWeight:"normal",fontSize:i.inputFontSize,textAlign:"center",borderRadius:i.borderRadius,transition:`all ${i.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`${rt(i.calc(i.paddingBlock).add(1).mul(-1).equal())} ${rt(i.calc(i.paddingInline).mul(-1).equal())}`,[`&${t}-select-single:not(${t}-select-customize-input):not(${t}-pagination-size-changer)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${rt(i.lineWidth)} ${i.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:i.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px ${rt(i.calc(i.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},ope()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:i.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[` & > ${e}-affix-wrapper, & > ${e}-number-affix-wrapper, & > ${t}-picker-range @@ -269,17 +269,17 @@ html body { & > ${t}-cascader-picker:first-child ${e}`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius},[`& > *:last-child, & > ${t}-select:last-child > ${t}-select-selector, & > ${t}-cascader-picker:last-child ${e}, - & > ${t}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:i.lineWidth,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius},[`& > ${t}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:i.calc(i.lineWidth).mul(-1).equal(),[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:i.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:i.borderRadius}}}})}},pUe=i=>{const{componentCls:e,controlHeightSM:t,lineWidth:n,calc:o}=i,r=16,s=o(t).sub(o(n).mul(2)).sub(r).div(2).equal();return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Pa(i)),bve(i)),lUe(i)),uUe(i)),dUe(i)),{'&[type="color"]':{height:i.controlHeight,[`&${e}-lg`]:{height:i.controlHeightLG},[`&${e}-sm`]:{height:t,paddingTop:s,paddingBottom:s}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},mUe=i=>{const{componentCls:e}=i;return{[`${e}-clear-icon`]:{margin:0,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"&:hover":{color:i.colorTextTertiary},"&:active":{color:i.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${rt(i.inputAffixPadding)}`}}}},vUe=i=>{const{componentCls:e,inputAffixPadding:t,colorTextDescription:n,motionDurationSlow:o,colorIcon:r,colorIconHover:s,iconCls:a}=i;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign({},bve(i)),{display:"inline-flex",[`&:not(${e}-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${e}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:i.paddingXS}},"&-show-count-suffix":{color:n},"&-show-count-has-suffix":{marginInlineEnd:i.paddingXXS},"&-prefix":{marginInlineEnd:t},"&-suffix":{marginInlineStart:t}}}),mUe(i)),{[`${a}${e}-password-icon`]:{color:r,cursor:"pointer",transition:`all ${o}`,"&:hover":{color:s}}})}},_Ue=i=>{const{componentCls:e,borderRadiusLG:t,borderRadiusSM:n}=i;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},Pa(i)),gUe(i)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:t,fontSize:i.inputFontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:n}}},cUe(i)),hUe(i)),{[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}}})})}},bUe=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-search`;return{[n]:{[`${e}`]:{"&:hover, &:focus":{borderColor:i.colorPrimaryHover,[`+ ${e}-group-addon ${n}-button:not(${t}-btn-primary)`]:{borderInlineStartColor:i.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{borderRadius:0},[`${e}-lg`]:{lineHeight:i.calc(i.lineHeightLG).sub(2e-4).equal({unit:!1})},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${n}-button`]:{marginInlineEnd:-1,paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${n}-button:not(${t}-btn-primary)`]:{color:i.colorTextDescription,"&:hover":{color:i.colorPrimaryHover},"&:active":{color:i.colorPrimaryActive},[`&${t}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${n}-button`]:{height:i.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${n}-button`]:{height:i.controlHeightLG},[`&-small ${n}-button`]:{height:i.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:i.calc(i.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button, + & > ${t}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:i.lineWidth,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius},[`& > ${t}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:i.calc(i.lineWidth).mul(-1).equal(),[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:i.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:i.borderRadius}}}})}},pUe=i=>{const{componentCls:e,controlHeightSM:t,lineWidth:n,calc:o}=i,r=16,s=o(t).sub(o(n).mul(2)).sub(r).div(2).equal();return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Pa(i)),Cve(i)),lUe(i)),uUe(i)),dUe(i)),{'&[type="color"]':{height:i.controlHeight,[`&${e}-lg`]:{height:i.controlHeightLG},[`&${e}-sm`]:{height:t,paddingTop:s,paddingBottom:s}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},mUe=i=>{const{componentCls:e}=i;return{[`${e}-clear-icon`]:{margin:0,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"&:hover":{color:i.colorTextTertiary},"&:active":{color:i.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${rt(i.inputAffixPadding)}`}}}},vUe=i=>{const{componentCls:e,inputAffixPadding:t,colorTextDescription:n,motionDurationSlow:o,colorIcon:r,colorIconHover:s,iconCls:a}=i;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign({},Cve(i)),{display:"inline-flex",[`&:not(${e}-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${e}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:i.paddingXS}},"&-show-count-suffix":{color:n},"&-show-count-has-suffix":{marginInlineEnd:i.paddingXXS},"&-prefix":{marginInlineEnd:t},"&-suffix":{marginInlineStart:t}}}),mUe(i)),{[`${a}${e}-password-icon`]:{color:r,cursor:"pointer",transition:`all ${o}`,"&:hover":{color:s}}})}},_Ue=i=>{const{componentCls:e,borderRadiusLG:t,borderRadiusSM:n}=i;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},Pa(i)),gUe(i)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:t,fontSize:i.inputFontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:n}}},cUe(i)),hUe(i)),{[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}}})})}},bUe=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-search`;return{[n]:{[`${e}`]:{"&:hover, &:focus":{borderColor:i.colorPrimaryHover,[`+ ${e}-group-addon ${n}-button:not(${t}-btn-primary)`]:{borderInlineStartColor:i.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{borderRadius:0},[`${e}-lg`]:{lineHeight:i.calc(i.lineHeightLG).sub(2e-4).equal({unit:!1})},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${n}-button`]:{marginInlineEnd:-1,paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${n}-button:not(${t}-btn-primary)`]:{color:i.colorTextDescription,"&:hover":{color:i.colorPrimaryHover},"&:active":{color:i.colorPrimaryActive},[`&${t}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${n}-button`]:{height:i.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${n}-button`]:{height:i.controlHeightLG},[`&-small ${n}-button`]:{height:i.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:i.calc(i.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button, > ${e}, - ${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}},CUe=i=>{const{componentCls:e,paddingLG:t}=i,n=`${e}-textarea`;return{[n]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:i.calc(i.fontSize).mul(i.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:i.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${n}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:i.paddingXS,insetBlockStart:i.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:i.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},yUe=i=>{const{componentCls:e}=i;return{[`${e}-out-of-range`]:{[`&, & input, & textarea, ${e}-show-count-suffix, ${e}-data-count`]:{color:i.colorError}}}};var wq=jc("Input",i=>{const e=lr(i,rUe(i));return[pUe(e),CUe(e),vUe(e),_Ue(e),bUe(e),yUe(e),QK(e)]},sUe),wUe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},SUe=wUe,xUe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:SUe}))},LUe=x.exports.forwardRef(xUe),F4=x.exports.createContext(null),EUe=function(e){var t=e.activeTabOffset,n=e.horizontal,o=e.rtl,r=e.indicator,s=r===void 0?{}:r,a=s.size,l=s.align,c=l===void 0?"center":l,d=x.exports.useState(),u=Ne(d,2),h=u[0],f=u[1],g=x.exports.useRef(),p=Bt.useCallback(function(m){return typeof a=="function"?a(m):typeof a=="number"?a:m},[a]);function v(){Xi.cancel(g.current)}return x.exports.useEffect(function(){var m={};if(t)if(n){m.width=p(t.width);var _=o?"right":"left";c==="start"&&(m[_]=t[_]),c==="center"&&(m[_]=t[_]+t.width/2,m.transform=o?"translateX(50%)":"translateX(-50%)"),c==="end"&&(m[_]=t[_]+t.width,m.transform="translateX(-100%)")}else m.height=p(t.height),c==="start"&&(m.top=t.top),c==="center"&&(m.top=t.top+t.height/2,m.transform="translateY(-50%)"),c==="end"&&(m.top=t.top+t.height,m.transform="translateY(-100%)");return v(),g.current=Xi(function(){f(m)}),v},[t,n,o,c,p]),{style:h}},xie={width:0,height:0,left:0,top:0};function DUe(i,e,t){return x.exports.useMemo(function(){for(var n,o=new Map,r=e.get((n=i[0])===null||n===void 0?void 0:n.key)||xie,s=r.left+r.width,a=0;aM?(P=R,D.current="x"):(P=A,D.current="y"),e(-P,-P)&&k.preventDefault()}var I=x.exports.useRef(null);I.current={onTouchStart:y,onTouchMove:w,onTouchEnd:L,onWheel:E},x.exports.useEffect(function(){function k(N){I.current.onTouchStart(N)}function R(N){I.current.onTouchMove(N)}function A(N){I.current.onTouchEnd(N)}function P(N){I.current.onWheel(N)}return document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("touchend",A,{passive:!1}),i.current.addEventListener("touchstart",k,{passive:!1}),i.current.addEventListener("wheel",P),function(){document.removeEventListener("touchmove",R),document.removeEventListener("touchend",A)}},[])}function Cve(i){var e=x.exports.useState(0),t=Ne(e,2),n=t[0],o=t[1],r=x.exports.useRef(0),s=x.exports.useRef();return s.current=i,JB(function(){var a;(a=s.current)===null||a===void 0||a.call(s)},[n]),function(){r.current===n&&(r.current+=1,o(r.current))}}function TUe(i){var e=x.exports.useRef([]),t=x.exports.useState({}),n=Ne(t,2),o=n[1],r=x.exports.useRef(typeof i=="function"?i():i),s=Cve(function(){var l=r.current;e.current.forEach(function(c){l=c(l)}),e.current=[],r.current=l,o({})});function a(l){e.current.push(l),s()}return[r.current,a]}var kie={width:0,height:0,left:0,top:0,right:0};function NUe(i,e,t,n,o,r,s){var a=s.tabs,l=s.tabPosition,c=s.rtl,d,u,h;return["top","bottom"].includes(l)?(d="width",u=c?"right":"left",h=Math.abs(t)):(d="height",u="top",h=-t),x.exports.useMemo(function(){if(!a.length)return[0,0];for(var f=a.length,g=f,p=0;ph+e){g=p-1;break}}for(var m=0,_=f-1;_>=0;_-=1){var y=i.get(a[_].key)||kie;if(y[u]=g?[0,0]:[m,g]},[i,e,n,o,r,h,l,a.map(function(f){return f.key}).join("_"),c])}function Iie(i){var e;return i instanceof Map?(e={},i.forEach(function(t,n){e[n]=t})):e=i,JSON.stringify(e)}var RUe="TABS_DQ";function yve(i){return String(i).replace(/"/g,RUe)}function wve(i,e,t,n){return!(!t||n||i===!1||i===void 0&&(e===!1||e===null))}var Sve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.editable,o=i.locale,r=i.style;return!n||n.showAdd===!1?null:x.exports.createElement("button",{ref:e,type:"button",className:"".concat(t,"-nav-add"),style:r,"aria-label":(o==null?void 0:o.addAriaLabel)||"Add tab",onClick:function(a){n.onEdit("add",{event:a})}},n.addIcon||"+")}),Tie=x.exports.forwardRef(function(i,e){var t=i.position,n=i.prefixCls,o=i.extra;if(!o)return null;var r,s={};return qn(o)==="object"&&!x.exports.isValidElement(o)?s=o:s.right=o,t==="right"&&(r=s.right),t==="left"&&(r=s.left),r?x.exports.createElement("div",{className:"".concat(n,"-extra-content"),ref:e},r):null}),MUe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.id,o=i.tabs,r=i.locale,s=i.mobile,a=i.moreIcon,l=a===void 0?"More":a,c=i.moreTransitionName,d=i.style,u=i.className,h=i.editable,f=i.tabBarGutter,g=i.rtl,p=i.removeAriaLabel,v=i.onTabClick,m=i.getPopupContainer,_=i.popupClassName,y=x.exports.useState(!1),w=Ne(y,2),L=w[0],D=w[1],E=x.exports.useState(null),I=Ne(E,2),k=I[0],R=I[1],A="".concat(n,"-more-popup"),P="".concat(t,"-dropdown"),N=k!==null?"".concat(A,"-").concat(k):null,M=r==null?void 0:r.dropdownAriaLabel;function H(G,X){G.preventDefault(),G.stopPropagation(),h.onEdit("remove",{key:X,event:G})}var B=x.exports.createElement(PI,{onClick:function(X){var ue=X.key,fe=X.domEvent;v(ue,fe),D(!1)},prefixCls:"".concat(P,"-menu"),id:A,tabIndex:-1,role:"listbox","aria-activedescendant":N,selectedKeys:[k],"aria-label":M!==void 0?M:"expanded dropdown"},o.map(function(G){var X=G.closable,ue=G.disabled,fe=G.closeIcon,pe=G.key,be=G.label,Se=wve(X,fe,h,ue);return x.exports.createElement(O4,{key:pe,id:"".concat(A,"-").concat(pe),role:"option","aria-controls":n&&"".concat(n,"-panel-").concat(pe),disabled:ue},x.exports.createElement("span",null,be),Se&&x.exports.createElement("button",{type:"button","aria-label":p||"remove",tabIndex:0,className:"".concat(P,"-menu-item-remove"),onClick:function(De){De.stopPropagation(),H(De,pe)}},fe||h.removeIcon||"\xD7"))}));function F(G){for(var X=o.filter(function(Se){return!Se.disabled}),ue=X.findIndex(function(Se){return Se.key===k})||0,fe=X.length,pe=0;peXt?"left":"right"})}),N=Ne(P,2),M=N[0],H=N[1],B=Lie(0,function(an,Xt){!A&&p&&p({direction:an>Xt?"top":"bottom"})}),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState([0,0]),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useState([0,0]),fe=Ne(ue,2),pe=fe[0],be=fe[1],Se=x.exports.useState([0,0]),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1],Pe=x.exports.useState([0,0]),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=TUe(new Map),nt=Ne(tt,2),Qe=nt[0],Ge=nt[1],re=DUe(y,Qe,pe[0]),ie=JN(G,A),se=JN(pe,A),U=JN(De,A),Y=JN(xe,A),oe=ieTe?Te:an}var je=x.exports.useRef(null),mt=x.exports.useState(),Dt=Ne(mt,2),At=Dt[0],Je=Dt[1];function Lt(){Je(Date.now())}function Ot(){je.current&&clearTimeout(je.current)}IUe(E,function(an,Xt){function oi(Ze,de){Ze(function(Ve){var ot=We(Ve+de);return ot})}return oe?(A?oi(H,an):oi(z,Xt),Ot(),Lt(),!0):!1}),x.exports.useEffect(function(){return Ot(),At&&(je.current=setTimeout(function(){Je(0)},100)),Ot},[At]);var Vn=NUe(re,te,A?M:$,se,U,Y,Ce(Ce({},i),{},{tabs:y})),Et=Ne(Vn,2),tn=Et[0],di=Et[1],cn=tl(function(){var an=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,Xt=re.get(an)||{width:0,height:0,left:0,right:0,top:0};if(A){var oi=M;a?Xt.rightM+te&&(oi=Xt.right+Xt.width-te):Xt.left<-M?oi=-Xt.left:Xt.left+Xt.width>-M+te&&(oi=-(Xt.left+Xt.width-te)),z(0),H(We(oi))}else{var Ze=$;Xt.top<-$?Ze=-Xt.top:Xt.top+Xt.height>-$+te&&(Ze=-(Xt.top+Xt.height-te)),H(0),z(We(Ze))}}),Gn={};u==="top"||u==="bottom"?Gn[a?"marginRight":"marginLeft"]=h:Gn.marginTop=h;var bn=y.map(function(an,Xt){var oi=an.key;return x.exports.createElement(PUe,{id:o,prefixCls:_,key:oi,tab:an,style:Xt===0?void 0:Gn,closable:an.closable,editable:c,active:oi===s,renderWrapper:f,removeAriaLabel:d==null?void 0:d.removeAriaLabel,onClick:function(de){g(oi,de)},onFocus:function(){cn(oi),Lt(),E.current&&(a||(E.current.scrollLeft=0),E.current.scrollTop=0)}})}),Pt=function(){return Ge(function(){var Xt,oi=new Map,Ze=(Xt=I.current)===null||Xt===void 0?void 0:Xt.getBoundingClientRect();return y.forEach(function(de){var Ve,ot=de.key,Sn=(Ve=I.current)===null||Ve===void 0?void 0:Ve.querySelector('[data-node-key="'.concat(yve(ot),'"]'));if(Sn){var $n=OUe(Sn,Ze),Ci=Ne($n,4),An=Ci[0],lo=Ci[1],Qo=Ci[2],zo=Ci[3];oi.set(ot,{width:An,height:lo,left:Qo,top:zo})}}),oi})};x.exports.useEffect(function(){Pt()},[y.map(function(an){return an.key}).join("_")]);var qt=Cve(function(){var an=B1(w),Xt=B1(L),oi=B1(D);X([an[0]-Xt[0]-oi[0],an[1]-Xt[1]-oi[1]]);var Ze=B1(R);ce(Ze);var de=B1(k);Ee(de);var Ve=B1(I);be([Ve[0]-Ze[0],Ve[1]-Ze[1]]),Pt()}),Nt=y.slice(0,tn),jt=y.slice(di+1),Gt=[].concat(_t(Nt),_t(jt)),It=re.get(s),Ft=EUe({activeTabOffset:It,horizontal:A,indicator:v,rtl:a}),Ct=Ft.style;x.exports.useEffect(function(){cn()},[s,Le,Te,Iie(It),Iie(re),A]),x.exports.useEffect(function(){qt()},[a]);var Zt=!!Gt.length,wn="".concat(_,"-nav-wrap"),Dn,Xn,jn,Zi;return A?a?(Xn=M>0,Dn=M!==Te):(Dn=M<0,Xn=M!==Le):(jn=$<0,Zi=$!==Le),x.exports.createElement(Mu,{onResize:qt},x.exports.createElement("div",{ref:Pb(e,w),role:"tablist",className:Ue("".concat(_,"-nav"),t),style:n,onKeyDown:function(){Lt()}},x.exports.createElement(Tie,{ref:L,position:"left",extra:l,prefixCls:_}),x.exports.createElement(Mu,{onResize:qt},x.exports.createElement("div",{className:Ue(wn,me(me(me(me({},"".concat(wn,"-ping-left"),Dn),"".concat(wn,"-ping-right"),Xn),"".concat(wn,"-ping-top"),jn),"".concat(wn,"-ping-bottom"),Zi)),ref:E},x.exports.createElement(Mu,{onResize:qt},x.exports.createElement("div",{ref:I,className:"".concat(_,"-nav-list"),style:{transform:"translate(".concat(M,"px, ").concat($,"px)"),transition:At?"none":void 0}},bn,x.exports.createElement(Sve,{ref:R,prefixCls:_,locale:d,editable:c,style:Ce(Ce({},bn.length===0?void 0:Gn),{},{visibility:Zt?"hidden":null})}),x.exports.createElement("div",{className:Ue("".concat(_,"-ink-bar"),me({},"".concat(_,"-ink-bar-animated"),r.inkBar)),style:Ct}))))),x.exports.createElement(AUe,yt({},i,{removeAriaLabel:d==null?void 0:d.removeAriaLabel,ref:k,prefixCls:_,tabs:Gt,className:!Zt&&ye,tabMoving:!!At})),x.exports.createElement(Tie,{ref:D,position:"right",extra:l,prefixCls:_})))}),xve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,o=i.style,r=i.id,s=i.active,a=i.tabKey,l=i.children;return x.exports.createElement("div",{id:r&&"".concat(r,"-panel-").concat(a),role:"tabpanel",tabIndex:s?0:-1,"aria-labelledby":r&&"".concat(r,"-tab-").concat(a),"aria-hidden":!s,style:o,className:Ue(t,s&&"".concat(t,"-active"),n),ref:e},l)}),FUe=["renderTabBar"],BUe=["label","key"],WUe=function(e){var t=e.renderTabBar,n=Hn(e,FUe),o=x.exports.useContext(F4),r=o.tabs;if(t){var s=Ce(Ce({},n),{},{panes:r.map(function(a){var l=a.label,c=a.key,d=Hn(a,BUe);return x.exports.createElement(xve,yt({tab:l,key:c,tabKey:c},d))})});return t(s,Nie)}return x.exports.createElement(Nie,n)},VUe=["key","forceRender","style","className","destroyInactiveTabPane"],HUe=function(e){var t=e.id,n=e.activeKey,o=e.animated,r=e.tabPosition,s=e.destroyInactiveTabPane,a=x.exports.useContext(F4),l=a.prefixCls,c=a.tabs,d=o.tabPane,u="".concat(l,"-tabpane");return x.exports.createElement("div",{className:Ue("".concat(l,"-content-holder"))},x.exports.createElement("div",{className:Ue("".concat(l,"-content"),"".concat(l,"-content-").concat(r),me({},"".concat(l,"-content-animated"),d))},c.map(function(h){var f=h.key,g=h.forceRender,p=h.style,v=h.className,m=h.destroyInactiveTabPane,_=Hn(h,VUe),y=f===n;return x.exports.createElement(th,yt({key:f,visible:y,forceRender:g,removeOnLeave:!!(s||m),leavedClassName:"".concat(u,"-hidden")},o.tabPaneMotion),function(w,L){var D=w.style,E=w.className;return x.exports.createElement(xve,yt({},_,{prefixCls:u,id:t,tabKey:f,animated:d,active:y,style:Ce(Ce({},p),D),className:Ue(v,E),ref:L}))})})))};function $Ue(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},e;return i===!1?e={inkBar:!1,tabPane:!1}:i===!0?e={inkBar:!0,tabPane:!1}:e=Ce({inkBar:!0},qn(i)==="object"?i:{}),e.tabPaneMotion&&e.tabPane===void 0&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}var zUe=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],Rie=0,UUe=x.exports.forwardRef(function(i,e){var t=i.id,n=i.prefixCls,o=n===void 0?"rc-tabs":n,r=i.className,s=i.items,a=i.direction,l=i.activeKey,c=i.defaultActiveKey,d=i.editable,u=i.animated,h=i.tabPosition,f=h===void 0?"top":h,g=i.tabBarGutter,p=i.tabBarStyle,v=i.tabBarExtraContent,m=i.locale,_=i.moreIcon,y=i.moreTransitionName,w=i.destroyInactiveTabPane,L=i.renderTabBar,D=i.onChange,E=i.onTabClick,I=i.onTabScroll,k=i.getPopupContainer,R=i.popupClassName,A=i.indicator,P=Hn(i,zUe),N=x.exports.useMemo(function(){return(s||[]).filter(function(Ee){return Ee&&qn(Ee)==="object"&&"key"in Ee})},[s]),M=a==="rtl",H=$Ue(u),B=x.exports.useState(!1),F=Ne(B,2),$=F[0],z=F[1];x.exports.useEffect(function(){z(sq())},[]);var K=Kl(function(){var Ee;return(Ee=N[0])===null||Ee===void 0?void 0:Ee.key},{value:l,defaultValue:c}),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useState(function(){return N.findIndex(function(Ee){return Ee.key===G})}),fe=Ne(ue,2),pe=fe[0],be=fe[1];x.exports.useEffect(function(){var Ee=N.findIndex(function(nt){return nt.key===G});if(Ee===-1){var tt;Ee=Math.max(0,Math.min(pe,N.length-1)),X((tt=N[Ee])===null||tt===void 0?void 0:tt.key)}be(Ee)},[N.map(function(Ee){return Ee.key}).join("_"),G,pe]);var Se=Kl(null,{value:t}),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1];x.exports.useEffect(function(){t||(ce("rc-tabs-".concat(Rie)),Rie+=1)},[]);function Pe(Ee,tt){E==null||E(Ee,tt);var nt=Ee!==G;X(Ee),nt&&(D==null||D(Ee))}var Oe={id:De,activeKey:G,animated:H,tabPosition:f,rtl:M,mobile:$},xe=Ce(Ce({},Oe),{},{editable:d,locale:m,moreIcon:_,moreTransitionName:y,tabBarGutter:g,onTabClick:Pe,onTabScroll:I,extra:v,style:p,panes:null,getPopupContainer:k,popupClassName:R,indicator:A});return x.exports.createElement(F4.Provider,{value:{tabs:N,prefixCls:o}},x.exports.createElement("div",yt({ref:e,id:t,className:Ue(o,"".concat(o,"-").concat(f),me(me(me({},"".concat(o,"-mobile"),$),"".concat(o,"-editable"),d),"".concat(o,"-rtl"),M),r)},P),x.exports.createElement(WUe,yt({},xe,{renderTabBar:L})),x.exports.createElement(HUe,yt({destroyInactiveTabPane:w},Oe,{animated:H}))))});const jUe={motionAppear:!1,motionEnter:!0,motionLeave:!0};function KUe(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},t;return e===!1?t={inkBar:!1,tabPane:!1}:e===!0?t={inkBar:!0,tabPane:!0}:t=Object.assign({inkBar:!0},typeof e=="object"?e:{}),t.tabPane&&(t.tabPaneMotion=Object.assign(Object.assign({},jUe),{motionName:q0(i,"switch")})),t}var qUe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oe)}function XUe(i,e){if(i)return i;const t=op(e).map(n=>{if(x.exports.isValidElement(n)){const{key:o,props:r}=n,s=r||{},{tab:a}=s,l=qUe(s,["tab"]);return Object.assign(Object.assign({key:String(o)},l),{label:a})}return null});return GUe(t)}const YUe=i=>{const{componentCls:e,motionDurationSlow:t}=i;return[{[e]:{[`${e}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${t}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${t}`}}}}},[kA(i,"slide-up"),kA(i,"slide-down")]]};var ZUe=YUe;const QUe=i=>{const{componentCls:e,tabsCardPadding:t,cardBg:n,cardGutter:o,colorBorderSecondary:r,itemSelectedColor:s}=i;return{[`${e}-card`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{margin:0,padding:t,background:n,border:`${rt(i.lineWidth)} ${i.lineType} ${r}`,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOut}`},[`${e}-tab-active`]:{color:s,background:i.colorBgContainer},[`${e}-ink-bar`]:{visibility:"hidden"}},[`&${e}-top, &${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginLeft:{_skip_check_:!0,value:rt(o)}}}},[`&${e}-top`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`},[`${e}-tab-active`]:{borderBottomColor:i.colorBgContainer}}},[`&${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`0 0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)}`},[`${e}-tab-active`]:{borderTopColor:i.colorBgContainer}}},[`&${e}-left, &${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginTop:rt(o)}}},[`&${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt(i.borderRadiusLG)} 0 0 ${rt(i.borderRadiusLG)}`}},[`${e}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:i.colorBgContainer}}}},[`&${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0`}},[`${e}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:i.colorBgContainer}}}}}}},JUe=i=>{const{componentCls:e,itemHoverColor:t,dropdownEdgeChildVerticalPadding:n}=i;return{[`${e}-dropdown`]:Object.assign(Object.assign({},Pa(i)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:i.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${e}-dropdown-menu`]:{maxHeight:i.tabsDropdownHeight,margin:0,padding:`${rt(n)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:i.colorBgContainer,backgroundClip:"padding-box",borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,"&-item":Object.assign(Object.assign({},wA),{display:"flex",alignItems:"center",minWidth:i.tabsDropdownWidth,margin:0,padding:`${rt(i.paddingXXS)} ${rt(i.paddingSM)}`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,lineHeight:i.lineHeight,cursor:"pointer",transition:`all ${i.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:i.marginSM},color:i.colorTextDescription,fontSize:i.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:t}},"&:hover":{background:i.controlItemBgHover},"&-disabled":{"&, &:hover":{color:i.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},eje=i=>{const{componentCls:e,margin:t,colorBorderSecondary:n,horizontalMargin:o,verticalItemPadding:r,verticalItemMargin:s,calc:a}=i;return{[`${e}-top, ${e}-bottom`]:{flexDirection:"column",[`> ${e}-nav, > div > ${e}-nav`]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${n}`,content:"''"},[`${e}-ink-bar`]:{height:i.lineWidthBold,"&-animated":{transition:`width ${i.motionDurationSlow}, left ${i.motionDurationSlow}, + ${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}},CUe=i=>{const{componentCls:e,paddingLG:t}=i,n=`${e}-textarea`;return{[n]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:i.calc(i.fontSize).mul(i.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:i.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${n}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:i.paddingXS,insetBlockStart:i.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:i.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},yUe=i=>{const{componentCls:e}=i;return{[`${e}-out-of-range`]:{[`&, & input, & textarea, ${e}-show-count-suffix, ${e}-data-count`]:{color:i.colorError}}}};var Sq=jc("Input",i=>{const e=lr(i,rUe(i));return[pUe(e),CUe(e),vUe(e),_Ue(e),bUe(e),yUe(e),JK(e)]},sUe),wUe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},SUe=wUe,xUe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:SUe}))},LUe=x.exports.forwardRef(xUe),F4=x.exports.createContext(null),EUe=function(e){var t=e.activeTabOffset,n=e.horizontal,o=e.rtl,r=e.indicator,s=r===void 0?{}:r,a=s.size,l=s.align,c=l===void 0?"center":l,d=x.exports.useState(),u=Ne(d,2),h=u[0],f=u[1],g=x.exports.useRef(),p=Bt.useCallback(function(m){return typeof a=="function"?a(m):typeof a=="number"?a:m},[a]);function v(){Xi.cancel(g.current)}return x.exports.useEffect(function(){var m={};if(t)if(n){m.width=p(t.width);var _=o?"right":"left";c==="start"&&(m[_]=t[_]),c==="center"&&(m[_]=t[_]+t.width/2,m.transform=o?"translateX(50%)":"translateX(-50%)"),c==="end"&&(m[_]=t[_]+t.width,m.transform="translateX(-100%)")}else m.height=p(t.height),c==="start"&&(m.top=t.top),c==="center"&&(m.top=t.top+t.height/2,m.transform="translateY(-50%)"),c==="end"&&(m.top=t.top+t.height,m.transform="translateY(-100%)");return v(),g.current=Xi(function(){f(m)}),v},[t,n,o,c,p]),{style:h}},Lie={width:0,height:0,left:0,top:0};function DUe(i,e,t){return x.exports.useMemo(function(){for(var n,o=new Map,r=e.get((n=i[0])===null||n===void 0?void 0:n.key)||Lie,s=r.left+r.width,a=0;aM?(P=R,D.current="x"):(P=A,D.current="y"),e(-P,-P)&&k.preventDefault()}var I=x.exports.useRef(null);I.current={onTouchStart:y,onTouchMove:w,onTouchEnd:L,onWheel:E},x.exports.useEffect(function(){function k(N){I.current.onTouchStart(N)}function R(N){I.current.onTouchMove(N)}function A(N){I.current.onTouchEnd(N)}function P(N){I.current.onWheel(N)}return document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("touchend",A,{passive:!1}),i.current.addEventListener("touchstart",k,{passive:!1}),i.current.addEventListener("wheel",P),function(){document.removeEventListener("touchmove",R),document.removeEventListener("touchend",A)}},[])}function yve(i){var e=x.exports.useState(0),t=Ne(e,2),n=t[0],o=t[1],r=x.exports.useRef(0),s=x.exports.useRef();return s.current=i,eW(function(){var a;(a=s.current)===null||a===void 0||a.call(s)},[n]),function(){r.current===n&&(r.current+=1,o(r.current))}}function TUe(i){var e=x.exports.useRef([]),t=x.exports.useState({}),n=Ne(t,2),o=n[1],r=x.exports.useRef(typeof i=="function"?i():i),s=yve(function(){var l=r.current;e.current.forEach(function(c){l=c(l)}),e.current=[],r.current=l,o({})});function a(l){e.current.push(l),s()}return[r.current,a]}var Iie={width:0,height:0,left:0,top:0,right:0};function NUe(i,e,t,n,o,r,s){var a=s.tabs,l=s.tabPosition,c=s.rtl,d,u,h;return["top","bottom"].includes(l)?(d="width",u=c?"right":"left",h=Math.abs(t)):(d="height",u="top",h=-t),x.exports.useMemo(function(){if(!a.length)return[0,0];for(var f=a.length,g=f,p=0;ph+e){g=p-1;break}}for(var m=0,_=f-1;_>=0;_-=1){var y=i.get(a[_].key)||Iie;if(y[u]=g?[0,0]:[m,g]},[i,e,n,o,r,h,l,a.map(function(f){return f.key}).join("_"),c])}function Tie(i){var e;return i instanceof Map?(e={},i.forEach(function(t,n){e[n]=t})):e=i,JSON.stringify(e)}var RUe="TABS_DQ";function wve(i){return String(i).replace(/"/g,RUe)}function Sve(i,e,t,n){return!(!t||n||i===!1||i===void 0&&(e===!1||e===null))}var xve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.editable,o=i.locale,r=i.style;return!n||n.showAdd===!1?null:x.exports.createElement("button",{ref:e,type:"button",className:"".concat(t,"-nav-add"),style:r,"aria-label":(o==null?void 0:o.addAriaLabel)||"Add tab",onClick:function(a){n.onEdit("add",{event:a})}},n.addIcon||"+")}),Nie=x.exports.forwardRef(function(i,e){var t=i.position,n=i.prefixCls,o=i.extra;if(!o)return null;var r,s={};return qn(o)==="object"&&!x.exports.isValidElement(o)?s=o:s.right=o,t==="right"&&(r=s.right),t==="left"&&(r=s.left),r?x.exports.createElement("div",{className:"".concat(n,"-extra-content"),ref:e},r):null}),MUe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.id,o=i.tabs,r=i.locale,s=i.mobile,a=i.moreIcon,l=a===void 0?"More":a,c=i.moreTransitionName,d=i.style,u=i.className,h=i.editable,f=i.tabBarGutter,g=i.rtl,p=i.removeAriaLabel,v=i.onTabClick,m=i.getPopupContainer,_=i.popupClassName,y=x.exports.useState(!1),w=Ne(y,2),L=w[0],D=w[1],E=x.exports.useState(null),I=Ne(E,2),k=I[0],R=I[1],A="".concat(n,"-more-popup"),P="".concat(t,"-dropdown"),N=k!==null?"".concat(A,"-").concat(k):null,M=r==null?void 0:r.dropdownAriaLabel;function H(G,X){G.preventDefault(),G.stopPropagation(),h.onEdit("remove",{key:X,event:G})}var B=x.exports.createElement(PI,{onClick:function(X){var ue=X.key,fe=X.domEvent;v(ue,fe),D(!1)},prefixCls:"".concat(P,"-menu"),id:A,tabIndex:-1,role:"listbox","aria-activedescendant":N,selectedKeys:[k],"aria-label":M!==void 0?M:"expanded dropdown"},o.map(function(G){var X=G.closable,ue=G.disabled,fe=G.closeIcon,pe=G.key,be=G.label,Se=Sve(X,fe,h,ue);return x.exports.createElement(O4,{key:pe,id:"".concat(A,"-").concat(pe),role:"option","aria-controls":n&&"".concat(n,"-panel-").concat(pe),disabled:ue},x.exports.createElement("span",null,be),Se&&x.exports.createElement("button",{type:"button","aria-label":p||"remove",tabIndex:0,className:"".concat(P,"-menu-item-remove"),onClick:function(De){De.stopPropagation(),H(De,pe)}},fe||h.removeIcon||"\xD7"))}));function F(G){for(var X=o.filter(function(Se){return!Se.disabled}),ue=X.findIndex(function(Se){return Se.key===k})||0,fe=X.length,pe=0;peXt?"left":"right"})}),N=Ne(P,2),M=N[0],H=N[1],B=Eie(0,function(an,Xt){!A&&p&&p({direction:an>Xt?"top":"bottom"})}),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState([0,0]),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useState([0,0]),fe=Ne(ue,2),pe=fe[0],be=fe[1],Se=x.exports.useState([0,0]),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1],Pe=x.exports.useState([0,0]),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=TUe(new Map),nt=Ne(tt,2),Qe=nt[0],Ge=nt[1],re=DUe(y,Qe,pe[0]),ie=JN(G,A),se=JN(pe,A),U=JN(De,A),Y=JN(xe,A),oe=ieTe?Te:an}var je=x.exports.useRef(null),mt=x.exports.useState(),Dt=Ne(mt,2),At=Dt[0],Je=Dt[1];function Lt(){Je(Date.now())}function Ot(){je.current&&clearTimeout(je.current)}IUe(E,function(an,Xt){function oi(Ze,de){Ze(function(Ve){var ot=We(Ve+de);return ot})}return oe?(A?oi(H,an):oi(z,Xt),Ot(),Lt(),!0):!1}),x.exports.useEffect(function(){return Ot(),At&&(je.current=setTimeout(function(){Je(0)},100)),Ot},[At]);var Vn=NUe(re,te,A?M:$,se,U,Y,Ce(Ce({},i),{},{tabs:y})),Et=Ne(Vn,2),tn=Et[0],di=Et[1],cn=tl(function(){var an=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,Xt=re.get(an)||{width:0,height:0,left:0,right:0,top:0};if(A){var oi=M;a?Xt.rightM+te&&(oi=Xt.right+Xt.width-te):Xt.left<-M?oi=-Xt.left:Xt.left+Xt.width>-M+te&&(oi=-(Xt.left+Xt.width-te)),z(0),H(We(oi))}else{var Ze=$;Xt.top<-$?Ze=-Xt.top:Xt.top+Xt.height>-$+te&&(Ze=-(Xt.top+Xt.height-te)),H(0),z(We(Ze))}}),Gn={};u==="top"||u==="bottom"?Gn[a?"marginRight":"marginLeft"]=h:Gn.marginTop=h;var bn=y.map(function(an,Xt){var oi=an.key;return x.exports.createElement(PUe,{id:o,prefixCls:_,key:oi,tab:an,style:Xt===0?void 0:Gn,closable:an.closable,editable:c,active:oi===s,renderWrapper:f,removeAriaLabel:d==null?void 0:d.removeAriaLabel,onClick:function(de){g(oi,de)},onFocus:function(){cn(oi),Lt(),E.current&&(a||(E.current.scrollLeft=0),E.current.scrollTop=0)}})}),Pt=function(){return Ge(function(){var Xt,oi=new Map,Ze=(Xt=I.current)===null||Xt===void 0?void 0:Xt.getBoundingClientRect();return y.forEach(function(de){var Ve,ot=de.key,Sn=(Ve=I.current)===null||Ve===void 0?void 0:Ve.querySelector('[data-node-key="'.concat(wve(ot),'"]'));if(Sn){var $n=OUe(Sn,Ze),Ci=Ne($n,4),An=Ci[0],lo=Ci[1],Qo=Ci[2],zo=Ci[3];oi.set(ot,{width:An,height:lo,left:Qo,top:zo})}}),oi})};x.exports.useEffect(function(){Pt()},[y.map(function(an){return an.key}).join("_")]);var qt=yve(function(){var an=B1(w),Xt=B1(L),oi=B1(D);X([an[0]-Xt[0]-oi[0],an[1]-Xt[1]-oi[1]]);var Ze=B1(R);ce(Ze);var de=B1(k);Ee(de);var Ve=B1(I);be([Ve[0]-Ze[0],Ve[1]-Ze[1]]),Pt()}),Nt=y.slice(0,tn),jt=y.slice(di+1),Gt=[].concat(_t(Nt),_t(jt)),It=re.get(s),Ft=EUe({activeTabOffset:It,horizontal:A,indicator:v,rtl:a}),Ct=Ft.style;x.exports.useEffect(function(){cn()},[s,Le,Te,Tie(It),Tie(re),A]),x.exports.useEffect(function(){qt()},[a]);var Zt=!!Gt.length,wn="".concat(_,"-nav-wrap"),Dn,Xn,jn,Zi;return A?a?(Xn=M>0,Dn=M!==Te):(Dn=M<0,Xn=M!==Le):(jn=$<0,Zi=$!==Le),x.exports.createElement(Mu,{onResize:qt},x.exports.createElement("div",{ref:Pb(e,w),role:"tablist",className:Ue("".concat(_,"-nav"),t),style:n,onKeyDown:function(){Lt()}},x.exports.createElement(Nie,{ref:L,position:"left",extra:l,prefixCls:_}),x.exports.createElement(Mu,{onResize:qt},x.exports.createElement("div",{className:Ue(wn,me(me(me(me({},"".concat(wn,"-ping-left"),Dn),"".concat(wn,"-ping-right"),Xn),"".concat(wn,"-ping-top"),jn),"".concat(wn,"-ping-bottom"),Zi)),ref:E},x.exports.createElement(Mu,{onResize:qt},x.exports.createElement("div",{ref:I,className:"".concat(_,"-nav-list"),style:{transform:"translate(".concat(M,"px, ").concat($,"px)"),transition:At?"none":void 0}},bn,x.exports.createElement(xve,{ref:R,prefixCls:_,locale:d,editable:c,style:Ce(Ce({},bn.length===0?void 0:Gn),{},{visibility:Zt?"hidden":null})}),x.exports.createElement("div",{className:Ue("".concat(_,"-ink-bar"),me({},"".concat(_,"-ink-bar-animated"),r.inkBar)),style:Ct}))))),x.exports.createElement(AUe,yt({},i,{removeAriaLabel:d==null?void 0:d.removeAriaLabel,ref:k,prefixCls:_,tabs:Gt,className:!Zt&&ye,tabMoving:!!At})),x.exports.createElement(Nie,{ref:D,position:"right",extra:l,prefixCls:_})))}),Lve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,o=i.style,r=i.id,s=i.active,a=i.tabKey,l=i.children;return x.exports.createElement("div",{id:r&&"".concat(r,"-panel-").concat(a),role:"tabpanel",tabIndex:s?0:-1,"aria-labelledby":r&&"".concat(r,"-tab-").concat(a),"aria-hidden":!s,style:o,className:Ue(t,s&&"".concat(t,"-active"),n),ref:e},l)}),FUe=["renderTabBar"],BUe=["label","key"],WUe=function(e){var t=e.renderTabBar,n=Hn(e,FUe),o=x.exports.useContext(F4),r=o.tabs;if(t){var s=Ce(Ce({},n),{},{panes:r.map(function(a){var l=a.label,c=a.key,d=Hn(a,BUe);return x.exports.createElement(Lve,yt({tab:l,key:c,tabKey:c},d))})});return t(s,Rie)}return x.exports.createElement(Rie,n)},VUe=["key","forceRender","style","className","destroyInactiveTabPane"],HUe=function(e){var t=e.id,n=e.activeKey,o=e.animated,r=e.tabPosition,s=e.destroyInactiveTabPane,a=x.exports.useContext(F4),l=a.prefixCls,c=a.tabs,d=o.tabPane,u="".concat(l,"-tabpane");return x.exports.createElement("div",{className:Ue("".concat(l,"-content-holder"))},x.exports.createElement("div",{className:Ue("".concat(l,"-content"),"".concat(l,"-content-").concat(r),me({},"".concat(l,"-content-animated"),d))},c.map(function(h){var f=h.key,g=h.forceRender,p=h.style,v=h.className,m=h.destroyInactiveTabPane,_=Hn(h,VUe),y=f===n;return x.exports.createElement(th,yt({key:f,visible:y,forceRender:g,removeOnLeave:!!(s||m),leavedClassName:"".concat(u,"-hidden")},o.tabPaneMotion),function(w,L){var D=w.style,E=w.className;return x.exports.createElement(Lve,yt({},_,{prefixCls:u,id:t,tabKey:f,animated:d,active:y,style:Ce(Ce({},p),D),className:Ue(v,E),ref:L}))})})))};function $Ue(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},e;return i===!1?e={inkBar:!1,tabPane:!1}:i===!0?e={inkBar:!0,tabPane:!1}:e=Ce({inkBar:!0},qn(i)==="object"?i:{}),e.tabPaneMotion&&e.tabPane===void 0&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}var zUe=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],Mie=0,UUe=x.exports.forwardRef(function(i,e){var t=i.id,n=i.prefixCls,o=n===void 0?"rc-tabs":n,r=i.className,s=i.items,a=i.direction,l=i.activeKey,c=i.defaultActiveKey,d=i.editable,u=i.animated,h=i.tabPosition,f=h===void 0?"top":h,g=i.tabBarGutter,p=i.tabBarStyle,v=i.tabBarExtraContent,m=i.locale,_=i.moreIcon,y=i.moreTransitionName,w=i.destroyInactiveTabPane,L=i.renderTabBar,D=i.onChange,E=i.onTabClick,I=i.onTabScroll,k=i.getPopupContainer,R=i.popupClassName,A=i.indicator,P=Hn(i,zUe),N=x.exports.useMemo(function(){return(s||[]).filter(function(Ee){return Ee&&qn(Ee)==="object"&&"key"in Ee})},[s]),M=a==="rtl",H=$Ue(u),B=x.exports.useState(!1),F=Ne(B,2),$=F[0],z=F[1];x.exports.useEffect(function(){z(aq())},[]);var K=Kl(function(){var Ee;return(Ee=N[0])===null||Ee===void 0?void 0:Ee.key},{value:l,defaultValue:c}),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useState(function(){return N.findIndex(function(Ee){return Ee.key===G})}),fe=Ne(ue,2),pe=fe[0],be=fe[1];x.exports.useEffect(function(){var Ee=N.findIndex(function(nt){return nt.key===G});if(Ee===-1){var tt;Ee=Math.max(0,Math.min(pe,N.length-1)),X((tt=N[Ee])===null||tt===void 0?void 0:tt.key)}be(Ee)},[N.map(function(Ee){return Ee.key}).join("_"),G,pe]);var Se=Kl(null,{value:t}),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1];x.exports.useEffect(function(){t||(ce("rc-tabs-".concat(Mie)),Mie+=1)},[]);function Pe(Ee,tt){E==null||E(Ee,tt);var nt=Ee!==G;X(Ee),nt&&(D==null||D(Ee))}var Oe={id:De,activeKey:G,animated:H,tabPosition:f,rtl:M,mobile:$},xe=Ce(Ce({},Oe),{},{editable:d,locale:m,moreIcon:_,moreTransitionName:y,tabBarGutter:g,onTabClick:Pe,onTabScroll:I,extra:v,style:p,panes:null,getPopupContainer:k,popupClassName:R,indicator:A});return x.exports.createElement(F4.Provider,{value:{tabs:N,prefixCls:o}},x.exports.createElement("div",yt({ref:e,id:t,className:Ue(o,"".concat(o,"-").concat(f),me(me(me({},"".concat(o,"-mobile"),$),"".concat(o,"-editable"),d),"".concat(o,"-rtl"),M),r)},P),x.exports.createElement(WUe,yt({},xe,{renderTabBar:L})),x.exports.createElement(HUe,yt({destroyInactiveTabPane:w},Oe,{animated:H}))))});const jUe={motionAppear:!1,motionEnter:!0,motionLeave:!0};function KUe(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},t;return e===!1?t={inkBar:!1,tabPane:!1}:e===!0?t={inkBar:!0,tabPane:!0}:t=Object.assign({inkBar:!0},typeof e=="object"?e:{}),t.tabPane&&(t.tabPaneMotion=Object.assign(Object.assign({},jUe),{motionName:q0(i,"switch")})),t}var qUe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oe)}function XUe(i,e){if(i)return i;const t=op(e).map(n=>{if(x.exports.isValidElement(n)){const{key:o,props:r}=n,s=r||{},{tab:a}=s,l=qUe(s,["tab"]);return Object.assign(Object.assign({key:String(o)},l),{label:a})}return null});return GUe(t)}const YUe=i=>{const{componentCls:e,motionDurationSlow:t}=i;return[{[e]:{[`${e}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${t}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${t}`}}}}},[kA(i,"slide-up"),kA(i,"slide-down")]]};var ZUe=YUe;const QUe=i=>{const{componentCls:e,tabsCardPadding:t,cardBg:n,cardGutter:o,colorBorderSecondary:r,itemSelectedColor:s}=i;return{[`${e}-card`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{margin:0,padding:t,background:n,border:`${rt(i.lineWidth)} ${i.lineType} ${r}`,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOut}`},[`${e}-tab-active`]:{color:s,background:i.colorBgContainer},[`${e}-ink-bar`]:{visibility:"hidden"}},[`&${e}-top, &${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginLeft:{_skip_check_:!0,value:rt(o)}}}},[`&${e}-top`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`},[`${e}-tab-active`]:{borderBottomColor:i.colorBgContainer}}},[`&${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`0 0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)}`},[`${e}-tab-active`]:{borderTopColor:i.colorBgContainer}}},[`&${e}-left, &${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginTop:rt(o)}}},[`&${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt(i.borderRadiusLG)} 0 0 ${rt(i.borderRadiusLG)}`}},[`${e}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:i.colorBgContainer}}}},[`&${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0`}},[`${e}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:i.colorBgContainer}}}}}}},JUe=i=>{const{componentCls:e,itemHoverColor:t,dropdownEdgeChildVerticalPadding:n}=i;return{[`${e}-dropdown`]:Object.assign(Object.assign({},Pa(i)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:i.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${e}-dropdown-menu`]:{maxHeight:i.tabsDropdownHeight,margin:0,padding:`${rt(n)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:i.colorBgContainer,backgroundClip:"padding-box",borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,"&-item":Object.assign(Object.assign({},wA),{display:"flex",alignItems:"center",minWidth:i.tabsDropdownWidth,margin:0,padding:`${rt(i.paddingXXS)} ${rt(i.paddingSM)}`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,lineHeight:i.lineHeight,cursor:"pointer",transition:`all ${i.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:i.marginSM},color:i.colorTextDescription,fontSize:i.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:t}},"&:hover":{background:i.controlItemBgHover},"&-disabled":{"&, &:hover":{color:i.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},eje=i=>{const{componentCls:e,margin:t,colorBorderSecondary:n,horizontalMargin:o,verticalItemPadding:r,verticalItemMargin:s,calc:a}=i;return{[`${e}-top, ${e}-bottom`]:{flexDirection:"column",[`> ${e}-nav, > div > ${e}-nav`]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${n}`,content:"''"},[`${e}-ink-bar`]:{height:i.lineWidthBold,"&-animated":{transition:`width ${i.motionDurationSlow}, left ${i.motionDurationSlow}, right ${i.motionDurationSlow}`}},[`${e}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:i.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:i.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:i.boxShadowTabsOverflowRight},[`&${e}-nav-wrap-ping-left::before`]:{opacity:1},[`&${e}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${e}-top`]:{[`> ${e}-nav, - > div > ${e}-nav`]:{"&::before":{bottom:0},[`${e}-ink-bar`]:{bottom:0}}},[`${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,marginTop:t,marginBottom:0,"&::before":{top:0},[`${e}-ink-bar`]:{top:0}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0}},[`${e}-left, ${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{flexDirection:"column",minWidth:a(i.controlHeight).mul(1.25).equal(),[`${e}-tab`]:{padding:r,textAlign:"center"},[`${e}-tab + ${e}-tab`]:{margin:s},[`${e}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:i.controlHeight},"&::before":{top:0,boxShadow:i.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:i.boxShadowTabsOverflowBottom},[`&${e}-nav-wrap-ping-top::before`]:{opacity:1},[`&${e}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${e}-ink-bar`]:{width:i.lineWidthBold,"&-animated":{transition:`height ${i.motionDurationSlow}, top ${i.motionDurationSlow}`}},[`${e}-nav-list, ${e}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{marginLeft:{_skip_check_:!0,value:rt(a(i.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:i.paddingLG}}}},[`${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,[`${e}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:a(i.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingRight:{_skip_check_:!0,value:i.paddingLG}}}}}},tje=i=>{const{componentCls:e,cardPaddingSM:t,cardPaddingLG:n,horizontalItemPaddingSM:o,horizontalItemPaddingLG:r}=i;return{[e]:{"&-small":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:o,fontSize:i.titleFontSizeSM}}},"&-large":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:r,fontSize:i.titleFontSizeLG}}}},[`${e}-card`]:{[`&${e}-small`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:t}},[`&${e}-bottom`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`0 0 ${rt(i.borderRadius)} ${rt(i.borderRadius)}`}},[`&${e}-top`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`${rt(i.borderRadius)} ${rt(i.borderRadius)} 0 0`}},[`&${e}-right`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt(i.borderRadius)} ${rt(i.borderRadius)} 0`}}},[`&${e}-left`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt(i.borderRadius)} 0 0 ${rt(i.borderRadius)}`}}}},[`&${e}-large`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:n}}}}}},nje=i=>{const{componentCls:e,itemActiveColor:t,itemHoverColor:n,iconCls:o,tabsHorizontalItemMargin:r,horizontalItemPadding:s,itemSelectedColor:a,itemColor:l}=i,c=`${e}-tab`;return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:s,fontSize:i.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:t}},E4(i)),"&-btn":{outline:"none",transition:"all 0.3s",[`${c}-icon:not(:last-child)`]:{marginInlineEnd:i.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:i.calc(i.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:i.marginXS},color:i.colorTextDescription,fontSize:i.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${i.motionDurationSlow}`,"&:hover":{color:i.colorTextHeading}},"&:hover":{color:n},[`&${c}-active ${c}-btn`]:{color:a,textShadow:i.tabsActiveTextShadow},[`&${c}-disabled`]:{color:i.colorTextDisabled,cursor:"not-allowed"},[`&${c}-disabled ${c}-btn, &${c}-disabled ${e}-remove`]:{"&:focus, &:active":{color:i.colorTextDisabled}},[`& ${c}-remove ${o}`]:{margin:0},[`${o}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:i.marginSM}}},[`${c} + ${c}`]:{margin:{_skip_check_:!0,value:r}}}},ije=i=>{const{componentCls:e,tabsHorizontalItemMarginRTL:t,iconCls:n,cardGutter:o,calc:r}=i;return{[`${e}-rtl`]:{direction:"rtl",[`${e}-nav`]:{[`${e}-tab`]:{margin:{_skip_check_:!0,value:t},[`${e}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[n]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:rt(i.marginSM)}},[`${e}-tab-remove`]:{marginRight:{_skip_check_:!0,value:rt(i.marginXS)},marginLeft:{_skip_check_:!0,value:rt(r(i.marginXXS).mul(-1).equal())},[n]:{margin:0}}}},[`&${e}-left`]:{[`> ${e}-nav`]:{order:1},[`> ${e}-content-holder`]:{order:0}},[`&${e}-right`]:{[`> ${e}-nav`]:{order:0},[`> ${e}-content-holder`]:{order:1}},[`&${e}-card${e}-top, &${e}-card${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},[`${e}-dropdown-rtl`]:{direction:"rtl"},[`${e}-menu-item`]:{[`${e}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},oje=i=>{const{componentCls:e,tabsCardPadding:t,cardHeight:n,cardGutter:o,itemHoverColor:r,itemActiveColor:s,colorBorderSecondary:a}=i;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Pa(i)),{display:"flex",[`> ${e}-nav, > div > ${e}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${e}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${i.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${e}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${i.motionDurationSlow}`},[`${e}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${e}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${e}-nav-more`]:{position:"relative",padding:t,background:"transparent",border:0,color:i.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:i.calc(i.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${e}-nav-add`]:Object.assign({minWidth:n,minHeight:n,marginLeft:{_skip_check_:!0,value:o},padding:`0 ${rt(i.paddingXS)}`,background:"transparent",border:`${rt(i.lineWidth)} ${i.lineType} ${a}`,borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:i.colorText,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOut}`,"&:hover":{color:r},"&:active, &:focus:not(:focus-visible)":{color:s}},E4(i))},[`${e}-extra-content`]:{flex:"none"},[`${e}-ink-bar`]:{position:"absolute",background:i.inkBarColor,pointerEvents:"none"}}),nje(i)),{[`${e}-content`]:{position:"relative",width:"100%"},[`${e}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${e}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${e}-centered`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-nav-wrap`]:{[`&:not([class*='${e}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}},rje=i=>{const e=i.controlHeightLG;return{zIndexPopup:i.zIndexPopupBase+50,cardBg:i.colorFillAlter,cardHeight:e,cardPadding:`${(e-Math.round(i.fontSize*i.lineHeight))/2-i.lineWidth}px ${i.padding}px`,cardPaddingSM:`${i.paddingXXS*1.5}px ${i.padding}px`,cardPaddingLG:`${i.paddingXS}px ${i.padding}px ${i.paddingXXS*1.5}px`,titleFontSize:i.fontSize,titleFontSizeLG:i.fontSizeLG,titleFontSizeSM:i.fontSize,inkBarColor:i.colorPrimary,horizontalMargin:`0 0 ${i.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${i.paddingSM}px 0`,horizontalItemPaddingSM:`${i.paddingXS}px 0`,horizontalItemPaddingLG:`${i.padding}px 0`,verticalItemPadding:`${i.paddingXS}px ${i.paddingLG}px`,verticalItemMargin:`${i.margin}px 0 0 0`,itemColor:i.colorText,itemSelectedColor:i.colorPrimary,itemHoverColor:i.colorPrimaryHover,itemActiveColor:i.colorPrimaryActive,cardGutter:i.marginXXS/2}};var sje=jc("Tabs",i=>{const e=lr(i,{tabsCardPadding:i.cardPadding,dropdownEdgeChildVerticalPadding:i.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${rt(i.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${rt(i.horizontalItemGutter)}`});return[tje(e),ije(e),eje(e),JUe(e),QUe(e),oje(e),ZUe(e)]},rje);const aje=()=>null;var lje=aje,cje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var e,t,n,o,r,s;const{type:a,className:l,rootClassName:c,size:d,onEdit:u,hideAdd:h,centered:f,addIcon:g,popupClassName:p,children:v,items:m,animated:_,style:y,indicatorSize:w,indicator:L}=i,D=cje(i,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:E,moreIcon:I=x.exports.createElement(oUe,null)}=D,{direction:k,tabs:R,getPrefixCls:A,getPopupContainer:P}=x.exports.useContext(Hi),N=A("tabs",E),M=nh(N),[H,B,F]=sje(N,M);let $;a==="editable-card"&&($={onEdit:(fe,pe)=>{let{key:be,event:Se}=pe;u==null||u(fe==="add"?Se:be,fe)},removeIcon:x.exports.createElement(hS,null),addIcon:g||x.exports.createElement(LUe,null),showAdd:h!==!0});const z=A(),K=Bb(d),j=XUe(m,v),G=KUe(N,_),X=Object.assign(Object.assign({},R==null?void 0:R.style),y),ue={align:(e=L==null?void 0:L.align)!==null&&e!==void 0?e:(t=R==null?void 0:R.indicator)===null||t===void 0?void 0:t.align,size:(s=(o=(n=L==null?void 0:L.size)!==null&&n!==void 0?n:w)!==null&&o!==void 0?o:(r=R==null?void 0:R.indicator)===null||r===void 0?void 0:r.size)!==null&&s!==void 0?s:R==null?void 0:R.indicatorSize};return H(x.exports.createElement(UUe,Object.assign({direction:k,getPopupContainer:P,moreTransitionName:`${z}-slide-up`},D,{items:j,className:Ue({[`${N}-${K}`]:K,[`${N}-card`]:["card","editable-card"].includes(a),[`${N}-editable-card`]:a==="editable-card",[`${N}-centered`]:f},R==null?void 0:R.className,l,c,B,F,M),popupClassName:Ue(p,B,F,M),style:X,editable:$,moreIcon:I,prefixCls:N,animated:G,indicator:ue})))};Lve.TabPane=lje;var dje=Lve;function Sc(i,e){return i[e]}var uje=["children"];function Eve(i,e){return"".concat(i,"-").concat(e)}function hje(i){return i&&i.type&&i.type.isTreeNode}function OI(i,e){return i!=null?i:e}function cw(i){var e=i||{},t=e.title,n=e._title,o=e.key,r=e.children,s=t||"title";return{title:s,_title:n||[s],key:o||"key",children:r||"children"}}function Dve(i){function e(t){var n=op(t);return n.map(function(o){if(!hje(o))return rr(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var r=o.key,s=o.props,a=s.children,l=Hn(s,uje),c=Ce({key:r},l),d=e(a);return d.length&&(c.children=d),c}).filter(function(o){return o})}return e(i)}function _6(i,e,t){var n=cw(t),o=n._title,r=n.key,s=n.children,a=new Set(e===!0?[]:e),l=[];function c(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(h,f){for(var g=Eve(u?u.pos:"0",f),p=OI(h[r],g),v,m=0;m1&&arguments[1]!==void 0?arguments[1]:{},t=e.initWrapper,n=e.processEntity,o=e.onProcessFinished,r=e.externalGetKey,s=e.childrenPropName,a=e.fieldNames,l=arguments.length>2?arguments[2]:void 0,c=r||l,d={},u={},h={posEntities:d,keyEntities:u};return t&&(h=t(h)||h),fje(i,function(f){var g=f.node,p=f.index,v=f.pos,m=f.key,_=f.parentPos,y=f.level,w=f.nodes,L={node:g,nodes:w,index:p,key:m,pos:v,level:y},D=OI(m,v);d[v]=L,u[D]=L,L.parent=d[_],L.parent&&(L.parent.children=L.parent.children||[],L.parent.children.push(L)),n&&n(L,h)},{externalGetKey:c,childrenPropName:s,fieldNames:a}),o&&o(h),h}function aE(i,e){var t=e.expandedKeys,n=e.selectedKeys,o=e.loadedKeys,r=e.loadingKeys,s=e.checkedKeys,a=e.halfCheckedKeys,l=e.dragOverNodeKey,c=e.dropPosition,d=e.keyEntities,u=Sc(d,i),h={eventKey:i,expanded:t.indexOf(i)!==-1,selected:n.indexOf(i)!==-1,loaded:o.indexOf(i)!==-1,loading:r.indexOf(i)!==-1,checked:s.indexOf(i)!==-1,halfChecked:a.indexOf(i)!==-1,pos:String(u?u.pos:""),dragOver:l===i&&c===0,dragOverGapTop:l===i&&c===-1,dragOverGapBottom:l===i&&c===1};return h}function Zr(i){var e=i.data,t=i.expanded,n=i.selected,o=i.checked,r=i.loaded,s=i.loading,a=i.halfChecked,l=i.dragOver,c=i.dragOverGapTop,d=i.dragOverGapBottom,u=i.pos,h=i.active,f=i.eventKey,g=Ce(Ce({},e),{},{expanded:t,selected:n,checked:o,loaded:r,loading:s,halfChecked:a,dragOver:l,dragOverGapTop:c,dragOverGapBottom:d,pos:u,active:h,key:f});return"props"in g||Object.defineProperty(g,"props",{get:function(){return rr(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),g}function Ive(i,e){var t=new Set;return i.forEach(function(n){e.has(n)||t.add(n)}),t}function gje(i){var e=i||{},t=e.disabled,n=e.disableCheckbox,o=e.checkable;return!!(t||n)||o===!1}function pje(i,e,t,n){for(var o=new Set(i),r=new Set,s=0;s<=t;s+=1){var a=e.get(s)||new Set;a.forEach(function(u){var h=u.key,f=u.node,g=u.children,p=g===void 0?[]:g;o.has(h)&&!n(f)&&p.filter(function(v){return!n(v.node)}).forEach(function(v){o.add(v.key)})})}for(var l=new Set,c=t;c>=0;c-=1){var d=e.get(c)||new Set;d.forEach(function(u){var h=u.parent,f=u.node;if(!(n(f)||!u.parent||l.has(u.parent.key))){if(n(u.parent.node)){l.add(h.key);return}var g=!0,p=!1;(h.children||[]).filter(function(v){return!n(v.node)}).forEach(function(v){var m=v.key,_=o.has(m);g&&!_&&(g=!1),!p&&(_||r.has(m))&&(p=!0)}),g&&o.add(h.key),p&&r.add(h.key),l.add(h.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(Ive(r,o))}}function mje(i,e,t,n,o){for(var r=new Set(i),s=new Set(e),a=0;a<=n;a+=1){var l=t.get(a)||new Set;l.forEach(function(h){var f=h.key,g=h.node,p=h.children,v=p===void 0?[]:p;!r.has(f)&&!s.has(f)&&!o(g)&&v.filter(function(m){return!o(m.node)}).forEach(function(m){r.delete(m.key)})})}s=new Set;for(var c=new Set,d=n;d>=0;d-=1){var u=t.get(d)||new Set;u.forEach(function(h){var f=h.parent,g=h.node;if(!(o(g)||!h.parent||c.has(h.parent.key))){if(o(h.parent.node)){c.add(f.key);return}var p=!0,v=!1;(f.children||[]).filter(function(m){return!o(m.node)}).forEach(function(m){var _=m.key,y=r.has(_);p&&!y&&(p=!1),!v&&(y||s.has(_))&&(v=!0)}),p||r.delete(f.key),v&&s.add(f.key),c.add(f.key)}})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(Ive(s,r))}}function b6(i,e,t,n){var o=[],r;n?r=n:r=gje;var s=new Set(i.filter(function(d){var u=!!Sc(t,d);return u||o.push(d),u})),a=new Map,l=0;Object.keys(t).forEach(function(d){var u=t[d],h=u.level,f=a.get(h);f||(f=new Set,a.set(h,f)),f.add(u),l=Math.max(l,h)}),rr(!o.length,"Tree missing follow keys: ".concat(o.slice(0,100).map(function(d){return"'".concat(d,"'")}).join(", ")));var c;return e===!0?c=pje(s,a,l,r):c=mje(s,e.halfCheckedKeys,a,l,r),c}const vje=i=>{const{checkboxCls:e}=i,t=`${e}-wrapper`;return[{[`${e}-group`]:Object.assign(Object.assign({},Pa(i)),{display:"inline-flex",flexWrap:"wrap",columnGap:i.marginXS,[`> ${i.antCls}-row`]:{flex:1}}),[t]:Object.assign(Object.assign({},Pa(i)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${t}`]:{marginInlineStart:0},[`&${t}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[e]:Object.assign(Object.assign({},Pa(i)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:i.borderRadiusSM,alignSelf:"center",[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${e}-inner`]:Object.assign({},FK(i))},[`${e}-inner`]:{boxSizing:"border-box",display:"block",width:i.checkboxSize,height:i.checkboxSize,direction:"ltr",backgroundColor:i.colorBgContainer,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadiusSM,borderCollapse:"separate",transition:`all ${i.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:i.calc(i.checkboxSize).div(14).mul(5).equal(),height:i.calc(i.checkboxSize).div(14).mul(8).equal(),border:`${rt(i.lineWidthBold)} solid ${i.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${i.motionDurationFast} ${i.motionEaseInBack}, opacity ${i.motionDurationFast}`}},"& + span":{paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS}})},{[` + > div > ${e}-nav`]:{"&::before":{bottom:0},[`${e}-ink-bar`]:{bottom:0}}},[`${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,marginTop:t,marginBottom:0,"&::before":{top:0},[`${e}-ink-bar`]:{top:0}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0}},[`${e}-left, ${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{flexDirection:"column",minWidth:a(i.controlHeight).mul(1.25).equal(),[`${e}-tab`]:{padding:r,textAlign:"center"},[`${e}-tab + ${e}-tab`]:{margin:s},[`${e}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:i.controlHeight},"&::before":{top:0,boxShadow:i.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:i.boxShadowTabsOverflowBottom},[`&${e}-nav-wrap-ping-top::before`]:{opacity:1},[`&${e}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${e}-ink-bar`]:{width:i.lineWidthBold,"&-animated":{transition:`height ${i.motionDurationSlow}, top ${i.motionDurationSlow}`}},[`${e}-nav-list, ${e}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{marginLeft:{_skip_check_:!0,value:rt(a(i.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:i.paddingLG}}}},[`${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,[`${e}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:a(i.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingRight:{_skip_check_:!0,value:i.paddingLG}}}}}},tje=i=>{const{componentCls:e,cardPaddingSM:t,cardPaddingLG:n,horizontalItemPaddingSM:o,horizontalItemPaddingLG:r}=i;return{[e]:{"&-small":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:o,fontSize:i.titleFontSizeSM}}},"&-large":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:r,fontSize:i.titleFontSizeLG}}}},[`${e}-card`]:{[`&${e}-small`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:t}},[`&${e}-bottom`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`0 0 ${rt(i.borderRadius)} ${rt(i.borderRadius)}`}},[`&${e}-top`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`${rt(i.borderRadius)} ${rt(i.borderRadius)} 0 0`}},[`&${e}-right`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt(i.borderRadius)} ${rt(i.borderRadius)} 0`}}},[`&${e}-left`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt(i.borderRadius)} 0 0 ${rt(i.borderRadius)}`}}}},[`&${e}-large`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:n}}}}}},nje=i=>{const{componentCls:e,itemActiveColor:t,itemHoverColor:n,iconCls:o,tabsHorizontalItemMargin:r,horizontalItemPadding:s,itemSelectedColor:a,itemColor:l}=i,c=`${e}-tab`;return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:s,fontSize:i.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:t}},E4(i)),"&-btn":{outline:"none",transition:"all 0.3s",[`${c}-icon:not(:last-child)`]:{marginInlineEnd:i.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:i.calc(i.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:i.marginXS},color:i.colorTextDescription,fontSize:i.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${i.motionDurationSlow}`,"&:hover":{color:i.colorTextHeading}},"&:hover":{color:n},[`&${c}-active ${c}-btn`]:{color:a,textShadow:i.tabsActiveTextShadow},[`&${c}-disabled`]:{color:i.colorTextDisabled,cursor:"not-allowed"},[`&${c}-disabled ${c}-btn, &${c}-disabled ${e}-remove`]:{"&:focus, &:active":{color:i.colorTextDisabled}},[`& ${c}-remove ${o}`]:{margin:0},[`${o}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:i.marginSM}}},[`${c} + ${c}`]:{margin:{_skip_check_:!0,value:r}}}},ije=i=>{const{componentCls:e,tabsHorizontalItemMarginRTL:t,iconCls:n,cardGutter:o,calc:r}=i;return{[`${e}-rtl`]:{direction:"rtl",[`${e}-nav`]:{[`${e}-tab`]:{margin:{_skip_check_:!0,value:t},[`${e}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[n]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:rt(i.marginSM)}},[`${e}-tab-remove`]:{marginRight:{_skip_check_:!0,value:rt(i.marginXS)},marginLeft:{_skip_check_:!0,value:rt(r(i.marginXXS).mul(-1).equal())},[n]:{margin:0}}}},[`&${e}-left`]:{[`> ${e}-nav`]:{order:1},[`> ${e}-content-holder`]:{order:0}},[`&${e}-right`]:{[`> ${e}-nav`]:{order:0},[`> ${e}-content-holder`]:{order:1}},[`&${e}-card${e}-top, &${e}-card${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},[`${e}-dropdown-rtl`]:{direction:"rtl"},[`${e}-menu-item`]:{[`${e}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},oje=i=>{const{componentCls:e,tabsCardPadding:t,cardHeight:n,cardGutter:o,itemHoverColor:r,itemActiveColor:s,colorBorderSecondary:a}=i;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Pa(i)),{display:"flex",[`> ${e}-nav, > div > ${e}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${e}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${i.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${e}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${i.motionDurationSlow}`},[`${e}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${e}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${e}-nav-more`]:{position:"relative",padding:t,background:"transparent",border:0,color:i.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:i.calc(i.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${e}-nav-add`]:Object.assign({minWidth:n,minHeight:n,marginLeft:{_skip_check_:!0,value:o},padding:`0 ${rt(i.paddingXS)}`,background:"transparent",border:`${rt(i.lineWidth)} ${i.lineType} ${a}`,borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:i.colorText,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOut}`,"&:hover":{color:r},"&:active, &:focus:not(:focus-visible)":{color:s}},E4(i))},[`${e}-extra-content`]:{flex:"none"},[`${e}-ink-bar`]:{position:"absolute",background:i.inkBarColor,pointerEvents:"none"}}),nje(i)),{[`${e}-content`]:{position:"relative",width:"100%"},[`${e}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${e}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${e}-centered`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-nav-wrap`]:{[`&:not([class*='${e}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}},rje=i=>{const e=i.controlHeightLG;return{zIndexPopup:i.zIndexPopupBase+50,cardBg:i.colorFillAlter,cardHeight:e,cardPadding:`${(e-Math.round(i.fontSize*i.lineHeight))/2-i.lineWidth}px ${i.padding}px`,cardPaddingSM:`${i.paddingXXS*1.5}px ${i.padding}px`,cardPaddingLG:`${i.paddingXS}px ${i.padding}px ${i.paddingXXS*1.5}px`,titleFontSize:i.fontSize,titleFontSizeLG:i.fontSizeLG,titleFontSizeSM:i.fontSize,inkBarColor:i.colorPrimary,horizontalMargin:`0 0 ${i.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${i.paddingSM}px 0`,horizontalItemPaddingSM:`${i.paddingXS}px 0`,horizontalItemPaddingLG:`${i.padding}px 0`,verticalItemPadding:`${i.paddingXS}px ${i.paddingLG}px`,verticalItemMargin:`${i.margin}px 0 0 0`,itemColor:i.colorText,itemSelectedColor:i.colorPrimary,itemHoverColor:i.colorPrimaryHover,itemActiveColor:i.colorPrimaryActive,cardGutter:i.marginXXS/2}};var sje=jc("Tabs",i=>{const e=lr(i,{tabsCardPadding:i.cardPadding,dropdownEdgeChildVerticalPadding:i.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${rt(i.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${rt(i.horizontalItemGutter)}`});return[tje(e),ije(e),eje(e),JUe(e),QUe(e),oje(e),ZUe(e)]},rje);const aje=()=>null;var lje=aje,cje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var e,t,n,o,r,s;const{type:a,className:l,rootClassName:c,size:d,onEdit:u,hideAdd:h,centered:f,addIcon:g,popupClassName:p,children:v,items:m,animated:_,style:y,indicatorSize:w,indicator:L}=i,D=cje(i,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:E,moreIcon:I=x.exports.createElement(oUe,null)}=D,{direction:k,tabs:R,getPrefixCls:A,getPopupContainer:P}=x.exports.useContext(Hi),N=A("tabs",E),M=nh(N),[H,B,F]=sje(N,M);let $;a==="editable-card"&&($={onEdit:(fe,pe)=>{let{key:be,event:Se}=pe;u==null||u(fe==="add"?Se:be,fe)},removeIcon:x.exports.createElement(hS,null),addIcon:g||x.exports.createElement(LUe,null),showAdd:h!==!0});const z=A(),K=Bb(d),j=XUe(m,v),G=KUe(N,_),X=Object.assign(Object.assign({},R==null?void 0:R.style),y),ue={align:(e=L==null?void 0:L.align)!==null&&e!==void 0?e:(t=R==null?void 0:R.indicator)===null||t===void 0?void 0:t.align,size:(s=(o=(n=L==null?void 0:L.size)!==null&&n!==void 0?n:w)!==null&&o!==void 0?o:(r=R==null?void 0:R.indicator)===null||r===void 0?void 0:r.size)!==null&&s!==void 0?s:R==null?void 0:R.indicatorSize};return H(x.exports.createElement(UUe,Object.assign({direction:k,getPopupContainer:P,moreTransitionName:`${z}-slide-up`},D,{items:j,className:Ue({[`${N}-${K}`]:K,[`${N}-card`]:["card","editable-card"].includes(a),[`${N}-editable-card`]:a==="editable-card",[`${N}-centered`]:f},R==null?void 0:R.className,l,c,B,F,M),popupClassName:Ue(p,B,F,M),style:X,editable:$,moreIcon:I,prefixCls:N,animated:G,indicator:ue})))};Eve.TabPane=lje;var dje=Eve;function Sc(i,e){return i[e]}var uje=["children"];function Dve(i,e){return"".concat(i,"-").concat(e)}function hje(i){return i&&i.type&&i.type.isTreeNode}function OI(i,e){return i!=null?i:e}function cw(i){var e=i||{},t=e.title,n=e._title,o=e.key,r=e.children,s=t||"title";return{title:s,_title:n||[s],key:o||"key",children:r||"children"}}function kve(i){function e(t){var n=op(t);return n.map(function(o){if(!hje(o))return rr(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var r=o.key,s=o.props,a=s.children,l=Hn(s,uje),c=Ce({key:r},l),d=e(a);return d.length&&(c.children=d),c}).filter(function(o){return o})}return e(i)}function b6(i,e,t){var n=cw(t),o=n._title,r=n.key,s=n.children,a=new Set(e===!0?[]:e),l=[];function c(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(h,f){for(var g=Dve(u?u.pos:"0",f),p=OI(h[r],g),v,m=0;m1&&arguments[1]!==void 0?arguments[1]:{},t=e.initWrapper,n=e.processEntity,o=e.onProcessFinished,r=e.externalGetKey,s=e.childrenPropName,a=e.fieldNames,l=arguments.length>2?arguments[2]:void 0,c=r||l,d={},u={},h={posEntities:d,keyEntities:u};return t&&(h=t(h)||h),fje(i,function(f){var g=f.node,p=f.index,v=f.pos,m=f.key,_=f.parentPos,y=f.level,w=f.nodes,L={node:g,nodes:w,index:p,key:m,pos:v,level:y},D=OI(m,v);d[v]=L,u[D]=L,L.parent=d[_],L.parent&&(L.parent.children=L.parent.children||[],L.parent.children.push(L)),n&&n(L,h)},{externalGetKey:c,childrenPropName:s,fieldNames:a}),o&&o(h),h}function aE(i,e){var t=e.expandedKeys,n=e.selectedKeys,o=e.loadedKeys,r=e.loadingKeys,s=e.checkedKeys,a=e.halfCheckedKeys,l=e.dragOverNodeKey,c=e.dropPosition,d=e.keyEntities,u=Sc(d,i),h={eventKey:i,expanded:t.indexOf(i)!==-1,selected:n.indexOf(i)!==-1,loaded:o.indexOf(i)!==-1,loading:r.indexOf(i)!==-1,checked:s.indexOf(i)!==-1,halfChecked:a.indexOf(i)!==-1,pos:String(u?u.pos:""),dragOver:l===i&&c===0,dragOverGapTop:l===i&&c===-1,dragOverGapBottom:l===i&&c===1};return h}function Zr(i){var e=i.data,t=i.expanded,n=i.selected,o=i.checked,r=i.loaded,s=i.loading,a=i.halfChecked,l=i.dragOver,c=i.dragOverGapTop,d=i.dragOverGapBottom,u=i.pos,h=i.active,f=i.eventKey,g=Ce(Ce({},e),{},{expanded:t,selected:n,checked:o,loaded:r,loading:s,halfChecked:a,dragOver:l,dragOverGapTop:c,dragOverGapBottom:d,pos:u,active:h,key:f});return"props"in g||Object.defineProperty(g,"props",{get:function(){return rr(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),g}function Tve(i,e){var t=new Set;return i.forEach(function(n){e.has(n)||t.add(n)}),t}function gje(i){var e=i||{},t=e.disabled,n=e.disableCheckbox,o=e.checkable;return!!(t||n)||o===!1}function pje(i,e,t,n){for(var o=new Set(i),r=new Set,s=0;s<=t;s+=1){var a=e.get(s)||new Set;a.forEach(function(u){var h=u.key,f=u.node,g=u.children,p=g===void 0?[]:g;o.has(h)&&!n(f)&&p.filter(function(v){return!n(v.node)}).forEach(function(v){o.add(v.key)})})}for(var l=new Set,c=t;c>=0;c-=1){var d=e.get(c)||new Set;d.forEach(function(u){var h=u.parent,f=u.node;if(!(n(f)||!u.parent||l.has(u.parent.key))){if(n(u.parent.node)){l.add(h.key);return}var g=!0,p=!1;(h.children||[]).filter(function(v){return!n(v.node)}).forEach(function(v){var m=v.key,_=o.has(m);g&&!_&&(g=!1),!p&&(_||r.has(m))&&(p=!0)}),g&&o.add(h.key),p&&r.add(h.key),l.add(h.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(Tve(r,o))}}function mje(i,e,t,n,o){for(var r=new Set(i),s=new Set(e),a=0;a<=n;a+=1){var l=t.get(a)||new Set;l.forEach(function(h){var f=h.key,g=h.node,p=h.children,v=p===void 0?[]:p;!r.has(f)&&!s.has(f)&&!o(g)&&v.filter(function(m){return!o(m.node)}).forEach(function(m){r.delete(m.key)})})}s=new Set;for(var c=new Set,d=n;d>=0;d-=1){var u=t.get(d)||new Set;u.forEach(function(h){var f=h.parent,g=h.node;if(!(o(g)||!h.parent||c.has(h.parent.key))){if(o(h.parent.node)){c.add(f.key);return}var p=!0,v=!1;(f.children||[]).filter(function(m){return!o(m.node)}).forEach(function(m){var _=m.key,y=r.has(_);p&&!y&&(p=!1),!v&&(y||s.has(_))&&(v=!0)}),p||r.delete(f.key),v&&s.add(f.key),c.add(f.key)}})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(Tve(s,r))}}function C6(i,e,t,n){var o=[],r;n?r=n:r=gje;var s=new Set(i.filter(function(d){var u=!!Sc(t,d);return u||o.push(d),u})),a=new Map,l=0;Object.keys(t).forEach(function(d){var u=t[d],h=u.level,f=a.get(h);f||(f=new Set,a.set(h,f)),f.add(u),l=Math.max(l,h)}),rr(!o.length,"Tree missing follow keys: ".concat(o.slice(0,100).map(function(d){return"'".concat(d,"'")}).join(", ")));var c;return e===!0?c=pje(s,a,l,r):c=mje(s,e.halfCheckedKeys,a,l,r),c}const vje=i=>{const{checkboxCls:e}=i,t=`${e}-wrapper`;return[{[`${e}-group`]:Object.assign(Object.assign({},Pa(i)),{display:"inline-flex",flexWrap:"wrap",columnGap:i.marginXS,[`> ${i.antCls}-row`]:{flex:1}}),[t]:Object.assign(Object.assign({},Pa(i)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${t}`]:{marginInlineStart:0},[`&${t}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[e]:Object.assign(Object.assign({},Pa(i)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:i.borderRadiusSM,alignSelf:"center",[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${e}-inner`]:Object.assign({},BK(i))},[`${e}-inner`]:{boxSizing:"border-box",display:"block",width:i.checkboxSize,height:i.checkboxSize,direction:"ltr",backgroundColor:i.colorBgContainer,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadiusSM,borderCollapse:"separate",transition:`all ${i.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:i.calc(i.checkboxSize).div(14).mul(5).equal(),height:i.calc(i.checkboxSize).div(14).mul(8).equal(),border:`${rt(i.lineWidthBold)} solid ${i.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${i.motionDurationFast} ${i.motionEaseInBack}, opacity ${i.motionDurationFast}`}},"& + span":{paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS}})},{[` ${t}:not(${t}-disabled), ${e}:not(${e}-disabled) `]:{[`&:hover ${e}-inner`]:{borderColor:i.colorPrimary}},[`${t}:not(${t}-disabled)`]:{[`&:hover ${e}-checked:not(${e}-disabled) ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${e}-checked:not(${e}-disabled):after`]:{borderColor:i.colorPrimaryHover}}},{[`${e}-checked`]:{[`${e}-inner`]:{backgroundColor:i.colorPrimary,borderColor:i.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${i.motionDurationMid} ${i.motionEaseOutBack} ${i.motionDurationFast}`}}},[` ${t}-checked:not(${t}-disabled), ${e}-checked:not(${e}-disabled) - `]:{[`&:hover ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"}}},{[e]:{"&-indeterminate":{[`${e}-inner`]:{backgroundColor:i.colorBgContainer,borderColor:i.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:i.calc(i.fontSizeLG).div(2).equal(),height:i.calc(i.fontSizeLG).div(2).equal(),backgroundColor:i.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:i.colorBgContainerDisabled,borderColor:i.colorBorder,"&:after":{borderColor:i.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:i.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:i.colorTextDisabled}}}]};function Tve(i,e){const t=lr(e,{checkboxCls:`.${i}`,checkboxSize:e.controlInteractiveSize});return[vje(t)]}jc("Checkbox",(i,e)=>{let{prefixCls:t}=e;return[Tve(t,i)]});const _je=x.exports.createContext({});var Nve=_je;const bje=i=>{const{componentCls:e}=i;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},Cje=i=>{const{componentCls:e}=i;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},yje=(i,e)=>{const{componentCls:t,gridColumns:n}=i,o={};for(let r=n;r>=0;r--)r===0?(o[`${t}${e}-${r}`]={display:"none"},o[`${t}-push-${r}`]={insetInlineStart:"auto"},o[`${t}-pull-${r}`]={insetInlineEnd:"auto"},o[`${t}${e}-push-${r}`]={insetInlineStart:"auto"},o[`${t}${e}-pull-${r}`]={insetInlineEnd:"auto"},o[`${t}${e}-offset-${r}`]={marginInlineStart:0},o[`${t}${e}-order-${r}`]={order:0}):(o[`${t}${e}-${r}`]=[{["--ant-display"]:"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${r/n*100}%`,maxWidth:`${r/n*100}%`}],o[`${t}${e}-push-${r}`]={insetInlineStart:`${r/n*100}%`},o[`${t}${e}-pull-${r}`]={insetInlineEnd:`${r/n*100}%`},o[`${t}${e}-offset-${r}`]={marginInlineStart:`${r/n*100}%`},o[`${t}${e}-order-${r}`]={order:r});return o},$W=(i,e)=>yje(i,e),wje=(i,e,t)=>({[`@media (min-width: ${rt(e)})`]:Object.assign({},$W(i,t))}),Sje=()=>({}),xje=()=>({}),Lje=jc("Grid",bje,Sje),Eje=jc("Grid",i=>{const e=lr(i,{gridColumns:24}),t={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[Cje(e),$W(e,""),$W(e,"-xs"),Object.keys(t).map(n=>wje(e,t[n],n)).reduce((n,o)=>Object.assign(Object.assign({},n),o),{})]},xje);var Dje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{getPrefixCls:t,direction:n}=x.exports.useContext(Hi),{gutter:o,wrap:r}=x.exports.useContext(Nve),{prefixCls:s,span:a,order:l,offset:c,push:d,pull:u,className:h,children:f,flex:g,style:p}=i,v=Dje(i,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),m=t("col",s),[_,y,w]=Eje(m);let L={};Ije.forEach(I=>{let k={};const R=i[I];typeof R=="number"?k.span=R:typeof R=="object"&&(k=R||{}),delete v[I],L=Object.assign(Object.assign({},L),{[`${m}-${I}-${k.span}`]:k.span!==void 0,[`${m}-${I}-order-${k.order}`]:k.order||k.order===0,[`${m}-${I}-offset-${k.offset}`]:k.offset||k.offset===0,[`${m}-${I}-push-${k.push}`]:k.push||k.push===0,[`${m}-${I}-pull-${k.pull}`]:k.pull||k.pull===0,[`${m}-${I}-flex-${k.flex}`]:k.flex||k.flex==="auto",[`${m}-rtl`]:n==="rtl"})});const D=Ue(m,{[`${m}-${a}`]:a!==void 0,[`${m}-order-${l}`]:l,[`${m}-offset-${c}`]:c,[`${m}-push-${d}`]:d,[`${m}-pull-${u}`]:u},h,L,y,w),E={};if(o&&o[0]>0){const I=o[0]/2;E.paddingLeft=I,E.paddingRight=I}return g&&(E.flex=kje(g),r===!1&&!E.minWidth&&(E.minWidth=0)),_(x.exports.createElement("div",Object.assign({},v,{style:Object.assign(Object.assign({},E),p),className:D,ref:e}),f))});var Rve=Tje,Nje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{if(typeof i=="string"&&n(i),typeof i=="object")for(let r=0;r{o()},[JSON.stringify(i),e]),t}const Rje=x.exports.forwardRef((i,e)=>{const{prefixCls:t,justify:n,align:o,className:r,style:s,children:a,gutter:l=0,wrap:c}=i,d=Nje(i,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:u,direction:h}=x.exports.useContext(Hi),[f,g]=x.exports.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[p,v]=x.exports.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),m=Mie(o,p),_=Mie(n,p),y=x.exports.useRef(l),w=U$e();x.exports.useEffect(()=>{const F=w.subscribe($=>{v($);const z=y.current||0;(!Array.isArray(z)&&typeof z=="object"||Array.isArray(z)&&(typeof z[0]=="object"||typeof z[1]=="object"))&&g($)});return()=>w.unsubscribe(F)},[]);const L=()=>{const F=[void 0,void 0];return(Array.isArray(l)?l:[l,void 0]).forEach((z,K)=>{if(typeof z=="object")for(let j=0;j0?R[0]/-2:void 0;N&&(P.marginLeft=N,P.marginRight=N),[,P.rowGap]=R;const[M,H]=R,B=x.exports.useMemo(()=>({gutter:[M,H],wrap:c}),[M,H,c]);return E(x.exports.createElement(Nve.Provider,{value:B},x.exports.createElement("div",Object.assign({},d,{className:A,style:Object.assign(Object.assign({},P),s),ref:e}),a)))});var Mje=Rje;function Aje(i){return!!(i.addonBefore||i.addonAfter)}function Pje(i){return!!(i.prefix||i.suffix||i.allowClear)}function RA(i,e,t,n){if(!!t){var o=e;if(e.type==="click"){var r=i.cloneNode(!0);o=Object.create(e,{target:{value:r},currentTarget:{value:r}}),r.value="",t(o);return}if(i.type!=="file"&&n!==void 0){var s=i.cloneNode(!0);o=Object.create(e,{target:{value:s},currentTarget:{value:s}}),s.value=n,t(o);return}t(o)}}function Oje(i,e){if(!!i){i.focus(e);var t=e||{},n=t.cursor;if(n){var o=i.value.length;switch(n){case"start":i.setSelectionRange(0,0);break;case"end":i.setSelectionRange(o,o);break;default:i.setSelectionRange(0,o)}}}}var Mve=function(e){var t,n,o=e.inputElement,r=e.children,s=e.prefixCls,a=e.prefix,l=e.suffix,c=e.addonBefore,d=e.addonAfter,u=e.className,h=e.style,f=e.disabled,g=e.readOnly,p=e.focused,v=e.triggerFocus,m=e.allowClear,_=e.value,y=e.handleReset,w=e.hidden,L=e.classes,D=e.classNames,E=e.dataAttrs,I=e.styles,k=e.components,R=r!=null?r:o,A=(k==null?void 0:k.affixWrapper)||"span",P=(k==null?void 0:k.groupWrapper)||"span",N=(k==null?void 0:k.wrapper)||"span",M=(k==null?void 0:k.groupAddon)||"span",H=x.exports.useRef(null),B=function(xe){var Ee;(Ee=H.current)!==null&&Ee!==void 0&&Ee.contains(xe.target)&&(v==null||v())},F=Pje(e),$=x.exports.cloneElement(R,{value:_,className:Ue(R.props.className,!F&&(D==null?void 0:D.variant))||null});if(F){var z,K=null;if(m){var j,G=!f&&!g&&_,X="".concat(s,"-clear-icon"),ue=qn(m)==="object"&&m!==null&&m!==void 0&&m.clearIcon?m.clearIcon:"\u2716";K=he("span",{onClick:y,onMouseDown:function(xe){return xe.preventDefault()},className:Ue(X,(j={},me(j,"".concat(X,"-hidden"),!G),me(j,"".concat(X,"-has-suffix"),!!l),j)),role:"button",tabIndex:-1,children:ue})}var fe="".concat(s,"-affix-wrapper"),pe=Ue(fe,(z={},me(z,"".concat(s,"-disabled"),f),me(z,"".concat(fe,"-disabled"),f),me(z,"".concat(fe,"-focused"),p),me(z,"".concat(fe,"-readonly"),g),me(z,"".concat(fe,"-input-with-clear-btn"),l&&m&&_),z),L==null?void 0:L.affixWrapper,D==null?void 0:D.affixWrapper,D==null?void 0:D.variant),be=(l||m)&&fn("span",{className:Ue("".concat(s,"-suffix"),D==null?void 0:D.suffix),style:I==null?void 0:I.suffix,children:[K,l]});$=fn(A,{className:pe,style:I==null?void 0:I.affixWrapper,onClick:B,...E==null?void 0:E.affixWrapper,ref:H,children:[a&&he("span",{className:Ue("".concat(s,"-prefix"),D==null?void 0:D.prefix),style:I==null?void 0:I.prefix,children:a}),$,be]})}if(Aje(e)){var Se="".concat(s,"-group"),Fe="".concat(Se,"-addon"),De="".concat(Se,"-wrapper"),ce=Ue("".concat(s,"-wrapper"),Se,L==null?void 0:L.wrapper,D==null?void 0:D.wrapper),Pe=Ue(De,me({},"".concat(De,"-disabled"),f),L==null?void 0:L.group,D==null?void 0:D.groupWrapper);$=he(P,{className:Pe,children:fn(N,{className:ce,children:[c&&he(M,{className:Fe,children:c}),$,d&&he(M,{className:Fe,children:d})]})})}return Bt.cloneElement($,{className:Ue((t=$.props)===null||t===void 0?void 0:t.className,u)||null,style:Ce(Ce({},(n=$.props)===null||n===void 0?void 0:n.style),h),hidden:w})},Fje=["show"];function Ave(i,e){return x.exports.useMemo(function(){var t={};e&&(t.show=qn(e)==="object"&&e.formatter?e.formatter:!!e),t=Ce(Ce({},t),i);var n=t,o=n.show,r=Hn(n,Fje);return Ce(Ce({},r),{},{show:!!o,showFormatter:typeof o=="function"?o:void 0,strategy:r.strategy||function(s){return s.length}})},[i,e])}var Bje=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Wje=x.exports.forwardRef(function(i,e){var t=i.autoComplete,n=i.onChange,o=i.onFocus,r=i.onBlur,s=i.onPressEnter,a=i.onKeyDown,l=i.prefixCls,c=l===void 0?"rc-input":l,d=i.disabled,u=i.htmlSize,h=i.className,f=i.maxLength,g=i.suffix,p=i.showCount,v=i.count,m=i.type,_=m===void 0?"text":m,y=i.classes,w=i.classNames,L=i.styles,D=i.onCompositionStart,E=i.onCompositionEnd,I=Hn(i,Bje),k=x.exports.useState(!1),R=Ne(k,2),A=R[0],P=R[1],N=x.exports.useRef(!1),M=x.exports.useRef(null),H=function(re){M.current&&Oje(M.current,re)},B=Kl(i.defaultValue,{value:i.value}),F=Ne(B,2),$=F[0],z=F[1],K=$==null?"":String($),j=x.exports.useState(null),G=Ne(j,2),X=G[0],ue=G[1],fe=Ave(v,p),pe=fe.max||f,be=fe.strategy(K),Se=!!pe&&be>pe;x.exports.useImperativeHandle(e,function(){return{focus:H,blur:function(){var re;(re=M.current)===null||re===void 0||re.blur()},setSelectionRange:function(re,ie,se){var U;(U=M.current)===null||U===void 0||U.setSelectionRange(re,ie,se)},select:function(){var re;(re=M.current)===null||re===void 0||re.select()},input:M.current}}),x.exports.useEffect(function(){P(function(Ge){return Ge&&d?!1:Ge})},[d]);var Fe=function(re,ie,se){var U=ie;if(!N.current&&fe.exceedFormatter&&fe.max&&fe.strategy(ie)>fe.max){if(U=fe.exceedFormatter(ie,{max:fe.max}),ie!==U){var Y,oe;ue([((Y=M.current)===null||Y===void 0?void 0:Y.selectionStart)||0,((oe=M.current)===null||oe===void 0?void 0:oe.selectionEnd)||0])}}else if(se.source==="compositionEnd")return;z(U),M.current&&RA(M.current,re,n,U)};x.exports.useEffect(function(){if(X){var Ge;(Ge=M.current)===null||Ge===void 0||Ge.setSelectionRange.apply(Ge,_t(X))}},[X]);var De=function(re){Fe(re,re.target.value,{source:"change"})},ce=function(re){N.current=!1,Fe(re,re.currentTarget.value,{source:"compositionEnd"}),E==null||E(re)},Pe=function(re){s&&re.key==="Enter"&&s(re),a==null||a(re)},Oe=function(re){P(!0),o==null||o(re)},xe=function(re){P(!1),r==null||r(re)},Ee=function(re){z(""),H(),M.current&&RA(M.current,re,n)},tt=Se&&"".concat(c,"-out-of-range"),nt=function(){var re=kf(i,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]);return he("input",{autoComplete:t,...re,onChange:De,onFocus:Oe,onBlur:xe,onKeyDown:Pe,className:Ue(c,me({},"".concat(c,"-disabled"),d),w==null?void 0:w.input),style:L==null?void 0:L.input,ref:M,size:u,type:_,onCompositionStart:function(se){N.current=!0,D==null||D(se)},onCompositionEnd:ce})},Qe=function(){var re=Number(pe)>0;if(g||fe.show){var ie=fe.showFormatter?fe.showFormatter({value:K,count:be,maxLength:pe}):"".concat(be).concat(re?" / ".concat(pe):"");return fn(ks,{children:[fe.show&&he("span",{className:Ue("".concat(c,"-show-count-suffix"),me({},"".concat(c,"-show-count-has-suffix"),!!g),w==null?void 0:w.count),style:Ce({},L==null?void 0:L.count),children:ie}),g]})}return null};return he(Mve,{...I,prefixCls:c,className:Ue(h,tt),handleReset:Ee,value:K,focused:A,triggerFocus:H,suffix:Qe(),disabled:d,classes:y,classNames:w,styles:L,children:nt()})});const Vje=i=>{const{getPrefixCls:e,direction:t}=x.exports.useContext(Hi),{prefixCls:n,className:o}=i,r=e("input-group",n),s=e("input"),[a,l]=wq(s),c=Ue(r,{[`${r}-lg`]:i.size==="large",[`${r}-sm`]:i.size==="small",[`${r}-compact`]:i.compact,[`${r}-rtl`]:t==="rtl"},l,o),d=x.exports.useContext(Uu),u=x.exports.useMemo(()=>Object.assign(Object.assign({},d),{isFormItemInput:!1}),[d]);return a(x.exports.createElement("span",{className:c,style:i.style,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave,onFocus:i.onFocus,onBlur:i.onBlur},x.exports.createElement(Uu.Provider,{value:u},i.children)))};var Hje=Vje;function Pve(i,e){const t=x.exports.useRef([]),n=()=>{t.current.push(setTimeout(()=>{var o,r,s,a;((o=i.current)===null||o===void 0?void 0:o.input)&&((r=i.current)===null||r===void 0?void 0:r.input.getAttribute("type"))==="password"&&((s=i.current)===null||s===void 0?void 0:s.input.hasAttribute("value"))&&((a=i.current)===null||a===void 0||a.input.removeAttribute("value"))}))};return x.exports.useEffect(()=>(e&&n(),()=>t.current.forEach(o=>{o&&clearTimeout(o)})),[]),n}function $je(i){return!!(i.prefix||i.suffix||i.allowClear||i.showCount)}const zje=i=>{let e;return typeof i=="object"&&(i==null?void 0:i.clearIcon)?e=i:i&&(e={clearIcon:Bt.createElement(uS,null)}),e};var Uje=zje,jje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o=!0,status:r,size:s,disabled:a,onBlur:l,onFocus:c,suffix:d,allowClear:u,addonAfter:h,addonBefore:f,className:g,style:p,styles:v,rootClassName:m,onChange:_,classNames:y,variant:w}=i,L=jje(i,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:D,direction:E,input:I}=Bt.useContext(Hi),k=D("input",n),R=x.exports.useRef(null),A=nh(k),[P,N,M]=wq(k,A),{compactSize:H,compactItemClassnames:B}=N4(k,E),F=Bb(Oe=>{var xe;return(xe=s!=null?s:H)!==null&&xe!==void 0?xe:Oe}),$=Bt.useContext(dS),z=a!=null?a:$,{status:K,hasFeedback:j,feedbackIcon:G}=x.exports.useContext(Uu),X=hq(K,r),ue=$je(i)||!!j;x.exports.useRef(ue);const fe=Pve(R,!0),pe=Oe=>{fe(),l==null||l(Oe)},be=Oe=>{fe(),c==null||c(Oe)},Se=Oe=>{fe(),_==null||_(Oe)},Fe=(j||d)&&fn(ks,{children:[d,j&&G]}),De=Uje(u),[ce,Pe]=gq(w,o);return P(he(Wje,{...Object.assign({ref:eh(e,R),prefixCls:k,autoComplete:I==null?void 0:I.autoComplete},L,{disabled:z,onBlur:pe,onFocus:be,style:Object.assign(Object.assign({},I==null?void 0:I.style),p),styles:Object.assign(Object.assign({},I==null?void 0:I.styles),v),suffix:Fe,allowClear:De,className:Ue(g,m,M,A,B,I==null?void 0:I.className),onChange:Se,addonAfter:h&&he(EA,{children:he(NW,{override:!0,status:!0,children:h})}),addonBefore:f&&he(EA,{children:he(NW,{override:!0,status:!0,children:f})}),classNames:Object.assign(Object.assign(Object.assign({},y),I==null?void 0:I.classNames),{input:Ue({[`${k}-sm`]:F==="small",[`${k}-lg`]:F==="large",[`${k}-rtl`]:E==="rtl"},y==null?void 0:y.input,(t=I==null?void 0:I.classNames)===null||t===void 0?void 0:t.input,N),variant:Ue({[`${k}-${ce}`]:Pe},TA(k,X)),affixWrapper:Ue({[`${k}-affix-wrapper-sm`]:F==="small",[`${k}-affix-wrapper-lg`]:F==="large",[`${k}-affix-wrapper-rtl`]:E==="rtl"},N),wrapper:Ue({[`${k}-group-rtl`]:E==="rtl"},N),groupWrapper:Ue({[`${k}-group-wrapper-sm`]:F==="small",[`${k}-group-wrapper-lg`]:F==="large",[`${k}-group-wrapper-rtl`]:E==="rtl",[`${k}-group-wrapper-${ce}`]:Pe},TA(`${k}-group-wrapper`,X,j),N)})})}))});var Sq=qje,Gje={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},Xje=Gje,Yje=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Xje}))},Zje=x.exports.forwardRef(Yje),Qje={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},Jje=Qje,eKe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Jje}))},tKe=x.exports.forwardRef(eKe),nKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oi?x.exports.createElement(tKe,null):x.exports.createElement(Zje,null),oKe={click:"onClick",hover:"onMouseOver"},rKe=x.exports.forwardRef((i,e)=>{const{visibilityToggle:t=!0}=i,n=typeof t=="object"&&t.visible!==void 0,[o,r]=x.exports.useState(()=>n?t.visible:!1),s=x.exports.useRef(null);x.exports.useEffect(()=>{n&&r(t.visible)},[n,t]);const a=Pve(s),l=()=>{const{disabled:L}=i;L||(o&&a(),r(D=>{var E;const I=!D;return typeof t=="object"&&((E=t.onVisibleChange)===null||E===void 0||E.call(t,I)),I}))},c=L=>{const{action:D="click",iconRender:E=iKe}=i,I=oKe[D]||"",k=E(o),R={[I]:l,className:`${L}-icon`,key:"passwordIcon",onMouseDown:A=>{A.preventDefault()},onMouseUp:A=>{A.preventDefault()}};return x.exports.cloneElement(x.exports.isValidElement(k)?k:x.exports.createElement("span",null,k),R)},{className:d,prefixCls:u,inputPrefixCls:h,size:f}=i,g=nKe(i,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:p}=x.exports.useContext(Hi),v=p("input",h),m=p("input-password",u),_=t&&c(m),y=Ue(m,d,{[`${m}-${f}`]:!!f}),w=Object.assign(Object.assign({},kf(g,["suffix","iconRender","visibilityToggle"])),{type:o?"text":"password",className:y,prefixCls:v,suffix:_});return f&&(w.size=f),x.exports.createElement(Sq,Object.assign({ref:eh(e,s)},w))});var sKe=rKe,aKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{prefixCls:t,inputPrefixCls:n,className:o,size:r,suffix:s,enterButton:a=!1,addonAfter:l,loading:c,disabled:d,onSearch:u,onChange:h,onCompositionStart:f,onCompositionEnd:g}=i,p=aKe(i,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:v,direction:m}=x.exports.useContext(Hi),_=x.exports.useRef(!1),y=v("input-search",t),w=v("input",n),{compactSize:L}=N4(y,m),D=Bb(K=>{var j;return(j=r!=null?r:L)!==null&&j!==void 0?j:K}),E=x.exports.useRef(null),I=K=>{K&&K.target&&K.type==="click"&&u&&u(K.target.value,K,{source:"clear"}),h&&h(K)},k=K=>{var j;document.activeElement===((j=E.current)===null||j===void 0?void 0:j.input)&&K.preventDefault()},R=K=>{var j,G;u&&u((G=(j=E.current)===null||j===void 0?void 0:j.input)===null||G===void 0?void 0:G.value,K,{source:"input"})},A=K=>{_.current||c||R(K)},P=typeof a=="boolean"?x.exports.createElement(Gme,null):null,N=`${y}-button`;let M;const H=a||{},B=H.type&&H.type.__ANT_BUTTON===!0;B||H.type==="button"?M=vv(H,Object.assign({onMouseDown:k,onClick:K=>{var j,G;(G=(j=H==null?void 0:H.props)===null||j===void 0?void 0:j.onClick)===null||G===void 0||G.call(j,K),R(K)},key:"enterButton"},B?{className:N,size:D}:{})):M=x.exports.createElement(ts,{className:N,type:a?"primary":void 0,size:D,disabled:d,key:"enterButton",onMouseDown:k,onClick:R,loading:c,icon:P},a),l&&(M=[M,vv(l,{key:"addonAfter"})]);const F=Ue(y,{[`${y}-rtl`]:m==="rtl",[`${y}-${D}`]:!!D,[`${y}-with-button`]:!!a},o),$=K=>{_.current=!0,f==null||f(K)},z=K=>{_.current=!1,g==null||g(K)};return x.exports.createElement(Sq,Object.assign({ref:eh(E,e),onPressEnter:A},p,{size:D,onCompositionStart:$,onCompositionEnd:z,prefixCls:w,addonAfter:M,suffix:s,onChange:I,className:F,disabled:d}))});var cKe=lKe,dKe=` + `]:{[`&:hover ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"}}},{[e]:{"&-indeterminate":{[`${e}-inner`]:{backgroundColor:i.colorBgContainer,borderColor:i.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:i.calc(i.fontSizeLG).div(2).equal(),height:i.calc(i.fontSizeLG).div(2).equal(),backgroundColor:i.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:i.colorBgContainerDisabled,borderColor:i.colorBorder,"&:after":{borderColor:i.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:i.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:i.colorTextDisabled}}}]};function Nve(i,e){const t=lr(e,{checkboxCls:`.${i}`,checkboxSize:e.controlInteractiveSize});return[vje(t)]}jc("Checkbox",(i,e)=>{let{prefixCls:t}=e;return[Nve(t,i)]});const _je=x.exports.createContext({});var Rve=_je;const bje=i=>{const{componentCls:e}=i;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},Cje=i=>{const{componentCls:e}=i;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},yje=(i,e)=>{const{componentCls:t,gridColumns:n}=i,o={};for(let r=n;r>=0;r--)r===0?(o[`${t}${e}-${r}`]={display:"none"},o[`${t}-push-${r}`]={insetInlineStart:"auto"},o[`${t}-pull-${r}`]={insetInlineEnd:"auto"},o[`${t}${e}-push-${r}`]={insetInlineStart:"auto"},o[`${t}${e}-pull-${r}`]={insetInlineEnd:"auto"},o[`${t}${e}-offset-${r}`]={marginInlineStart:0},o[`${t}${e}-order-${r}`]={order:0}):(o[`${t}${e}-${r}`]=[{["--ant-display"]:"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${r/n*100}%`,maxWidth:`${r/n*100}%`}],o[`${t}${e}-push-${r}`]={insetInlineStart:`${r/n*100}%`},o[`${t}${e}-pull-${r}`]={insetInlineEnd:`${r/n*100}%`},o[`${t}${e}-offset-${r}`]={marginInlineStart:`${r/n*100}%`},o[`${t}${e}-order-${r}`]={order:r});return o},zW=(i,e)=>yje(i,e),wje=(i,e,t)=>({[`@media (min-width: ${rt(e)})`]:Object.assign({},zW(i,t))}),Sje=()=>({}),xje=()=>({}),Lje=jc("Grid",bje,Sje),Eje=jc("Grid",i=>{const e=lr(i,{gridColumns:24}),t={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[Cje(e),zW(e,""),zW(e,"-xs"),Object.keys(t).map(n=>wje(e,t[n],n)).reduce((n,o)=>Object.assign(Object.assign({},n),o),{})]},xje);var Dje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{getPrefixCls:t,direction:n}=x.exports.useContext(Hi),{gutter:o,wrap:r}=x.exports.useContext(Rve),{prefixCls:s,span:a,order:l,offset:c,push:d,pull:u,className:h,children:f,flex:g,style:p}=i,v=Dje(i,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),m=t("col",s),[_,y,w]=Eje(m);let L={};Ije.forEach(I=>{let k={};const R=i[I];typeof R=="number"?k.span=R:typeof R=="object"&&(k=R||{}),delete v[I],L=Object.assign(Object.assign({},L),{[`${m}-${I}-${k.span}`]:k.span!==void 0,[`${m}-${I}-order-${k.order}`]:k.order||k.order===0,[`${m}-${I}-offset-${k.offset}`]:k.offset||k.offset===0,[`${m}-${I}-push-${k.push}`]:k.push||k.push===0,[`${m}-${I}-pull-${k.pull}`]:k.pull||k.pull===0,[`${m}-${I}-flex-${k.flex}`]:k.flex||k.flex==="auto",[`${m}-rtl`]:n==="rtl"})});const D=Ue(m,{[`${m}-${a}`]:a!==void 0,[`${m}-order-${l}`]:l,[`${m}-offset-${c}`]:c,[`${m}-push-${d}`]:d,[`${m}-pull-${u}`]:u},h,L,y,w),E={};if(o&&o[0]>0){const I=o[0]/2;E.paddingLeft=I,E.paddingRight=I}return g&&(E.flex=kje(g),r===!1&&!E.minWidth&&(E.minWidth=0)),_(x.exports.createElement("div",Object.assign({},v,{style:Object.assign(Object.assign({},E),p),className:D,ref:e}),f))});var Mve=Tje,Nje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{if(typeof i=="string"&&n(i),typeof i=="object")for(let r=0;r{o()},[JSON.stringify(i),e]),t}const Rje=x.exports.forwardRef((i,e)=>{const{prefixCls:t,justify:n,align:o,className:r,style:s,children:a,gutter:l=0,wrap:c}=i,d=Nje(i,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:u,direction:h}=x.exports.useContext(Hi),[f,g]=x.exports.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[p,v]=x.exports.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),m=Aie(o,p),_=Aie(n,p),y=x.exports.useRef(l),w=U$e();x.exports.useEffect(()=>{const F=w.subscribe($=>{v($);const z=y.current||0;(!Array.isArray(z)&&typeof z=="object"||Array.isArray(z)&&(typeof z[0]=="object"||typeof z[1]=="object"))&&g($)});return()=>w.unsubscribe(F)},[]);const L=()=>{const F=[void 0,void 0];return(Array.isArray(l)?l:[l,void 0]).forEach((z,K)=>{if(typeof z=="object")for(let j=0;j0?R[0]/-2:void 0;N&&(P.marginLeft=N,P.marginRight=N),[,P.rowGap]=R;const[M,H]=R,B=x.exports.useMemo(()=>({gutter:[M,H],wrap:c}),[M,H,c]);return E(x.exports.createElement(Rve.Provider,{value:B},x.exports.createElement("div",Object.assign({},d,{className:A,style:Object.assign(Object.assign({},P),s),ref:e}),a)))});var Mje=Rje;function Aje(i){return!!(i.addonBefore||i.addonAfter)}function Pje(i){return!!(i.prefix||i.suffix||i.allowClear)}function RA(i,e,t,n){if(!!t){var o=e;if(e.type==="click"){var r=i.cloneNode(!0);o=Object.create(e,{target:{value:r},currentTarget:{value:r}}),r.value="",t(o);return}if(i.type!=="file"&&n!==void 0){var s=i.cloneNode(!0);o=Object.create(e,{target:{value:s},currentTarget:{value:s}}),s.value=n,t(o);return}t(o)}}function Oje(i,e){if(!!i){i.focus(e);var t=e||{},n=t.cursor;if(n){var o=i.value.length;switch(n){case"start":i.setSelectionRange(0,0);break;case"end":i.setSelectionRange(o,o);break;default:i.setSelectionRange(0,o)}}}}var Ave=function(e){var t,n,o=e.inputElement,r=e.children,s=e.prefixCls,a=e.prefix,l=e.suffix,c=e.addonBefore,d=e.addonAfter,u=e.className,h=e.style,f=e.disabled,g=e.readOnly,p=e.focused,v=e.triggerFocus,m=e.allowClear,_=e.value,y=e.handleReset,w=e.hidden,L=e.classes,D=e.classNames,E=e.dataAttrs,I=e.styles,k=e.components,R=r!=null?r:o,A=(k==null?void 0:k.affixWrapper)||"span",P=(k==null?void 0:k.groupWrapper)||"span",N=(k==null?void 0:k.wrapper)||"span",M=(k==null?void 0:k.groupAddon)||"span",H=x.exports.useRef(null),B=function(xe){var Ee;(Ee=H.current)!==null&&Ee!==void 0&&Ee.contains(xe.target)&&(v==null||v())},F=Pje(e),$=x.exports.cloneElement(R,{value:_,className:Ue(R.props.className,!F&&(D==null?void 0:D.variant))||null});if(F){var z,K=null;if(m){var j,G=!f&&!g&&_,X="".concat(s,"-clear-icon"),ue=qn(m)==="object"&&m!==null&&m!==void 0&&m.clearIcon?m.clearIcon:"\u2716";K=he("span",{onClick:y,onMouseDown:function(xe){return xe.preventDefault()},className:Ue(X,(j={},me(j,"".concat(X,"-hidden"),!G),me(j,"".concat(X,"-has-suffix"),!!l),j)),role:"button",tabIndex:-1,children:ue})}var fe="".concat(s,"-affix-wrapper"),pe=Ue(fe,(z={},me(z,"".concat(s,"-disabled"),f),me(z,"".concat(fe,"-disabled"),f),me(z,"".concat(fe,"-focused"),p),me(z,"".concat(fe,"-readonly"),g),me(z,"".concat(fe,"-input-with-clear-btn"),l&&m&&_),z),L==null?void 0:L.affixWrapper,D==null?void 0:D.affixWrapper,D==null?void 0:D.variant),be=(l||m)&&fn("span",{className:Ue("".concat(s,"-suffix"),D==null?void 0:D.suffix),style:I==null?void 0:I.suffix,children:[K,l]});$=fn(A,{className:pe,style:I==null?void 0:I.affixWrapper,onClick:B,...E==null?void 0:E.affixWrapper,ref:H,children:[a&&he("span",{className:Ue("".concat(s,"-prefix"),D==null?void 0:D.prefix),style:I==null?void 0:I.prefix,children:a}),$,be]})}if(Aje(e)){var Se="".concat(s,"-group"),Fe="".concat(Se,"-addon"),De="".concat(Se,"-wrapper"),ce=Ue("".concat(s,"-wrapper"),Se,L==null?void 0:L.wrapper,D==null?void 0:D.wrapper),Pe=Ue(De,me({},"".concat(De,"-disabled"),f),L==null?void 0:L.group,D==null?void 0:D.groupWrapper);$=he(P,{className:Pe,children:fn(N,{className:ce,children:[c&&he(M,{className:Fe,children:c}),$,d&&he(M,{className:Fe,children:d})]})})}return Bt.cloneElement($,{className:Ue((t=$.props)===null||t===void 0?void 0:t.className,u)||null,style:Ce(Ce({},(n=$.props)===null||n===void 0?void 0:n.style),h),hidden:w})},Fje=["show"];function Pve(i,e){return x.exports.useMemo(function(){var t={};e&&(t.show=qn(e)==="object"&&e.formatter?e.formatter:!!e),t=Ce(Ce({},t),i);var n=t,o=n.show,r=Hn(n,Fje);return Ce(Ce({},r),{},{show:!!o,showFormatter:typeof o=="function"?o:void 0,strategy:r.strategy||function(s){return s.length}})},[i,e])}var Bje=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Wje=x.exports.forwardRef(function(i,e){var t=i.autoComplete,n=i.onChange,o=i.onFocus,r=i.onBlur,s=i.onPressEnter,a=i.onKeyDown,l=i.prefixCls,c=l===void 0?"rc-input":l,d=i.disabled,u=i.htmlSize,h=i.className,f=i.maxLength,g=i.suffix,p=i.showCount,v=i.count,m=i.type,_=m===void 0?"text":m,y=i.classes,w=i.classNames,L=i.styles,D=i.onCompositionStart,E=i.onCompositionEnd,I=Hn(i,Bje),k=x.exports.useState(!1),R=Ne(k,2),A=R[0],P=R[1],N=x.exports.useRef(!1),M=x.exports.useRef(null),H=function(re){M.current&&Oje(M.current,re)},B=Kl(i.defaultValue,{value:i.value}),F=Ne(B,2),$=F[0],z=F[1],K=$==null?"":String($),j=x.exports.useState(null),G=Ne(j,2),X=G[0],ue=G[1],fe=Pve(v,p),pe=fe.max||f,be=fe.strategy(K),Se=!!pe&&be>pe;x.exports.useImperativeHandle(e,function(){return{focus:H,blur:function(){var re;(re=M.current)===null||re===void 0||re.blur()},setSelectionRange:function(re,ie,se){var U;(U=M.current)===null||U===void 0||U.setSelectionRange(re,ie,se)},select:function(){var re;(re=M.current)===null||re===void 0||re.select()},input:M.current}}),x.exports.useEffect(function(){P(function(Ge){return Ge&&d?!1:Ge})},[d]);var Fe=function(re,ie,se){var U=ie;if(!N.current&&fe.exceedFormatter&&fe.max&&fe.strategy(ie)>fe.max){if(U=fe.exceedFormatter(ie,{max:fe.max}),ie!==U){var Y,oe;ue([((Y=M.current)===null||Y===void 0?void 0:Y.selectionStart)||0,((oe=M.current)===null||oe===void 0?void 0:oe.selectionEnd)||0])}}else if(se.source==="compositionEnd")return;z(U),M.current&&RA(M.current,re,n,U)};x.exports.useEffect(function(){if(X){var Ge;(Ge=M.current)===null||Ge===void 0||Ge.setSelectionRange.apply(Ge,_t(X))}},[X]);var De=function(re){Fe(re,re.target.value,{source:"change"})},ce=function(re){N.current=!1,Fe(re,re.currentTarget.value,{source:"compositionEnd"}),E==null||E(re)},Pe=function(re){s&&re.key==="Enter"&&s(re),a==null||a(re)},Oe=function(re){P(!0),o==null||o(re)},xe=function(re){P(!1),r==null||r(re)},Ee=function(re){z(""),H(),M.current&&RA(M.current,re,n)},tt=Se&&"".concat(c,"-out-of-range"),nt=function(){var re=kf(i,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]);return he("input",{autoComplete:t,...re,onChange:De,onFocus:Oe,onBlur:xe,onKeyDown:Pe,className:Ue(c,me({},"".concat(c,"-disabled"),d),w==null?void 0:w.input),style:L==null?void 0:L.input,ref:M,size:u,type:_,onCompositionStart:function(se){N.current=!0,D==null||D(se)},onCompositionEnd:ce})},Qe=function(){var re=Number(pe)>0;if(g||fe.show){var ie=fe.showFormatter?fe.showFormatter({value:K,count:be,maxLength:pe}):"".concat(be).concat(re?" / ".concat(pe):"");return fn(ks,{children:[fe.show&&he("span",{className:Ue("".concat(c,"-show-count-suffix"),me({},"".concat(c,"-show-count-has-suffix"),!!g),w==null?void 0:w.count),style:Ce({},L==null?void 0:L.count),children:ie}),g]})}return null};return he(Ave,{...I,prefixCls:c,className:Ue(h,tt),handleReset:Ee,value:K,focused:A,triggerFocus:H,suffix:Qe(),disabled:d,classes:y,classNames:w,styles:L,children:nt()})});const Vje=i=>{const{getPrefixCls:e,direction:t}=x.exports.useContext(Hi),{prefixCls:n,className:o}=i,r=e("input-group",n),s=e("input"),[a,l]=Sq(s),c=Ue(r,{[`${r}-lg`]:i.size==="large",[`${r}-sm`]:i.size==="small",[`${r}-compact`]:i.compact,[`${r}-rtl`]:t==="rtl"},l,o),d=x.exports.useContext(Uu),u=x.exports.useMemo(()=>Object.assign(Object.assign({},d),{isFormItemInput:!1}),[d]);return a(x.exports.createElement("span",{className:c,style:i.style,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave,onFocus:i.onFocus,onBlur:i.onBlur},x.exports.createElement(Uu.Provider,{value:u},i.children)))};var Hje=Vje;function Ove(i,e){const t=x.exports.useRef([]),n=()=>{t.current.push(setTimeout(()=>{var o,r,s,a;((o=i.current)===null||o===void 0?void 0:o.input)&&((r=i.current)===null||r===void 0?void 0:r.input.getAttribute("type"))==="password"&&((s=i.current)===null||s===void 0?void 0:s.input.hasAttribute("value"))&&((a=i.current)===null||a===void 0||a.input.removeAttribute("value"))}))};return x.exports.useEffect(()=>(e&&n(),()=>t.current.forEach(o=>{o&&clearTimeout(o)})),[]),n}function $je(i){return!!(i.prefix||i.suffix||i.allowClear||i.showCount)}const zje=i=>{let e;return typeof i=="object"&&(i==null?void 0:i.clearIcon)?e=i:i&&(e={clearIcon:Bt.createElement(uS,null)}),e};var Uje=zje,jje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o=!0,status:r,size:s,disabled:a,onBlur:l,onFocus:c,suffix:d,allowClear:u,addonAfter:h,addonBefore:f,className:g,style:p,styles:v,rootClassName:m,onChange:_,classNames:y,variant:w}=i,L=jje(i,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:D,direction:E,input:I}=Bt.useContext(Hi),k=D("input",n),R=x.exports.useRef(null),A=nh(k),[P,N,M]=Sq(k,A),{compactSize:H,compactItemClassnames:B}=N4(k,E),F=Bb(Oe=>{var xe;return(xe=s!=null?s:H)!==null&&xe!==void 0?xe:Oe}),$=Bt.useContext(dS),z=a!=null?a:$,{status:K,hasFeedback:j,feedbackIcon:G}=x.exports.useContext(Uu),X=fq(K,r),ue=$je(i)||!!j;x.exports.useRef(ue);const fe=Ove(R,!0),pe=Oe=>{fe(),l==null||l(Oe)},be=Oe=>{fe(),c==null||c(Oe)},Se=Oe=>{fe(),_==null||_(Oe)},Fe=(j||d)&&fn(ks,{children:[d,j&&G]}),De=Uje(u),[ce,Pe]=pq(w,o);return P(he(Wje,{...Object.assign({ref:eh(e,R),prefixCls:k,autoComplete:I==null?void 0:I.autoComplete},L,{disabled:z,onBlur:pe,onFocus:be,style:Object.assign(Object.assign({},I==null?void 0:I.style),p),styles:Object.assign(Object.assign({},I==null?void 0:I.styles),v),suffix:Fe,allowClear:De,className:Ue(g,m,M,A,B,I==null?void 0:I.className),onChange:Se,addonAfter:h&&he(EA,{children:he(RW,{override:!0,status:!0,children:h})}),addonBefore:f&&he(EA,{children:he(RW,{override:!0,status:!0,children:f})}),classNames:Object.assign(Object.assign(Object.assign({},y),I==null?void 0:I.classNames),{input:Ue({[`${k}-sm`]:F==="small",[`${k}-lg`]:F==="large",[`${k}-rtl`]:E==="rtl"},y==null?void 0:y.input,(t=I==null?void 0:I.classNames)===null||t===void 0?void 0:t.input,N),variant:Ue({[`${k}-${ce}`]:Pe},TA(k,X)),affixWrapper:Ue({[`${k}-affix-wrapper-sm`]:F==="small",[`${k}-affix-wrapper-lg`]:F==="large",[`${k}-affix-wrapper-rtl`]:E==="rtl"},N),wrapper:Ue({[`${k}-group-rtl`]:E==="rtl"},N),groupWrapper:Ue({[`${k}-group-wrapper-sm`]:F==="small",[`${k}-group-wrapper-lg`]:F==="large",[`${k}-group-wrapper-rtl`]:E==="rtl",[`${k}-group-wrapper-${ce}`]:Pe},TA(`${k}-group-wrapper`,X,j),N)})})}))});var xq=qje,Gje={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},Xje=Gje,Yje=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Xje}))},Zje=x.exports.forwardRef(Yje),Qje={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},Jje=Qje,eKe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Jje}))},tKe=x.exports.forwardRef(eKe),nKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oi?x.exports.createElement(tKe,null):x.exports.createElement(Zje,null),oKe={click:"onClick",hover:"onMouseOver"},rKe=x.exports.forwardRef((i,e)=>{const{visibilityToggle:t=!0}=i,n=typeof t=="object"&&t.visible!==void 0,[o,r]=x.exports.useState(()=>n?t.visible:!1),s=x.exports.useRef(null);x.exports.useEffect(()=>{n&&r(t.visible)},[n,t]);const a=Ove(s),l=()=>{const{disabled:L}=i;L||(o&&a(),r(D=>{var E;const I=!D;return typeof t=="object"&&((E=t.onVisibleChange)===null||E===void 0||E.call(t,I)),I}))},c=L=>{const{action:D="click",iconRender:E=iKe}=i,I=oKe[D]||"",k=E(o),R={[I]:l,className:`${L}-icon`,key:"passwordIcon",onMouseDown:A=>{A.preventDefault()},onMouseUp:A=>{A.preventDefault()}};return x.exports.cloneElement(x.exports.isValidElement(k)?k:x.exports.createElement("span",null,k),R)},{className:d,prefixCls:u,inputPrefixCls:h,size:f}=i,g=nKe(i,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:p}=x.exports.useContext(Hi),v=p("input",h),m=p("input-password",u),_=t&&c(m),y=Ue(m,d,{[`${m}-${f}`]:!!f}),w=Object.assign(Object.assign({},kf(g,["suffix","iconRender","visibilityToggle"])),{type:o?"text":"password",className:y,prefixCls:v,suffix:_});return f&&(w.size=f),x.exports.createElement(xq,Object.assign({ref:eh(e,s)},w))});var sKe=rKe,aKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{prefixCls:t,inputPrefixCls:n,className:o,size:r,suffix:s,enterButton:a=!1,addonAfter:l,loading:c,disabled:d,onSearch:u,onChange:h,onCompositionStart:f,onCompositionEnd:g}=i,p=aKe(i,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:v,direction:m}=x.exports.useContext(Hi),_=x.exports.useRef(!1),y=v("input-search",t),w=v("input",n),{compactSize:L}=N4(y,m),D=Bb(K=>{var j;return(j=r!=null?r:L)!==null&&j!==void 0?j:K}),E=x.exports.useRef(null),I=K=>{K&&K.target&&K.type==="click"&&u&&u(K.target.value,K,{source:"clear"}),h&&h(K)},k=K=>{var j;document.activeElement===((j=E.current)===null||j===void 0?void 0:j.input)&&K.preventDefault()},R=K=>{var j,G;u&&u((G=(j=E.current)===null||j===void 0?void 0:j.input)===null||G===void 0?void 0:G.value,K,{source:"input"})},A=K=>{_.current||c||R(K)},P=typeof a=="boolean"?x.exports.createElement(Xme,null):null,N=`${y}-button`;let M;const H=a||{},B=H.type&&H.type.__ANT_BUTTON===!0;B||H.type==="button"?M=_v(H,Object.assign({onMouseDown:k,onClick:K=>{var j,G;(G=(j=H==null?void 0:H.props)===null||j===void 0?void 0:j.onClick)===null||G===void 0||G.call(j,K),R(K)},key:"enterButton"},B?{className:N,size:D}:{})):M=x.exports.createElement(ts,{className:N,type:a?"primary":void 0,size:D,disabled:d,key:"enterButton",onMouseDown:k,onClick:R,loading:c,icon:P},a),l&&(M=[M,_v(l,{key:"addonAfter"})]);const F=Ue(y,{[`${y}-rtl`]:m==="rtl",[`${y}-${D}`]:!!D,[`${y}-with-button`]:!!a},o),$=K=>{_.current=!0,f==null||f(K)},z=K=>{_.current=!1,g==null||g(K)};return x.exports.createElement(xq,Object.assign({ref:eh(E,e),onPressEnter:A},p,{size:D,onCompositionStart:$,onCompositionEnd:z,prefixCls:w,addonAfter:M,suffix:s,onChange:I,className:F,disabled:d}))});var cKe=lKe,dKe=` min-height:0 !important; max-height:none !important; height:0 !important; @@ -290,27 +290,27 @@ html body { top:0 !important; right:0 !important; pointer-events: none !important; -`,uKe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],C6={},dd;function hKe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=i.getAttribute("id")||i.getAttribute("data-reactid")||i.getAttribute("name");if(e&&C6[t])return C6[t];var n=window.getComputedStyle(i),o=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),r=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),a=uKe.map(function(c){return"".concat(c,":").concat(n.getPropertyValue(c))}).join(";"),l={sizingStyle:a,paddingSize:r,borderSize:s,boxSizing:o};return e&&t&&(C6[t]=l),l}function fKe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;dd||(dd=document.createElement("textarea"),dd.setAttribute("tab-index","-1"),dd.setAttribute("aria-hidden","true"),document.body.appendChild(dd)),i.getAttribute("wrap")?dd.setAttribute("wrap",i.getAttribute("wrap")):dd.removeAttribute("wrap");var o=hKe(i,e),r=o.paddingSize,s=o.borderSize,a=o.boxSizing,l=o.sizingStyle;dd.setAttribute("style","".concat(l,";").concat(dKe)),dd.value=i.value||i.placeholder||"";var c=void 0,d=void 0,u,h=dd.scrollHeight;if(a==="border-box"?h+=s:a==="content-box"&&(h-=r),t!==null||n!==null){dd.value=" ";var f=dd.scrollHeight-r;t!==null&&(c=f*t,a==="border-box"&&(c=c+r+s),h=Math.max(c,h)),n!==null&&(d=f*n,a==="border-box"&&(d=d+r+s),u=h>d?"":"hidden",h=Math.min(d,h))}var g={height:h,overflowY:u,resize:"none"};return c&&(g.minHeight=c),d&&(g.maxHeight=d),g}var gKe=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],y6=0,w6=1,S6=2,pKe=x.exports.forwardRef(function(i,e){var t=i,n=t.prefixCls;t.onPressEnter;var o=t.defaultValue,r=t.value,s=t.autoSize,a=t.onResize,l=t.className,c=t.style,d=t.disabled,u=t.onChange;t.onInternalAutoSize;var h=Hn(t,gKe),f=Kl(o,{value:r,postState:function(ue){return ue!=null?ue:""}}),g=Ne(f,2),p=g[0],v=g[1],m=function(ue){v(ue.target.value),u==null||u(ue)},_=x.exports.useRef();x.exports.useImperativeHandle(e,function(){return{textArea:_.current}});var y=x.exports.useMemo(function(){return s&&qn(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),w=Ne(y,2),L=w[0],D=w[1],E=!!s,I=function(){try{if(document.activeElement===_.current){var ue=_.current,fe=ue.selectionStart,pe=ue.selectionEnd,be=ue.scrollTop;_.current.setSelectionRange(fe,pe),_.current.scrollTop=be}}catch{}},k=x.exports.useState(S6),R=Ne(k,2),A=R[0],P=R[1],N=x.exports.useState(),M=Ne(N,2),H=M[0],B=M[1],F=function(){P(y6)};go(function(){E&&F()},[r,L,D,E]),go(function(){if(A===y6)P(w6);else if(A===w6){var X=fKe(_.current,!1,L,D);P(S6),B(X)}else I()},[A]);var $=x.exports.useRef(),z=function(){Xi.cancel($.current)},K=function(ue){A===S6&&(a==null||a(ue),s&&(z(),$.current=Xi(function(){F()})))};x.exports.useEffect(function(){return z},[]);var j=E?H:null,G=Ce(Ce({},c),j);return(A===y6||A===w6)&&(G.overflowY="hidden",G.overflowX="hidden"),x.exports.createElement(Mu,{onResize:K,disabled:!(s||a)},x.exports.createElement("textarea",yt({},h,{ref:_,style:G,className:Ue(n,l,me({},"".concat(n,"-disabled"),d)),disabled:d,value:p,onChange:m})))}),mKe=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],vKe=Bt.forwardRef(function(i,e){var t,n,o=i.defaultValue,r=i.value,s=i.onFocus,a=i.onBlur,l=i.onChange,c=i.allowClear,d=i.maxLength,u=i.onCompositionStart,h=i.onCompositionEnd,f=i.suffix,g=i.prefixCls,p=g===void 0?"rc-textarea":g,v=i.showCount,m=i.count,_=i.className,y=i.style,w=i.disabled,L=i.hidden,D=i.classNames,E=i.styles,I=i.onResize,k=Hn(i,mKe),R=Kl(o,{value:r,defaultValue:o}),A=Ne(R,2),P=A[0],N=A[1],M=P==null?"":String(P),H=Bt.useState(!1),B=Ne(H,2),F=B[0],$=B[1],z=Bt.useRef(!1),K=Bt.useState(null),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useRef(null),fe=function(){var Te;return(Te=ue.current)===null||Te===void 0?void 0:Te.textArea},pe=function(){fe().focus()};x.exports.useImperativeHandle(e,function(){return{resizableTextArea:ue.current,focus:pe,blur:function(){fe().blur()}}}),x.exports.useEffect(function(){$(function(Le){return!w&&Le})},[w]);var be=Bt.useState(null),Se=Ne(be,2),Fe=Se[0],De=Se[1];Bt.useEffect(function(){if(Fe){var Le;(Le=fe()).setSelectionRange.apply(Le,_t(Fe))}},[Fe]);var ce=Ave(m,v),Pe=(t=ce.max)!==null&&t!==void 0?t:d,Oe=Number(Pe)>0,xe=ce.strategy(M),Ee=!!Pe&&xe>Pe,tt=function(Te,We){var je=We;!z.current&&ce.exceedFormatter&&ce.max&&ce.strategy(We)>ce.max&&(je=ce.exceedFormatter(We,{max:ce.max}),We!==je&&De([fe().selectionStart||0,fe().selectionEnd||0])),N(je),RA(Te.currentTarget,Te,l,je)},nt=function(Te){z.current=!0,u==null||u(Te)},Qe=function(Te){z.current=!1,tt(Te,Te.currentTarget.value),h==null||h(Te)},Ge=function(Te){tt(Te,Te.target.value)},re=function(Te){var We=k.onPressEnter,je=k.onKeyDown;Te.key==="Enter"&&We&&We(Te),je==null||je(Te)},ie=function(Te){$(!0),s==null||s(Te)},se=function(Te){$(!1),a==null||a(Te)},U=function(Te){N(""),pe(),RA(fe(),Te,l)},Y=f,oe;ce.show&&(ce.showFormatter?oe=ce.showFormatter({value:M,count:xe,maxLength:Pe}):oe="".concat(xe).concat(Oe?" / ".concat(Pe):""),Y=fn(ks,{children:[Y,he("span",{className:Ue("".concat(p,"-data-count"),D==null?void 0:D.count),style:E==null?void 0:E.count,children:oe})]}));var te=function(Te){var We;I==null||I(Te),(We=fe())!==null&&We!==void 0&&We.style.height&&X(!0)},ye=!k.autoSize&&!v&&!c;return he(Mve,{value:M,allowClear:c,handleReset:U,suffix:Y,prefixCls:p,classNames:Ce(Ce({},D),{},{affixWrapper:Ue(D==null?void 0:D.affixWrapper,(n={},me(n,"".concat(p,"-show-count"),v),me(n,"".concat(p,"-textarea-allow-clear"),c),n))}),disabled:w,focused:F,className:Ue(_,Ee&&"".concat(p,"-out-of-range")),style:Ce(Ce({},y),G&&!ye?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof oe=="string"?oe:void 0}},hidden:L,children:he(pKe,{...k,maxLength:d,onKeyDown:re,onChange:Ge,onFocus:ie,onBlur:se,onCompositionStart:nt,onCompositionEnd:Qe,className:Ue(D==null?void 0:D.textarea),style:Ce(Ce({},E==null?void 0:E.textarea),{},{resize:y==null?void 0:y.resize}),disabled:w,prefixCls:p,onResize:te,ref:ue})})}),_Ke=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o=!0,size:r,disabled:s,status:a,allowClear:l,classNames:c,rootClassName:d,className:u,variant:h}=i,f=_Ke(i,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:g,direction:p}=x.exports.useContext(Hi),v=Bb(r),m=x.exports.useContext(dS),_=s!=null?s:m,{status:y,hasFeedback:w,feedbackIcon:L}=x.exports.useContext(Uu),D=hq(y,a),E=x.exports.useRef(null);x.exports.useImperativeHandle(e,()=>{var B;return{resizableTextArea:(B=E.current)===null||B===void 0?void 0:B.resizableTextArea,focus:F=>{var $,z;Kje((z=($=E.current)===null||$===void 0?void 0:$.resizableTextArea)===null||z===void 0?void 0:z.textArea,F)},blur:()=>{var F;return(F=E.current)===null||F===void 0?void 0:F.blur()}}});const I=g("input",n);let k;typeof l=="object"&&(l==null?void 0:l.clearIcon)?k=l:l&&(k={clearIcon:x.exports.createElement(uS,null)});const R=nh(I),[A,P,N]=wq(I,R),[M,H]=gq(h,o);return A(x.exports.createElement(vKe,Object.assign({},f,{disabled:_,allowClear:k,className:Ue(N,R,u,d),classNames:Object.assign(Object.assign({},c),{textarea:Ue({[`${I}-sm`]:v==="small",[`${I}-lg`]:v==="large"},P,c==null?void 0:c.textarea),variant:Ue({[`${I}-${M}`]:H},TA(I,D)),affixWrapper:Ue(`${I}-textarea-affix-wrapper`,{[`${I}-affix-wrapper-rtl`]:p==="rtl",[`${I}-affix-wrapper-sm`]:v==="small",[`${I}-affix-wrapper-lg`]:v==="large",[`${I}-textarea-show-count`]:i.showCount||((t=i.count)===null||t===void 0?void 0:t.show)},P)}),prefixCls:I,suffix:w&&x.exports.createElement("span",{className:`${I}-textarea-suffix`},L),ref:E})))});var CKe=bKe;const FI=Sq;FI.Group=Hje;FI.Search=cKe;FI.TextArea=CKe;FI.Password=sKe;var dw=FI;function MA(i){const[e,t]=x.exports.useState(i);return x.exports.useEffect(()=>{const n=setTimeout(()=>{t(i)},i.length?0:10);return()=>{clearTimeout(n)}},[i]),e}const yKe=i=>{const{componentCls:e}=i,t=`${e}-show-help`,n=`${e}-show-help-item`;return{[t]:{transition:`opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[n]:{overflow:"hidden",transition:`height ${i.motionDurationSlow} ${i.motionEaseInOut}, +`,uKe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],y6={},dd;function hKe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=i.getAttribute("id")||i.getAttribute("data-reactid")||i.getAttribute("name");if(e&&y6[t])return y6[t];var n=window.getComputedStyle(i),o=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),r=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),a=uKe.map(function(c){return"".concat(c,":").concat(n.getPropertyValue(c))}).join(";"),l={sizingStyle:a,paddingSize:r,borderSize:s,boxSizing:o};return e&&t&&(y6[t]=l),l}function fKe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;dd||(dd=document.createElement("textarea"),dd.setAttribute("tab-index","-1"),dd.setAttribute("aria-hidden","true"),document.body.appendChild(dd)),i.getAttribute("wrap")?dd.setAttribute("wrap",i.getAttribute("wrap")):dd.removeAttribute("wrap");var o=hKe(i,e),r=o.paddingSize,s=o.borderSize,a=o.boxSizing,l=o.sizingStyle;dd.setAttribute("style","".concat(l,";").concat(dKe)),dd.value=i.value||i.placeholder||"";var c=void 0,d=void 0,u,h=dd.scrollHeight;if(a==="border-box"?h+=s:a==="content-box"&&(h-=r),t!==null||n!==null){dd.value=" ";var f=dd.scrollHeight-r;t!==null&&(c=f*t,a==="border-box"&&(c=c+r+s),h=Math.max(c,h)),n!==null&&(d=f*n,a==="border-box"&&(d=d+r+s),u=h>d?"":"hidden",h=Math.min(d,h))}var g={height:h,overflowY:u,resize:"none"};return c&&(g.minHeight=c),d&&(g.maxHeight=d),g}var gKe=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],w6=0,S6=1,x6=2,pKe=x.exports.forwardRef(function(i,e){var t=i,n=t.prefixCls;t.onPressEnter;var o=t.defaultValue,r=t.value,s=t.autoSize,a=t.onResize,l=t.className,c=t.style,d=t.disabled,u=t.onChange;t.onInternalAutoSize;var h=Hn(t,gKe),f=Kl(o,{value:r,postState:function(ue){return ue!=null?ue:""}}),g=Ne(f,2),p=g[0],v=g[1],m=function(ue){v(ue.target.value),u==null||u(ue)},_=x.exports.useRef();x.exports.useImperativeHandle(e,function(){return{textArea:_.current}});var y=x.exports.useMemo(function(){return s&&qn(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),w=Ne(y,2),L=w[0],D=w[1],E=!!s,I=function(){try{if(document.activeElement===_.current){var ue=_.current,fe=ue.selectionStart,pe=ue.selectionEnd,be=ue.scrollTop;_.current.setSelectionRange(fe,pe),_.current.scrollTop=be}}catch{}},k=x.exports.useState(x6),R=Ne(k,2),A=R[0],P=R[1],N=x.exports.useState(),M=Ne(N,2),H=M[0],B=M[1],F=function(){P(w6)};go(function(){E&&F()},[r,L,D,E]),go(function(){if(A===w6)P(S6);else if(A===S6){var X=fKe(_.current,!1,L,D);P(x6),B(X)}else I()},[A]);var $=x.exports.useRef(),z=function(){Xi.cancel($.current)},K=function(ue){A===x6&&(a==null||a(ue),s&&(z(),$.current=Xi(function(){F()})))};x.exports.useEffect(function(){return z},[]);var j=E?H:null,G=Ce(Ce({},c),j);return(A===w6||A===S6)&&(G.overflowY="hidden",G.overflowX="hidden"),x.exports.createElement(Mu,{onResize:K,disabled:!(s||a)},x.exports.createElement("textarea",yt({},h,{ref:_,style:G,className:Ue(n,l,me({},"".concat(n,"-disabled"),d)),disabled:d,value:p,onChange:m})))}),mKe=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],vKe=Bt.forwardRef(function(i,e){var t,n,o=i.defaultValue,r=i.value,s=i.onFocus,a=i.onBlur,l=i.onChange,c=i.allowClear,d=i.maxLength,u=i.onCompositionStart,h=i.onCompositionEnd,f=i.suffix,g=i.prefixCls,p=g===void 0?"rc-textarea":g,v=i.showCount,m=i.count,_=i.className,y=i.style,w=i.disabled,L=i.hidden,D=i.classNames,E=i.styles,I=i.onResize,k=Hn(i,mKe),R=Kl(o,{value:r,defaultValue:o}),A=Ne(R,2),P=A[0],N=A[1],M=P==null?"":String(P),H=Bt.useState(!1),B=Ne(H,2),F=B[0],$=B[1],z=Bt.useRef(!1),K=Bt.useState(null),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useRef(null),fe=function(){var Te;return(Te=ue.current)===null||Te===void 0?void 0:Te.textArea},pe=function(){fe().focus()};x.exports.useImperativeHandle(e,function(){return{resizableTextArea:ue.current,focus:pe,blur:function(){fe().blur()}}}),x.exports.useEffect(function(){$(function(Le){return!w&&Le})},[w]);var be=Bt.useState(null),Se=Ne(be,2),Fe=Se[0],De=Se[1];Bt.useEffect(function(){if(Fe){var Le;(Le=fe()).setSelectionRange.apply(Le,_t(Fe))}},[Fe]);var ce=Pve(m,v),Pe=(t=ce.max)!==null&&t!==void 0?t:d,Oe=Number(Pe)>0,xe=ce.strategy(M),Ee=!!Pe&&xe>Pe,tt=function(Te,We){var je=We;!z.current&&ce.exceedFormatter&&ce.max&&ce.strategy(We)>ce.max&&(je=ce.exceedFormatter(We,{max:ce.max}),We!==je&&De([fe().selectionStart||0,fe().selectionEnd||0])),N(je),RA(Te.currentTarget,Te,l,je)},nt=function(Te){z.current=!0,u==null||u(Te)},Qe=function(Te){z.current=!1,tt(Te,Te.currentTarget.value),h==null||h(Te)},Ge=function(Te){tt(Te,Te.target.value)},re=function(Te){var We=k.onPressEnter,je=k.onKeyDown;Te.key==="Enter"&&We&&We(Te),je==null||je(Te)},ie=function(Te){$(!0),s==null||s(Te)},se=function(Te){$(!1),a==null||a(Te)},U=function(Te){N(""),pe(),RA(fe(),Te,l)},Y=f,oe;ce.show&&(ce.showFormatter?oe=ce.showFormatter({value:M,count:xe,maxLength:Pe}):oe="".concat(xe).concat(Oe?" / ".concat(Pe):""),Y=fn(ks,{children:[Y,he("span",{className:Ue("".concat(p,"-data-count"),D==null?void 0:D.count),style:E==null?void 0:E.count,children:oe})]}));var te=function(Te){var We;I==null||I(Te),(We=fe())!==null&&We!==void 0&&We.style.height&&X(!0)},ye=!k.autoSize&&!v&&!c;return he(Ave,{value:M,allowClear:c,handleReset:U,suffix:Y,prefixCls:p,classNames:Ce(Ce({},D),{},{affixWrapper:Ue(D==null?void 0:D.affixWrapper,(n={},me(n,"".concat(p,"-show-count"),v),me(n,"".concat(p,"-textarea-allow-clear"),c),n))}),disabled:w,focused:F,className:Ue(_,Ee&&"".concat(p,"-out-of-range")),style:Ce(Ce({},y),G&&!ye?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof oe=="string"?oe:void 0}},hidden:L,children:he(pKe,{...k,maxLength:d,onKeyDown:re,onChange:Ge,onFocus:ie,onBlur:se,onCompositionStart:nt,onCompositionEnd:Qe,className:Ue(D==null?void 0:D.textarea),style:Ce(Ce({},E==null?void 0:E.textarea),{},{resize:y==null?void 0:y.resize}),disabled:w,prefixCls:p,onResize:te,ref:ue})})}),_Ke=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o=!0,size:r,disabled:s,status:a,allowClear:l,classNames:c,rootClassName:d,className:u,variant:h}=i,f=_Ke(i,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:g,direction:p}=x.exports.useContext(Hi),v=Bb(r),m=x.exports.useContext(dS),_=s!=null?s:m,{status:y,hasFeedback:w,feedbackIcon:L}=x.exports.useContext(Uu),D=fq(y,a),E=x.exports.useRef(null);x.exports.useImperativeHandle(e,()=>{var B;return{resizableTextArea:(B=E.current)===null||B===void 0?void 0:B.resizableTextArea,focus:F=>{var $,z;Kje((z=($=E.current)===null||$===void 0?void 0:$.resizableTextArea)===null||z===void 0?void 0:z.textArea,F)},blur:()=>{var F;return(F=E.current)===null||F===void 0?void 0:F.blur()}}});const I=g("input",n);let k;typeof l=="object"&&(l==null?void 0:l.clearIcon)?k=l:l&&(k={clearIcon:x.exports.createElement(uS,null)});const R=nh(I),[A,P,N]=Sq(I,R),[M,H]=pq(h,o);return A(x.exports.createElement(vKe,Object.assign({},f,{disabled:_,allowClear:k,className:Ue(N,R,u,d),classNames:Object.assign(Object.assign({},c),{textarea:Ue({[`${I}-sm`]:v==="small",[`${I}-lg`]:v==="large"},P,c==null?void 0:c.textarea),variant:Ue({[`${I}-${M}`]:H},TA(I,D)),affixWrapper:Ue(`${I}-textarea-affix-wrapper`,{[`${I}-affix-wrapper-rtl`]:p==="rtl",[`${I}-affix-wrapper-sm`]:v==="small",[`${I}-affix-wrapper-lg`]:v==="large",[`${I}-textarea-show-count`]:i.showCount||((t=i.count)===null||t===void 0?void 0:t.show)},P)}),prefixCls:I,suffix:w&&x.exports.createElement("span",{className:`${I}-textarea-suffix`},L),ref:E})))});var CKe=bKe;const FI=xq;FI.Group=Hje;FI.Search=cKe;FI.TextArea=CKe;FI.Password=sKe;var dw=FI;function MA(i){const[e,t]=x.exports.useState(i);return x.exports.useEffect(()=>{const n=setTimeout(()=>{t(i)},i.length?0:10);return()=>{clearTimeout(n)}},[i]),e}const yKe=i=>{const{componentCls:e}=i,t=`${e}-show-help`,n=`${e}-show-help-item`;return{[t]:{transition:`opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[n]:{overflow:"hidden",transition:`height ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}, transform ${i.motionDurationSlow} ${i.motionEaseInOut} !important`,[`&${n}-appear, &${n}-enter`]:{transform:"translateY(-5px)",opacity:0,["&-active"]:{transform:"translateY(0)",opacity:1}},[`&${n}-leave-active`]:{transform:"translateY(-5px)"}}}}};var wKe=yKe;const SKe=i=>({legend:{display:"block",width:"100%",marginBottom:i.marginLG,padding:0,color:i.colorTextDescription,fontSize:i.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},[`input[type='file']:focus, input[type='radio']:focus, - input[type='checkbox']:focus`]:{outline:0,boxShadow:`0 0 0 ${rt(i.controlOutlineWidth)} ${i.controlOutline}`},output:{display:"block",paddingTop:15,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight}}),Aie=(i,e)=>{const{formItemCls:t}=i;return{[t]:{[`${t}-label > label`]:{height:e},[`${t}-control-input`]:{minHeight:e}}}},xKe=i=>{const{componentCls:e}=i;return{[i.componentCls]:Object.assign(Object.assign(Object.assign({},Pa(i)),SKe(i)),{[`${e}-text`]:{display:"inline-block",paddingInlineEnd:i.paddingSM},"&-small":Object.assign({},Aie(i,i.controlHeightSM)),"&-large":Object.assign({},Aie(i,i.controlHeightLG))})}},LKe=i=>{const{formItemCls:e,iconCls:t,componentCls:n,rootPrefixCls:o,labelRequiredMarkColor:r,labelColor:s,labelFontSize:a,labelHeight:l,labelColonMarginInlineStart:c,labelColonMarginInlineEnd:d,itemMarginBottom:u}=i;return{[e]:Object.assign(Object.assign({},Pa(i)),{marginBottom:u,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden, - &-hidden.${o}-row`]:{display:"none"},"&-has-warning":{[`${e}-split`]:{color:i.colorError}},"&-has-error":{[`${e}-split`]:{color:i.colorWarning}},[`${e}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:i.lineHeight,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:l,color:s,fontSize:a,[`> ${t}`]:{fontSize:i.fontSize,verticalAlign:"top"},[`&${e}-required:not(${e}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:i.marginXXS,color:r,fontSize:i.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${n}-hide-required-mark &`]:{display:"none"}},[`${e}-optional`]:{display:"inline-block",marginInlineStart:i.marginXXS,color:i.colorTextDescription,[`${n}-hide-required-mark &`]:{display:"none"}},[`${e}-tooltip`]:{color:i.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:i.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:c,marginInlineEnd:d},[`&${e}-no-colon::after`]:{content:'"\\a0"'}}},[`${e}-control`]:{["--ant-display"]:"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${o}-col-'"]):not([class*="' ${o}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:i.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[e]:{"&-explain, &-extra":{clear:"both",color:i.colorTextDescription,fontSize:i.fontSize,lineHeight:i.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:i.controlHeightSM,transition:`color ${i.motionDurationMid} ${i.motionEaseOut}`},"&-explain":{"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning}}},[`&-with-help ${e}-explain`]:{height:"auto",opacity:1},[`${e}-feedback-icon`]:{fontSize:i.fontSize,textAlign:"center",visibility:"visible",animationName:rq,animationDuration:i.motionDurationMid,animationTimingFunction:i.motionEaseOutBack,pointerEvents:"none","&-success":{color:i.colorSuccess},"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning},"&-validating":{color:i.colorPrimary}}})}},EKe=i=>{const{componentCls:e,formItemCls:t}=i;return{[`${e}-horizontal`]:{[`${t}-label`]:{flexGrow:0},[`${t}-control`]:{flex:"1 1 0",minWidth:0},[`${t}-label[class$='-24'], ${t}-label[class*='-24 ']`]:{[`& + ${t}-control`]:{minWidth:"unset"}}}}},DKe=i=>{const{componentCls:e,formItemCls:t}=i;return{[`${e}-inline`]:{display:"flex",flexWrap:"wrap",[t]:{flex:"none",marginInlineEnd:i.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${t}-label, + input[type='checkbox']:focus`]:{outline:0,boxShadow:`0 0 0 ${rt(i.controlOutlineWidth)} ${i.controlOutline}`},output:{display:"block",paddingTop:15,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight}}),Pie=(i,e)=>{const{formItemCls:t}=i;return{[t]:{[`${t}-label > label`]:{height:e},[`${t}-control-input`]:{minHeight:e}}}},xKe=i=>{const{componentCls:e}=i;return{[i.componentCls]:Object.assign(Object.assign(Object.assign({},Pa(i)),SKe(i)),{[`${e}-text`]:{display:"inline-block",paddingInlineEnd:i.paddingSM},"&-small":Object.assign({},Pie(i,i.controlHeightSM)),"&-large":Object.assign({},Pie(i,i.controlHeightLG))})}},LKe=i=>{const{formItemCls:e,iconCls:t,componentCls:n,rootPrefixCls:o,labelRequiredMarkColor:r,labelColor:s,labelFontSize:a,labelHeight:l,labelColonMarginInlineStart:c,labelColonMarginInlineEnd:d,itemMarginBottom:u}=i;return{[e]:Object.assign(Object.assign({},Pa(i)),{marginBottom:u,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden, + &-hidden.${o}-row`]:{display:"none"},"&-has-warning":{[`${e}-split`]:{color:i.colorError}},"&-has-error":{[`${e}-split`]:{color:i.colorWarning}},[`${e}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:i.lineHeight,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:l,color:s,fontSize:a,[`> ${t}`]:{fontSize:i.fontSize,verticalAlign:"top"},[`&${e}-required:not(${e}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:i.marginXXS,color:r,fontSize:i.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${n}-hide-required-mark &`]:{display:"none"}},[`${e}-optional`]:{display:"inline-block",marginInlineStart:i.marginXXS,color:i.colorTextDescription,[`${n}-hide-required-mark &`]:{display:"none"}},[`${e}-tooltip`]:{color:i.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:i.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:c,marginInlineEnd:d},[`&${e}-no-colon::after`]:{content:'"\\a0"'}}},[`${e}-control`]:{["--ant-display"]:"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${o}-col-'"]):not([class*="' ${o}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:i.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[e]:{"&-explain, &-extra":{clear:"both",color:i.colorTextDescription,fontSize:i.fontSize,lineHeight:i.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:i.controlHeightSM,transition:`color ${i.motionDurationMid} ${i.motionEaseOut}`},"&-explain":{"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning}}},[`&-with-help ${e}-explain`]:{height:"auto",opacity:1},[`${e}-feedback-icon`]:{fontSize:i.fontSize,textAlign:"center",visibility:"visible",animationName:sq,animationDuration:i.motionDurationMid,animationTimingFunction:i.motionEaseOutBack,pointerEvents:"none","&-success":{color:i.colorSuccess},"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning},"&-validating":{color:i.colorPrimary}}})}},EKe=i=>{const{componentCls:e,formItemCls:t}=i;return{[`${e}-horizontal`]:{[`${t}-label`]:{flexGrow:0},[`${t}-control`]:{flex:"1 1 0",minWidth:0},[`${t}-label[class$='-24'], ${t}-label[class*='-24 ']`]:{[`& + ${t}-control`]:{minWidth:"unset"}}}}},DKe=i=>{const{componentCls:e,formItemCls:t}=i;return{[`${e}-inline`]:{display:"flex",flexWrap:"wrap",[t]:{flex:"none",marginInlineEnd:i.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${t}-label, > ${t}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${t}-label`]:{flex:"none"},[`${e}-text`]:{display:"inline-block"},[`${t}-has-feedback`]:{display:"inline-block"}}}}},dC=i=>({padding:i.verticalLabelPadding,margin:i.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),kKe=i=>{const{componentCls:e,formItemCls:t,rootPrefixCls:n}=i;return{[`${t} ${t}-label`]:dC(i),[`${e}:not(${e}-inline)`]:{[t]:{flexWrap:"wrap",[`${t}-label, ${t}-control`]:{[`&:not([class*=" ${n}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},IKe=i=>{const{componentCls:e,formItemCls:t,rootPrefixCls:n}=i;return{[`${e}-vertical`]:{[t]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${e}-item-control`]:{width:"100%"}}},[`${e}-vertical ${t}-label, .${n}-col-24${t}-label, - .${n}-col-xl-24${t}-label`]:dC(i),[`@media (max-width: ${rt(i.screenXSMax)})`]:[kKe(i),{[e]:{[`.${n}-col-xs-24${t}-label`]:dC(i)}}],[`@media (max-width: ${rt(i.screenSMMax)})`]:{[e]:{[`.${n}-col-sm-24${t}-label`]:dC(i)}},[`@media (max-width: ${rt(i.screenMDMax)})`]:{[e]:{[`.${n}-col-md-24${t}-label`]:dC(i)}},[`@media (max-width: ${rt(i.screenLGMax)})`]:{[e]:{[`.${n}-col-lg-24${t}-label`]:dC(i)}}}},TKe=i=>({labelRequiredMarkColor:i.colorError,labelColor:i.colorTextHeading,labelFontSize:i.fontSize,labelHeight:i.controlHeight,labelColonMarginInlineStart:i.marginXXS/2,labelColonMarginInlineEnd:i.marginXS,itemMarginBottom:i.marginLG,verticalLabelPadding:`0 0 ${i.paddingXS}px`,verticalLabelMargin:0}),Ove=(i,e)=>lr(i,{formItemCls:`${i.componentCls}-item`,rootPrefixCls:e});var xq=jc("Form",(i,e)=>{let{rootPrefixCls:t}=e;const n=Ove(i,t);return[xKe(n),LKe(n),wKe(n),EKe(n),DKe(n),IKe(n),vme(n),rq]},TKe,{order:-1e3});const Pie=[];function x6(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof i=="string"?i:`${e}-${n}`,error:i,errorStatus:t}}const NKe=i=>{let{help:e,helpStatus:t,errors:n=Pie,warnings:o=Pie,className:r,fieldId:s,onVisibleChanged:a}=i;const{prefixCls:l}=x.exports.useContext(oq),c=`${l}-item-explain`,d=nh(l),[u,h,f]=xq(l,d),g=x.exports.useMemo(()=>_W(l),[l]),p=MA(n),v=MA(o),m=x.exports.useMemo(()=>e!=null?[x6(e,"help",t)]:[].concat(_t(p.map((y,w)=>x6(y,"error","error",w))),_t(v.map((y,w)=>x6(y,"warning","warning",w)))),[e,t,p,v]),_={};return s&&(_.id=`${s}_help`),u(x.exports.createElement(th,{motionDeadline:g.motionDeadline,motionName:`${l}-show-help`,visible:!!m.length,onVisibleChanged:a},y=>{const{className:w,style:L}=y;return x.exports.createElement("div",Object.assign({},_,{className:Ue(c,w,f,d,r,h),style:L,role:"alert"}),x.exports.createElement(Cpe,Object.assign({keys:m},_W(l),{motionName:`${l}-show-help-item`,component:!1}),D=>{const{key:E,error:I,errorStatus:k,className:R,style:A}=D;return x.exports.createElement("div",{key:E,className:Ue(R,{[`${c}-${k}`]:k}),style:A},I)}))}))};var Fve=NKe;const RKe=["parentNode"],MKe="form_item";function lE(i){return i===void 0||i===!1?[]:Array.isArray(i)?i:[i]}function Bve(i,e){if(!i.length)return;const t=i.join("_");return e?`${e}_${t}`:RKe.includes(t)?`${MKe}_${t}`:t}function Wve(i,e,t,n,o,r){let s=n;return r!==void 0?s=r:t.validating?s="validating":i.length?s="error":e.length?s="warning":(t.touched||o&&t.validated)&&(s="success"),s}function Oie(i){return lE(i).join("_")}function Vve(i){const[e]=iq(),t=x.exports.useRef({}),n=x.exports.useMemo(()=>i!=null?i:Object.assign(Object.assign({},e),{__INTERNAL__:{itemRef:o=>r=>{const s=Oie(o);r?t.current[s]=r:delete t.current[s]}},scrollToField:function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=lE(o),a=Bve(s,n.__INTERNAL__.name),l=a?document.getElementById(a):null;l&&I9e(l,Object.assign({scrollMode:"if-needed",block:"nearest"},r))},getFieldInstance:o=>{const r=Oie(o);return t.current[r]}}),[i,e]);return[n]}var AKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const t=x.exports.useContext(dS),{getPrefixCls:n,direction:o,form:r}=x.exports.useContext(Hi),{prefixCls:s,className:a,rootClassName:l,size:c,disabled:d=t,form:u,colon:h,labelAlign:f,labelWrap:g,labelCol:p,wrapperCol:v,hideRequiredMark:m,layout:_="horizontal",scrollToFirstError:y,requiredMark:w,onFinishFailed:L,name:D,style:E,feedbackIcons:I,variant:k}=i,R=AKe(i,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),A=Bb(c),P=x.exports.useContext(zge),N=x.exports.useMemo(()=>w!==void 0?w:m?!1:r&&r.requiredMark!==void 0?r.requiredMark:!0,[m,w,r]),M=h!=null?h:r==null?void 0:r.colon,H=n("form",s),B=nh(H),[F,$,z]=xq(H,B),K=Ue(H,`${H}-${_}`,{[`${H}-hide-required-mark`]:N===!1,[`${H}-rtl`]:o==="rtl",[`${H}-${A}`]:A},z,B,$,r==null?void 0:r.className,a,l),[j]=Vve(u),{__INTERNAL__:G}=j;G.name=D;const X=x.exports.useMemo(()=>({name:D,labelAlign:f,labelCol:p,labelWrap:g,wrapperCol:v,vertical:_==="vertical",colon:M,requiredMark:N,itemRef:G.itemRef,form:j,feedbackIcons:I}),[D,f,p,v,_,M,N,j,I]);x.exports.useImperativeHandle(e,()=>j);const ue=(pe,be)=>{if(pe){let Se={block:"nearest"};typeof pe=="object"&&(Se=pe),j.scrollToField(be,Se)}},fe=pe=>{if(L==null||L(pe),pe.errorFields.length){const be=pe.errorFields[0].name;if(y!==void 0){ue(y,be);return}r&&r.scrollToFirstError!==void 0&&ue(r.scrollToFirstError,be)}};return F(x.exports.createElement(cme.Provider,{value:k},x.exports.createElement(PK,{disabled:d},x.exports.createElement(DI.Provider,{value:A},x.exports.createElement(lme,{validateMessages:P},x.exports.createElement(sp.Provider,{value:X},x.exports.createElement(fS,Object.assign({id:D},R,{name:D,onFinishFailed:fe,form:j,style:Object.assign(Object.assign({},r==null?void 0:r.style),E),className:K}))))))))},OKe=x.exports.forwardRef(PKe);var FKe=OKe;function BKe(i){if(typeof i=="function")return i;const e=op(i);return e.length<=1?e[0]:e}const Hve=()=>{const{status:i,errors:e=[],warnings:t=[]}=x.exports.useContext(Uu);return{status:i,errors:e,warnings:t}};Hve.Context=Uu;var WKe=Hve;function VKe(i){const[e,t]=x.exports.useState(i),n=x.exports.useRef(null),o=x.exports.useRef([]),r=x.exports.useRef(!1);x.exports.useEffect(()=>(r.current=!1,()=>{r.current=!0,Xi.cancel(n.current),n.current=null}),[]);function s(a){r.current||(n.current===null&&(o.current=[],n.current=Xi(()=>{n.current=null,t(l=>{let c=l;return o.current.forEach(d=>{c=d(c)}),c})})),o.current.push(a))}return[e,s]}function HKe(){const{itemRef:i}=x.exports.useContext(sp),e=x.exports.useRef({});function t(n,o){const r=o&&typeof o=="object"&&o.ref,s=n.join("_");return(e.current.name!==s||e.current.originRef!==r)&&(e.current.name=s,e.current.originRef=r,e.current.ref=eh(i(n),r)),e.current.ref}return t}const $Ke=i=>{const{formItemCls:e}=i;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${e}-control`]:{display:"flex"}}}};var zKe=WK(["Form","item-item"],(i,e)=>{let{rootPrefixCls:t}=e;const n=Ove(i,t);return[$Ke(n)]});const UKe=i=>{const{prefixCls:e,status:t,wrapperCol:n,children:o,errors:r,warnings:s,_internalItemRender:a,extra:l,help:c,fieldId:d,marginBottom:u,onErrorVisibleChanged:h}=i,f=`${e}-item`,g=x.exports.useContext(sp),p=n||g.wrapperCol||{},v=Ue(`${f}-control`,p.className),m=x.exports.useMemo(()=>Object.assign({},g),[g]);delete m.labelCol,delete m.wrapperCol;const _=x.exports.createElement("div",{className:`${f}-control-input`},x.exports.createElement("div",{className:`${f}-control-input-content`},o)),y=x.exports.useMemo(()=>({prefixCls:e,status:t}),[e,t]),w=u!==null||r.length||s.length?x.exports.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},x.exports.createElement(oq.Provider,{value:y},x.exports.createElement(Fve,{fieldId:d,errors:r,warnings:s,help:c,helpStatus:t,className:`${f}-explain-connected`,onVisibleChanged:h})),!!u&&x.exports.createElement("div",{style:{width:0,height:u}})):null,L={};d&&(L.id=`${d}_extra`);const D=l?x.exports.createElement("div",Object.assign({},L,{className:`${f}-extra`}),l):null,E=a&&a.mark==="pro_table_render"&&a.render?a.render(i,{input:_,errorList:w,extra:D}):x.exports.createElement(x.exports.Fragment,null,_,w,D);return x.exports.createElement(sp.Provider,{value:m},x.exports.createElement(Rve,Object.assign({},p,{className:v}),E),x.exports.createElement(zKe,{prefixCls:e}))};var jKe=UKe,KKe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},qKe=KKe,GKe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:qKe}))},XKe=x.exports.forwardRef(GKe),YKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{prefixCls:e,label:t,htmlFor:n,labelCol:o,labelAlign:r,colon:s,required:a,requiredMark:l,tooltip:c}=i;var d;const[u]=EI("Form"),{vertical:h,labelAlign:f,labelCol:g,labelWrap:p,colon:v}=x.exports.useContext(sp);if(!t)return null;const m=o||g||{},_=r||f,y=`${e}-item-label`,w=Ue(y,_==="left"&&`${y}-left`,m.className,{[`${y}-wrap`]:!!p});let L=t;const D=s===!0||v!==!1&&s!==!1;D&&!h&&typeof t=="string"&&t.trim()!==""&&(L=t.replace(/[:|:]\s*$/,""));const I=ZKe(c);if(I){const{icon:P=x.exports.createElement(XKe,null)}=I,N=YKe(I,["icon"]),M=x.exports.createElement(cze,Object.assign({},N),x.exports.cloneElement(P,{className:`${e}-item-tooltip`,title:"",onClick:H=>{H.preventDefault()},tabIndex:null}));L=x.exports.createElement(x.exports.Fragment,null,L,M)}const k=l==="optional",R=typeof l=="function";R?L=l(L,{required:!!a}):k&&!a&&(L=x.exports.createElement(x.exports.Fragment,null,L,x.exports.createElement("span",{className:`${e}-item-optional`,title:""},(u==null?void 0:u.optional)||((d=mv.Form)===null||d===void 0?void 0:d.optional))));const A=Ue({[`${e}-item-required`]:a,[`${e}-item-required-mark-optional`]:k||R,[`${e}-item-no-colon`]:!D});return x.exports.createElement(Rve,Object.assign({},m,{className:w}),x.exports.createElement("label",{htmlFor:n,className:A,title:typeof t=="string"?t:""},L))};var JKe=QKe;const eqe={success:zK,warning:UK,error:uS,validating:kI};function $ve(i){let{children:e,errors:t,warnings:n,hasFeedback:o,validateStatus:r,prefixCls:s,meta:a,noStyle:l}=i;const c=`${s}-item`,{feedbackIcons:d}=x.exports.useContext(sp),u=Wve(t,n,a,null,!!o,r),{isFormItemInput:h,status:f,hasFeedback:g,feedbackIcon:p}=x.exports.useContext(Uu),v=x.exports.useMemo(()=>{var m;let _;if(o){const w=o!==!0&&o.icons||d,L=u&&((m=w==null?void 0:w({status:u,errors:t,warnings:n}))===null||m===void 0?void 0:m[u]),D=u&&eqe[u];_=L!==!1&&D?x.exports.createElement("span",{className:Ue(`${c}-feedback-icon`,`${c}-feedback-icon-${u}`)},L||x.exports.createElement(D,null)):null}const y={status:u||"",errors:t,warnings:n,hasFeedback:!!o,feedbackIcon:_,isFormItemInput:!0};return l&&(y.status=(u!=null?u:f)||"",y.isFormItemInput=h,y.hasFeedback=!!(o!=null?o:g),y.feedbackIcon=o!==void 0?y.feedbackIcon:p),y},[u,o,l,h,f]);return x.exports.createElement(Uu.Provider,{value:v},e)}var tqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{if(I&&w.current){const B=getComputedStyle(w.current);A(parseInt(B.marginBottom,10))}},[I,k]);const P=B=>{B||A(null)},M=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const F=B?L:c.errors,$=B?D:c.warnings;return Wve(F,$,c,"",!!d,l)}(),H=Ue(_,t,n,{[`${_}-with-help`]:E||L.length||D.length,[`${_}-has-feedback`]:M&&d,[`${_}-has-success`]:M==="success",[`${_}-has-warning`]:M==="warning",[`${_}-has-error`]:M==="error",[`${_}-is-validating`]:M==="validating",[`${_}-hidden`]:u});return x.exports.createElement("div",{className:H,style:o,ref:w},x.exports.createElement(Mje,Object.assign({className:`${_}-row`},kf(m,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),x.exports.createElement(JKe,Object.assign({htmlFor:f},i,{requiredMark:y,required:g!=null?g:p,prefixCls:e})),x.exports.createElement(jKe,Object.assign({},i,c,{errors:L,warnings:D,prefixCls:e,status:M,help:r,marginBottom:R,onErrorVisibleChanged:P}),x.exports.createElement(ame.Provider,{value:v},x.exports.createElement($ve,{prefixCls:e,meta:c,errors:c.errors,warnings:c.warnings,hasFeedback:d,validateStatus:M},h)))),!!R&&x.exports.createElement("div",{className:`${_}-margin-offset`,style:{marginBottom:-R}}))}const iqe="__SPLIT__";function oqe(i,e){const t=Object.keys(i),n=Object.keys(e);return t.length===n.length&&t.every(o=>{const r=i[o],s=e[o];return r===s||typeof r=="function"||typeof s=="function"})}const rqe=x.exports.memo(i=>{let{children:e}=i;return e},(i,e)=>oqe(i.control,e.control)&&i.update===e.update&&i.childProps.length===e.childProps.length&&i.childProps.every((t,n)=>t===e.childProps[n]));function Fie(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function sqe(i){const{name:e,noStyle:t,className:n,dependencies:o,prefixCls:r,shouldUpdate:s,rules:a,children:l,required:c,label:d,messageVariables:u,trigger:h="onChange",validateTrigger:f,hidden:g,help:p}=i,{getPrefixCls:v}=x.exports.useContext(Hi),{name:m}=x.exports.useContext(sp),_=BKe(l),y=typeof _=="function",w=x.exports.useContext(ame),{validateTrigger:L}=x.exports.useContext(G0),D=f!==void 0?f:L,E=e!=null,I=v("form",r),k=nh(I),[R,A,P]=xq(I,k);L4();const N=x.exports.useContext(vD),M=x.exports.useRef(),[H,B]=VKe({}),[F,$]=Um(()=>Fie()),z=pe=>{const be=N==null?void 0:N.getKey(pe.name);if($(pe.destroy?Fie():pe,!0),t&&p!==!1&&w){let Se=pe.name;if(pe.destroy)Se=M.current||Se;else if(be!==void 0){const[Fe,De]=be;Se=[Fe].concat(_t(De)),M.current=Se}w(pe,Se)}},K=(pe,be)=>{B(Se=>{const Fe=Object.assign({},Se),ce=[].concat(_t(pe.name.slice(0,-1)),_t(be)).join(iqe);return pe.destroy?delete Fe[ce]:Fe[ce]=pe,Fe})},[j,G]=x.exports.useMemo(()=>{const pe=_t(F.errors),be=_t(F.warnings);return Object.values(H).forEach(Se=>{pe.push.apply(pe,_t(Se.errors||[])),be.push.apply(be,_t(Se.warnings||[]))}),[pe,be]},[H,F.errors,F.warnings]),X=HKe();function ue(pe,be,Se){return t&&!g?x.exports.createElement($ve,{prefixCls:I,hasFeedback:i.hasFeedback,validateStatus:i.validateStatus,meta:F,errors:j,warnings:G,noStyle:!0},pe):x.exports.createElement(nqe,Object.assign({key:"row"},i,{className:Ue(n,P,k,A),prefixCls:I,fieldId:be,isRequired:Se,errors:j,warnings:G,meta:F,onSubItemMetaChange:K}),pe)}if(!E&&!y&&!o)return R(ue(_));let fe={};return typeof d=="string"?fe.label=d:e&&(fe.label=String(e)),u&&(fe=Object.assign(Object.assign({},fe),u)),R(x.exports.createElement(nq,Object.assign({},i,{messageVariables:fe,trigger:h,validateTrigger:D,onMetaChange:z}),(pe,be,Se)=>{const Fe=lE(e).length&&be?be.name:[],De=Bve(Fe,m),ce=c!==void 0?c:!!(a&&a.some(xe=>{if(xe&&typeof xe=="object"&&xe.required&&!xe.warningOnly)return!0;if(typeof xe=="function"){const Ee=xe(Se);return Ee&&Ee.required&&!Ee.warningOnly}return!1})),Pe=Object.assign({},pe);let Oe=null;if(Array.isArray(_)&&E)Oe=_;else if(!(y&&(!(s||o)||E))){if(!(o&&!y&&!E))if(lw(_)){const xe=Object.assign(Object.assign({},_.props),Pe);if(xe.id||(xe.id=De),p||j.length>0||G.length>0||i.extra){const nt=[];(p||j.length>0)&&nt.push(`${De}_help`),i.extra&&nt.push(`${De}_extra`),xe["aria-describedby"]=nt.join(" ")}j.length>0&&(xe["aria-invalid"]="true"),ce&&(xe["aria-required"]="true"),Gv(_)&&(xe.ref=X(Fe,_)),new Set([].concat(_t(lE(h)),_t(lE(D)))).forEach(nt=>{xe[nt]=function(){for(var Qe,Ge,re,ie,se,U=arguments.length,Y=new Array(U),oe=0;oe{var{prefixCls:e,children:t}=i,n=lqe(i,["prefixCls","children"]);const{getPrefixCls:o}=x.exports.useContext(Hi),r=o("form",e),s=x.exports.useMemo(()=>({prefixCls:r,status:"error"}),[r]);return x.exports.createElement(ime,Object.assign({},n),(a,l,c)=>x.exports.createElement(oq.Provider,{value:s},t(a.map(d=>Object.assign(Object.assign({},d),{fieldKey:d.key})),l,{errors:c.errors,warnings:c.warnings})))};var dqe=cqe;function uqe(){const{form:i}=x.exports.useContext(sp);return i}const pp=FKe;pp.Item=aqe;pp.List=dqe;pp.ErrorList=Fve;pp.useForm=Vve;pp.useFormInstance=uqe;pp.useWatch=sme;pp.Provider=lme;pp.create=()=>{};var wD=pp;let pd=null,l0=i=>i(),SD=[],xD={};function Bie(){const{getContainer:i,duration:e,rtl:t,maxCount:n,top:o}=xD,r=(i==null?void 0:i())||document.body;return{getContainer:()=>r,duration:e,rtl:t,maxCount:n,top:o}}const hqe=Bt.forwardRef((i,e)=>{const{messageConfig:t,sync:n}=i,{getPrefixCls:o}=x.exports.useContext(Hi),r=xD.prefixCls||o("message"),s=x.exports.useContext(vVe),[a,l]=Ppe(Object.assign(Object.assign(Object.assign({},t),{prefixCls:r}),s.message));return Bt.useImperativeHandle(e,()=>{const c=Object.assign({},a);return Object.keys(c).forEach(d=>{c[d]=function(){return n(),a[d].apply(a,arguments)}}),{instance:c,sync:n}}),l}),fqe=Bt.forwardRef((i,e)=>{const[t,n]=Bt.useState(Bie),o=()=>{n(Bie)};Bt.useEffect(o,[]);const r=HK(),s=r.getRootPrefixCls(),a=r.getIconPrefixCls(),l=r.getTheme(),c=he(hqe,{ref:e,sync:o,messageConfig:t});return he(gp,{prefixCls:s,iconPrefixCls:a,theme:l,children:r.holderRender?r.holderRender(c):c})});function B4(){if(!pd){const i=document.createDocumentFragment(),e={fragment:i};pd=e,l0(()=>{XK(he(fqe,{ref:t=>{const{instance:n,sync:o}=t||{};Promise.resolve().then(()=>{!e.instance&&n&&(e.instance=n,e.sync=o,B4())})}}),i)});return}!pd.instance||(SD.forEach(i=>{const{type:e,skipped:t}=i;if(!t)switch(e){case"open":{l0(()=>{const n=pd.instance.open(Object.assign(Object.assign({},xD),i.config));n==null||n.then(i.resolve),i.setCloseFn(n)});break}case"destroy":l0(()=>{pd==null||pd.instance.destroy(i.key)});break;default:l0(()=>{var n;const o=(n=pd.instance)[e].apply(n,_t(i.args));o==null||o.then(i.resolve),i.setCloseFn(o)})}}),SD=[])}function gqe(i){xD=Object.assign(Object.assign({},xD),i),l0(()=>{var e;(e=pd==null?void 0:pd.sync)===null||e===void 0||e.call(pd)})}function pqe(i){const e=GK(t=>{let n;const o={type:"open",config:i,resolve:t,setCloseFn:r=>{n=r}};return SD.push(o),()=>{n?l0(()=>{n()}):o.skipped=!0}});return B4(),e}function mqe(i,e){HK();const t=GK(n=>{let o;const r={type:i,args:e,resolve:n,setCloseFn:s=>{o=s}};return SD.push(r),()=>{o?l0(()=>{o()}):r.skipped=!0}});return B4(),t}function vqe(i){SD.push({type:"destroy",key:i}),B4()}const _qe=["success","info","warning","error","loading"],bqe={open:pqe,destroy:vqe,config:gqe,useMessage:s7e,_InternalPanelDoNotUseOrYouWillBeFired:Q9e},Uve=bqe;_qe.forEach(i=>{Uve[i]=function(){for(var e=arguments.length,t=new Array(e),n=0;n{const{prefixCls:e,className:t,closeIcon:n,closable:o,type:r,title:s,children:a,footer:l}=i,c=Cqe(i,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:d}=x.exports.useContext(Hi),u=d(),h=e||d("modal"),f=nh(u),[g,p,v]=Cme(h,f),m=`${h}-confirm`;let _={};return r?_={closable:o!=null?o:!1,title:"",footer:"",children:x.exports.createElement(wme,Object.assign({},i,{prefixCls:h,confirmPrefixCls:m,rootPrefixCls:u,content:a}))}:_={closable:o!=null?o:!0,title:s,footer:l!==null&&x.exports.createElement(ume,Object.assign({},i)),children:a},g(x.exports.createElement(Zpe,Object.assign({prefixCls:h,className:Ue(p,`${h}-pure-panel`,r&&m,r&&`${m}-${r}`,t,v,f)},c,{closeIcon:dme(h,n),closable:o},_)))};var wqe=Nme(yqe);function jve(i){return RI(Eme(i))}const ih=yme;ih.useModal=mVe;ih.info=function(e){return RI(Dme(e))};ih.success=function(e){return RI(kme(e))};ih.error=function(e){return RI(Ime(e))};ih.warning=jve;ih.warn=jve;ih.confirm=function(e){return RI(Tme(e))};ih.destroyAll=function(){for(;a0.length;){const e=a0.pop();e&&e()}};ih.config=uVe;ih._InternalPanelDoNotUseOrYouWillBeFired=wqe;var Lq=ih,Eq=x.exports.createContext(null),Sqe=function(e){for(var t=e.prefixCls,n=e.level,o=e.isStart,r=e.isEnd,s="".concat(t,"-indent-unit"),a=[],l=0;l=0&&t.splice(n,1),t}function Fp(i,e){var t=(i||[]).slice();return t.indexOf(e)===-1&&t.push(e),t}function Dq(i){return i.split("-")}function kqe(i,e){var t=[],n=Sc(e,i);function o(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];r.forEach(function(s){var a=s.key,l=s.children;t.push(a),o(l)})}return o(n.children),t}function Iqe(i){if(i.parent){var e=Dq(i.pos);return Number(e[e.length-1])===i.parent.children.length-1}return!1}function Tqe(i){var e=Dq(i.pos);return Number(e[e.length-1])===0}function Hie(i,e,t,n,o,r,s,a,l,c){var d,u=i.clientX,h=i.clientY,f=i.target.getBoundingClientRect(),g=f.top,p=f.height,v=(c==="rtl"?-1:1)*(((o==null?void 0:o.x)||0)-u),m=(v-12)/n,_=Sc(a,t.props.eventKey);if(h-1.5?r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1:r({dragNode:P,dropNode:N,dropPosition:0})?k=0:r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1:r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1,{dropPosition:k,dropLevelOffset:R,dropTargetKey:_.key,dropTargetPos:_.pos,dragOverNodeKey:I,dropContainerKey:k===0?null:((d=_.parent)===null||d===void 0?void 0:d.key)||null,dropAllowed:M}}function $ie(i,e){if(!!i){var t=e.multiple;return t?i.slice():i.length?[i[0]]:i}}function L6(i){if(!i)return null;var e;if(Array.isArray(i))e={checkedKeys:i,halfCheckedKeys:void 0};else if(qn(i)==="object")e={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return rr(!1,"`checkedKeys` is not an array or an object"),null;return e}function zW(i,e){var t=new Set;function n(o){if(!t.has(o)){var r=Sc(e,o);if(!!r){t.add(o);var s=r.parent,a=r.node;a.disabled||s&&n(s.key)}}}return(i||[]).forEach(function(o){n(o)}),_t(t)}function Nqe(i){var e=i.dropPosition,t=i.dropLevelOffset,n=i.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:o.top=0,o.left=-t*n;break;case 1:o.bottom=0,o.left=-t*n;break;case 0:o.bottom=0,o.left=n;break}return x.exports.createElement("div",{style:o})}function Kve(i){if(i==null)throw new TypeError("Cannot destructure "+i)}function Rqe(i,e){var t=x.exports.useState(!1),n=Ne(t,2),o=n[0],r=n[1];go(function(){if(o)return i(),function(){e()}},[o]),go(function(){return r(!0),function(){r(!1)}},[])}var Mqe=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],qve=function(e,t){var n=e.className,o=e.style,r=e.motion,s=e.motionNodes,a=e.motionType,l=e.onMotionStart,c=e.onMotionEnd,d=e.active,u=e.treeNodeRequiredProps,h=Hn(e,Mqe),f=x.exports.useState(!0),g=Ne(f,2),p=g[0],v=g[1],m=x.exports.useContext(Eq),_=m.prefixCls,y=s&&a!=="hide";go(function(){s&&y!==p&&v(y)},[s]);var w=function(){s&&l()},L=x.exports.useRef(!1),D=function(){s&&!L.current&&(L.current=!0,c())};Rqe(w,D);var E=function(k){y===k&&D()};return s?x.exports.createElement(th,yt({ref:t,visible:p},r,{motionAppear:a==="show",onVisibleChanged:E}),function(I,k){var R=I.className,A=I.style;return x.exports.createElement("div",{ref:k,className:Ue("".concat(_,"-treenode-motion"),R),style:A},s.map(function(P){var N=yt({},(Kve(P.data),P.data)),M=P.title,H=P.key,B=P.isStart,F=P.isEnd;delete N.children;var $=aE(H,u);return x.exports.createElement(uw,yt({},N,$,{title:M,active:d,data:P.data,key:H,isStart:B,isEnd:F}))}))}):x.exports.createElement(uw,yt({domRef:t,className:n,style:o},h,{active:d}))};qve.displayName="MotionTreeNode";var Aqe=x.exports.forwardRef(qve);function Pqe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=i.length,n=e.length;if(Math.abs(t-n)!==1)return{add:!1,key:null};function o(r,s){var a=new Map;r.forEach(function(c){a.set(c,!0)});var l=s.filter(function(c){return!a.has(c)});return l.length===1?l[0]:null}return t ").concat(e);return e}var Xve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.data;i.selectable,i.checkable;var o=i.expandedKeys,r=i.selectedKeys,s=i.checkedKeys,a=i.loadedKeys,l=i.loadingKeys,c=i.halfCheckedKeys,d=i.keyEntities,u=i.disabled,h=i.dragging,f=i.dragOverNodeKey,g=i.dropPosition,p=i.motion,v=i.height,m=i.itemHeight,_=i.virtual,y=i.focusable,w=i.activeItem,L=i.focused,D=i.tabIndex,E=i.onKeyDown,I=i.onFocus,k=i.onBlur,R=i.onActiveChange,A=i.onListChangeStart,P=i.onListChangeEnd,N=Hn(i,Oqe),M=x.exports.useRef(null),H=x.exports.useRef(null);x.exports.useImperativeHandle(e,function(){return{scrollTo:function(ie){M.current.scrollTo(ie)},getIndentWidth:function(){return H.current.offsetWidth}}});var B=x.exports.useState(o),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState(n),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useState(n),fe=Ne(ue,2),pe=fe[0],be=fe[1],Se=x.exports.useState([]),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1],Pe=x.exports.useState(null),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=x.exports.useRef(n);tt.current=n;function nt(){var re=tt.current;X(re),be(re),ce([]),Ee(null),P()}go(function(){z(o);var re=Pqe($,o);if(re.key!==null)if(re.add){var ie=G.findIndex(function(ye){var Le=ye.key;return Le===re.key}),se=Kie(zie(G,n,re.key),_,v,m),U=G.slice();U.splice(ie+1,0,jie),be(U),ce(se),Ee("show")}else{var Y=n.findIndex(function(ye){var Le=ye.key;return Le===re.key}),oe=Kie(zie(n,G,re.key),_,v,m),te=n.slice();te.splice(Y+1,0,jie),be(te),ce(oe),Ee("hide")}else G!==n&&(X(n),be(n))},[o,n]),x.exports.useEffect(function(){h||nt()},[h]);var Qe=p?pe:n,Ge={expandedKeys:o,selectedKeys:r,loadedKeys:a,loadingKeys:l,checkedKeys:s,halfCheckedKeys:c,dragOverNodeKey:f,dropPosition:g,keyEntities:d};return x.exports.createElement(x.exports.Fragment,null,L&&w&&x.exports.createElement("span",{style:Uie,"aria-live":"assertive"},Bqe(w)),x.exports.createElement("div",null,x.exports.createElement("input",{style:Uie,disabled:y===!1||u,tabIndex:y!==!1?D:null,onKeyDown:E,onFocus:I,onBlur:k,value:"",onChange:Fqe,"aria-label":"for screen reader"})),x.exports.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},x.exports.createElement("div",{className:"".concat(t,"-indent")},x.exports.createElement("div",{ref:H,className:"".concat(t,"-indent-unit")}))),x.exports.createElement(dq,yt({},N,{data:Qe,itemKey:qie,height:v,fullHeight:!1,virtual:_,itemHeight:m,prefixCls:"".concat(t,"-list"),ref:M,onVisibleChange:function(ie,se){var U=new Set(ie),Y=se.filter(function(oe){return!U.has(oe)});Y.some(function(oe){return qie(oe)===X0})&&nt()}}),function(re){var ie=re.pos,se=yt({},(Kve(re.data),re.data)),U=re.title,Y=re.key,oe=re.isStart,te=re.isEnd,ye=OI(Y,ie);delete se.key,delete se.children;var Le=aE(ye,Ge);return x.exports.createElement(Aqe,yt({},se,Le,{title:U,active:!!w&&Y===w.key,pos:ie,data:re.data,isStart:oe,isEnd:te,motion:p,motionNodes:Y===X0?De:null,motionType:xe,onMotionStart:A,onMotionEnd:nt,treeNodeRequiredProps:Ge,onMouseMove:function(){R(null)}}))}))});Xve.displayName="NodeList";var Wqe=10,kq=function(i){fp(t,i);var e=Ob(t);function t(){var n;ga(this,t);for(var o=arguments.length,r=new Array(o),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,u=n.state,h=u.dragChildrenKeys,f=u.dropPosition,g=u.dropTargetKey,p=u.dropTargetPos,v=u.dropAllowed;if(!!v){var m=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),g!==null){var _=Ce(Ce({},aE(g,n.getTreeNodeRequiredProps())),{},{active:((c=n.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:Sc(n.state.keyEntities,g).node}),y=h.indexOf(g)!==-1;rr(!y,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var w=Dq(p),L={event:a,node:Zr(_),dragNode:n.dragNode?Zr(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(h),dropToGap:f!==0,dropPosition:f+Number(w[w.length-1])};d||m==null||m(L),n.dragNode=null}}},n.cleanDragState=function(){var a=n.state.draggingNodeKey;a!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(a,l){var c=n.state,d=c.expandedKeys,u=c.flattenNodes,h=l.expanded,f=l.key,g=l.isLeaf;if(!(g||a.shiftKey||a.metaKey||a.ctrlKey)){var p=u.filter(function(m){return m.key===f})[0],v=Zr(Ce(Ce({},aE(f,n.getTreeNodeRequiredProps())),{},{data:p.data}));n.setExpandedKeys(h?Gf(d,f):Fp(d,f)),n.onNodeExpand(a,v)}},n.onNodeClick=function(a,l){var c=n.props,d=c.onClick,u=c.expandAction;u==="click"&&n.triggerExpandActionExpand(a,l),d==null||d(a,l)},n.onNodeDoubleClick=function(a,l){var c=n.props,d=c.onDoubleClick,u=c.expandAction;u==="doubleClick"&&n.triggerExpandActionExpand(a,l),d==null||d(a,l)},n.onNodeSelect=function(a,l){var c=n.state.selectedKeys,d=n.state,u=d.keyEntities,h=d.fieldNames,f=n.props,g=f.onSelect,p=f.multiple,v=l.selected,m=l[h.key],_=!v;_?p?c=Fp(c,m):c=[m]:c=Gf(c,m);var y=c.map(function(w){var L=Sc(u,w);return L?L.node:null}).filter(function(w){return w});n.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:_,node:l,selectedNodes:y,nativeEvent:a.nativeEvent})},n.onNodeCheck=function(a,l,c){var d=n.state,u=d.keyEntities,h=d.checkedKeys,f=d.halfCheckedKeys,g=n.props,p=g.checkStrictly,v=g.onCheck,m=l.key,_,y={event:"check",node:l,checked:c,nativeEvent:a.nativeEvent};if(p){var w=c?Fp(h,m):Gf(h,m),L=Gf(f,m);_={checked:w,halfChecked:L},y.checkedNodes=w.map(function(A){return Sc(u,A)}).filter(function(A){return A}).map(function(A){return A.node}),n.setUncontrolledState({checkedKeys:w})}else{var D=b6([].concat(_t(h),[m]),!0,u),E=D.checkedKeys,I=D.halfCheckedKeys;if(!c){var k=new Set(E);k.delete(m);var R=b6(Array.from(k),{checked:!1,halfCheckedKeys:I},u);E=R.checkedKeys,I=R.halfCheckedKeys}_=E,y.checkedNodes=[],y.checkedNodesPositions=[],y.halfCheckedKeys=I,E.forEach(function(A){var P=Sc(u,A);if(!!P){var N=P.node,M=P.pos;y.checkedNodes.push(N),y.checkedNodesPositions.push({node:N,pos:M})}}),n.setUncontrolledState({checkedKeys:E},!1,{halfCheckedKeys:I})}v==null||v(_,y)},n.onNodeLoad=function(a){var l=a.key,c=new Promise(function(d,u){n.setState(function(h){var f=h.loadedKeys,g=f===void 0?[]:f,p=h.loadingKeys,v=p===void 0?[]:p,m=n.props,_=m.loadData,y=m.onLoad;if(!_||g.indexOf(l)!==-1||v.indexOf(l)!==-1)return null;var w=_(a);return w.then(function(){var L=n.state.loadedKeys,D=Fp(L,l);y==null||y(D,{event:"load",node:a}),n.setUncontrolledState({loadedKeys:D}),n.setState(function(E){return{loadingKeys:Gf(E.loadingKeys,l)}}),d()}).catch(function(L){if(n.setState(function(E){return{loadingKeys:Gf(E.loadingKeys,l)}}),n.loadingRetryTimes[l]=(n.loadingRetryTimes[l]||0)+1,n.loadingRetryTimes[l]>=Wqe){var D=n.state.loadedKeys;rr(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:Fp(D,l)}),d()}u(L)}),{loadingKeys:Fp(v,l)}})});return c.catch(function(){}),c},n.onNodeMouseEnter=function(a,l){var c=n.props.onMouseEnter;c==null||c({event:a,node:l})},n.onNodeMouseLeave=function(a,l){var c=n.props.onMouseLeave;c==null||c({event:a,node:l})},n.onNodeContextMenu=function(a,l){var c=n.props.onRightClick;c&&(a.preventDefault(),c({event:a,node:l}))},n.onFocus=function(){var a=n.props.onFocus;n.setState({focused:!0});for(var l=arguments.length,c=new Array(l),d=0;d1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var d=!1,u=!0,h={};Object.keys(a).forEach(function(f){if(f in n.props){u=!1;return}d=!0,h[f]=a[f]}),d&&(!l||u)&&n.setState(Ce(Ce({},h),c))}},n.scrollTo=function(a){n.listRef.current.scrollTo(a)},n}return pa(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var o=this.props,r=o.activeKey,s=o.itemScrollOffset,a=s===void 0?0:s;r!==void 0&&r!==this.state.activeKey&&(this.setState({activeKey:r}),r!==null&&this.scrollTo({key:r,offset:a}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var o,r=this.state,s=r.focused,a=r.flattenNodes,l=r.keyEntities,c=r.draggingNodeKey,d=r.activeKey,u=r.dropLevelOffset,h=r.dropContainerKey,f=r.dropTargetKey,g=r.dropPosition,p=r.dragOverNodeKey,v=r.indent,m=this.props,_=m.prefixCls,y=m.className,w=m.style,L=m.showLine,D=m.focusable,E=m.tabIndex,I=E===void 0?0:E,k=m.selectable,R=m.showIcon,A=m.icon,P=m.switcherIcon,N=m.draggable,M=m.checkable,H=m.checkStrictly,B=m.disabled,F=m.motion,$=m.loadData,z=m.filterTreeNode,K=m.height,j=m.itemHeight,G=m.virtual,X=m.titleRender,ue=m.dropIndicatorRender,fe=m.onContextMenu,pe=m.onScroll,be=m.direction,Se=m.rootClassName,Fe=m.rootStyle,De=K0(this.props,{aria:!0,data:!0}),ce;return N&&(qn(N)==="object"?ce=N:typeof N=="function"?ce={nodeDraggable:N}:ce={}),x.exports.createElement(Eq.Provider,{value:{prefixCls:_,selectable:k,showIcon:R,icon:A,switcherIcon:P,draggable:ce,draggingNodeKey:c,checkable:M,checkStrictly:H,disabled:B,keyEntities:l,dropLevelOffset:u,dropContainerKey:h,dropTargetKey:f,dropPosition:g,dragOverNodeKey:p,indent:v,direction:be,dropIndicatorRender:ue,loadData:$,filterTreeNode:z,titleRender:X,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},x.exports.createElement("div",{role:"tree",className:Ue(_,y,Se,(o={},me(o,"".concat(_,"-show-line"),L),me(o,"".concat(_,"-focused"),s),me(o,"".concat(_,"-active-focused"),d!==null),o)),style:Fe},x.exports.createElement(Xve,yt({ref:this.listRef,prefixCls:_,style:w,data:a,disabled:B,selectable:k,checkable:!!M,motion:F,dragging:c!==null,height:K,itemHeight:j,virtual:G,focusable:D,focused:s,tabIndex:I,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:fe,onScroll:pe},this.getTreeNodeRequiredProps(),De))))}}],[{key:"getDerivedStateFromProps",value:function(o,r){var s=r.prevProps,a={prevProps:o};function l(D){return!s&&D in o||s&&s[D]!==o[D]}var c,d=r.fieldNames;if(l("fieldNames")&&(d=cw(o.fieldNames),a.fieldNames=d),l("treeData")?c=o.treeData:l("children")&&(rr(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=Dve(o.children)),c){a.treeData=c;var u=kve(c,{fieldNames:d});a.keyEntities=Ce(me({},X0,Gve),u.keyEntities)}var h=a.keyEntities||r.keyEntities;if(l("expandedKeys")||s&&l("autoExpandParent"))a.expandedKeys=o.autoExpandParent||!s&&o.defaultExpandParent?zW(o.expandedKeys,h):o.expandedKeys;else if(!s&&o.defaultExpandAll){var f=Ce({},h);delete f[X0],a.expandedKeys=Object.keys(f).map(function(D){return f[D].key})}else!s&&o.defaultExpandedKeys&&(a.expandedKeys=o.autoExpandParent||o.defaultExpandParent?zW(o.defaultExpandedKeys,h):o.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,c||a.expandedKeys){var g=_6(c||r.treeData,a.expandedKeys||r.expandedKeys,d);a.flattenNodes=g}if(o.selectable&&(l("selectedKeys")?a.selectedKeys=$ie(o.selectedKeys,o):!s&&o.defaultSelectedKeys&&(a.selectedKeys=$ie(o.defaultSelectedKeys,o))),o.checkable){var p;if(l("checkedKeys")?p=L6(o.checkedKeys)||{}:!s&&o.defaultCheckedKeys?p=L6(o.defaultCheckedKeys)||{}:c&&(p=L6(o.checkedKeys)||{checkedKeys:r.checkedKeys,halfCheckedKeys:r.halfCheckedKeys}),p){var v=p,m=v.checkedKeys,_=m===void 0?[]:m,y=v.halfCheckedKeys,w=y===void 0?[]:y;if(!o.checkStrictly){var L=b6(_,!0,h);_=L.checkedKeys,w=L.halfCheckedKeys}a.checkedKeys=_,a.halfCheckedKeys=w}}return l("loadedKeys")&&(a.loadedKeys=o.loadedKeys),a}}]),t}(x.exports.Component);kq.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:Nqe,allowDrop:function(){return!0},expandAction:!1};kq.TreeNode=uw;var Vqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},Hqe=Vqe,$qe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Hqe}))},Yve=x.exports.forwardRef($qe),zqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},Uqe=zqe,jqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Uqe}))},Kqe=x.exports.forwardRef(jqe),qqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},Gqe=qqe,Xqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Gqe}))},Yqe=x.exports.forwardRef(Xqe),Zqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},Qqe=Zqe,Jqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Qqe}))},eGe=x.exports.forwardRef(Jqe);const tGe=new ji("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nGe=(i,e)=>({[`.${i}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),iGe=(i,e)=>({[`.${i}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${rt(e.lineWidthBold)} solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),oGe=(i,e)=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:o,titleHeight:r,nodeSelectedBg:s,nodeHoverBg:a}=e,l=e.paddingXS;return{[t]:Object.assign(Object.assign({},Pa(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${t}-rtl`]:{[`${t}-switcher`]:{"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${t}-active-focused)`]:Object.assign({},FK(e)),[`${t}-list-holder-inner`]:{alignItems:"flex-start"},[`&${t}-block-node`]:{[`${t}-list-holder-inner`]:{alignItems:"stretch",[`${t}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:tGe,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${n}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${rt(o)} 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${t}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${t}-node-content-wrapper`]:{background:e.controlItemBgHover},[`&:not(${n}-disabled).filter-node ${t}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",[`${t}-draggable-icon`]:{flexShrink:0,width:r,lineHeight:`${rt(r)}`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${n}:hover &`]:{opacity:.45}},[`&${n}-disabled`]:{[`${t}-draggable-icon`]:{visibility:"hidden"}}}},[`${t}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:r}},[`${t}-draggable-icon`]:{visibility:"hidden"},[`${t}-switcher`]:Object.assign(Object.assign({},nGe(i,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:r,margin:0,lineHeight:`${rt(r)}`,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${e.motionDurationSlow}`,borderRadius:e.borderRadius,"&-noop":{cursor:"unset"},[`&:not(${t}-switcher-noop):hover`]:{backgroundColor:e.colorBgTextHover},"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(r).div(2).equal(),bottom:e.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:e.calc(e.calc(r).div(2).equal()).mul(.8).equal(),height:e.calc(r).div(2).equal(),borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${t}-checkbox`]:{top:"initial",marginInlineEnd:l,alignSelf:"flex-start",marginTop:e.marginXXS},[`${t}-node-content-wrapper, ${t}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:r,margin:0,padding:`0 ${rt(e.calc(e.paddingXS).div(2).equal())}`,color:"inherit",lineHeight:`${rt(r)}`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:a},[`&${t}-node-selected`]:{backgroundColor:s},[`${t}-iconEle`]:{display:"inline-block",width:r,height:r,lineHeight:`${rt(r)}`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${t}-unselectable ${t}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${t}-node-content-wrapper`]:Object.assign({lineHeight:`${rt(r)}`,userSelect:"none"},iGe(i,e)),[`${n}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${t}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(r).div(2).equal(),bottom:e.calc(o).mul(-1).equal(),borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${t}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last`]:{[`${t}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${rt(e.calc(r).div(2).equal())} !important`}}}}})}},rGe=i=>{const{treeCls:e,treeNodeCls:t,treeNodePadding:n,directoryNodeSelectedBg:o,directoryNodeSelectedColor:r}=i;return{[`${e}${e}-directory`]:{[t]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:n,insetInlineStart:0,transition:`background-color ${i.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:i.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${i.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:r,background:"transparent"}},"&-selected":{[` + .${n}-col-xl-24${t}-label`]:dC(i),[`@media (max-width: ${rt(i.screenXSMax)})`]:[kKe(i),{[e]:{[`.${n}-col-xs-24${t}-label`]:dC(i)}}],[`@media (max-width: ${rt(i.screenSMMax)})`]:{[e]:{[`.${n}-col-sm-24${t}-label`]:dC(i)}},[`@media (max-width: ${rt(i.screenMDMax)})`]:{[e]:{[`.${n}-col-md-24${t}-label`]:dC(i)}},[`@media (max-width: ${rt(i.screenLGMax)})`]:{[e]:{[`.${n}-col-lg-24${t}-label`]:dC(i)}}}},TKe=i=>({labelRequiredMarkColor:i.colorError,labelColor:i.colorTextHeading,labelFontSize:i.fontSize,labelHeight:i.controlHeight,labelColonMarginInlineStart:i.marginXXS/2,labelColonMarginInlineEnd:i.marginXS,itemMarginBottom:i.marginLG,verticalLabelPadding:`0 0 ${i.paddingXS}px`,verticalLabelMargin:0}),Fve=(i,e)=>lr(i,{formItemCls:`${i.componentCls}-item`,rootPrefixCls:e});var Lq=jc("Form",(i,e)=>{let{rootPrefixCls:t}=e;const n=Fve(i,t);return[xKe(n),LKe(n),wKe(n),EKe(n),DKe(n),IKe(n),_me(n),sq]},TKe,{order:-1e3});const Oie=[];function L6(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof i=="string"?i:`${e}-${n}`,error:i,errorStatus:t}}const NKe=i=>{let{help:e,helpStatus:t,errors:n=Oie,warnings:o=Oie,className:r,fieldId:s,onVisibleChanged:a}=i;const{prefixCls:l}=x.exports.useContext(rq),c=`${l}-item-explain`,d=nh(l),[u,h,f]=Lq(l,d),g=x.exports.useMemo(()=>bW(l),[l]),p=MA(n),v=MA(o),m=x.exports.useMemo(()=>e!=null?[L6(e,"help",t)]:[].concat(_t(p.map((y,w)=>L6(y,"error","error",w))),_t(v.map((y,w)=>L6(y,"warning","warning",w)))),[e,t,p,v]),_={};return s&&(_.id=`${s}_help`),u(x.exports.createElement(th,{motionDeadline:g.motionDeadline,motionName:`${l}-show-help`,visible:!!m.length,onVisibleChanged:a},y=>{const{className:w,style:L}=y;return x.exports.createElement("div",Object.assign({},_,{className:Ue(c,w,f,d,r,h),style:L,role:"alert"}),x.exports.createElement(ype,Object.assign({keys:m},bW(l),{motionName:`${l}-show-help-item`,component:!1}),D=>{const{key:E,error:I,errorStatus:k,className:R,style:A}=D;return x.exports.createElement("div",{key:E,className:Ue(R,{[`${c}-${k}`]:k}),style:A},I)}))}))};var Bve=NKe;const RKe=["parentNode"],MKe="form_item";function lE(i){return i===void 0||i===!1?[]:Array.isArray(i)?i:[i]}function Wve(i,e){if(!i.length)return;const t=i.join("_");return e?`${e}_${t}`:RKe.includes(t)?`${MKe}_${t}`:t}function Vve(i,e,t,n,o,r){let s=n;return r!==void 0?s=r:t.validating?s="validating":i.length?s="error":e.length?s="warning":(t.touched||o&&t.validated)&&(s="success"),s}function Fie(i){return lE(i).join("_")}function Hve(i){const[e]=oq(),t=x.exports.useRef({}),n=x.exports.useMemo(()=>i!=null?i:Object.assign(Object.assign({},e),{__INTERNAL__:{itemRef:o=>r=>{const s=Fie(o);r?t.current[s]=r:delete t.current[s]}},scrollToField:function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=lE(o),a=Wve(s,n.__INTERNAL__.name),l=a?document.getElementById(a):null;l&&I9e(l,Object.assign({scrollMode:"if-needed",block:"nearest"},r))},getFieldInstance:o=>{const r=Fie(o);return t.current[r]}}),[i,e]);return[n]}var AKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const t=x.exports.useContext(dS),{getPrefixCls:n,direction:o,form:r}=x.exports.useContext(Hi),{prefixCls:s,className:a,rootClassName:l,size:c,disabled:d=t,form:u,colon:h,labelAlign:f,labelWrap:g,labelCol:p,wrapperCol:v,hideRequiredMark:m,layout:_="horizontal",scrollToFirstError:y,requiredMark:w,onFinishFailed:L,name:D,style:E,feedbackIcons:I,variant:k}=i,R=AKe(i,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),A=Bb(c),P=x.exports.useContext(Uge),N=x.exports.useMemo(()=>w!==void 0?w:m?!1:r&&r.requiredMark!==void 0?r.requiredMark:!0,[m,w,r]),M=h!=null?h:r==null?void 0:r.colon,H=n("form",s),B=nh(H),[F,$,z]=Lq(H,B),K=Ue(H,`${H}-${_}`,{[`${H}-hide-required-mark`]:N===!1,[`${H}-rtl`]:o==="rtl",[`${H}-${A}`]:A},z,B,$,r==null?void 0:r.className,a,l),[j]=Hve(u),{__INTERNAL__:G}=j;G.name=D;const X=x.exports.useMemo(()=>({name:D,labelAlign:f,labelCol:p,labelWrap:g,wrapperCol:v,vertical:_==="vertical",colon:M,requiredMark:N,itemRef:G.itemRef,form:j,feedbackIcons:I}),[D,f,p,v,_,M,N,j,I]);x.exports.useImperativeHandle(e,()=>j);const ue=(pe,be)=>{if(pe){let Se={block:"nearest"};typeof pe=="object"&&(Se=pe),j.scrollToField(be,Se)}},fe=pe=>{if(L==null||L(pe),pe.errorFields.length){const be=pe.errorFields[0].name;if(y!==void 0){ue(y,be);return}r&&r.scrollToFirstError!==void 0&&ue(r.scrollToFirstError,be)}};return F(x.exports.createElement(dme.Provider,{value:k},x.exports.createElement(OK,{disabled:d},x.exports.createElement(DI.Provider,{value:A},x.exports.createElement(cme,{validateMessages:P},x.exports.createElement(sp.Provider,{value:X},x.exports.createElement(fS,Object.assign({id:D},R,{name:D,onFinishFailed:fe,form:j,style:Object.assign(Object.assign({},r==null?void 0:r.style),E),className:K}))))))))},OKe=x.exports.forwardRef(PKe);var FKe=OKe;function BKe(i){if(typeof i=="function")return i;const e=op(i);return e.length<=1?e[0]:e}const $ve=()=>{const{status:i,errors:e=[],warnings:t=[]}=x.exports.useContext(Uu);return{status:i,errors:e,warnings:t}};$ve.Context=Uu;var WKe=$ve;function VKe(i){const[e,t]=x.exports.useState(i),n=x.exports.useRef(null),o=x.exports.useRef([]),r=x.exports.useRef(!1);x.exports.useEffect(()=>(r.current=!1,()=>{r.current=!0,Xi.cancel(n.current),n.current=null}),[]);function s(a){r.current||(n.current===null&&(o.current=[],n.current=Xi(()=>{n.current=null,t(l=>{let c=l;return o.current.forEach(d=>{c=d(c)}),c})})),o.current.push(a))}return[e,s]}function HKe(){const{itemRef:i}=x.exports.useContext(sp),e=x.exports.useRef({});function t(n,o){const r=o&&typeof o=="object"&&o.ref,s=n.join("_");return(e.current.name!==s||e.current.originRef!==r)&&(e.current.name=s,e.current.originRef=r,e.current.ref=eh(i(n),r)),e.current.ref}return t}const $Ke=i=>{const{formItemCls:e}=i;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${e}-control`]:{display:"flex"}}}};var zKe=VK(["Form","item-item"],(i,e)=>{let{rootPrefixCls:t}=e;const n=Fve(i,t);return[$Ke(n)]});const UKe=i=>{const{prefixCls:e,status:t,wrapperCol:n,children:o,errors:r,warnings:s,_internalItemRender:a,extra:l,help:c,fieldId:d,marginBottom:u,onErrorVisibleChanged:h}=i,f=`${e}-item`,g=x.exports.useContext(sp),p=n||g.wrapperCol||{},v=Ue(`${f}-control`,p.className),m=x.exports.useMemo(()=>Object.assign({},g),[g]);delete m.labelCol,delete m.wrapperCol;const _=x.exports.createElement("div",{className:`${f}-control-input`},x.exports.createElement("div",{className:`${f}-control-input-content`},o)),y=x.exports.useMemo(()=>({prefixCls:e,status:t}),[e,t]),w=u!==null||r.length||s.length?x.exports.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},x.exports.createElement(rq.Provider,{value:y},x.exports.createElement(Bve,{fieldId:d,errors:r,warnings:s,help:c,helpStatus:t,className:`${f}-explain-connected`,onVisibleChanged:h})),!!u&&x.exports.createElement("div",{style:{width:0,height:u}})):null,L={};d&&(L.id=`${d}_extra`);const D=l?x.exports.createElement("div",Object.assign({},L,{className:`${f}-extra`}),l):null,E=a&&a.mark==="pro_table_render"&&a.render?a.render(i,{input:_,errorList:w,extra:D}):x.exports.createElement(x.exports.Fragment,null,_,w,D);return x.exports.createElement(sp.Provider,{value:m},x.exports.createElement(Mve,Object.assign({},p,{className:v}),E),x.exports.createElement(zKe,{prefixCls:e}))};var jKe=UKe,KKe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},qKe=KKe,GKe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:qKe}))},XKe=x.exports.forwardRef(GKe),YKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{prefixCls:e,label:t,htmlFor:n,labelCol:o,labelAlign:r,colon:s,required:a,requiredMark:l,tooltip:c}=i;var d;const[u]=EI("Form"),{vertical:h,labelAlign:f,labelCol:g,labelWrap:p,colon:v}=x.exports.useContext(sp);if(!t)return null;const m=o||g||{},_=r||f,y=`${e}-item-label`,w=Ue(y,_==="left"&&`${y}-left`,m.className,{[`${y}-wrap`]:!!p});let L=t;const D=s===!0||v!==!1&&s!==!1;D&&!h&&typeof t=="string"&&t.trim()!==""&&(L=t.replace(/[:|:]\s*$/,""));const I=ZKe(c);if(I){const{icon:P=x.exports.createElement(XKe,null)}=I,N=YKe(I,["icon"]),M=x.exports.createElement(cze,Object.assign({},N),x.exports.cloneElement(P,{className:`${e}-item-tooltip`,title:"",onClick:H=>{H.preventDefault()},tabIndex:null}));L=x.exports.createElement(x.exports.Fragment,null,L,M)}const k=l==="optional",R=typeof l=="function";R?L=l(L,{required:!!a}):k&&!a&&(L=x.exports.createElement(x.exports.Fragment,null,L,x.exports.createElement("span",{className:`${e}-item-optional`,title:""},(u==null?void 0:u.optional)||((d=vv.Form)===null||d===void 0?void 0:d.optional))));const A=Ue({[`${e}-item-required`]:a,[`${e}-item-required-mark-optional`]:k||R,[`${e}-item-no-colon`]:!D});return x.exports.createElement(Mve,Object.assign({},m,{className:w}),x.exports.createElement("label",{htmlFor:n,className:A,title:typeof t=="string"?t:""},L))};var JKe=QKe;const eqe={success:UK,warning:jK,error:uS,validating:kI};function zve(i){let{children:e,errors:t,warnings:n,hasFeedback:o,validateStatus:r,prefixCls:s,meta:a,noStyle:l}=i;const c=`${s}-item`,{feedbackIcons:d}=x.exports.useContext(sp),u=Vve(t,n,a,null,!!o,r),{isFormItemInput:h,status:f,hasFeedback:g,feedbackIcon:p}=x.exports.useContext(Uu),v=x.exports.useMemo(()=>{var m;let _;if(o){const w=o!==!0&&o.icons||d,L=u&&((m=w==null?void 0:w({status:u,errors:t,warnings:n}))===null||m===void 0?void 0:m[u]),D=u&&eqe[u];_=L!==!1&&D?x.exports.createElement("span",{className:Ue(`${c}-feedback-icon`,`${c}-feedback-icon-${u}`)},L||x.exports.createElement(D,null)):null}const y={status:u||"",errors:t,warnings:n,hasFeedback:!!o,feedbackIcon:_,isFormItemInput:!0};return l&&(y.status=(u!=null?u:f)||"",y.isFormItemInput=h,y.hasFeedback=!!(o!=null?o:g),y.feedbackIcon=o!==void 0?y.feedbackIcon:p),y},[u,o,l,h,f]);return x.exports.createElement(Uu.Provider,{value:v},e)}var tqe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{if(I&&w.current){const B=getComputedStyle(w.current);A(parseInt(B.marginBottom,10))}},[I,k]);const P=B=>{B||A(null)},M=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const F=B?L:c.errors,$=B?D:c.warnings;return Vve(F,$,c,"",!!d,l)}(),H=Ue(_,t,n,{[`${_}-with-help`]:E||L.length||D.length,[`${_}-has-feedback`]:M&&d,[`${_}-has-success`]:M==="success",[`${_}-has-warning`]:M==="warning",[`${_}-has-error`]:M==="error",[`${_}-is-validating`]:M==="validating",[`${_}-hidden`]:u});return x.exports.createElement("div",{className:H,style:o,ref:w},x.exports.createElement(Mje,Object.assign({className:`${_}-row`},kf(m,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),x.exports.createElement(JKe,Object.assign({htmlFor:f},i,{requiredMark:y,required:g!=null?g:p,prefixCls:e})),x.exports.createElement(jKe,Object.assign({},i,c,{errors:L,warnings:D,prefixCls:e,status:M,help:r,marginBottom:R,onErrorVisibleChanged:P}),x.exports.createElement(lme.Provider,{value:v},x.exports.createElement(zve,{prefixCls:e,meta:c,errors:c.errors,warnings:c.warnings,hasFeedback:d,validateStatus:M},h)))),!!R&&x.exports.createElement("div",{className:`${_}-margin-offset`,style:{marginBottom:-R}}))}const iqe="__SPLIT__";function oqe(i,e){const t=Object.keys(i),n=Object.keys(e);return t.length===n.length&&t.every(o=>{const r=i[o],s=e[o];return r===s||typeof r=="function"||typeof s=="function"})}const rqe=x.exports.memo(i=>{let{children:e}=i;return e},(i,e)=>oqe(i.control,e.control)&&i.update===e.update&&i.childProps.length===e.childProps.length&&i.childProps.every((t,n)=>t===e.childProps[n]));function Bie(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function sqe(i){const{name:e,noStyle:t,className:n,dependencies:o,prefixCls:r,shouldUpdate:s,rules:a,children:l,required:c,label:d,messageVariables:u,trigger:h="onChange",validateTrigger:f,hidden:g,help:p}=i,{getPrefixCls:v}=x.exports.useContext(Hi),{name:m}=x.exports.useContext(sp),_=BKe(l),y=typeof _=="function",w=x.exports.useContext(lme),{validateTrigger:L}=x.exports.useContext(G0),D=f!==void 0?f:L,E=e!=null,I=v("form",r),k=nh(I),[R,A,P]=Lq(I,k);L4();const N=x.exports.useContext(vD),M=x.exports.useRef(),[H,B]=VKe({}),[F,$]=jm(()=>Bie()),z=pe=>{const be=N==null?void 0:N.getKey(pe.name);if($(pe.destroy?Bie():pe,!0),t&&p!==!1&&w){let Se=pe.name;if(pe.destroy)Se=M.current||Se;else if(be!==void 0){const[Fe,De]=be;Se=[Fe].concat(_t(De)),M.current=Se}w(pe,Se)}},K=(pe,be)=>{B(Se=>{const Fe=Object.assign({},Se),ce=[].concat(_t(pe.name.slice(0,-1)),_t(be)).join(iqe);return pe.destroy?delete Fe[ce]:Fe[ce]=pe,Fe})},[j,G]=x.exports.useMemo(()=>{const pe=_t(F.errors),be=_t(F.warnings);return Object.values(H).forEach(Se=>{pe.push.apply(pe,_t(Se.errors||[])),be.push.apply(be,_t(Se.warnings||[]))}),[pe,be]},[H,F.errors,F.warnings]),X=HKe();function ue(pe,be,Se){return t&&!g?x.exports.createElement(zve,{prefixCls:I,hasFeedback:i.hasFeedback,validateStatus:i.validateStatus,meta:F,errors:j,warnings:G,noStyle:!0},pe):x.exports.createElement(nqe,Object.assign({key:"row"},i,{className:Ue(n,P,k,A),prefixCls:I,fieldId:be,isRequired:Se,errors:j,warnings:G,meta:F,onSubItemMetaChange:K}),pe)}if(!E&&!y&&!o)return R(ue(_));let fe={};return typeof d=="string"?fe.label=d:e&&(fe.label=String(e)),u&&(fe=Object.assign(Object.assign({},fe),u)),R(x.exports.createElement(iq,Object.assign({},i,{messageVariables:fe,trigger:h,validateTrigger:D,onMetaChange:z}),(pe,be,Se)=>{const Fe=lE(e).length&&be?be.name:[],De=Wve(Fe,m),ce=c!==void 0?c:!!(a&&a.some(xe=>{if(xe&&typeof xe=="object"&&xe.required&&!xe.warningOnly)return!0;if(typeof xe=="function"){const Ee=xe(Se);return Ee&&Ee.required&&!Ee.warningOnly}return!1})),Pe=Object.assign({},pe);let Oe=null;if(Array.isArray(_)&&E)Oe=_;else if(!(y&&(!(s||o)||E))){if(!(o&&!y&&!E))if(lw(_)){const xe=Object.assign(Object.assign({},_.props),Pe);if(xe.id||(xe.id=De),p||j.length>0||G.length>0||i.extra){const nt=[];(p||j.length>0)&&nt.push(`${De}_help`),i.extra&&nt.push(`${De}_extra`),xe["aria-describedby"]=nt.join(" ")}j.length>0&&(xe["aria-invalid"]="true"),ce&&(xe["aria-required"]="true"),Gv(_)&&(xe.ref=X(Fe,_)),new Set([].concat(_t(lE(h)),_t(lE(D)))).forEach(nt=>{xe[nt]=function(){for(var Qe,Ge,re,ie,se,U=arguments.length,Y=new Array(U),oe=0;oe{var{prefixCls:e,children:t}=i,n=lqe(i,["prefixCls","children"]);const{getPrefixCls:o}=x.exports.useContext(Hi),r=o("form",e),s=x.exports.useMemo(()=>({prefixCls:r,status:"error"}),[r]);return x.exports.createElement(ome,Object.assign({},n),(a,l,c)=>x.exports.createElement(rq.Provider,{value:s},t(a.map(d=>Object.assign(Object.assign({},d),{fieldKey:d.key})),l,{errors:c.errors,warnings:c.warnings})))};var dqe=cqe;function uqe(){const{form:i}=x.exports.useContext(sp);return i}const mp=FKe;mp.Item=aqe;mp.List=dqe;mp.ErrorList=Bve;mp.useForm=Hve;mp.useFormInstance=uqe;mp.useWatch=ame;mp.Provider=cme;mp.create=()=>{};var wD=mp;let pd=null,l0=i=>i(),SD=[],xD={};function Wie(){const{getContainer:i,duration:e,rtl:t,maxCount:n,top:o}=xD,r=(i==null?void 0:i())||document.body;return{getContainer:()=>r,duration:e,rtl:t,maxCount:n,top:o}}const hqe=Bt.forwardRef((i,e)=>{const{messageConfig:t,sync:n}=i,{getPrefixCls:o}=x.exports.useContext(Hi),r=xD.prefixCls||o("message"),s=x.exports.useContext(vVe),[a,l]=Ope(Object.assign(Object.assign(Object.assign({},t),{prefixCls:r}),s.message));return Bt.useImperativeHandle(e,()=>{const c=Object.assign({},a);return Object.keys(c).forEach(d=>{c[d]=function(){return n(),a[d].apply(a,arguments)}}),{instance:c,sync:n}}),l}),fqe=Bt.forwardRef((i,e)=>{const[t,n]=Bt.useState(Wie),o=()=>{n(Wie)};Bt.useEffect(o,[]);const r=$K(),s=r.getRootPrefixCls(),a=r.getIconPrefixCls(),l=r.getTheme(),c=he(hqe,{ref:e,sync:o,messageConfig:t});return he(pp,{prefixCls:s,iconPrefixCls:a,theme:l,children:r.holderRender?r.holderRender(c):c})});function B4(){if(!pd){const i=document.createDocumentFragment(),e={fragment:i};pd=e,l0(()=>{YK(he(fqe,{ref:t=>{const{instance:n,sync:o}=t||{};Promise.resolve().then(()=>{!e.instance&&n&&(e.instance=n,e.sync=o,B4())})}}),i)});return}!pd.instance||(SD.forEach(i=>{const{type:e,skipped:t}=i;if(!t)switch(e){case"open":{l0(()=>{const n=pd.instance.open(Object.assign(Object.assign({},xD),i.config));n==null||n.then(i.resolve),i.setCloseFn(n)});break}case"destroy":l0(()=>{pd==null||pd.instance.destroy(i.key)});break;default:l0(()=>{var n;const o=(n=pd.instance)[e].apply(n,_t(i.args));o==null||o.then(i.resolve),i.setCloseFn(o)})}}),SD=[])}function gqe(i){xD=Object.assign(Object.assign({},xD),i),l0(()=>{var e;(e=pd==null?void 0:pd.sync)===null||e===void 0||e.call(pd)})}function pqe(i){const e=XK(t=>{let n;const o={type:"open",config:i,resolve:t,setCloseFn:r=>{n=r}};return SD.push(o),()=>{n?l0(()=>{n()}):o.skipped=!0}});return B4(),e}function mqe(i,e){$K();const t=XK(n=>{let o;const r={type:i,args:e,resolve:n,setCloseFn:s=>{o=s}};return SD.push(r),()=>{o?l0(()=>{o()}):r.skipped=!0}});return B4(),t}function vqe(i){SD.push({type:"destroy",key:i}),B4()}const _qe=["success","info","warning","error","loading"],bqe={open:pqe,destroy:vqe,config:gqe,useMessage:s7e,_InternalPanelDoNotUseOrYouWillBeFired:Q9e},jve=bqe;_qe.forEach(i=>{jve[i]=function(){for(var e=arguments.length,t=new Array(e),n=0;n{const{prefixCls:e,className:t,closeIcon:n,closable:o,type:r,title:s,children:a,footer:l}=i,c=Cqe(i,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:d}=x.exports.useContext(Hi),u=d(),h=e||d("modal"),f=nh(u),[g,p,v]=yme(h,f),m=`${h}-confirm`;let _={};return r?_={closable:o!=null?o:!1,title:"",footer:"",children:x.exports.createElement(Sme,Object.assign({},i,{prefixCls:h,confirmPrefixCls:m,rootPrefixCls:u,content:a}))}:_={closable:o!=null?o:!0,title:s,footer:l!==null&&x.exports.createElement(hme,Object.assign({},i)),children:a},g(x.exports.createElement(Qpe,Object.assign({prefixCls:h,className:Ue(p,`${h}-pure-panel`,r&&m,r&&`${m}-${r}`,t,v,f)},c,{closeIcon:ume(h,n),closable:o},_)))};var wqe=Rme(yqe);function Kve(i){return RI(Dme(i))}const ih=wme;ih.useModal=mVe;ih.info=function(e){return RI(kme(e))};ih.success=function(e){return RI(Ime(e))};ih.error=function(e){return RI(Tme(e))};ih.warning=Kve;ih.warn=Kve;ih.confirm=function(e){return RI(Nme(e))};ih.destroyAll=function(){for(;a0.length;){const e=a0.pop();e&&e()}};ih.config=uVe;ih._InternalPanelDoNotUseOrYouWillBeFired=wqe;var Eq=ih,Dq=x.exports.createContext(null),Sqe=function(e){for(var t=e.prefixCls,n=e.level,o=e.isStart,r=e.isEnd,s="".concat(t,"-indent-unit"),a=[],l=0;l=0&&t.splice(n,1),t}function Bp(i,e){var t=(i||[]).slice();return t.indexOf(e)===-1&&t.push(e),t}function kq(i){return i.split("-")}function kqe(i,e){var t=[],n=Sc(e,i);function o(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];r.forEach(function(s){var a=s.key,l=s.children;t.push(a),o(l)})}return o(n.children),t}function Iqe(i){if(i.parent){var e=kq(i.pos);return Number(e[e.length-1])===i.parent.children.length-1}return!1}function Tqe(i){var e=kq(i.pos);return Number(e[e.length-1])===0}function $ie(i,e,t,n,o,r,s,a,l,c){var d,u=i.clientX,h=i.clientY,f=i.target.getBoundingClientRect(),g=f.top,p=f.height,v=(c==="rtl"?-1:1)*(((o==null?void 0:o.x)||0)-u),m=(v-12)/n,_=Sc(a,t.props.eventKey);if(h-1.5?r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1:r({dragNode:P,dropNode:N,dropPosition:0})?k=0:r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1:r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1,{dropPosition:k,dropLevelOffset:R,dropTargetKey:_.key,dropTargetPos:_.pos,dragOverNodeKey:I,dropContainerKey:k===0?null:((d=_.parent)===null||d===void 0?void 0:d.key)||null,dropAllowed:M}}function zie(i,e){if(!!i){var t=e.multiple;return t?i.slice():i.length?[i[0]]:i}}function E6(i){if(!i)return null;var e;if(Array.isArray(i))e={checkedKeys:i,halfCheckedKeys:void 0};else if(qn(i)==="object")e={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return rr(!1,"`checkedKeys` is not an array or an object"),null;return e}function UW(i,e){var t=new Set;function n(o){if(!t.has(o)){var r=Sc(e,o);if(!!r){t.add(o);var s=r.parent,a=r.node;a.disabled||s&&n(s.key)}}}return(i||[]).forEach(function(o){n(o)}),_t(t)}function Nqe(i){var e=i.dropPosition,t=i.dropLevelOffset,n=i.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:o.top=0,o.left=-t*n;break;case 1:o.bottom=0,o.left=-t*n;break;case 0:o.bottom=0,o.left=n;break}return x.exports.createElement("div",{style:o})}function qve(i){if(i==null)throw new TypeError("Cannot destructure "+i)}function Rqe(i,e){var t=x.exports.useState(!1),n=Ne(t,2),o=n[0],r=n[1];go(function(){if(o)return i(),function(){e()}},[o]),go(function(){return r(!0),function(){r(!1)}},[])}var Mqe=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],Gve=function(e,t){var n=e.className,o=e.style,r=e.motion,s=e.motionNodes,a=e.motionType,l=e.onMotionStart,c=e.onMotionEnd,d=e.active,u=e.treeNodeRequiredProps,h=Hn(e,Mqe),f=x.exports.useState(!0),g=Ne(f,2),p=g[0],v=g[1],m=x.exports.useContext(Dq),_=m.prefixCls,y=s&&a!=="hide";go(function(){s&&y!==p&&v(y)},[s]);var w=function(){s&&l()},L=x.exports.useRef(!1),D=function(){s&&!L.current&&(L.current=!0,c())};Rqe(w,D);var E=function(k){y===k&&D()};return s?x.exports.createElement(th,yt({ref:t,visible:p},r,{motionAppear:a==="show",onVisibleChanged:E}),function(I,k){var R=I.className,A=I.style;return x.exports.createElement("div",{ref:k,className:Ue("".concat(_,"-treenode-motion"),R),style:A},s.map(function(P){var N=yt({},(qve(P.data),P.data)),M=P.title,H=P.key,B=P.isStart,F=P.isEnd;delete N.children;var $=aE(H,u);return x.exports.createElement(uw,yt({},N,$,{title:M,active:d,data:P.data,key:H,isStart:B,isEnd:F}))}))}):x.exports.createElement(uw,yt({domRef:t,className:n,style:o},h,{active:d}))};Gve.displayName="MotionTreeNode";var Aqe=x.exports.forwardRef(Gve);function Pqe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=i.length,n=e.length;if(Math.abs(t-n)!==1)return{add:!1,key:null};function o(r,s){var a=new Map;r.forEach(function(c){a.set(c,!0)});var l=s.filter(function(c){return!a.has(c)});return l.length===1?l[0]:null}return t ").concat(e);return e}var Yve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.data;i.selectable,i.checkable;var o=i.expandedKeys,r=i.selectedKeys,s=i.checkedKeys,a=i.loadedKeys,l=i.loadingKeys,c=i.halfCheckedKeys,d=i.keyEntities,u=i.disabled,h=i.dragging,f=i.dragOverNodeKey,g=i.dropPosition,p=i.motion,v=i.height,m=i.itemHeight,_=i.virtual,y=i.focusable,w=i.activeItem,L=i.focused,D=i.tabIndex,E=i.onKeyDown,I=i.onFocus,k=i.onBlur,R=i.onActiveChange,A=i.onListChangeStart,P=i.onListChangeEnd,N=Hn(i,Oqe),M=x.exports.useRef(null),H=x.exports.useRef(null);x.exports.useImperativeHandle(e,function(){return{scrollTo:function(ie){M.current.scrollTo(ie)},getIndentWidth:function(){return H.current.offsetWidth}}});var B=x.exports.useState(o),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState(n),j=Ne(K,2),G=j[0],X=j[1],ue=x.exports.useState(n),fe=Ne(ue,2),pe=fe[0],be=fe[1],Se=x.exports.useState([]),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1],Pe=x.exports.useState(null),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=x.exports.useRef(n);tt.current=n;function nt(){var re=tt.current;X(re),be(re),ce([]),Ee(null),P()}go(function(){z(o);var re=Pqe($,o);if(re.key!==null)if(re.add){var ie=G.findIndex(function(ye){var Le=ye.key;return Le===re.key}),se=qie(Uie(G,n,re.key),_,v,m),U=G.slice();U.splice(ie+1,0,Kie),be(U),ce(se),Ee("show")}else{var Y=n.findIndex(function(ye){var Le=ye.key;return Le===re.key}),oe=qie(Uie(n,G,re.key),_,v,m),te=n.slice();te.splice(Y+1,0,Kie),be(te),ce(oe),Ee("hide")}else G!==n&&(X(n),be(n))},[o,n]),x.exports.useEffect(function(){h||nt()},[h]);var Qe=p?pe:n,Ge={expandedKeys:o,selectedKeys:r,loadedKeys:a,loadingKeys:l,checkedKeys:s,halfCheckedKeys:c,dragOverNodeKey:f,dropPosition:g,keyEntities:d};return x.exports.createElement(x.exports.Fragment,null,L&&w&&x.exports.createElement("span",{style:jie,"aria-live":"assertive"},Bqe(w)),x.exports.createElement("div",null,x.exports.createElement("input",{style:jie,disabled:y===!1||u,tabIndex:y!==!1?D:null,onKeyDown:E,onFocus:I,onBlur:k,value:"",onChange:Fqe,"aria-label":"for screen reader"})),x.exports.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},x.exports.createElement("div",{className:"".concat(t,"-indent")},x.exports.createElement("div",{ref:H,className:"".concat(t,"-indent-unit")}))),x.exports.createElement(uq,yt({},N,{data:Qe,itemKey:Gie,height:v,fullHeight:!1,virtual:_,itemHeight:m,prefixCls:"".concat(t,"-list"),ref:M,onVisibleChange:function(ie,se){var U=new Set(ie),Y=se.filter(function(oe){return!U.has(oe)});Y.some(function(oe){return Gie(oe)===X0})&&nt()}}),function(re){var ie=re.pos,se=yt({},(qve(re.data),re.data)),U=re.title,Y=re.key,oe=re.isStart,te=re.isEnd,ye=OI(Y,ie);delete se.key,delete se.children;var Le=aE(ye,Ge);return x.exports.createElement(Aqe,yt({},se,Le,{title:U,active:!!w&&Y===w.key,pos:ie,data:re.data,isStart:oe,isEnd:te,motion:p,motionNodes:Y===X0?De:null,motionType:xe,onMotionStart:A,onMotionEnd:nt,treeNodeRequiredProps:Ge,onMouseMove:function(){R(null)}}))}))});Yve.displayName="NodeList";var Wqe=10,Iq=function(i){gp(t,i);var e=Ob(t);function t(){var n;ga(this,t);for(var o=arguments.length,r=new Array(o),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,u=n.state,h=u.dragChildrenKeys,f=u.dropPosition,g=u.dropTargetKey,p=u.dropTargetPos,v=u.dropAllowed;if(!!v){var m=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),g!==null){var _=Ce(Ce({},aE(g,n.getTreeNodeRequiredProps())),{},{active:((c=n.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:Sc(n.state.keyEntities,g).node}),y=h.indexOf(g)!==-1;rr(!y,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var w=kq(p),L={event:a,node:Zr(_),dragNode:n.dragNode?Zr(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(h),dropToGap:f!==0,dropPosition:f+Number(w[w.length-1])};d||m==null||m(L),n.dragNode=null}}},n.cleanDragState=function(){var a=n.state.draggingNodeKey;a!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(a,l){var c=n.state,d=c.expandedKeys,u=c.flattenNodes,h=l.expanded,f=l.key,g=l.isLeaf;if(!(g||a.shiftKey||a.metaKey||a.ctrlKey)){var p=u.filter(function(m){return m.key===f})[0],v=Zr(Ce(Ce({},aE(f,n.getTreeNodeRequiredProps())),{},{data:p.data}));n.setExpandedKeys(h?Gf(d,f):Bp(d,f)),n.onNodeExpand(a,v)}},n.onNodeClick=function(a,l){var c=n.props,d=c.onClick,u=c.expandAction;u==="click"&&n.triggerExpandActionExpand(a,l),d==null||d(a,l)},n.onNodeDoubleClick=function(a,l){var c=n.props,d=c.onDoubleClick,u=c.expandAction;u==="doubleClick"&&n.triggerExpandActionExpand(a,l),d==null||d(a,l)},n.onNodeSelect=function(a,l){var c=n.state.selectedKeys,d=n.state,u=d.keyEntities,h=d.fieldNames,f=n.props,g=f.onSelect,p=f.multiple,v=l.selected,m=l[h.key],_=!v;_?p?c=Bp(c,m):c=[m]:c=Gf(c,m);var y=c.map(function(w){var L=Sc(u,w);return L?L.node:null}).filter(function(w){return w});n.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:_,node:l,selectedNodes:y,nativeEvent:a.nativeEvent})},n.onNodeCheck=function(a,l,c){var d=n.state,u=d.keyEntities,h=d.checkedKeys,f=d.halfCheckedKeys,g=n.props,p=g.checkStrictly,v=g.onCheck,m=l.key,_,y={event:"check",node:l,checked:c,nativeEvent:a.nativeEvent};if(p){var w=c?Bp(h,m):Gf(h,m),L=Gf(f,m);_={checked:w,halfChecked:L},y.checkedNodes=w.map(function(A){return Sc(u,A)}).filter(function(A){return A}).map(function(A){return A.node}),n.setUncontrolledState({checkedKeys:w})}else{var D=C6([].concat(_t(h),[m]),!0,u),E=D.checkedKeys,I=D.halfCheckedKeys;if(!c){var k=new Set(E);k.delete(m);var R=C6(Array.from(k),{checked:!1,halfCheckedKeys:I},u);E=R.checkedKeys,I=R.halfCheckedKeys}_=E,y.checkedNodes=[],y.checkedNodesPositions=[],y.halfCheckedKeys=I,E.forEach(function(A){var P=Sc(u,A);if(!!P){var N=P.node,M=P.pos;y.checkedNodes.push(N),y.checkedNodesPositions.push({node:N,pos:M})}}),n.setUncontrolledState({checkedKeys:E},!1,{halfCheckedKeys:I})}v==null||v(_,y)},n.onNodeLoad=function(a){var l=a.key,c=new Promise(function(d,u){n.setState(function(h){var f=h.loadedKeys,g=f===void 0?[]:f,p=h.loadingKeys,v=p===void 0?[]:p,m=n.props,_=m.loadData,y=m.onLoad;if(!_||g.indexOf(l)!==-1||v.indexOf(l)!==-1)return null;var w=_(a);return w.then(function(){var L=n.state.loadedKeys,D=Bp(L,l);y==null||y(D,{event:"load",node:a}),n.setUncontrolledState({loadedKeys:D}),n.setState(function(E){return{loadingKeys:Gf(E.loadingKeys,l)}}),d()}).catch(function(L){if(n.setState(function(E){return{loadingKeys:Gf(E.loadingKeys,l)}}),n.loadingRetryTimes[l]=(n.loadingRetryTimes[l]||0)+1,n.loadingRetryTimes[l]>=Wqe){var D=n.state.loadedKeys;rr(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:Bp(D,l)}),d()}u(L)}),{loadingKeys:Bp(v,l)}})});return c.catch(function(){}),c},n.onNodeMouseEnter=function(a,l){var c=n.props.onMouseEnter;c==null||c({event:a,node:l})},n.onNodeMouseLeave=function(a,l){var c=n.props.onMouseLeave;c==null||c({event:a,node:l})},n.onNodeContextMenu=function(a,l){var c=n.props.onRightClick;c&&(a.preventDefault(),c({event:a,node:l}))},n.onFocus=function(){var a=n.props.onFocus;n.setState({focused:!0});for(var l=arguments.length,c=new Array(l),d=0;d1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var d=!1,u=!0,h={};Object.keys(a).forEach(function(f){if(f in n.props){u=!1;return}d=!0,h[f]=a[f]}),d&&(!l||u)&&n.setState(Ce(Ce({},h),c))}},n.scrollTo=function(a){n.listRef.current.scrollTo(a)},n}return pa(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var o=this.props,r=o.activeKey,s=o.itemScrollOffset,a=s===void 0?0:s;r!==void 0&&r!==this.state.activeKey&&(this.setState({activeKey:r}),r!==null&&this.scrollTo({key:r,offset:a}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var o,r=this.state,s=r.focused,a=r.flattenNodes,l=r.keyEntities,c=r.draggingNodeKey,d=r.activeKey,u=r.dropLevelOffset,h=r.dropContainerKey,f=r.dropTargetKey,g=r.dropPosition,p=r.dragOverNodeKey,v=r.indent,m=this.props,_=m.prefixCls,y=m.className,w=m.style,L=m.showLine,D=m.focusable,E=m.tabIndex,I=E===void 0?0:E,k=m.selectable,R=m.showIcon,A=m.icon,P=m.switcherIcon,N=m.draggable,M=m.checkable,H=m.checkStrictly,B=m.disabled,F=m.motion,$=m.loadData,z=m.filterTreeNode,K=m.height,j=m.itemHeight,G=m.virtual,X=m.titleRender,ue=m.dropIndicatorRender,fe=m.onContextMenu,pe=m.onScroll,be=m.direction,Se=m.rootClassName,Fe=m.rootStyle,De=K0(this.props,{aria:!0,data:!0}),ce;return N&&(qn(N)==="object"?ce=N:typeof N=="function"?ce={nodeDraggable:N}:ce={}),x.exports.createElement(Dq.Provider,{value:{prefixCls:_,selectable:k,showIcon:R,icon:A,switcherIcon:P,draggable:ce,draggingNodeKey:c,checkable:M,checkStrictly:H,disabled:B,keyEntities:l,dropLevelOffset:u,dropContainerKey:h,dropTargetKey:f,dropPosition:g,dragOverNodeKey:p,indent:v,direction:be,dropIndicatorRender:ue,loadData:$,filterTreeNode:z,titleRender:X,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},x.exports.createElement("div",{role:"tree",className:Ue(_,y,Se,(o={},me(o,"".concat(_,"-show-line"),L),me(o,"".concat(_,"-focused"),s),me(o,"".concat(_,"-active-focused"),d!==null),o)),style:Fe},x.exports.createElement(Yve,yt({ref:this.listRef,prefixCls:_,style:w,data:a,disabled:B,selectable:k,checkable:!!M,motion:F,dragging:c!==null,height:K,itemHeight:j,virtual:G,focusable:D,focused:s,tabIndex:I,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:fe,onScroll:pe},this.getTreeNodeRequiredProps(),De))))}}],[{key:"getDerivedStateFromProps",value:function(o,r){var s=r.prevProps,a={prevProps:o};function l(D){return!s&&D in o||s&&s[D]!==o[D]}var c,d=r.fieldNames;if(l("fieldNames")&&(d=cw(o.fieldNames),a.fieldNames=d),l("treeData")?c=o.treeData:l("children")&&(rr(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=kve(o.children)),c){a.treeData=c;var u=Ive(c,{fieldNames:d});a.keyEntities=Ce(me({},X0,Xve),u.keyEntities)}var h=a.keyEntities||r.keyEntities;if(l("expandedKeys")||s&&l("autoExpandParent"))a.expandedKeys=o.autoExpandParent||!s&&o.defaultExpandParent?UW(o.expandedKeys,h):o.expandedKeys;else if(!s&&o.defaultExpandAll){var f=Ce({},h);delete f[X0],a.expandedKeys=Object.keys(f).map(function(D){return f[D].key})}else!s&&o.defaultExpandedKeys&&(a.expandedKeys=o.autoExpandParent||o.defaultExpandParent?UW(o.defaultExpandedKeys,h):o.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,c||a.expandedKeys){var g=b6(c||r.treeData,a.expandedKeys||r.expandedKeys,d);a.flattenNodes=g}if(o.selectable&&(l("selectedKeys")?a.selectedKeys=zie(o.selectedKeys,o):!s&&o.defaultSelectedKeys&&(a.selectedKeys=zie(o.defaultSelectedKeys,o))),o.checkable){var p;if(l("checkedKeys")?p=E6(o.checkedKeys)||{}:!s&&o.defaultCheckedKeys?p=E6(o.defaultCheckedKeys)||{}:c&&(p=E6(o.checkedKeys)||{checkedKeys:r.checkedKeys,halfCheckedKeys:r.halfCheckedKeys}),p){var v=p,m=v.checkedKeys,_=m===void 0?[]:m,y=v.halfCheckedKeys,w=y===void 0?[]:y;if(!o.checkStrictly){var L=C6(_,!0,h);_=L.checkedKeys,w=L.halfCheckedKeys}a.checkedKeys=_,a.halfCheckedKeys=w}}return l("loadedKeys")&&(a.loadedKeys=o.loadedKeys),a}}]),t}(x.exports.Component);Iq.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:Nqe,allowDrop:function(){return!0},expandAction:!1};Iq.TreeNode=uw;var Vqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},Hqe=Vqe,$qe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Hqe}))},Zve=x.exports.forwardRef($qe),zqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},Uqe=zqe,jqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Uqe}))},Kqe=x.exports.forwardRef(jqe),qqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},Gqe=qqe,Xqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Gqe}))},Yqe=x.exports.forwardRef(Xqe),Zqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},Qqe=Zqe,Jqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Qqe}))},eGe=x.exports.forwardRef(Jqe);const tGe=new ji("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nGe=(i,e)=>({[`.${i}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),iGe=(i,e)=>({[`.${i}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${rt(e.lineWidthBold)} solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),oGe=(i,e)=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:o,titleHeight:r,nodeSelectedBg:s,nodeHoverBg:a}=e,l=e.paddingXS;return{[t]:Object.assign(Object.assign({},Pa(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${t}-rtl`]:{[`${t}-switcher`]:{"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${t}-active-focused)`]:Object.assign({},BK(e)),[`${t}-list-holder-inner`]:{alignItems:"flex-start"},[`&${t}-block-node`]:{[`${t}-list-holder-inner`]:{alignItems:"stretch",[`${t}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:tGe,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${n}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${rt(o)} 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${t}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${t}-node-content-wrapper`]:{background:e.controlItemBgHover},[`&:not(${n}-disabled).filter-node ${t}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",[`${t}-draggable-icon`]:{flexShrink:0,width:r,lineHeight:`${rt(r)}`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${n}:hover &`]:{opacity:.45}},[`&${n}-disabled`]:{[`${t}-draggable-icon`]:{visibility:"hidden"}}}},[`${t}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:r}},[`${t}-draggable-icon`]:{visibility:"hidden"},[`${t}-switcher`]:Object.assign(Object.assign({},nGe(i,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:r,margin:0,lineHeight:`${rt(r)}`,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${e.motionDurationSlow}`,borderRadius:e.borderRadius,"&-noop":{cursor:"unset"},[`&:not(${t}-switcher-noop):hover`]:{backgroundColor:e.colorBgTextHover},"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(r).div(2).equal(),bottom:e.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:e.calc(e.calc(r).div(2).equal()).mul(.8).equal(),height:e.calc(r).div(2).equal(),borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${t}-checkbox`]:{top:"initial",marginInlineEnd:l,alignSelf:"flex-start",marginTop:e.marginXXS},[`${t}-node-content-wrapper, ${t}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:r,margin:0,padding:`0 ${rt(e.calc(e.paddingXS).div(2).equal())}`,color:"inherit",lineHeight:`${rt(r)}`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:a},[`&${t}-node-selected`]:{backgroundColor:s},[`${t}-iconEle`]:{display:"inline-block",width:r,height:r,lineHeight:`${rt(r)}`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${t}-unselectable ${t}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${t}-node-content-wrapper`]:Object.assign({lineHeight:`${rt(r)}`,userSelect:"none"},iGe(i,e)),[`${n}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${t}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(r).div(2).equal(),bottom:e.calc(o).mul(-1).equal(),borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${t}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last`]:{[`${t}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${rt(e.calc(r).div(2).equal())} !important`}}}}})}},rGe=i=>{const{treeCls:e,treeNodeCls:t,treeNodePadding:n,directoryNodeSelectedBg:o,directoryNodeSelectedColor:r}=i;return{[`${e}${e}-directory`]:{[t]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:n,insetInlineStart:0,transition:`background-color ${i.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:i.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${i.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:r,background:"transparent"}},"&-selected":{[` &:hover::before, &::before - `]:{background:o},[`${e}-switcher`]:{color:r},[`${e}-node-content-wrapper`]:{color:r,background:"transparent"}}}}}},sGe=(i,e)=>{const t=`.${i}`,n=`${t}-treenode`,o=e.calc(e.paddingXS).div(2).equal(),r=lr(e,{treeCls:t,treeNodeCls:n,treeNodePadding:o});return[oGe(i,r),rGe(r)]},aGe=i=>{const{controlHeightSM:e}=i;return{titleHeight:e,nodeHoverBg:i.controlItemBgHover,nodeSelectedBg:i.controlItemBgActive}},lGe=i=>{const{colorTextLightSolid:e,colorPrimary:t}=i;return Object.assign(Object.assign({},aGe(i)),{directoryNodeSelectedColor:e,directoryNodeSelectedBg:t})};var cGe=jc("Tree",(i,e)=>{let{prefixCls:t}=e;return[{[i.componentCls]:Tve(`${t}-checkbox`,i)},sGe(t,i),vme(i)]},lGe);const Gie=4;function dGe(i){const{dropPosition:e,dropLevelOffset:t,prefixCls:n,indent:o,direction:r="ltr"}=i,s=r==="ltr"?"left":"right",a=r==="ltr"?"right":"left",l={[s]:-t*o+Gie,[a]:0};switch(e){case-1:l.top=-3;break;case 1:l.bottom=-3;break;default:l.bottom=-3,l[s]=o+Gie;break}return Bt.createElement("div",{style:l,className:`${n}-drop-indicator`})}var uGe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},hGe=uGe,fGe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:hGe}))},gGe=x.exports.forwardRef(fGe),pGe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},mGe=pGe,vGe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:mGe}))},_Ge=x.exports.forwardRef(vGe),bGe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},CGe=bGe,yGe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:CGe}))},wGe=x.exports.forwardRef(yGe);const SGe=i=>{const{prefixCls:e,switcherIcon:t,treeNodeProps:n,showLine:o}=i,{isLeaf:r,expanded:s,loading:a}=n;if(a)return x.exports.createElement(kI,{className:`${e}-switcher-loading-icon`});let l;if(o&&typeof o=="object"&&(l=o.showLeafIcon),r){if(!o)return null;if(typeof l!="boolean"&&!!l){const u=typeof l=="function"?l(n):l,h=`${e}-switcher-line-custom-icon`;return lw(u)?vv(u,{className:Ue(u.props.className||"",h)}):u}return l?x.exports.createElement(Yve,{className:`${e}-switcher-line-icon`}):x.exports.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,d=typeof t=="function"?t(n):t;return lw(d)?vv(d,{className:Ue(d.props.className||"",c)}):d!==void 0?d:o?s?x.exports.createElement(_Ge,{className:`${e}-switcher-line-icon`}):x.exports.createElement(wGe,{className:`${e}-switcher-line-icon`}):x.exports.createElement(gGe,{className:c})};var xGe=SGe;const LGe=Bt.forwardRef((i,e)=>{var t;const{getPrefixCls:n,direction:o,virtual:r,tree:s}=Bt.useContext(Hi),{prefixCls:a,className:l,showIcon:c=!1,showLine:d,switcherIcon:u,blockNode:h=!1,children:f,checkable:g=!1,selectable:p=!0,draggable:v,motion:m,style:_}=i,y=n("tree",a),w=n(),L=m!=null?m:Object.assign(Object.assign({},_W(w)),{motionAppear:!1}),D=Object.assign(Object.assign({},i),{checkable:g,selectable:p,showIcon:c,motion:L,blockNode:h,showLine:Boolean(d),dropIndicatorRender:dGe}),[E,I,k]=cGe(y),[,R]=Ba(),A=R.paddingXS/2+(((t=R.Tree)===null||t===void 0?void 0:t.titleHeight)||R.controlHeightSM),P=Bt.useMemo(()=>{if(!v)return!1;let M={};switch(typeof v){case"function":M.nodeDraggable=v;break;case"object":M=Object.assign({},v);break}return M.icon!==!1&&(M.icon=M.icon||Bt.createElement(eGe,null)),M},[v]),N=M=>Bt.createElement(xGe,{prefixCls:y,switcherIcon:u,treeNodeProps:M,showLine:d});return E(Bt.createElement(kq,Object.assign({itemHeight:A,ref:e,virtual:r},D,{style:Object.assign(Object.assign({},s==null?void 0:s.style),_),prefixCls:y,className:Ue({[`${y}-icon-hide`]:!c,[`${y}-block-node`]:h,[`${y}-unselectable`]:!p,[`${y}-rtl`]:o==="rtl"},s==null?void 0:s.className,l,I,k),direction:o,checkable:g&&Bt.createElement("span",{className:`${y}-checkbox-inner`}),selectable:p,switcherIcon:N,draggable:P}),f))});var Zve=LGe,sg;(function(i){i[i.None=0]="None",i[i.Start=1]="Start",i[i.End=2]="End"})(sg||(sg={}));function Iq(i,e,t){const{key:n,children:o}=t;function r(s){const a=s[n],l=s[o];e(a,s)!==!1&&Iq(l||[],e,t)}i.forEach(r)}function EGe(i){let{treeData:e,expandedKeys:t,startKey:n,endKey:o,fieldNames:r}=i;const s=[];let a=sg.None;if(n&&n===o)return[n];if(!n||!o)return[];function l(c){return c===n||c===o}return Iq(e,c=>{if(a===sg.End)return!1;if(l(c)){if(s.push(c),a===sg.None)a=sg.Start;else if(a===sg.Start)return a=sg.End,!1}else a===sg.Start&&s.push(c);return t.includes(c)},cw(r)),s}function E6(i,e,t){const n=_t(e),o=[];return Iq(i,(r,s)=>{const a=n.indexOf(r);return a!==-1&&(o.push(s),n.splice(a,1)),!!n.length},cw(t)),o}var Xie=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var{defaultExpandAll:t,defaultExpandParent:n,defaultExpandedKeys:o}=i,r=Xie(i,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=x.exports.useRef(),a=x.exports.useRef(),l=()=>{const{keyEntities:I}=kve(Yie(r));let k;return t?k=Object.keys(I):n?k=zW(r.expandedKeys||o||[],I):k=r.expandedKeys||o,k},[c,d]=x.exports.useState(r.selectedKeys||r.defaultSelectedKeys||[]),[u,h]=x.exports.useState(()=>l());x.exports.useEffect(()=>{"selectedKeys"in r&&d(r.selectedKeys)},[r.selectedKeys]),x.exports.useEffect(()=>{"expandedKeys"in r&&h(r.expandedKeys)},[r.expandedKeys]);const f=(I,k)=>{var R;return"expandedKeys"in r||h(I),(R=r.onExpand)===null||R===void 0?void 0:R.call(r,I,k)},g=(I,k)=>{var R;const{multiple:A,fieldNames:P}=r,{node:N,nativeEvent:M}=k,{key:H=""}=N,B=Yie(r),F=Object.assign(Object.assign({},k),{selected:!0}),$=(M==null?void 0:M.ctrlKey)||(M==null?void 0:M.metaKey),z=M==null?void 0:M.shiftKey;let K;A&&$?(K=I,s.current=H,a.current=K,F.selectedNodes=E6(B,K,P)):A&&z?(K=Array.from(new Set([].concat(_t(a.current||[]),_t(EGe({treeData:B,expandedKeys:u,startKey:H,endKey:s.current,fieldNames:P}))))),F.selectedNodes=E6(B,K,P)):(K=[H],s.current=H,a.current=K,F.selectedNodes=E6(B,K,P)),(R=r.onSelect)===null||R===void 0||R.call(r,K,F),"selectedKeys"in r||d(K)},{getPrefixCls:p,direction:v}=x.exports.useContext(Hi),{prefixCls:m,className:_,showIcon:y=!0,expandAction:w="click"}=r,L=Xie(r,["prefixCls","className","showIcon","expandAction"]),D=p("tree",m),E=Ue(`${D}-directory`,{[`${D}-directory-rtl`]:v==="rtl"},_);return x.exports.createElement(Zve,Object.assign({icon:DGe,ref:e,blockNode:!0},L,{showIcon:y,expandAction:w,prefixCls:D,className:E,expandedKeys:u,selectedKeys:c,onSelect:g,onExpand:f}))},IGe=x.exports.forwardRef(kGe);var TGe=IGe;const Tq=Zve;Tq.DirectoryTree=TGe;Tq.TreeNode=uw;var NGe=Tq,Cc={exports:{}};/** + `]:{background:o},[`${e}-switcher`]:{color:r},[`${e}-node-content-wrapper`]:{color:r,background:"transparent"}}}}}},sGe=(i,e)=>{const t=`.${i}`,n=`${t}-treenode`,o=e.calc(e.paddingXS).div(2).equal(),r=lr(e,{treeCls:t,treeNodeCls:n,treeNodePadding:o});return[oGe(i,r),rGe(r)]},aGe=i=>{const{controlHeightSM:e}=i;return{titleHeight:e,nodeHoverBg:i.controlItemBgHover,nodeSelectedBg:i.controlItemBgActive}},lGe=i=>{const{colorTextLightSolid:e,colorPrimary:t}=i;return Object.assign(Object.assign({},aGe(i)),{directoryNodeSelectedColor:e,directoryNodeSelectedBg:t})};var cGe=jc("Tree",(i,e)=>{let{prefixCls:t}=e;return[{[i.componentCls]:Nve(`${t}-checkbox`,i)},sGe(t,i),_me(i)]},lGe);const Xie=4;function dGe(i){const{dropPosition:e,dropLevelOffset:t,prefixCls:n,indent:o,direction:r="ltr"}=i,s=r==="ltr"?"left":"right",a=r==="ltr"?"right":"left",l={[s]:-t*o+Xie,[a]:0};switch(e){case-1:l.top=-3;break;case 1:l.bottom=-3;break;default:l.bottom=-3,l[s]=o+Xie;break}return Bt.createElement("div",{style:l,className:`${n}-drop-indicator`})}var uGe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},hGe=uGe,fGe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:hGe}))},gGe=x.exports.forwardRef(fGe),pGe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},mGe=pGe,vGe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:mGe}))},_Ge=x.exports.forwardRef(vGe),bGe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},CGe=bGe,yGe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:CGe}))},wGe=x.exports.forwardRef(yGe);const SGe=i=>{const{prefixCls:e,switcherIcon:t,treeNodeProps:n,showLine:o}=i,{isLeaf:r,expanded:s,loading:a}=n;if(a)return x.exports.createElement(kI,{className:`${e}-switcher-loading-icon`});let l;if(o&&typeof o=="object"&&(l=o.showLeafIcon),r){if(!o)return null;if(typeof l!="boolean"&&!!l){const u=typeof l=="function"?l(n):l,h=`${e}-switcher-line-custom-icon`;return lw(u)?_v(u,{className:Ue(u.props.className||"",h)}):u}return l?x.exports.createElement(Zve,{className:`${e}-switcher-line-icon`}):x.exports.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,d=typeof t=="function"?t(n):t;return lw(d)?_v(d,{className:Ue(d.props.className||"",c)}):d!==void 0?d:o?s?x.exports.createElement(_Ge,{className:`${e}-switcher-line-icon`}):x.exports.createElement(wGe,{className:`${e}-switcher-line-icon`}):x.exports.createElement(gGe,{className:c})};var xGe=SGe;const LGe=Bt.forwardRef((i,e)=>{var t;const{getPrefixCls:n,direction:o,virtual:r,tree:s}=Bt.useContext(Hi),{prefixCls:a,className:l,showIcon:c=!1,showLine:d,switcherIcon:u,blockNode:h=!1,children:f,checkable:g=!1,selectable:p=!0,draggable:v,motion:m,style:_}=i,y=n("tree",a),w=n(),L=m!=null?m:Object.assign(Object.assign({},bW(w)),{motionAppear:!1}),D=Object.assign(Object.assign({},i),{checkable:g,selectable:p,showIcon:c,motion:L,blockNode:h,showLine:Boolean(d),dropIndicatorRender:dGe}),[E,I,k]=cGe(y),[,R]=Ba(),A=R.paddingXS/2+(((t=R.Tree)===null||t===void 0?void 0:t.titleHeight)||R.controlHeightSM),P=Bt.useMemo(()=>{if(!v)return!1;let M={};switch(typeof v){case"function":M.nodeDraggable=v;break;case"object":M=Object.assign({},v);break}return M.icon!==!1&&(M.icon=M.icon||Bt.createElement(eGe,null)),M},[v]),N=M=>Bt.createElement(xGe,{prefixCls:y,switcherIcon:u,treeNodeProps:M,showLine:d});return E(Bt.createElement(Iq,Object.assign({itemHeight:A,ref:e,virtual:r},D,{style:Object.assign(Object.assign({},s==null?void 0:s.style),_),prefixCls:y,className:Ue({[`${y}-icon-hide`]:!c,[`${y}-block-node`]:h,[`${y}-unselectable`]:!p,[`${y}-rtl`]:o==="rtl"},s==null?void 0:s.className,l,I,k),direction:o,checkable:g&&Bt.createElement("span",{className:`${y}-checkbox-inner`}),selectable:p,switcherIcon:N,draggable:P}),f))});var Qve=LGe,sg;(function(i){i[i.None=0]="None",i[i.Start=1]="Start",i[i.End=2]="End"})(sg||(sg={}));function Tq(i,e,t){const{key:n,children:o}=t;function r(s){const a=s[n],l=s[o];e(a,s)!==!1&&Tq(l||[],e,t)}i.forEach(r)}function EGe(i){let{treeData:e,expandedKeys:t,startKey:n,endKey:o,fieldNames:r}=i;const s=[];let a=sg.None;if(n&&n===o)return[n];if(!n||!o)return[];function l(c){return c===n||c===o}return Tq(e,c=>{if(a===sg.End)return!1;if(l(c)){if(s.push(c),a===sg.None)a=sg.Start;else if(a===sg.Start)return a=sg.End,!1}else a===sg.Start&&s.push(c);return t.includes(c)},cw(r)),s}function D6(i,e,t){const n=_t(e),o=[];return Tq(i,(r,s)=>{const a=n.indexOf(r);return a!==-1&&(o.push(s),n.splice(a,1)),!!n.length},cw(t)),o}var Yie=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var{defaultExpandAll:t,defaultExpandParent:n,defaultExpandedKeys:o}=i,r=Yie(i,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=x.exports.useRef(),a=x.exports.useRef(),l=()=>{const{keyEntities:I}=Ive(Zie(r));let k;return t?k=Object.keys(I):n?k=UW(r.expandedKeys||o||[],I):k=r.expandedKeys||o,k},[c,d]=x.exports.useState(r.selectedKeys||r.defaultSelectedKeys||[]),[u,h]=x.exports.useState(()=>l());x.exports.useEffect(()=>{"selectedKeys"in r&&d(r.selectedKeys)},[r.selectedKeys]),x.exports.useEffect(()=>{"expandedKeys"in r&&h(r.expandedKeys)},[r.expandedKeys]);const f=(I,k)=>{var R;return"expandedKeys"in r||h(I),(R=r.onExpand)===null||R===void 0?void 0:R.call(r,I,k)},g=(I,k)=>{var R;const{multiple:A,fieldNames:P}=r,{node:N,nativeEvent:M}=k,{key:H=""}=N,B=Zie(r),F=Object.assign(Object.assign({},k),{selected:!0}),$=(M==null?void 0:M.ctrlKey)||(M==null?void 0:M.metaKey),z=M==null?void 0:M.shiftKey;let K;A&&$?(K=I,s.current=H,a.current=K,F.selectedNodes=D6(B,K,P)):A&&z?(K=Array.from(new Set([].concat(_t(a.current||[]),_t(EGe({treeData:B,expandedKeys:u,startKey:H,endKey:s.current,fieldNames:P}))))),F.selectedNodes=D6(B,K,P)):(K=[H],s.current=H,a.current=K,F.selectedNodes=D6(B,K,P)),(R=r.onSelect)===null||R===void 0||R.call(r,K,F),"selectedKeys"in r||d(K)},{getPrefixCls:p,direction:v}=x.exports.useContext(Hi),{prefixCls:m,className:_,showIcon:y=!0,expandAction:w="click"}=r,L=Yie(r,["prefixCls","className","showIcon","expandAction"]),D=p("tree",m),E=Ue(`${D}-directory`,{[`${D}-directory-rtl`]:v==="rtl"},_);return x.exports.createElement(Qve,Object.assign({icon:DGe,ref:e,blockNode:!0},L,{showIcon:y,expandAction:w,prefixCls:D,className:E,expandedKeys:u,selectedKeys:c,onSelect:g,onExpand:f}))},IGe=x.exports.forwardRef(kGe);var TGe=IGe;const Nq=Qve;Nq.DirectoryTree=TGe;Nq.TreeNode=uw;var NGe=Nq,Cc={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(i,e){(function(){var t,n="4.17.21",o=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",u=1,h=2,f=4,g=1,p=2,v=1,m=2,_=4,y=8,w=16,L=32,D=64,E=128,I=256,k=512,R=30,A="...",P=800,N=16,M=1,H=2,B=3,F=1/0,$=9007199254740991,z=17976931348623157e292,K=0/0,j=4294967295,G=j-1,X=j>>>1,ue=[["ary",E],["bind",v],["bindKey",m],["curry",y],["curryRight",w],["flip",k],["partial",L],["partialRight",D],["rearg",I]],fe="[object Arguments]",pe="[object Array]",be="[object AsyncFunction]",Se="[object Boolean]",Fe="[object Date]",De="[object DOMException]",ce="[object Error]",Pe="[object Function]",Oe="[object GeneratorFunction]",xe="[object Map]",Ee="[object Number]",tt="[object Null]",nt="[object Object]",Qe="[object Promise]",Ge="[object Proxy]",re="[object RegExp]",ie="[object Set]",se="[object String]",U="[object Symbol]",Y="[object Undefined]",oe="[object WeakMap]",te="[object WeakSet]",ye="[object ArrayBuffer]",Le="[object DataView]",Te="[object Float32Array]",We="[object Float64Array]",je="[object Int8Array]",mt="[object Int16Array]",Dt="[object Int32Array]",At="[object Uint8Array]",Je="[object Uint8ClampedArray]",Lt="[object Uint16Array]",Ot="[object Uint32Array]",Vn=/\b__p \+= '';/g,Et=/\b(__p \+=) '' \+/g,tn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,di=/&(?:amp|lt|gt|quot|#39);/g,cn=/[&<>"']/g,Gn=RegExp(di.source),bn=RegExp(cn.source),Pt=/<%-([\s\S]+?)%>/g,qt=/<%([\s\S]+?)%>/g,Nt=/<%=([\s\S]+?)%>/g,jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,It=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ft=/[\\^$.*+?()[\]{}|]/g,Ct=RegExp(Ft.source),Zt=/^\s+/,wn=/\s/,Dn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Xn=/\{\n\/\* \[wrapped with (.+)\] \*/,jn=/,? & /,Zi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,an=/[()=,{}\[\]\/\s]/,Xt=/\\(\\)?/g,oi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ze=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,Ve=/^0b[01]+$/i,ot=/^\[object .+?Constructor\]$/,Sn=/^0o[0-7]+$/i,$n=/^(?:0|[1-9]\d*)$/,Ci=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,An=/($^)/,lo=/['\n\r\u2028\u2029\\]/g,Qo="\\ud800-\\udfff",zo="\\u0300-\\u036f",oc="\\ufe20-\\ufe2f",Yc="\\u20d0-\\u20ff",Gr=zo+oc+Yc,Ua="\\u2700-\\u27bf",vl="a-z\\xdf-\\xf6\\xf8-\\xff",ba="\\xac\\xb1\\xd7\\xf7",_l="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rc="\\u2000-\\u206f",Zc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ca="A-Z\\xc0-\\xd6\\xd8-\\xde",Yd="\\ufe0e\\ufe0f",bl=ba+_l+rc+Zc,mi="['\u2019]",gi="["+Qo+"]",Kt="["+bl+"]",on="["+Gr+"]",vi="\\d+",Uo="["+Ua+"]",Qi="["+vl+"]",Jo="[^"+Qo+bl+vi+Ua+vl+Ca+"]",_r="\\ud83c[\\udffb-\\udfff]",zs="(?:"+on+"|"+_r+")",Tr="[^"+Qo+"]",ds="(?:\\ud83c[\\udde6-\\uddff]){2}",Ts="[\\ud800-\\udbff][\\udc00-\\udfff]",er="["+Ca+"]",l_="\\u200d",Qc="(?:"+Qi+"|"+Jo+")",Mf="(?:"+er+"|"+Jo+")",Af="(?:"+mi+"(?:d|ll|m|re|s|t|ve))?",Pf="(?:"+mi+"(?:D|LL|M|RE|S|T|VE))?",xp=zs+"?",Lp="["+Yd+"]?",r1="(?:"+l_+"(?:"+[Tr,ds,Ts].join("|")+")"+Lp+xp+")*",WS="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",VS="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",s1=Lp+xp+r1,HS="(?:"+[Uo,ds,Ts].join("|")+")"+s1,rn="(?:"+[Tr+on+"?",on,ds,Ts,gi].join("|")+")",zn=RegExp(mi,"g"),tr=RegExp(on,"g"),dr=RegExp(_r+"(?="+_r+")|"+rn+s1,"g"),nr=RegExp([er+"?"+Qi+"+"+Af+"(?="+[Kt,er,"$"].join("|")+")",Mf+"+"+Pf+"(?="+[Kt,er+Qc,"$"].join("|")+")",er+"?"+Qc+"+"+Af,er+"+"+Pf,VS,WS,vi,HS].join("|"),"g"),a1=RegExp("["+l_+Qo+Gr+Yd+"]"),$S=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,RT=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],l1=-1,jo={};jo[Te]=jo[We]=jo[je]=jo[mt]=jo[Dt]=jo[At]=jo[Je]=jo[Lt]=jo[Ot]=!0,jo[fe]=jo[pe]=jo[ye]=jo[Se]=jo[Le]=jo[Fe]=jo[ce]=jo[Pe]=jo[xe]=jo[Ee]=jo[nt]=jo[re]=jo[ie]=jo[se]=jo[oe]=!1;var Po={};Po[fe]=Po[pe]=Po[ye]=Po[Le]=Po[Se]=Po[Fe]=Po[Te]=Po[We]=Po[je]=Po[mt]=Po[Dt]=Po[xe]=Po[Ee]=Po[nt]=Po[re]=Po[ie]=Po[se]=Po[U]=Po[At]=Po[Je]=Po[Lt]=Po[Ot]=!0,Po[ce]=Po[Pe]=Po[oe]=!1;var Hxe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},$xe={"&":"&","<":"<",">":">",'"':""","'":"'"},zxe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Uxe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jxe=parseFloat,Kxe=parseInt,rZ=typeof rx=="object"&&rx&&rx.Object===Object&&rx,qxe=typeof self=="object"&&self&&self.Object===Object&&self,Us=rZ||qxe||Function("return this")(),o3=e&&!e.nodeType&&e,c_=o3&&!0&&i&&!i.nodeType&&i,sZ=c_&&c_.exports===o3,r3=sZ&&rZ.process,Jc=function(){try{var Ie=c_&&c_.require&&c_.require("util").types;return Ie||r3&&r3.binding&&r3.binding("util")}catch{}}(),aZ=Jc&&Jc.isArrayBuffer,lZ=Jc&&Jc.isDate,cZ=Jc&&Jc.isMap,dZ=Jc&&Jc.isRegExp,uZ=Jc&&Jc.isSet,hZ=Jc&&Jc.isTypedArray;function sc(Ie,it,qe){switch(qe.length){case 0:return Ie.call(it);case 1:return Ie.call(it,qe[0]);case 2:return Ie.call(it,qe[0],qe[1]);case 3:return Ie.call(it,qe[0],qe[1],qe[2])}return Ie.apply(it,qe)}function Gxe(Ie,it,qe,Yt){for(var ei=-1,Ji=Ie==null?0:Ie.length;++ei-1}function s3(Ie,it,qe){for(var Yt=-1,ei=Ie==null?0:Ie.length;++Yt-1;);return qe}function CZ(Ie,it){for(var qe=Ie.length;qe--&&c1(it,Ie[qe],0)>-1;);return qe}function iLe(Ie,it){for(var qe=Ie.length,Yt=0;qe--;)Ie[qe]===it&&++Yt;return Yt}var oLe=d3(Hxe),rLe=d3($xe);function sLe(Ie){return"\\"+Uxe[Ie]}function aLe(Ie,it){return Ie==null?t:Ie[it]}function d1(Ie){return a1.test(Ie)}function lLe(Ie){return $S.test(Ie)}function cLe(Ie){for(var it,qe=[];!(it=Ie.next()).done;)qe.push(it.value);return qe}function g3(Ie){var it=-1,qe=Array(Ie.size);return Ie.forEach(function(Yt,ei){qe[++it]=[ei,Yt]}),qe}function yZ(Ie,it){return function(qe){return Ie(it(qe))}}function kp(Ie,it){for(var qe=-1,Yt=Ie.length,ei=0,Ji=[];++qe-1}function YLe(b,S){var T=this.__data__,O=YT(T,b);return O<0?(++this.size,T.push([b,S])):T[O][1]=S,this}Of.prototype.clear=KLe,Of.prototype.delete=qLe,Of.prototype.get=GLe,Of.prototype.has=XLe,Of.prototype.set=YLe;function Ff(b){var S=-1,T=b==null?0:b.length;for(this.clear();++S=S?b:S)),b}function id(b,S,T,O,q,ne){var ge,we=S&u,Re=S&h,dt=S&f;if(T&&(ge=q?T(b,O,q,ne):T(b)),ge!==t)return ge;if(!ur(b))return b;var ut=ni(b);if(ut){if(ge=eDe(b),!we)return Cl(b,ge)}else{var vt=wa(b),Ht=vt==Pe||vt==Oe;if(Ap(b))return iQ(b,we);if(vt==nt||vt==fe||Ht&&!q){if(ge=Re||Ht?{}:wQ(b),!we)return Re?zEe(b,hEe(ge,b)):$Ee(b,MZ(ge,b))}else{if(!Po[vt])return q?b:{};ge=tDe(b,vt,we)}}ne||(ne=new Qd);var dn=ne.get(b);if(dn)return dn;ne.set(b,ge),ZQ(b)?b.forEach(function(Bn){ge.add(id(Bn,S,T,Bn,b,ne))}):XQ(b)&&b.forEach(function(Bn,yi){ge.set(yi,id(Bn,S,T,yi,b,ne))});var Fn=dt?Re?V3:W3:Re?wl:Ns,ui=ut?t:Fn(b);return ed(ui||b,function(Bn,yi){ui&&(yi=Bn,Bn=b[yi]),XS(ge,yi,id(Bn,S,T,yi,b,ne))}),ge}function fEe(b){var S=Ns(b);return function(T){return AZ(T,b,S)}}function AZ(b,S,T){var O=T.length;if(b==null)return!O;for(b=Do(b);O--;){var q=T[O],ne=S[q],ge=b[q];if(ge===t&&!(q in b)||!ne(ge))return!1}return!0}function PZ(b,S,T){if(typeof b!="function")throw new td(s);return nx(function(){b.apply(t,T)},S)}function YS(b,S,T,O){var q=-1,ne=MT,ge=!0,we=b.length,Re=[],dt=S.length;if(!we)return Re;T&&(S=ir(S,ac(T))),O?(ne=s3,ge=!1):S.length>=o&&(ne=zS,ge=!1,S=new h_(S));e:for(;++qq?0:q+T),O=O===t||O>q?q:ai(O),O<0&&(O+=q),O=T>O?0:JQ(O);T0&&T(we)?S>1?js(we,S-1,T,O,q):Dp(q,we):O||(q[q.length]=we)}return q}var y3=cQ(),BZ=cQ(!0);function fh(b,S){return b&&y3(b,S,Ns)}function w3(b,S){return b&&BZ(b,S,Ns)}function QT(b,S){return Ep(S,function(T){return $f(b[T])})}function g_(b,S){S=Rp(S,b);for(var T=0,O=S.length;b!=null&&TS}function mEe(b,S){return b!=null&&co.call(b,S)}function vEe(b,S){return b!=null&&S in Do(b)}function _Ee(b,S,T){return b>=ya(S,T)&&b=120&&ut.length>=120)?new h_(ge&&ut):t}ut=b[0];var vt=-1,Ht=we[0];e:for(;++vt-1;)we!==b&&zT.call(we,Re,1),zT.call(b,Re,1);return b}function XZ(b,S){for(var T=b?S.length:0,O=T-1;T--;){var q=S[T];if(T==O||q!==ne){var ne=q;Hf(q)?zT.call(b,q,1):R3(b,q)}}return b}function I3(b,S){return b+KT(IZ()*(S-b+1))}function NEe(b,S,T,O){for(var q=-1,ne=hs(jT((S-b)/(T||1)),0),ge=qe(ne);ne--;)ge[O?ne:++q]=b,b+=T;return ge}function T3(b,S){var T="";if(!b||S<1||S>$)return T;do S%2&&(T+=b),S=KT(S/2),S&&(b+=b);while(S);return T}function pi(b,S){return q3(LQ(b,S,Sl),b+"")}function REe(b){return RZ(y1(b))}function MEe(b,S){var T=y1(b);return cN(T,f_(S,0,T.length))}function JS(b,S,T,O){if(!ur(b))return b;S=Rp(S,b);for(var q=-1,ne=S.length,ge=ne-1,we=b;we!=null&&++qq?0:q+S),T=T>q?q:T,T<0&&(T+=q),q=S>T?0:T-S>>>0,S>>>=0;for(var ne=qe(q);++O>>1,ge=b[ne];ge!==null&&!cc(ge)&&(T?ge<=S:ge=o){var dt=S?null:qEe(b);if(dt)return PT(dt);ge=!1,q=zS,Re=new h_}else Re=S?[]:we;e:for(;++O=O?b:od(b,S,T)}var nQ=xLe||function(b){return Us.clearTimeout(b)};function iQ(b,S){if(S)return b.slice();var T=b.length,O=xZ?xZ(T):new b.constructor(T);return b.copy(O),O}function O3(b){var S=new b.constructor(b.byteLength);return new HT(S).set(new HT(b)),S}function BEe(b,S){var T=S?O3(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.byteLength)}function WEe(b){var S=new b.constructor(b.source,Ze.exec(b));return S.lastIndex=b.lastIndex,S}function VEe(b){return GS?Do(GS.call(b)):{}}function oQ(b,S){var T=S?O3(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.length)}function rQ(b,S){if(b!==S){var T=b!==t,O=b===null,q=b===b,ne=cc(b),ge=S!==t,we=S===null,Re=S===S,dt=cc(S);if(!we&&!dt&&!ne&&b>S||ne&&ge&&Re&&!we&&!dt||O&&ge&&Re||!T&&Re||!q)return 1;if(!O&&!ne&&!dt&&b=we)return Re;var dt=T[O];return Re*(dt=="desc"?-1:1)}}return b.index-S.index}function sQ(b,S,T,O){for(var q=-1,ne=b.length,ge=T.length,we=-1,Re=S.length,dt=hs(ne-ge,0),ut=qe(Re+dt),vt=!O;++we1?T[q-1]:t,ge=q>2?T[2]:t;for(ne=b.length>3&&typeof ne=="function"?(q--,ne):t,ge&&Ka(T[0],T[1],ge)&&(ne=q<3?t:ne,q=1),S=Do(S);++O-1?q[ne?S[ge]:ge]:t}}function hQ(b){return Vf(function(S){var T=S.length,O=T,q=nd.prototype.thru;for(b&&S.reverse();O--;){var ne=S[O];if(typeof ne!="function")throw new td(s);if(q&&!ge&&aN(ne)=="wrapper")var ge=new nd([],!0)}for(O=ge?O:T;++O1&&Ni.reverse(),ut&&Rewe))return!1;var dt=ne.get(b),ut=ne.get(S);if(dt&&ut)return dt==S&&ut==b;var vt=-1,Ht=!0,dn=T&p?new h_:t;for(ne.set(b,S),ne.set(S,b);++vt1?"& ":"")+S[O],S=S.join(T>2?", ":" "),b.replace(Dn,`{ + */(function(i,e){(function(){var t,n="4.17.21",o=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",u=1,h=2,f=4,g=1,p=2,v=1,m=2,_=4,y=8,w=16,L=32,D=64,E=128,I=256,k=512,R=30,A="...",P=800,N=16,M=1,H=2,B=3,F=1/0,$=9007199254740991,z=17976931348623157e292,K=0/0,j=4294967295,G=j-1,X=j>>>1,ue=[["ary",E],["bind",v],["bindKey",m],["curry",y],["curryRight",w],["flip",k],["partial",L],["partialRight",D],["rearg",I]],fe="[object Arguments]",pe="[object Array]",be="[object AsyncFunction]",Se="[object Boolean]",Fe="[object Date]",De="[object DOMException]",ce="[object Error]",Pe="[object Function]",Oe="[object GeneratorFunction]",xe="[object Map]",Ee="[object Number]",tt="[object Null]",nt="[object Object]",Qe="[object Promise]",Ge="[object Proxy]",re="[object RegExp]",ie="[object Set]",se="[object String]",U="[object Symbol]",Y="[object Undefined]",oe="[object WeakMap]",te="[object WeakSet]",ye="[object ArrayBuffer]",Le="[object DataView]",Te="[object Float32Array]",We="[object Float64Array]",je="[object Int8Array]",mt="[object Int16Array]",Dt="[object Int32Array]",At="[object Uint8Array]",Je="[object Uint8ClampedArray]",Lt="[object Uint16Array]",Ot="[object Uint32Array]",Vn=/\b__p \+= '';/g,Et=/\b(__p \+=) '' \+/g,tn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,di=/&(?:amp|lt|gt|quot|#39);/g,cn=/[&<>"']/g,Gn=RegExp(di.source),bn=RegExp(cn.source),Pt=/<%-([\s\S]+?)%>/g,qt=/<%([\s\S]+?)%>/g,Nt=/<%=([\s\S]+?)%>/g,jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,It=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ft=/[\\^$.*+?()[\]{}|]/g,Ct=RegExp(Ft.source),Zt=/^\s+/,wn=/\s/,Dn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Xn=/\{\n\/\* \[wrapped with (.+)\] \*/,jn=/,? & /,Zi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,an=/[()=,{}\[\]\/\s]/,Xt=/\\(\\)?/g,oi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ze=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,Ve=/^0b[01]+$/i,ot=/^\[object .+?Constructor\]$/,Sn=/^0o[0-7]+$/i,$n=/^(?:0|[1-9]\d*)$/,Ci=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,An=/($^)/,lo=/['\n\r\u2028\u2029\\]/g,Qo="\\ud800-\\udfff",zo="\\u0300-\\u036f",oc="\\ufe20-\\ufe2f",Yc="\\u20d0-\\u20ff",Gr=zo+oc+Yc,Ua="\\u2700-\\u27bf",vl="a-z\\xdf-\\xf6\\xf8-\\xff",ba="\\xac\\xb1\\xd7\\xf7",_l="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rc="\\u2000-\\u206f",Zc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ca="A-Z\\xc0-\\xd6\\xd8-\\xde",Yd="\\ufe0e\\ufe0f",bl=ba+_l+rc+Zc,mi="['\u2019]",gi="["+Qo+"]",Kt="["+bl+"]",on="["+Gr+"]",vi="\\d+",Uo="["+Ua+"]",Qi="["+vl+"]",Jo="[^"+Qo+bl+vi+Ua+vl+Ca+"]",_r="\\ud83c[\\udffb-\\udfff]",zs="(?:"+on+"|"+_r+")",Tr="[^"+Qo+"]",ds="(?:\\ud83c[\\udde6-\\uddff]){2}",Ts="[\\ud800-\\udbff][\\udc00-\\udfff]",er="["+Ca+"]",l_="\\u200d",Qc="(?:"+Qi+"|"+Jo+")",Mf="(?:"+er+"|"+Jo+")",Af="(?:"+mi+"(?:d|ll|m|re|s|t|ve))?",Pf="(?:"+mi+"(?:D|LL|M|RE|S|T|VE))?",Lp=zs+"?",Ep="["+Yd+"]?",r1="(?:"+l_+"(?:"+[Tr,ds,Ts].join("|")+")"+Ep+Lp+")*",WS="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",VS="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",s1=Ep+Lp+r1,HS="(?:"+[Uo,ds,Ts].join("|")+")"+s1,rn="(?:"+[Tr+on+"?",on,ds,Ts,gi].join("|")+")",zn=RegExp(mi,"g"),tr=RegExp(on,"g"),dr=RegExp(_r+"(?="+_r+")|"+rn+s1,"g"),nr=RegExp([er+"?"+Qi+"+"+Af+"(?="+[Kt,er,"$"].join("|")+")",Mf+"+"+Pf+"(?="+[Kt,er+Qc,"$"].join("|")+")",er+"?"+Qc+"+"+Af,er+"+"+Pf,VS,WS,vi,HS].join("|"),"g"),a1=RegExp("["+l_+Qo+Gr+Yd+"]"),$S=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,RT=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],l1=-1,jo={};jo[Te]=jo[We]=jo[je]=jo[mt]=jo[Dt]=jo[At]=jo[Je]=jo[Lt]=jo[Ot]=!0,jo[fe]=jo[pe]=jo[ye]=jo[Se]=jo[Le]=jo[Fe]=jo[ce]=jo[Pe]=jo[xe]=jo[Ee]=jo[nt]=jo[re]=jo[ie]=jo[se]=jo[oe]=!1;var Po={};Po[fe]=Po[pe]=Po[ye]=Po[Le]=Po[Se]=Po[Fe]=Po[Te]=Po[We]=Po[je]=Po[mt]=Po[Dt]=Po[xe]=Po[Ee]=Po[nt]=Po[re]=Po[ie]=Po[se]=Po[U]=Po[At]=Po[Je]=Po[Lt]=Po[Ot]=!0,Po[ce]=Po[Pe]=Po[oe]=!1;var Hxe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},$xe={"&":"&","<":"<",">":">",'"':""","'":"'"},zxe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Uxe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jxe=parseFloat,Kxe=parseInt,sZ=typeof rx=="object"&&rx&&rx.Object===Object&&rx,qxe=typeof self=="object"&&self&&self.Object===Object&&self,Us=sZ||qxe||Function("return this")(),r3=e&&!e.nodeType&&e,c_=r3&&!0&&i&&!i.nodeType&&i,aZ=c_&&c_.exports===r3,s3=aZ&&sZ.process,Jc=function(){try{var Ie=c_&&c_.require&&c_.require("util").types;return Ie||s3&&s3.binding&&s3.binding("util")}catch{}}(),lZ=Jc&&Jc.isArrayBuffer,cZ=Jc&&Jc.isDate,dZ=Jc&&Jc.isMap,uZ=Jc&&Jc.isRegExp,hZ=Jc&&Jc.isSet,fZ=Jc&&Jc.isTypedArray;function sc(Ie,it,qe){switch(qe.length){case 0:return Ie.call(it);case 1:return Ie.call(it,qe[0]);case 2:return Ie.call(it,qe[0],qe[1]);case 3:return Ie.call(it,qe[0],qe[1],qe[2])}return Ie.apply(it,qe)}function Gxe(Ie,it,qe,Yt){for(var ei=-1,Ji=Ie==null?0:Ie.length;++ei-1}function a3(Ie,it,qe){for(var Yt=-1,ei=Ie==null?0:Ie.length;++Yt-1;);return qe}function yZ(Ie,it){for(var qe=Ie.length;qe--&&c1(it,Ie[qe],0)>-1;);return qe}function iLe(Ie,it){for(var qe=Ie.length,Yt=0;qe--;)Ie[qe]===it&&++Yt;return Yt}var oLe=u3(Hxe),rLe=u3($xe);function sLe(Ie){return"\\"+Uxe[Ie]}function aLe(Ie,it){return Ie==null?t:Ie[it]}function d1(Ie){return a1.test(Ie)}function lLe(Ie){return $S.test(Ie)}function cLe(Ie){for(var it,qe=[];!(it=Ie.next()).done;)qe.push(it.value);return qe}function p3(Ie){var it=-1,qe=Array(Ie.size);return Ie.forEach(function(Yt,ei){qe[++it]=[ei,Yt]}),qe}function wZ(Ie,it){return function(qe){return Ie(it(qe))}}function Ip(Ie,it){for(var qe=-1,Yt=Ie.length,ei=0,Ji=[];++qe-1}function YLe(b,S){var T=this.__data__,O=YT(T,b);return O<0?(++this.size,T.push([b,S])):T[O][1]=S,this}Of.prototype.clear=KLe,Of.prototype.delete=qLe,Of.prototype.get=GLe,Of.prototype.has=XLe,Of.prototype.set=YLe;function Ff(b){var S=-1,T=b==null?0:b.length;for(this.clear();++S=S?b:S)),b}function id(b,S,T,O,q,ne){var ge,we=S&u,Re=S&h,dt=S&f;if(T&&(ge=q?T(b,O,q,ne):T(b)),ge!==t)return ge;if(!ur(b))return b;var ut=ni(b);if(ut){if(ge=eDe(b),!we)return Cl(b,ge)}else{var vt=wa(b),Ht=vt==Pe||vt==Oe;if(Pp(b))return oQ(b,we);if(vt==nt||vt==fe||Ht&&!q){if(ge=Re||Ht?{}:SQ(b),!we)return Re?zEe(b,hEe(ge,b)):$Ee(b,AZ(ge,b))}else{if(!Po[vt])return q?b:{};ge=tDe(b,vt,we)}}ne||(ne=new Qd);var dn=ne.get(b);if(dn)return dn;ne.set(b,ge),QQ(b)?b.forEach(function(Bn){ge.add(id(Bn,S,T,Bn,b,ne))}):YQ(b)&&b.forEach(function(Bn,yi){ge.set(yi,id(Bn,S,T,yi,b,ne))});var Fn=dt?Re?H3:V3:Re?wl:Ns,ui=ut?t:Fn(b);return ed(ui||b,function(Bn,yi){ui&&(yi=Bn,Bn=b[yi]),XS(ge,yi,id(Bn,S,T,yi,b,ne))}),ge}function fEe(b){var S=Ns(b);return function(T){return PZ(T,b,S)}}function PZ(b,S,T){var O=T.length;if(b==null)return!O;for(b=Do(b);O--;){var q=T[O],ne=S[q],ge=b[q];if(ge===t&&!(q in b)||!ne(ge))return!1}return!0}function OZ(b,S,T){if(typeof b!="function")throw new td(s);return nx(function(){b.apply(t,T)},S)}function YS(b,S,T,O){var q=-1,ne=MT,ge=!0,we=b.length,Re=[],dt=S.length;if(!we)return Re;T&&(S=ir(S,ac(T))),O?(ne=a3,ge=!1):S.length>=o&&(ne=zS,ge=!1,S=new h_(S));e:for(;++qq?0:q+T),O=O===t||O>q?q:ai(O),O<0&&(O+=q),O=T>O?0:eJ(O);T0&&T(we)?S>1?js(we,S-1,T,O,q):kp(q,we):O||(q[q.length]=we)}return q}var w3=dQ(),WZ=dQ(!0);function fh(b,S){return b&&w3(b,S,Ns)}function S3(b,S){return b&&WZ(b,S,Ns)}function QT(b,S){return Dp(S,function(T){return $f(b[T])})}function g_(b,S){S=Mp(S,b);for(var T=0,O=S.length;b!=null&&TS}function mEe(b,S){return b!=null&&co.call(b,S)}function vEe(b,S){return b!=null&&S in Do(b)}function _Ee(b,S,T){return b>=ya(S,T)&&b=120&&ut.length>=120)?new h_(ge&&ut):t}ut=b[0];var vt=-1,Ht=we[0];e:for(;++vt-1;)we!==b&&zT.call(we,Re,1),zT.call(b,Re,1);return b}function YZ(b,S){for(var T=b?S.length:0,O=T-1;T--;){var q=S[T];if(T==O||q!==ne){var ne=q;Hf(q)?zT.call(b,q,1):M3(b,q)}}return b}function T3(b,S){return b+KT(TZ()*(S-b+1))}function NEe(b,S,T,O){for(var q=-1,ne=hs(jT((S-b)/(T||1)),0),ge=qe(ne);ne--;)ge[O?ne:++q]=b,b+=T;return ge}function N3(b,S){var T="";if(!b||S<1||S>$)return T;do S%2&&(T+=b),S=KT(S/2),S&&(b+=b);while(S);return T}function pi(b,S){return G3(EQ(b,S,Sl),b+"")}function REe(b){return MZ(y1(b))}function MEe(b,S){var T=y1(b);return cN(T,f_(S,0,T.length))}function JS(b,S,T,O){if(!ur(b))return b;S=Mp(S,b);for(var q=-1,ne=S.length,ge=ne-1,we=b;we!=null&&++qq?0:q+S),T=T>q?q:T,T<0&&(T+=q),q=S>T?0:T-S>>>0,S>>>=0;for(var ne=qe(q);++O>>1,ge=b[ne];ge!==null&&!cc(ge)&&(T?ge<=S:ge=o){var dt=S?null:qEe(b);if(dt)return PT(dt);ge=!1,q=zS,Re=new h_}else Re=S?[]:we;e:for(;++O=O?b:od(b,S,T)}var iQ=xLe||function(b){return Us.clearTimeout(b)};function oQ(b,S){if(S)return b.slice();var T=b.length,O=LZ?LZ(T):new b.constructor(T);return b.copy(O),O}function F3(b){var S=new b.constructor(b.byteLength);return new HT(S).set(new HT(b)),S}function BEe(b,S){var T=S?F3(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.byteLength)}function WEe(b){var S=new b.constructor(b.source,Ze.exec(b));return S.lastIndex=b.lastIndex,S}function VEe(b){return GS?Do(GS.call(b)):{}}function rQ(b,S){var T=S?F3(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.length)}function sQ(b,S){if(b!==S){var T=b!==t,O=b===null,q=b===b,ne=cc(b),ge=S!==t,we=S===null,Re=S===S,dt=cc(S);if(!we&&!dt&&!ne&&b>S||ne&&ge&&Re&&!we&&!dt||O&&ge&&Re||!T&&Re||!q)return 1;if(!O&&!ne&&!dt&&b=we)return Re;var dt=T[O];return Re*(dt=="desc"?-1:1)}}return b.index-S.index}function aQ(b,S,T,O){for(var q=-1,ne=b.length,ge=T.length,we=-1,Re=S.length,dt=hs(ne-ge,0),ut=qe(Re+dt),vt=!O;++we1?T[q-1]:t,ge=q>2?T[2]:t;for(ne=b.length>3&&typeof ne=="function"?(q--,ne):t,ge&&Ka(T[0],T[1],ge)&&(ne=q<3?t:ne,q=1),S=Do(S);++O-1?q[ne?S[ge]:ge]:t}}function fQ(b){return Vf(function(S){var T=S.length,O=T,q=nd.prototype.thru;for(b&&S.reverse();O--;){var ne=S[O];if(typeof ne!="function")throw new td(s);if(q&&!ge&&aN(ne)=="wrapper")var ge=new nd([],!0)}for(O=ge?O:T;++O1&&Ni.reverse(),ut&&Rewe))return!1;var dt=ne.get(b),ut=ne.get(S);if(dt&&ut)return dt==S&&ut==b;var vt=-1,Ht=!0,dn=T&p?new h_:t;for(ne.set(b,S),ne.set(S,b);++vt1?"& ":"")+S[O],S=S.join(T>2?", ":" "),b.replace(Dn,`{ /* [wrapped with `+S+`] */ -`)}function iDe(b){return ni(b)||v_(b)||!!(DZ&&b&&b[DZ])}function Hf(b,S){var T=typeof b;return S=S==null?$:S,!!S&&(T=="number"||T!="symbol"&&$n.test(b))&&b>-1&&b%1==0&&b0){if(++S>=P)return arguments[0]}else S=0;return b.apply(t,arguments)}}function cN(b,S){var T=-1,O=b.length,q=O-1;for(S=S===t?O:S;++T1?b[S-1]:t;return T=typeof T=="function"?(b.pop(),T):t,FQ(b,T)});function BQ(b){var S=ee(b);return S.__chain__=!0,S}function gke(b,S){return S(b),b}function dN(b,S){return S(b)}var pke=Vf(function(b){var S=b.length,T=S?b[0]:0,O=this.__wrapped__,q=function(ne){return C3(ne,b)};return S>1||this.__actions__.length||!(O instanceof Li)||!Hf(T)?this.thru(q):(O=O.slice(T,+T+(S?1:0)),O.__actions__.push({func:dN,args:[q],thisArg:t}),new nd(O,this.__chain__).thru(function(ne){return S&&!ne.length&&ne.push(t),ne}))});function mke(){return BQ(this)}function vke(){return new nd(this.value(),this.__chain__)}function _ke(){this.__values__===t&&(this.__values__=QQ(this.value()));var b=this.__index__>=this.__values__.length,S=b?t:this.__values__[this.__index__++];return{done:b,value:S}}function bke(){return this}function Cke(b){for(var S,T=this;T instanceof XT;){var O=NQ(T);O.__index__=0,O.__values__=t,S?q.__wrapped__=O:S=O;var q=O;T=T.__wrapped__}return q.__wrapped__=b,S}function yke(){var b=this.__wrapped__;if(b instanceof Li){var S=b;return this.__actions__.length&&(S=new Li(this)),S=S.reverse(),S.__actions__.push({func:dN,args:[G3],thisArg:t}),new nd(S,this.__chain__)}return this.thru(G3)}function wke(){return eQ(this.__wrapped__,this.__actions__)}var Ske=nN(function(b,S,T){co.call(b,T)?++b[T]:Bf(b,T,1)});function xke(b,S,T){var O=ni(b)?fZ:gEe;return T&&Ka(b,S,T)&&(S=t),O(b,Pn(S,3))}function Lke(b,S){var T=ni(b)?Ep:FZ;return T(b,Pn(S,3))}var Eke=uQ(RQ),Dke=uQ(MQ);function kke(b,S){return js(uN(b,S),1)}function Ike(b,S){return js(uN(b,S),F)}function Tke(b,S,T){return T=T===t?1:ai(T),js(uN(b,S),T)}function WQ(b,S){var T=ni(b)?ed:Tp;return T(b,Pn(S,3))}function VQ(b,S){var T=ni(b)?Xxe:OZ;return T(b,Pn(S,3))}var Nke=nN(function(b,S,T){co.call(b,T)?b[T].push(S):Bf(b,T,[S])});function Rke(b,S,T,O){b=yl(b)?b:y1(b),T=T&&!O?ai(T):0;var q=b.length;return T<0&&(T=hs(q+T,0)),mN(b)?T<=q&&b.indexOf(S,T)>-1:!!q&&c1(b,S,T)>-1}var Mke=pi(function(b,S,T){var O=-1,q=typeof S=="function",ne=yl(b)?qe(b.length):[];return Tp(b,function(ge){ne[++O]=q?sc(S,ge,T):ZS(ge,S,T)}),ne}),Ake=nN(function(b,S,T){Bf(b,T,S)});function uN(b,S){var T=ni(b)?ir:zZ;return T(b,Pn(S,3))}function Pke(b,S,T,O){return b==null?[]:(ni(S)||(S=S==null?[]:[S]),T=O?t:T,ni(T)||(T=T==null?[]:[T]),qZ(b,S,T))}var Oke=nN(function(b,S,T){b[T?0:1].push(S)},function(){return[[],[]]});function Fke(b,S,T){var O=ni(b)?a3:vZ,q=arguments.length<3;return O(b,Pn(S,4),T,q,Tp)}function Bke(b,S,T){var O=ni(b)?Yxe:vZ,q=arguments.length<3;return O(b,Pn(S,4),T,q,OZ)}function Wke(b,S){var T=ni(b)?Ep:FZ;return T(b,gN(Pn(S,3)))}function Vke(b){var S=ni(b)?RZ:REe;return S(b)}function Hke(b,S,T){(T?Ka(b,S,T):S===t)?S=1:S=ai(S);var O=ni(b)?cEe:MEe;return O(b,S)}function $ke(b){var S=ni(b)?dEe:PEe;return S(b)}function zke(b){if(b==null)return 0;if(yl(b))return mN(b)?u1(b):b.length;var S=wa(b);return S==xe||S==ie?b.size:E3(b).length}function Uke(b,S,T){var O=ni(b)?l3:OEe;return T&&Ka(b,S,T)&&(S=t),O(b,Pn(S,3))}var jke=pi(function(b,S){if(b==null)return[];var T=S.length;return T>1&&Ka(b,S[0],S[1])?S=[]:T>2&&Ka(S[0],S[1],S[2])&&(S=[S[0]]),qZ(b,js(S,1),[])}),hN=LLe||function(){return Us.Date.now()};function Kke(b,S){if(typeof S!="function")throw new td(s);return b=ai(b),function(){if(--b<1)return S.apply(this,arguments)}}function HQ(b,S,T){return S=T?t:S,S=b&&S==null?b.length:S,Wf(b,E,t,t,t,t,S)}function $Q(b,S){var T;if(typeof S!="function")throw new td(s);return b=ai(b),function(){return--b>0&&(T=S.apply(this,arguments)),b<=1&&(S=t),T}}var Y3=pi(function(b,S,T){var O=v;if(T.length){var q=kp(T,b1(Y3));O|=L}return Wf(b,O,S,T,q)}),zQ=pi(function(b,S,T){var O=v|m;if(T.length){var q=kp(T,b1(zQ));O|=L}return Wf(S,O,b,T,q)});function UQ(b,S,T){S=T?t:S;var O=Wf(b,y,t,t,t,t,t,S);return O.placeholder=UQ.placeholder,O}function jQ(b,S,T){S=T?t:S;var O=Wf(b,w,t,t,t,t,t,S);return O.placeholder=jQ.placeholder,O}function KQ(b,S,T){var O,q,ne,ge,we,Re,dt=0,ut=!1,vt=!1,Ht=!0;if(typeof b!="function")throw new td(s);S=sd(S)||0,ur(T)&&(ut=!!T.leading,vt="maxWait"in T,ne=vt?hs(sd(T.maxWait)||0,S):ne,Ht="trailing"in T?!!T.trailing:Ht);function dn(Rr){var eu=O,Uf=q;return O=q=t,dt=Rr,ge=b.apply(Uf,eu),ge}function Fn(Rr){return dt=Rr,we=nx(yi,S),ut?dn(Rr):ge}function ui(Rr){var eu=Rr-Re,Uf=Rr-dt,uJ=S-eu;return vt?ya(uJ,ne-Uf):uJ}function Bn(Rr){var eu=Rr-Re,Uf=Rr-dt;return Re===t||eu>=S||eu<0||vt&&Uf>=ne}function yi(){var Rr=hN();if(Bn(Rr))return Ni(Rr);we=nx(yi,ui(Rr))}function Ni(Rr){return we=t,Ht&&O?dn(Rr):(O=q=t,ge)}function dc(){we!==t&&nQ(we),dt=0,O=Re=q=we=t}function qa(){return we===t?ge:Ni(hN())}function uc(){var Rr=hN(),eu=Bn(Rr);if(O=arguments,q=this,Re=Rr,eu){if(we===t)return Fn(Re);if(vt)return nQ(we),we=nx(yi,S),dn(Re)}return we===t&&(we=nx(yi,S)),ge}return uc.cancel=dc,uc.flush=qa,uc}var qke=pi(function(b,S){return PZ(b,1,S)}),Gke=pi(function(b,S,T){return PZ(b,sd(S)||0,T)});function Xke(b){return Wf(b,k)}function fN(b,S){if(typeof b!="function"||S!=null&&typeof S!="function")throw new td(s);var T=function(){var O=arguments,q=S?S.apply(this,O):O[0],ne=T.cache;if(ne.has(q))return ne.get(q);var ge=b.apply(this,O);return T.cache=ne.set(q,ge)||ne,ge};return T.cache=new(fN.Cache||Ff),T}fN.Cache=Ff;function gN(b){if(typeof b!="function")throw new td(s);return function(){var S=arguments;switch(S.length){case 0:return!b.call(this);case 1:return!b.call(this,S[0]);case 2:return!b.call(this,S[0],S[1]);case 3:return!b.call(this,S[0],S[1],S[2])}return!b.apply(this,S)}}function Yke(b){return $Q(2,b)}var Zke=FEe(function(b,S){S=S.length==1&&ni(S[0])?ir(S[0],ac(Pn())):ir(js(S,1),ac(Pn()));var T=S.length;return pi(function(O){for(var q=-1,ne=ya(O.length,T);++q=S}),v_=VZ(function(){return arguments}())?VZ:function(b){return br(b)&&co.call(b,"callee")&&!EZ.call(b,"callee")},ni=qe.isArray,hIe=aZ?ac(aZ):CEe;function yl(b){return b!=null&&pN(b.length)&&!$f(b)}function Nr(b){return br(b)&&yl(b)}function fIe(b){return b===!0||b===!1||br(b)&&ja(b)==Se}var Ap=DLe||l8,gIe=lZ?ac(lZ):yEe;function pIe(b){return br(b)&&b.nodeType===1&&!ix(b)}function mIe(b){if(b==null)return!0;if(yl(b)&&(ni(b)||typeof b=="string"||typeof b.splice=="function"||Ap(b)||C1(b)||v_(b)))return!b.length;var S=wa(b);if(S==xe||S==ie)return!b.size;if(tx(b))return!E3(b).length;for(var T in b)if(co.call(b,T))return!1;return!0}function vIe(b,S){return QS(b,S)}function _Ie(b,S,T){T=typeof T=="function"?T:t;var O=T?T(b,S):t;return O===t?QS(b,S,t,T):!!O}function Q3(b){if(!br(b))return!1;var S=ja(b);return S==ce||S==De||typeof b.message=="string"&&typeof b.name=="string"&&!ix(b)}function bIe(b){return typeof b=="number"&&kZ(b)}function $f(b){if(!ur(b))return!1;var S=ja(b);return S==Pe||S==Oe||S==be||S==Ge}function GQ(b){return typeof b=="number"&&b==ai(b)}function pN(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=$}function ur(b){var S=typeof b;return b!=null&&(S=="object"||S=="function")}function br(b){return b!=null&&typeof b=="object"}var XQ=cZ?ac(cZ):SEe;function CIe(b,S){return b===S||L3(b,S,$3(S))}function yIe(b,S,T){return T=typeof T=="function"?T:t,L3(b,S,$3(S),T)}function wIe(b){return YQ(b)&&b!=+b}function SIe(b){if(sDe(b))throw new ei(r);return HZ(b)}function xIe(b){return b===null}function LIe(b){return b==null}function YQ(b){return typeof b=="number"||br(b)&&ja(b)==Ee}function ix(b){if(!br(b)||ja(b)!=nt)return!1;var S=$T(b);if(S===null)return!0;var T=co.call(S,"constructor")&&S.constructor;return typeof T=="function"&&T instanceof T&&BT.call(T)==yLe}var J3=dZ?ac(dZ):xEe;function EIe(b){return GQ(b)&&b>=-$&&b<=$}var ZQ=uZ?ac(uZ):LEe;function mN(b){return typeof b=="string"||!ni(b)&&br(b)&&ja(b)==se}function cc(b){return typeof b=="symbol"||br(b)&&ja(b)==U}var C1=hZ?ac(hZ):EEe;function DIe(b){return b===t}function kIe(b){return br(b)&&wa(b)==oe}function IIe(b){return br(b)&&ja(b)==te}var TIe=sN(D3),NIe=sN(function(b,S){return b<=S});function QQ(b){if(!b)return[];if(yl(b))return mN(b)?Zd(b):Cl(b);if(US&&b[US])return cLe(b[US]());var S=wa(b),T=S==xe?g3:S==ie?PT:y1;return T(b)}function zf(b){if(!b)return b===0?b:0;if(b=sd(b),b===F||b===-F){var S=b<0?-1:1;return S*z}return b===b?b:0}function ai(b){var S=zf(b),T=S%1;return S===S?T?S-T:S:0}function JQ(b){return b?f_(ai(b),0,j):0}function sd(b){if(typeof b=="number")return b;if(cc(b))return K;if(ur(b)){var S=typeof b.valueOf=="function"?b.valueOf():b;b=ur(S)?S+"":S}if(typeof b!="string")return b===0?b:+b;b=_Z(b);var T=Ve.test(b);return T||Sn.test(b)?Kxe(b.slice(2),T?2:8):de.test(b)?K:+b}function eJ(b){return gh(b,wl(b))}function RIe(b){return b?f_(ai(b),-$,$):b===0?b:0}function io(b){return b==null?"":lc(b)}var MIe=v1(function(b,S){if(tx(S)||yl(S)){gh(S,Ns(S),b);return}for(var T in S)co.call(S,T)&&XS(b,T,S[T])}),tJ=v1(function(b,S){gh(S,wl(S),b)}),vN=v1(function(b,S,T,O){gh(S,wl(S),b,O)}),AIe=v1(function(b,S,T,O){gh(S,Ns(S),b,O)}),PIe=Vf(C3);function OIe(b,S){var T=m1(b);return S==null?T:MZ(T,S)}var FIe=pi(function(b,S){b=Do(b);var T=-1,O=S.length,q=O>2?S[2]:t;for(q&&Ka(S[0],S[1],q)&&(O=1);++T1),ne}),gh(b,V3(b),T),O&&(T=id(T,u|h|f,GEe));for(var q=S.length;q--;)R3(T,S[q]);return T});function tTe(b,S){return iJ(b,gN(Pn(S)))}var nTe=Vf(function(b,S){return b==null?{}:IEe(b,S)});function iJ(b,S){if(b==null)return{};var T=ir(V3(b),function(O){return[O]});return S=Pn(S),GZ(b,T,function(O,q){return S(O,q[0])})}function iTe(b,S,T){S=Rp(S,b);var O=-1,q=S.length;for(q||(q=1,b=t);++OS){var O=b;b=S,S=O}if(T||b%1||S%1){var q=IZ();return ya(b+q*(S-b+jxe("1e-"+((q+"").length-1))),S)}return I3(b,S)}var gTe=_1(function(b,S,T){return S=S.toLowerCase(),b+(T?sJ(S):S)});function sJ(b){return n8(io(b).toLowerCase())}function aJ(b){return b=io(b),b&&b.replace(Ci,oLe).replace(tr,"")}function pTe(b,S,T){b=io(b),S=lc(S);var O=b.length;T=T===t?O:f_(ai(T),0,O);var q=T;return T-=S.length,T>=0&&b.slice(T,q)==S}function mTe(b){return b=io(b),b&&bn.test(b)?b.replace(cn,rLe):b}function vTe(b){return b=io(b),b&&Ct.test(b)?b.replace(Ft,"\\$&"):b}var _Te=_1(function(b,S,T){return b+(T?"-":"")+S.toLowerCase()}),bTe=_1(function(b,S,T){return b+(T?" ":"")+S.toLowerCase()}),CTe=dQ("toLowerCase");function yTe(b,S,T){b=io(b),S=ai(S);var O=S?u1(b):0;if(!S||O>=S)return b;var q=(S-O)/2;return rN(KT(q),T)+b+rN(jT(q),T)}function wTe(b,S,T){b=io(b),S=ai(S);var O=S?u1(b):0;return S&&O>>0,T?(b=io(b),b&&(typeof S=="string"||S!=null&&!J3(S))&&(S=lc(S),!S&&d1(b))?Mp(Zd(b),0,T):b.split(S,T)):[]}var ITe=_1(function(b,S,T){return b+(T?" ":"")+n8(S)});function TTe(b,S,T){return b=io(b),T=T==null?0:f_(ai(T),0,b.length),S=lc(S),b.slice(T,T+S.length)==S}function NTe(b,S,T){var O=ee.templateSettings;T&&Ka(b,S,T)&&(S=t),b=io(b),S=vN({},S,O,vQ);var q=vN({},S.imports,O.imports,vQ),ne=Ns(q),ge=f3(q,ne),we,Re,dt=0,ut=S.interpolate||An,vt="__p += '",Ht=p3((S.escape||An).source+"|"+ut.source+"|"+(ut===Nt?oi:An).source+"|"+(S.evaluate||An).source+"|$","g"),dn="//# sourceURL="+(co.call(S,"sourceURL")?(S.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++l1+"]")+` +`)}function iDe(b){return ni(b)||v_(b)||!!(kZ&&b&&b[kZ])}function Hf(b,S){var T=typeof b;return S=S==null?$:S,!!S&&(T=="number"||T!="symbol"&&$n.test(b))&&b>-1&&b%1==0&&b0){if(++S>=P)return arguments[0]}else S=0;return b.apply(t,arguments)}}function cN(b,S){var T=-1,O=b.length,q=O-1;for(S=S===t?O:S;++T1?b[S-1]:t;return T=typeof T=="function"?(b.pop(),T):t,BQ(b,T)});function WQ(b){var S=ee(b);return S.__chain__=!0,S}function gke(b,S){return S(b),b}function dN(b,S){return S(b)}var pke=Vf(function(b){var S=b.length,T=S?b[0]:0,O=this.__wrapped__,q=function(ne){return y3(ne,b)};return S>1||this.__actions__.length||!(O instanceof Li)||!Hf(T)?this.thru(q):(O=O.slice(T,+T+(S?1:0)),O.__actions__.push({func:dN,args:[q],thisArg:t}),new nd(O,this.__chain__).thru(function(ne){return S&&!ne.length&&ne.push(t),ne}))});function mke(){return WQ(this)}function vke(){return new nd(this.value(),this.__chain__)}function _ke(){this.__values__===t&&(this.__values__=JQ(this.value()));var b=this.__index__>=this.__values__.length,S=b?t:this.__values__[this.__index__++];return{done:b,value:S}}function bke(){return this}function Cke(b){for(var S,T=this;T instanceof XT;){var O=RQ(T);O.__index__=0,O.__values__=t,S?q.__wrapped__=O:S=O;var q=O;T=T.__wrapped__}return q.__wrapped__=b,S}function yke(){var b=this.__wrapped__;if(b instanceof Li){var S=b;return this.__actions__.length&&(S=new Li(this)),S=S.reverse(),S.__actions__.push({func:dN,args:[X3],thisArg:t}),new nd(S,this.__chain__)}return this.thru(X3)}function wke(){return tQ(this.__wrapped__,this.__actions__)}var Ske=nN(function(b,S,T){co.call(b,T)?++b[T]:Bf(b,T,1)});function xke(b,S,T){var O=ni(b)?gZ:gEe;return T&&Ka(b,S,T)&&(S=t),O(b,Pn(S,3))}function Lke(b,S){var T=ni(b)?Dp:BZ;return T(b,Pn(S,3))}var Eke=hQ(MQ),Dke=hQ(AQ);function kke(b,S){return js(uN(b,S),1)}function Ike(b,S){return js(uN(b,S),F)}function Tke(b,S,T){return T=T===t?1:ai(T),js(uN(b,S),T)}function VQ(b,S){var T=ni(b)?ed:Np;return T(b,Pn(S,3))}function HQ(b,S){var T=ni(b)?Xxe:FZ;return T(b,Pn(S,3))}var Nke=nN(function(b,S,T){co.call(b,T)?b[T].push(S):Bf(b,T,[S])});function Rke(b,S,T,O){b=yl(b)?b:y1(b),T=T&&!O?ai(T):0;var q=b.length;return T<0&&(T=hs(q+T,0)),mN(b)?T<=q&&b.indexOf(S,T)>-1:!!q&&c1(b,S,T)>-1}var Mke=pi(function(b,S,T){var O=-1,q=typeof S=="function",ne=yl(b)?qe(b.length):[];return Np(b,function(ge){ne[++O]=q?sc(S,ge,T):ZS(ge,S,T)}),ne}),Ake=nN(function(b,S,T){Bf(b,T,S)});function uN(b,S){var T=ni(b)?ir:UZ;return T(b,Pn(S,3))}function Pke(b,S,T,O){return b==null?[]:(ni(S)||(S=S==null?[]:[S]),T=O?t:T,ni(T)||(T=T==null?[]:[T]),GZ(b,S,T))}var Oke=nN(function(b,S,T){b[T?0:1].push(S)},function(){return[[],[]]});function Fke(b,S,T){var O=ni(b)?l3:_Z,q=arguments.length<3;return O(b,Pn(S,4),T,q,Np)}function Bke(b,S,T){var O=ni(b)?Yxe:_Z,q=arguments.length<3;return O(b,Pn(S,4),T,q,FZ)}function Wke(b,S){var T=ni(b)?Dp:BZ;return T(b,gN(Pn(S,3)))}function Vke(b){var S=ni(b)?MZ:REe;return S(b)}function Hke(b,S,T){(T?Ka(b,S,T):S===t)?S=1:S=ai(S);var O=ni(b)?cEe:MEe;return O(b,S)}function $ke(b){var S=ni(b)?dEe:PEe;return S(b)}function zke(b){if(b==null)return 0;if(yl(b))return mN(b)?u1(b):b.length;var S=wa(b);return S==xe||S==ie?b.size:D3(b).length}function Uke(b,S,T){var O=ni(b)?c3:OEe;return T&&Ka(b,S,T)&&(S=t),O(b,Pn(S,3))}var jke=pi(function(b,S){if(b==null)return[];var T=S.length;return T>1&&Ka(b,S[0],S[1])?S=[]:T>2&&Ka(S[0],S[1],S[2])&&(S=[S[0]]),GZ(b,js(S,1),[])}),hN=LLe||function(){return Us.Date.now()};function Kke(b,S){if(typeof S!="function")throw new td(s);return b=ai(b),function(){if(--b<1)return S.apply(this,arguments)}}function $Q(b,S,T){return S=T?t:S,S=b&&S==null?b.length:S,Wf(b,E,t,t,t,t,S)}function zQ(b,S){var T;if(typeof S!="function")throw new td(s);return b=ai(b),function(){return--b>0&&(T=S.apply(this,arguments)),b<=1&&(S=t),T}}var Z3=pi(function(b,S,T){var O=v;if(T.length){var q=Ip(T,b1(Z3));O|=L}return Wf(b,O,S,T,q)}),UQ=pi(function(b,S,T){var O=v|m;if(T.length){var q=Ip(T,b1(UQ));O|=L}return Wf(S,O,b,T,q)});function jQ(b,S,T){S=T?t:S;var O=Wf(b,y,t,t,t,t,t,S);return O.placeholder=jQ.placeholder,O}function KQ(b,S,T){S=T?t:S;var O=Wf(b,w,t,t,t,t,t,S);return O.placeholder=KQ.placeholder,O}function qQ(b,S,T){var O,q,ne,ge,we,Re,dt=0,ut=!1,vt=!1,Ht=!0;if(typeof b!="function")throw new td(s);S=sd(S)||0,ur(T)&&(ut=!!T.leading,vt="maxWait"in T,ne=vt?hs(sd(T.maxWait)||0,S):ne,Ht="trailing"in T?!!T.trailing:Ht);function dn(Rr){var eu=O,Uf=q;return O=q=t,dt=Rr,ge=b.apply(Uf,eu),ge}function Fn(Rr){return dt=Rr,we=nx(yi,S),ut?dn(Rr):ge}function ui(Rr){var eu=Rr-Re,Uf=Rr-dt,hJ=S-eu;return vt?ya(hJ,ne-Uf):hJ}function Bn(Rr){var eu=Rr-Re,Uf=Rr-dt;return Re===t||eu>=S||eu<0||vt&&Uf>=ne}function yi(){var Rr=hN();if(Bn(Rr))return Ni(Rr);we=nx(yi,ui(Rr))}function Ni(Rr){return we=t,Ht&&O?dn(Rr):(O=q=t,ge)}function dc(){we!==t&&iQ(we),dt=0,O=Re=q=we=t}function qa(){return we===t?ge:Ni(hN())}function uc(){var Rr=hN(),eu=Bn(Rr);if(O=arguments,q=this,Re=Rr,eu){if(we===t)return Fn(Re);if(vt)return iQ(we),we=nx(yi,S),dn(Re)}return we===t&&(we=nx(yi,S)),ge}return uc.cancel=dc,uc.flush=qa,uc}var qke=pi(function(b,S){return OZ(b,1,S)}),Gke=pi(function(b,S,T){return OZ(b,sd(S)||0,T)});function Xke(b){return Wf(b,k)}function fN(b,S){if(typeof b!="function"||S!=null&&typeof S!="function")throw new td(s);var T=function(){var O=arguments,q=S?S.apply(this,O):O[0],ne=T.cache;if(ne.has(q))return ne.get(q);var ge=b.apply(this,O);return T.cache=ne.set(q,ge)||ne,ge};return T.cache=new(fN.Cache||Ff),T}fN.Cache=Ff;function gN(b){if(typeof b!="function")throw new td(s);return function(){var S=arguments;switch(S.length){case 0:return!b.call(this);case 1:return!b.call(this,S[0]);case 2:return!b.call(this,S[0],S[1]);case 3:return!b.call(this,S[0],S[1],S[2])}return!b.apply(this,S)}}function Yke(b){return zQ(2,b)}var Zke=FEe(function(b,S){S=S.length==1&&ni(S[0])?ir(S[0],ac(Pn())):ir(js(S,1),ac(Pn()));var T=S.length;return pi(function(O){for(var q=-1,ne=ya(O.length,T);++q=S}),v_=HZ(function(){return arguments}())?HZ:function(b){return br(b)&&co.call(b,"callee")&&!DZ.call(b,"callee")},ni=qe.isArray,hIe=lZ?ac(lZ):CEe;function yl(b){return b!=null&&pN(b.length)&&!$f(b)}function Nr(b){return br(b)&&yl(b)}function fIe(b){return b===!0||b===!1||br(b)&&ja(b)==Se}var Pp=DLe||c8,gIe=cZ?ac(cZ):yEe;function pIe(b){return br(b)&&b.nodeType===1&&!ix(b)}function mIe(b){if(b==null)return!0;if(yl(b)&&(ni(b)||typeof b=="string"||typeof b.splice=="function"||Pp(b)||C1(b)||v_(b)))return!b.length;var S=wa(b);if(S==xe||S==ie)return!b.size;if(tx(b))return!D3(b).length;for(var T in b)if(co.call(b,T))return!1;return!0}function vIe(b,S){return QS(b,S)}function _Ie(b,S,T){T=typeof T=="function"?T:t;var O=T?T(b,S):t;return O===t?QS(b,S,t,T):!!O}function J3(b){if(!br(b))return!1;var S=ja(b);return S==ce||S==De||typeof b.message=="string"&&typeof b.name=="string"&&!ix(b)}function bIe(b){return typeof b=="number"&&IZ(b)}function $f(b){if(!ur(b))return!1;var S=ja(b);return S==Pe||S==Oe||S==be||S==Ge}function XQ(b){return typeof b=="number"&&b==ai(b)}function pN(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=$}function ur(b){var S=typeof b;return b!=null&&(S=="object"||S=="function")}function br(b){return b!=null&&typeof b=="object"}var YQ=dZ?ac(dZ):SEe;function CIe(b,S){return b===S||E3(b,S,z3(S))}function yIe(b,S,T){return T=typeof T=="function"?T:t,E3(b,S,z3(S),T)}function wIe(b){return ZQ(b)&&b!=+b}function SIe(b){if(sDe(b))throw new ei(r);return $Z(b)}function xIe(b){return b===null}function LIe(b){return b==null}function ZQ(b){return typeof b=="number"||br(b)&&ja(b)==Ee}function ix(b){if(!br(b)||ja(b)!=nt)return!1;var S=$T(b);if(S===null)return!0;var T=co.call(S,"constructor")&&S.constructor;return typeof T=="function"&&T instanceof T&&BT.call(T)==yLe}var e8=uZ?ac(uZ):xEe;function EIe(b){return XQ(b)&&b>=-$&&b<=$}var QQ=hZ?ac(hZ):LEe;function mN(b){return typeof b=="string"||!ni(b)&&br(b)&&ja(b)==se}function cc(b){return typeof b=="symbol"||br(b)&&ja(b)==U}var C1=fZ?ac(fZ):EEe;function DIe(b){return b===t}function kIe(b){return br(b)&&wa(b)==oe}function IIe(b){return br(b)&&ja(b)==te}var TIe=sN(k3),NIe=sN(function(b,S){return b<=S});function JQ(b){if(!b)return[];if(yl(b))return mN(b)?Zd(b):Cl(b);if(US&&b[US])return cLe(b[US]());var S=wa(b),T=S==xe?p3:S==ie?PT:y1;return T(b)}function zf(b){if(!b)return b===0?b:0;if(b=sd(b),b===F||b===-F){var S=b<0?-1:1;return S*z}return b===b?b:0}function ai(b){var S=zf(b),T=S%1;return S===S?T?S-T:S:0}function eJ(b){return b?f_(ai(b),0,j):0}function sd(b){if(typeof b=="number")return b;if(cc(b))return K;if(ur(b)){var S=typeof b.valueOf=="function"?b.valueOf():b;b=ur(S)?S+"":S}if(typeof b!="string")return b===0?b:+b;b=bZ(b);var T=Ve.test(b);return T||Sn.test(b)?Kxe(b.slice(2),T?2:8):de.test(b)?K:+b}function tJ(b){return gh(b,wl(b))}function RIe(b){return b?f_(ai(b),-$,$):b===0?b:0}function io(b){return b==null?"":lc(b)}var MIe=v1(function(b,S){if(tx(S)||yl(S)){gh(S,Ns(S),b);return}for(var T in S)co.call(S,T)&&XS(b,T,S[T])}),nJ=v1(function(b,S){gh(S,wl(S),b)}),vN=v1(function(b,S,T,O){gh(S,wl(S),b,O)}),AIe=v1(function(b,S,T,O){gh(S,Ns(S),b,O)}),PIe=Vf(y3);function OIe(b,S){var T=m1(b);return S==null?T:AZ(T,S)}var FIe=pi(function(b,S){b=Do(b);var T=-1,O=S.length,q=O>2?S[2]:t;for(q&&Ka(S[0],S[1],q)&&(O=1);++T1),ne}),gh(b,H3(b),T),O&&(T=id(T,u|h|f,GEe));for(var q=S.length;q--;)M3(T,S[q]);return T});function tTe(b,S){return oJ(b,gN(Pn(S)))}var nTe=Vf(function(b,S){return b==null?{}:IEe(b,S)});function oJ(b,S){if(b==null)return{};var T=ir(H3(b),function(O){return[O]});return S=Pn(S),XZ(b,T,function(O,q){return S(O,q[0])})}function iTe(b,S,T){S=Mp(S,b);var O=-1,q=S.length;for(q||(q=1,b=t);++OS){var O=b;b=S,S=O}if(T||b%1||S%1){var q=TZ();return ya(b+q*(S-b+jxe("1e-"+((q+"").length-1))),S)}return T3(b,S)}var gTe=_1(function(b,S,T){return S=S.toLowerCase(),b+(T?aJ(S):S)});function aJ(b){return i8(io(b).toLowerCase())}function lJ(b){return b=io(b),b&&b.replace(Ci,oLe).replace(tr,"")}function pTe(b,S,T){b=io(b),S=lc(S);var O=b.length;T=T===t?O:f_(ai(T),0,O);var q=T;return T-=S.length,T>=0&&b.slice(T,q)==S}function mTe(b){return b=io(b),b&&bn.test(b)?b.replace(cn,rLe):b}function vTe(b){return b=io(b),b&&Ct.test(b)?b.replace(Ft,"\\$&"):b}var _Te=_1(function(b,S,T){return b+(T?"-":"")+S.toLowerCase()}),bTe=_1(function(b,S,T){return b+(T?" ":"")+S.toLowerCase()}),CTe=uQ("toLowerCase");function yTe(b,S,T){b=io(b),S=ai(S);var O=S?u1(b):0;if(!S||O>=S)return b;var q=(S-O)/2;return rN(KT(q),T)+b+rN(jT(q),T)}function wTe(b,S,T){b=io(b),S=ai(S);var O=S?u1(b):0;return S&&O>>0,T?(b=io(b),b&&(typeof S=="string"||S!=null&&!e8(S))&&(S=lc(S),!S&&d1(b))?Ap(Zd(b),0,T):b.split(S,T)):[]}var ITe=_1(function(b,S,T){return b+(T?" ":"")+i8(S)});function TTe(b,S,T){return b=io(b),T=T==null?0:f_(ai(T),0,b.length),S=lc(S),b.slice(T,T+S.length)==S}function NTe(b,S,T){var O=ee.templateSettings;T&&Ka(b,S,T)&&(S=t),b=io(b),S=vN({},S,O,_Q);var q=vN({},S.imports,O.imports,_Q),ne=Ns(q),ge=g3(q,ne),we,Re,dt=0,ut=S.interpolate||An,vt="__p += '",Ht=m3((S.escape||An).source+"|"+ut.source+"|"+(ut===Nt?oi:An).source+"|"+(S.evaluate||An).source+"|$","g"),dn="//# sourceURL="+(co.call(S,"sourceURL")?(S.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++l1+"]")+` `;b.replace(Ht,function(Bn,yi,Ni,dc,qa,uc){return Ni||(Ni=dc),vt+=b.slice(dt,uc).replace(lo,sLe),yi&&(we=!0,vt+=`' + __e(`+yi+`) + '`),qa&&(Re=!0,vt+=`'; @@ -327,14 +327,14 @@ __p += '`),Ni&&(vt+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+vt+`return __p -}`;var ui=cJ(function(){return Ji(ne,dn+"return "+vt).apply(t,ge)});if(ui.source=vt,Q3(ui))throw ui;return ui}function RTe(b){return io(b).toLowerCase()}function MTe(b){return io(b).toUpperCase()}function ATe(b,S,T){if(b=io(b),b&&(T||S===t))return _Z(b);if(!b||!(S=lc(S)))return b;var O=Zd(b),q=Zd(S),ne=bZ(O,q),ge=CZ(O,q)+1;return Mp(O,ne,ge).join("")}function PTe(b,S,T){if(b=io(b),b&&(T||S===t))return b.slice(0,wZ(b)+1);if(!b||!(S=lc(S)))return b;var O=Zd(b),q=CZ(O,Zd(S))+1;return Mp(O,0,q).join("")}function OTe(b,S,T){if(b=io(b),b&&(T||S===t))return b.replace(Zt,"");if(!b||!(S=lc(S)))return b;var O=Zd(b),q=bZ(O,Zd(S));return Mp(O,q).join("")}function FTe(b,S){var T=R,O=A;if(ur(S)){var q="separator"in S?S.separator:q;T="length"in S?ai(S.length):T,O="omission"in S?lc(S.omission):O}b=io(b);var ne=b.length;if(d1(b)){var ge=Zd(b);ne=ge.length}if(T>=ne)return b;var we=T-u1(O);if(we<1)return O;var Re=ge?Mp(ge,0,we).join(""):b.slice(0,we);if(q===t)return Re+O;if(ge&&(we+=Re.length-we),J3(q)){if(b.slice(we).search(q)){var dt,ut=Re;for(q.global||(q=p3(q.source,io(Ze.exec(q))+"g")),q.lastIndex=0;dt=q.exec(ut);)var vt=dt.index;Re=Re.slice(0,vt===t?we:vt)}}else if(b.indexOf(lc(q),we)!=we){var Ht=Re.lastIndexOf(q);Ht>-1&&(Re=Re.slice(0,Ht))}return Re+O}function BTe(b){return b=io(b),b&&Gn.test(b)?b.replace(di,fLe):b}var WTe=_1(function(b,S,T){return b+(T?" ":"")+S.toUpperCase()}),n8=dQ("toUpperCase");function lJ(b,S,T){return b=io(b),S=T?t:S,S===t?lLe(b)?mLe(b):Jxe(b):b.match(S)||[]}var cJ=pi(function(b,S){try{return sc(b,t,S)}catch(T){return Q3(T)?T:new ei(T)}}),VTe=Vf(function(b,S){return ed(S,function(T){T=ph(T),Bf(b,T,Y3(b[T],b))}),b});function HTe(b){var S=b==null?0:b.length,T=Pn();return b=S?ir(b,function(O){if(typeof O[1]!="function")throw new td(s);return[T(O[0]),O[1]]}):[],pi(function(O){for(var q=-1;++q$)return[];var T=j,O=ya(b,j);S=Pn(S),b-=j;for(var q=h3(O,S);++T0||S<0)?new Li(T):(b<0?T=T.takeRight(-b):b&&(T=T.drop(b)),S!==t&&(S=ai(S),T=S<0?T.dropRight(-S):T.take(S-b)),T)},Li.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},Li.prototype.toArray=function(){return this.take(j)},fh(Li.prototype,function(b,S){var T=/^(?:filter|find|map|reject)|While$/.test(S),O=/^(?:head|last)$/.test(S),q=ee[O?"take"+(S=="last"?"Right":""):S],ne=O||/^find/.test(S);!q||(ee.prototype[S]=function(){var ge=this.__wrapped__,we=O?[1]:arguments,Re=ge instanceof Li,dt=we[0],ut=Re||ni(ge),vt=function(yi){var Ni=q.apply(ee,Dp([yi],we));return O&&Ht?Ni[0]:Ni};ut&&T&&typeof dt=="function"&&dt.length!=1&&(Re=ut=!1);var Ht=this.__chain__,dn=!!this.__actions__.length,Fn=ne&&!Ht,ui=Re&&!dn;if(!ne&&ut){ge=ui?ge:new Li(this);var Bn=b.apply(ge,we);return Bn.__actions__.push({func:dN,args:[vt],thisArg:t}),new nd(Bn,Ht)}return Fn&&ui?b.apply(this,we):(Bn=this.thru(vt),Fn?O?Bn.value()[0]:Bn.value():Bn)})}),ed(["pop","push","shift","sort","splice","unshift"],function(b){var S=OT[b],T=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",O=/^(?:pop|shift)$/.test(b);ee.prototype[b]=function(){var q=arguments;if(O&&!this.__chain__){var ne=this.value();return S.apply(ni(ne)?ne:[],q)}return this[T](function(ge){return S.apply(ni(ge)?ge:[],q)})}}),fh(Li.prototype,function(b,S){var T=ee[S];if(T){var O=T.name+"";co.call(p1,O)||(p1[O]=[]),p1[O].push({name:S,func:T})}}),p1[iN(t,m).name]=[{name:"wrapper",func:t}],Li.prototype.clone=BLe,Li.prototype.reverse=WLe,Li.prototype.value=VLe,ee.prototype.at=pke,ee.prototype.chain=mke,ee.prototype.commit=vke,ee.prototype.next=_ke,ee.prototype.plant=Cke,ee.prototype.reverse=yke,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=wke,ee.prototype.first=ee.prototype.head,US&&(ee.prototype[US]=bke),ee},h1=vLe();c_?((c_.exports=h1)._=h1,o3._=h1):Us._=h1}).call(rx)})(Cc,Cc.exports);class mp{constructor(e){bt(this,"defaultOperatorData");bt(this,"isUnique");bt(this,"nodeColor");bt(this,"description");bt(this,"isCustom");this.defaultOperatorData=e}get operatorType(){var e;return(e=this.defaultOperatorData)==null?void 0:e.operatorType}get operatorName(){var e;return((e=this.defaultOperatorData)==null?void 0:e.operatorName)||this.operatorType}create(e,t){return{position:{x:0,y:0},...t,id:(t==null?void 0:t.id)||lge(),type:this.defaultOperatorData.nodeType,data:{...this.defaultOperatorData,...t==null?void 0:t.data,...e,operatorName:this.defaultOperatorData.operatorName,operatorType:this.defaultOperatorData.operatorType,nodeType:this.defaultOperatorData.nodeType,nodeOptions:this.defaultOperatorData.nodeOptions}}}updateNodeMeta(e,t){return{...e,...t,...Cc.exports.pick(e,"id","data")}}updateData(e,t){const n=["nodeOptions","nodeType","operatorName","operatorType"];return{...e,data:{...e.data,...t,...Cc.exports.pick(e.data,...n)}}}updateNodeOptions(e,t){var n;return{...e,data:{...e==null?void 0:e.data,nodeOptions:{...(n=e==null?void 0:e.data)==null?void 0:n.nodeOptions,...t}}}}getExtraAppContainers(e){return[]}getIgnoreDegreeIds(e){return[]}onAfterCreate(e){}onNodeFocus(e){}onNodeDoubleClick(e){}onLayerChange(e){}generateAttributeControl(e){const{node:t,actions:n}=e;function o(r){t.data.nodeLabel=r,n.updateNode(t.id,t)}return he(ks,{children:he(dw,{placeholder:"input label",style:{width:"100%",maxWidth:"none"},value:t.data.nodeLabel,onChange:r=>{o(r.target.value)}})})}getNodeProps(e){return{}}renderCustomLabel(e){return null}}var oh=(i=>(i.Node="Node",i))(oh||{});class ri{constructor(e){bt(this,"id");bt(this,"type");bt(this,"variableName");bt(this,"label");bt(this,"hint");bt(this,"isConnectable");bt(this,"children");bt(this,"allowRemove");bt(this,"allowAddAndRemoveChildren");bt(this,"variableType");bt(this,"defaultChildData");bt(this,"ignoreDegree");Object.assign(this,e),this.id||(this.id=SI()),this.variableName||(this.variableName=ri.generateVariableName(this.hint)),this.type||(this.type="unknown")}static generateVariableName(e){return`${e||"var"}_${Math.random().toString(36).slice(2,7)}`}static createFromGroup(e){return new ri({hint:e.hint,...e==null?void 0:e.defaultChildData})}}var qs=(i=>(i.String="string",i.Number="number",i.Boolean="boolean",i.Object="object",i))(qs||{});class Qve{constructor(){bt(this,"listenerMap",new Map)}on(e,t){const n=this.listenerMap.get(e);n?n.add(t):this.listenerMap.set(e,new Set([t]))}off(e,t){const n=this.listenerMap.get(e);n!=null&&n.has(t)&&n.delete(t)}emit(e,t){const n=this.listenerMap.get(e);if(n)for(const o of n==null?void 0:n.values())o(t)}}class RGe{constructor(e){bt(this,"node");this.node=e}getLastChild(){let e=this.node.next;for(;e!=null&&e.nextSibling;)e=e.nextSibling;return e}addNextChildren(...e){const[t]=e;let n=t;t.return=this.node;for(let r=1;r<(e==null?void 0:e.length);r++){const s=e[r];n.nextSibling=s,n=s,s.return=this.node}const o=this.getLastChild();o?o.nextSibling=t:this.node.next=t}removeChild(e){const t=this.node.next;if(t===e)return this.node.next=t.nextSibling,!0;for(;t!=null&&t.nextSibling;)if(t.nextSibling===e)return t.nextSibling=t.nextSibling.nextSibling,!0;return!1}*children(){let e=this.node.next;for(;e;)yield e,e=e.nextSibling}preAction(e,t){let n=e;e:for(;n&&n!==e.return;)if(t(n),n.next)n=n.next;else if(n.nextSibling&&n!==e)n=n.nextSibling;else{for(n=n.return;n&&n!==e;){if(n.nextSibling){n=n.nextSibling;continue e}n=n==null?void 0:n.return}break}}postAction(e,t){let n=e;for(;n.next;)n=n==null?void 0:n.next;for(;n&&n!==e.return;){if(t(n),n.nextSibling&&n!==e){for(n=n.nextSibling;n.next;)n=n==null?void 0:n.next;continue}n=n.return}}action(e,t,n){e==="pre"?this.preAction(t,n):e==="post"?this.postAction(t,n):console.log("unknow type",e)}}class Nq{constructor(e){bt(this,"uid");this.uid=e||SI()}}class MGe extends Nq{constructor(t){super();bt(this,"template");bt(this,"output");bt(this,"input");const{template:n,input:o}=t;this.template=n,this.input=o||{}}get name(){var t,n;return((t=this.template.meta)==null?void 0:t.name)||((n=this.template)==null?void 0:n.name)}log(t){console.log(`[ModelBlock ${this.name} - ${this.uid}]: ${t}`)}}var ag;(function(i){i[i.BeforeInited=0]="BeforeInited",i[i.Initing=1]="Initing",i[i.Done=2]="Done"})(ag||(ag={}));class LD extends MGe{constructor(t){super(t);bt(this,"next",null);bt(this,"nextSibling",null);bt(this,"return",null);bt(this,"eventEmitter",new Qve);bt(this,"status",ag.BeforeInited);bt(this,"pendingChildren",[]);bt(this,"relationHelper");this.relationHelper=new RGe(this)}setNext(t){this.next=t}setNextSibling(t){this.nextSibling=t}setReturn(t){this.return=t!=null?t:null}_getInnerHandler(){return{getContext:this.getContext.bind(this)}}getContext(){return{id:this.uid,onLifecycle:this.onLifecycle.bind(this),mount:this.mountTemplate.bind(this),unmount:this.unmountChild.bind(this)}}onLifecycle(t,n){return this.eventEmitter.on(t,n),{unsubscribe:()=>{this.eventEmitter.off(t,n)}}}childrenAction(t,n,o){this.relationHelper.action(t,o,r=>{var s;(s=r[n])==null||s.call(r)})}mountChildOnly(t){this.relationHelper.addNextChildren(t),this.childrenAction("pre","preInitSelf",t),this.childrenAction("post","postInitSelf",t),this.childrenAction("pre","preMountSelf",t),this.childrenAction("post","postMountSelf",t),this.childrenAction("pre","beforeMountSelf",t),this.childrenAction("post","mountSelf",t)}mountTemplate(t,n){if(t===this.template)throw new Error("can not mount yourself");let o=this.return;for(;o;){if(t===o.template)throw new Error("loop mount!");o=o.return}const r=new LD({template:t,input:n});return this.mountChild(r),r}mountChild(t){console.log("mount::status",this.status),this.status===ag.Done?this.mountChildOnly(t):this.status===ag.Initing?this.pendingChildren.push(t):this.status===ag.BeforeInited&&(t.preInitSelf(),this.relationHelper.addNextChildren(t))}unmountChild(t){t instanceof LD&&(this.relationHelper.removeChild(t),t.unmount())}triggerLifecycle(t){this.eventEmitter.emit(t,void 0)}preInitSelf(){this.log("preInitSelf"),this.status===ag.BeforeInited&&(this.output=this.template(this.input,this.getContext())),this.status=ag.Initing}postInitSelf(){this.log("postInitSelf"),this.triggerLifecycle("postInit")}preMountSelf(){this.log("preMountSelf"),this.triggerLifecycle("preMount")}postMountSelf(){var t;this.log("postMountSelf"),this.triggerLifecycle("postMount"),this.status=ag.Done,(t=this.pendingChildren)!=null&&t.length&&(this.log("pendingChildren"),this.pendingChildren.forEach(n=>{this.mountChildOnly(n)}),this.pendingChildren=[])}beforeMountSelf(){this.log("beforeMountSelf"),this.triggerLifecycle("beforeMount")}mountSelf(){this.log("mountSelf"),this.triggerLifecycle("mount")}preUnmountSelf(){this.log("preUnmountSelf"),this.triggerLifecycle("preUnmount")}postUnmountSelf(){this.log("postUnmountSelf"),this.triggerLifecycle("postUnmount")}beforeUnmountSelf(){this.log("beforeUnmountSelf"),this.triggerLifecycle("beforeUnmount")}unmountSelf(){this.log("unmountSelf"),this.triggerLifecycle("unmount")}preAction(t){this.relationHelper.preAction(this,n=>{var o;(o=n[t])==null||o.call(n)})}postAction(t){this.relationHelper.postAction(this,n=>{var o;(o=n[t])==null||o.call(n)})}mount(){this.preAction("preInitSelf"),this.postAction("postInitSelf"),this.preAction("preMountSelf"),this.postAction("postMountSelf"),this.preAction("beforeMountSelf"),this.postAction("mountSelf")}unmount(){this.preAction("beforeUnmountSelf"),this.postAction("unmountSelf"),this.preAction("preUnmountSelf"),this.postAction("postUnmountSelf")}}var Uy;class AGe{constructor(){Oo(this,Uy,new Set)}add(e){ht(this,Uy).add(e)}unsubscribe(){for(const e of ht(this,Uy).values())e();ht(this,Uy).clear()}}Uy=new WeakMap;var jy;class Jve extends Nq{constructor(){super();Oo(this,jy,new Set);this.subscribe=this.subscribe.bind(this),this.trigger=this.trigger.bind(this)}get current(){throw new Error("need override")}trigger(...t){for(const n of ht(this,jy).values())try{n(...t)}catch(o){setTimeout(()=>{throw o})}}subscribe(t){ht(this,jy).add(t);const n=new AGe;return n.add(()=>{ht(this,jy).delete(t)}),n}pipe(t){return t(this)}}jy=new WeakMap;class PGe extends Qve{track(e){this.emit("track",e)}onTrack(e){this.on("track",e)}}const e_e=new PGe;function t_e(i,e){return typeof e=="function"?e(i):e}class OGe extends Jve{constructor(t){super();bt(this,"_current");this._current=t,this.next=this.next.bind(this)}get current(){return this._current}next(t){const n=t_e(this._current,t.payload);this._current=n,e_e.track({target:this.uid,action:t}),super.trigger(t.concat({payload:n,path:this.uid}))}}class Ou extends OGe{next(e){super.next(e)}}class _v extends Nq{constructor(t){super(t==null?void 0:t.uid);bt(this,"payload");bt(this,"path","");bt(this,"extra");bt(this,"from");Object.assign(this,t)}static create(t,n){const o=new _v(t);return o.from=(o==null?void 0:o.from)||[],n!=null&&n.uid&&(o.from=o.from.concat((n==null?void 0:n.uid)||"")),o.extra="extra"in t?t==null?void 0:t.extra:n==null?void 0:n.extra,o}concat(t){return _v.create(t,this)}}function FGe(i,e){const t=new LD({template:i,input:e});return t.mount(),t}class BGe extends Jve{next(e){super.trigger(e||new _v({payload:void 0,path:"event"}))}}var WGe=Object.freeze(Object.defineProperty({__proto__:null,Action:_v,ModelBlock:LD,ModelEvent:BGe,start:FGe,ModelState:Ou,tracker:e_e},Symbol.toStringTag,{value:"Module"}));function VGe(i){return new Ou(i)}function HGe(i,e){const t=Cc.exports.get(i.current,e);class n extends Ou{get current(){return Cc.exports.get(i.current,e)}next(r){i.next(r.concat({payload:s=>{const a=Cc.exports.get(s,e),l=Cc.exports.clone(s),c=t_e(a,r.payload);return Cc.exports.set(l,e,c),l},path:"ProxyState"}))}subscribe(r){return i.subscribe(s=>r(s.concat({payload:Cc.exports.get(s.payload,e),path:"ProxyState"})))}}return new n(t)}function $Ge(...i){const e=new Ou(0);function t(n,o){e.next(n.concat({payload:i.map(r=>r.current).reduce((r,s)=>r+s,0),path:o}))}return t(new _v({payload:void 0,path:"init"}),"[sum]: init"),i.forEach(n=>{n.subscribe(o=>{t(o,"sum")})}),e}function zGe(i,e){const t=new Ou([]);return i.forEach(n=>{n.subscribe(o=>{const r=[...i,...e].map(s=>s.current);t.next(o.concat({payload:r,path:"combine"}))})}),t}function UGe(i,e){return i.pipe(t=>{const n=new Ou(void 0);return t.subscribe(async o=>{const r=e(o.payload);let s=r;r instanceof Promise&&(s=await r),n.next(o.concat({payload:s,path:"transform"}))}),n})}function jGe(i){const e=new Ou([]);return i.forEach(t=>{t.subscribe(n=>{e.next(n.concat({payload:n.payload,path:"merge"}))})}),e}function KGe(...i){return i.reduce((e,t)=>e+t,0)}function qGe(i,e,t){const{data:n,key:o}=i,{mount:r,unmount:s}=e,a=new Ou(n.current.map((l,c)=>{const d=new Ou(c),u=Cc.exports.get(l,o);return{key:u,index:d,instance:r(t,{index:d,data:n,key:u})}})||[]);return n.subscribe(l=>{const c=n.current.map((g,p)=>({key:Cc.exports.get(g,o),index:p})),d=a.current,u=new Map(c.map(g=>[g.key,g])),h=new Map(d.map(g=>[g.key,g])),f=[];for(const g of c){const p=h.get(g.key);if(p)f.push(p),p.index.current!==g.index&&p.index.next(l.concat({payload:g.index,path:"nextInstanceList"}));else{const v=new Ou(g.index),m={index:v,key:g.key,instance:r(t,{index:v,data:n,key:g.key})};f.push(m),console.log("mount ==> ",m.key)}}d.filter(g=>!u.get(g.key)).forEach(g=>{console.log("unmount ==> ",g.key),s(g.instance)}),a.next(l.concat({payload:f,path:"instanceList"}))}),{data:n,instanceList:a}}var GGe=Object.freeze(Object.defineProperty({__proto__:null,combine:zGe,constValue:VGe,merge:jGe,mountList:qGe,proxyData:HGe,sum:$Ge,sumValue:KGe,transform:UGe},Symbol.toStringTag,{value:"Module"}));const jm="EosCore",pS="EosOperators",n_e=Bt.createContext({store:void 0,nodes:[],edges:[]});function XGe(){return x.exports.useContext(n_e)}function YGe(i){const e={exports:void 0};return new Function("module",jm,pS,i)(e,WGe,GGe),e}const ZGe=i=>{const{value:e,children:t,nodes:n,edges:o}=i,[r,s]=x.exports.useState(),a=x.exports.useMemo(()=>({store:r,nodes:n,edges:o}),[r,n,o]);return x.exports.useEffect(()=>{if(!e)return;const l=YGe(e);console.log({result:l,value:e}),l&&s(()=>l.exports)},[e]),he(n_e.Provider,{value:a,children:t})};function QGe(i){switch(i){case qs.Boolean:return!1;case qs.Number:return 0;case qs.String:return"";case qs.Object:return"{}";default:return}}class i_e extends mp{constructor(){super({operatorName:"State",operatorType:"StateOperator",nodeType:oh.Node});bt(this,"nodeColor","#0079FF")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",label:"data",hint:"data"}),new ri({type:"target",label:"update",hint:"update"})]},value:0,valueType:qs.Number})}getStateSymbol(t){var r,s,a;const{node:n,formatVariableName:o}=t;return o(((a=(s=(r=n.data.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="source"&&l.hint==="data"))==null?void 0:a.id)||"")}generateBlockDeclarations(t){const{node:n}=t;return[`const ${this.getStateSymbol(t)} = new ${jm}.ModelState(${JSON.stringify(n.data.value)})`]}generateBlockOutput(t){return[]}generateBlockRelation(t){const{node:n,formatVariableName:o,nodeGraph:r}=t,s=r.findSourceNodes(n.id)||[];return[...s==null?void 0:s.map(a=>` +}`;var ui=dJ(function(){return Ji(ne,dn+"return "+vt).apply(t,ge)});if(ui.source=vt,J3(ui))throw ui;return ui}function RTe(b){return io(b).toLowerCase()}function MTe(b){return io(b).toUpperCase()}function ATe(b,S,T){if(b=io(b),b&&(T||S===t))return bZ(b);if(!b||!(S=lc(S)))return b;var O=Zd(b),q=Zd(S),ne=CZ(O,q),ge=yZ(O,q)+1;return Ap(O,ne,ge).join("")}function PTe(b,S,T){if(b=io(b),b&&(T||S===t))return b.slice(0,SZ(b)+1);if(!b||!(S=lc(S)))return b;var O=Zd(b),q=yZ(O,Zd(S))+1;return Ap(O,0,q).join("")}function OTe(b,S,T){if(b=io(b),b&&(T||S===t))return b.replace(Zt,"");if(!b||!(S=lc(S)))return b;var O=Zd(b),q=CZ(O,Zd(S));return Ap(O,q).join("")}function FTe(b,S){var T=R,O=A;if(ur(S)){var q="separator"in S?S.separator:q;T="length"in S?ai(S.length):T,O="omission"in S?lc(S.omission):O}b=io(b);var ne=b.length;if(d1(b)){var ge=Zd(b);ne=ge.length}if(T>=ne)return b;var we=T-u1(O);if(we<1)return O;var Re=ge?Ap(ge,0,we).join(""):b.slice(0,we);if(q===t)return Re+O;if(ge&&(we+=Re.length-we),e8(q)){if(b.slice(we).search(q)){var dt,ut=Re;for(q.global||(q=m3(q.source,io(Ze.exec(q))+"g")),q.lastIndex=0;dt=q.exec(ut);)var vt=dt.index;Re=Re.slice(0,vt===t?we:vt)}}else if(b.indexOf(lc(q),we)!=we){var Ht=Re.lastIndexOf(q);Ht>-1&&(Re=Re.slice(0,Ht))}return Re+O}function BTe(b){return b=io(b),b&&Gn.test(b)?b.replace(di,fLe):b}var WTe=_1(function(b,S,T){return b+(T?" ":"")+S.toUpperCase()}),i8=uQ("toUpperCase");function cJ(b,S,T){return b=io(b),S=T?t:S,S===t?lLe(b)?mLe(b):Jxe(b):b.match(S)||[]}var dJ=pi(function(b,S){try{return sc(b,t,S)}catch(T){return J3(T)?T:new ei(T)}}),VTe=Vf(function(b,S){return ed(S,function(T){T=ph(T),Bf(b,T,Z3(b[T],b))}),b});function HTe(b){var S=b==null?0:b.length,T=Pn();return b=S?ir(b,function(O){if(typeof O[1]!="function")throw new td(s);return[T(O[0]),O[1]]}):[],pi(function(O){for(var q=-1;++q$)return[];var T=j,O=ya(b,j);S=Pn(S),b-=j;for(var q=f3(O,S);++T0||S<0)?new Li(T):(b<0?T=T.takeRight(-b):b&&(T=T.drop(b)),S!==t&&(S=ai(S),T=S<0?T.dropRight(-S):T.take(S-b)),T)},Li.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},Li.prototype.toArray=function(){return this.take(j)},fh(Li.prototype,function(b,S){var T=/^(?:filter|find|map|reject)|While$/.test(S),O=/^(?:head|last)$/.test(S),q=ee[O?"take"+(S=="last"?"Right":""):S],ne=O||/^find/.test(S);!q||(ee.prototype[S]=function(){var ge=this.__wrapped__,we=O?[1]:arguments,Re=ge instanceof Li,dt=we[0],ut=Re||ni(ge),vt=function(yi){var Ni=q.apply(ee,kp([yi],we));return O&&Ht?Ni[0]:Ni};ut&&T&&typeof dt=="function"&&dt.length!=1&&(Re=ut=!1);var Ht=this.__chain__,dn=!!this.__actions__.length,Fn=ne&&!Ht,ui=Re&&!dn;if(!ne&&ut){ge=ui?ge:new Li(this);var Bn=b.apply(ge,we);return Bn.__actions__.push({func:dN,args:[vt],thisArg:t}),new nd(Bn,Ht)}return Fn&&ui?b.apply(this,we):(Bn=this.thru(vt),Fn?O?Bn.value()[0]:Bn.value():Bn)})}),ed(["pop","push","shift","sort","splice","unshift"],function(b){var S=OT[b],T=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",O=/^(?:pop|shift)$/.test(b);ee.prototype[b]=function(){var q=arguments;if(O&&!this.__chain__){var ne=this.value();return S.apply(ni(ne)?ne:[],q)}return this[T](function(ge){return S.apply(ni(ge)?ge:[],q)})}}),fh(Li.prototype,function(b,S){var T=ee[S];if(T){var O=T.name+"";co.call(p1,O)||(p1[O]=[]),p1[O].push({name:S,func:T})}}),p1[iN(t,m).name]=[{name:"wrapper",func:t}],Li.prototype.clone=BLe,Li.prototype.reverse=WLe,Li.prototype.value=VLe,ee.prototype.at=pke,ee.prototype.chain=mke,ee.prototype.commit=vke,ee.prototype.next=_ke,ee.prototype.plant=Cke,ee.prototype.reverse=yke,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=wke,ee.prototype.first=ee.prototype.head,US&&(ee.prototype[US]=bke),ee},h1=vLe();c_?((c_.exports=h1)._=h1,r3._=h1):Us._=h1}).call(rx)})(Cc,Cc.exports);class vp{constructor(e){bt(this,"defaultOperatorData");bt(this,"isUnique");bt(this,"nodeColor");bt(this,"description");bt(this,"isCustom");this.defaultOperatorData=e}get operatorType(){var e;return(e=this.defaultOperatorData)==null?void 0:e.operatorType}get operatorName(){var e;return((e=this.defaultOperatorData)==null?void 0:e.operatorName)||this.operatorType}create(e,t){return{position:{x:0,y:0},...t,id:(t==null?void 0:t.id)||cge(),type:this.defaultOperatorData.nodeType,data:{...this.defaultOperatorData,...t==null?void 0:t.data,...e,operatorName:this.defaultOperatorData.operatorName,operatorType:this.defaultOperatorData.operatorType,nodeType:this.defaultOperatorData.nodeType,nodeOptions:this.defaultOperatorData.nodeOptions}}}updateNodeMeta(e,t){return{...e,...t,...Cc.exports.pick(e,"id","data")}}updateData(e,t){const n=["nodeOptions","nodeType","operatorName","operatorType"];return{...e,data:{...e.data,...t,...Cc.exports.pick(e.data,...n)}}}updateNodeOptions(e,t){var n;return{...e,data:{...e==null?void 0:e.data,nodeOptions:{...(n=e==null?void 0:e.data)==null?void 0:n.nodeOptions,...t}}}}getExtraAppContainers(e){return[]}getIgnoreDegreeIds(e){return[]}onAfterCreate(e){}onNodeFocus(e){}onNodeDoubleClick(e){}onLayerChange(e){}generateAttributeControl(e){const{node:t,actions:n}=e;function o(r){t.data.nodeLabel=r,n.updateNode(t.id,t)}return he(ks,{children:he(dw,{placeholder:"input label",style:{width:"100%",maxWidth:"none"},value:t.data.nodeLabel,onChange:r=>{o(r.target.value)}})})}getNodeProps(e){return{}}renderCustomLabel(e){return null}}var oh=(i=>(i.Node="Node",i))(oh||{});class ri{constructor(e){bt(this,"id");bt(this,"type");bt(this,"variableName");bt(this,"label");bt(this,"hint");bt(this,"isConnectable");bt(this,"children");bt(this,"allowRemove");bt(this,"allowAddAndRemoveChildren");bt(this,"variableType");bt(this,"defaultChildData");bt(this,"ignoreDegree");Object.assign(this,e),this.id||(this.id=SI()),this.variableName||(this.variableName=ri.generateVariableName(this.hint)),this.type||(this.type="unknown")}static generateVariableName(e){return`${e||"var"}_${Math.random().toString(36).slice(2,7)}`}static createFromGroup(e){return new ri({hint:e.hint,...e==null?void 0:e.defaultChildData})}}var qs=(i=>(i.String="string",i.Number="number",i.Boolean="boolean",i.Object="object",i))(qs||{});class Jve{constructor(){bt(this,"listenerMap",new Map)}on(e,t){const n=this.listenerMap.get(e);n?n.add(t):this.listenerMap.set(e,new Set([t]))}off(e,t){const n=this.listenerMap.get(e);n!=null&&n.has(t)&&n.delete(t)}emit(e,t){const n=this.listenerMap.get(e);if(n)for(const o of n==null?void 0:n.values())o(t)}}class RGe{constructor(e){bt(this,"node");this.node=e}getLastChild(){let e=this.node.next;for(;e!=null&&e.nextSibling;)e=e.nextSibling;return e}addNextChildren(...e){const[t]=e;let n=t;t.return=this.node;for(let r=1;r<(e==null?void 0:e.length);r++){const s=e[r];n.nextSibling=s,n=s,s.return=this.node}const o=this.getLastChild();o?o.nextSibling=t:this.node.next=t}removeChild(e){const t=this.node.next;if(t===e)return this.node.next=t.nextSibling,!0;for(;t!=null&&t.nextSibling;)if(t.nextSibling===e)return t.nextSibling=t.nextSibling.nextSibling,!0;return!1}*children(){let e=this.node.next;for(;e;)yield e,e=e.nextSibling}preAction(e,t){let n=e;e:for(;n&&n!==e.return;)if(t(n),n.next)n=n.next;else if(n.nextSibling&&n!==e)n=n.nextSibling;else{for(n=n.return;n&&n!==e;){if(n.nextSibling){n=n.nextSibling;continue e}n=n==null?void 0:n.return}break}}postAction(e,t){let n=e;for(;n.next;)n=n==null?void 0:n.next;for(;n&&n!==e.return;){if(t(n),n.nextSibling&&n!==e){for(n=n.nextSibling;n.next;)n=n==null?void 0:n.next;continue}n=n.return}}action(e,t,n){e==="pre"?this.preAction(t,n):e==="post"?this.postAction(t,n):console.log("unknow type",e)}}class Rq{constructor(e){bt(this,"uid");this.uid=e||SI()}}class MGe extends Rq{constructor(t){super();bt(this,"template");bt(this,"output");bt(this,"input");const{template:n,input:o}=t;this.template=n,this.input=o||{}}get name(){var t,n;return((t=this.template.meta)==null?void 0:t.name)||((n=this.template)==null?void 0:n.name)}log(t){console.log(`[ModelBlock ${this.name} - ${this.uid}]: ${t}`)}}var ag;(function(i){i[i.BeforeInited=0]="BeforeInited",i[i.Initing=1]="Initing",i[i.Done=2]="Done"})(ag||(ag={}));class LD extends MGe{constructor(t){super(t);bt(this,"next",null);bt(this,"nextSibling",null);bt(this,"return",null);bt(this,"eventEmitter",new Jve);bt(this,"status",ag.BeforeInited);bt(this,"pendingChildren",[]);bt(this,"relationHelper");this.relationHelper=new RGe(this)}setNext(t){this.next=t}setNextSibling(t){this.nextSibling=t}setReturn(t){this.return=t!=null?t:null}_getInnerHandler(){return{getContext:this.getContext.bind(this)}}getContext(){return{id:this.uid,onLifecycle:this.onLifecycle.bind(this),mount:this.mountTemplate.bind(this),unmount:this.unmountChild.bind(this)}}onLifecycle(t,n){return this.eventEmitter.on(t,n),{unsubscribe:()=>{this.eventEmitter.off(t,n)}}}childrenAction(t,n,o){this.relationHelper.action(t,o,r=>{var s;(s=r[n])==null||s.call(r)})}mountChildOnly(t){this.relationHelper.addNextChildren(t),this.childrenAction("pre","preInitSelf",t),this.childrenAction("post","postInitSelf",t),this.childrenAction("pre","preMountSelf",t),this.childrenAction("post","postMountSelf",t),this.childrenAction("pre","beforeMountSelf",t),this.childrenAction("post","mountSelf",t)}mountTemplate(t,n){if(t===this.template)throw new Error("can not mount yourself");let o=this.return;for(;o;){if(t===o.template)throw new Error("loop mount!");o=o.return}const r=new LD({template:t,input:n});return this.mountChild(r),r}mountChild(t){console.log("mount::status",this.status),this.status===ag.Done?this.mountChildOnly(t):this.status===ag.Initing?this.pendingChildren.push(t):this.status===ag.BeforeInited&&(t.preInitSelf(),this.relationHelper.addNextChildren(t))}unmountChild(t){t instanceof LD&&(this.relationHelper.removeChild(t),t.unmount())}triggerLifecycle(t){this.eventEmitter.emit(t,void 0)}preInitSelf(){this.log("preInitSelf"),this.status===ag.BeforeInited&&(this.output=this.template(this.input,this.getContext())),this.status=ag.Initing}postInitSelf(){this.log("postInitSelf"),this.triggerLifecycle("postInit")}preMountSelf(){this.log("preMountSelf"),this.triggerLifecycle("preMount")}postMountSelf(){var t;this.log("postMountSelf"),this.triggerLifecycle("postMount"),this.status=ag.Done,(t=this.pendingChildren)!=null&&t.length&&(this.log("pendingChildren"),this.pendingChildren.forEach(n=>{this.mountChildOnly(n)}),this.pendingChildren=[])}beforeMountSelf(){this.log("beforeMountSelf"),this.triggerLifecycle("beforeMount")}mountSelf(){this.log("mountSelf"),this.triggerLifecycle("mount")}preUnmountSelf(){this.log("preUnmountSelf"),this.triggerLifecycle("preUnmount")}postUnmountSelf(){this.log("postUnmountSelf"),this.triggerLifecycle("postUnmount")}beforeUnmountSelf(){this.log("beforeUnmountSelf"),this.triggerLifecycle("beforeUnmount")}unmountSelf(){this.log("unmountSelf"),this.triggerLifecycle("unmount")}preAction(t){this.relationHelper.preAction(this,n=>{var o;(o=n[t])==null||o.call(n)})}postAction(t){this.relationHelper.postAction(this,n=>{var o;(o=n[t])==null||o.call(n)})}mount(){this.preAction("preInitSelf"),this.postAction("postInitSelf"),this.preAction("preMountSelf"),this.postAction("postMountSelf"),this.preAction("beforeMountSelf"),this.postAction("mountSelf")}unmount(){this.preAction("beforeUnmountSelf"),this.postAction("unmountSelf"),this.preAction("preUnmountSelf"),this.postAction("postUnmountSelf")}}var Uy;class AGe{constructor(){Oo(this,Uy,new Set)}add(e){ht(this,Uy).add(e)}unsubscribe(){for(const e of ht(this,Uy).values())e();ht(this,Uy).clear()}}Uy=new WeakMap;var jy;class W4 extends Rq{constructor(){super();Oo(this,jy,new Set);this.subscribe=this.subscribe.bind(this),this.trigger=this.trigger.bind(this)}get current(){throw new Error("need override")}trigger(...t){for(const n of ht(this,jy).values())try{n(...t)}catch(o){setTimeout(()=>{throw o})}}subscribe(t){ht(this,jy).add(t);const n=new AGe;return n.add(()=>{ht(this,jy).delete(t)}),n}pipe(t){return t(this)}}jy=new WeakMap;class PGe extends Jve{track(e){this.emit("track",e)}onTrack(e){this.on("track",e)}}const e_e=new PGe;function t_e(i,e){return typeof e=="function"?e(i):e}class OGe extends W4{constructor(t){super();bt(this,"_current");this._current=t,this.next=this.next.bind(this)}get current(){return this._current}next(t){const n=t_e(this._current,t.payload);this._current=n,e_e.track({target:this.uid,action:t}),super.trigger(t.concat({payload:n,path:this.uid}))}}class Ou extends OGe{next(e){super.next(e)}}class ap extends Rq{constructor(t){super(t==null?void 0:t.uid);bt(this,"payload");bt(this,"path","");bt(this,"extra");bt(this,"from");Object.assign(this,t)}static create(t,n){const o=new ap(t);return o.from=(o==null?void 0:o.from)||[],n!=null&&n.uid&&(o.from=o.from.concat((n==null?void 0:n.uid)||"")),o.extra="extra"in t?t==null?void 0:t.extra:n==null?void 0:n.extra,o}concat(t){return ap.create(t,this)}}function FGe(i,e){const t=new LD({template:i,input:e});return t.mount(),t}class BGe extends W4{next(e){super.trigger(e||new ap({payload:void 0,path:"event"}))}}class WGe extends W4{constructor(){super(...arguments);bt(this,"instance")}proxy(t){var n;this.instance=t,super.trigger(new ap({payload:(n=this.instance)==null?void 0:n.current,path:"ModelProxyInit"})),this.instance.subscribe(o=>{super.trigger(o)})}next(t){var n;(n=this.instance)==null||n.next(t)}}class VGe extends W4{constructor(){super(...arguments);bt(this,"instance")}proxy(t){this.instance=t,this.instance.subscribe(n=>{super.trigger(n)})}next(t){var n;(n=this.instance)==null||n.next(t)}}var HGe=Object.freeze(Object.defineProperty({__proto__:null,Action:ap,ModelBlock:LD,ModelEvent:BGe,ModelEventProxy:VGe,ModelStateProxy:WGe,start:FGe,ModelState:Ou,tracker:e_e},Symbol.toStringTag,{value:"Module"}));function $Ge(i){return new Ou(i)}function zGe(i,e){const t=Cc.exports.get(i.current,e);class n extends Ou{get current(){return Cc.exports.get(i.current,e)}next(r){i.next(r.concat({payload:s=>{const a=Cc.exports.get(s,e),l=Cc.exports.clone(s),c=t_e(a,r.payload);return Cc.exports.set(l,e,c),l},path:"ProxyState"}))}subscribe(r){return i.subscribe(s=>r(s.concat({payload:Cc.exports.get(s.payload,e),path:"ProxyState"})))}}return new n(t)}function UGe(...i){const e=new Ou(0);function t(n,o){e.next(n.concat({payload:i.map(r=>r.current).reduce((r,s)=>r+s,0),path:o}))}return t(new ap({payload:void 0,path:"init"}),"[sum]: init"),i.forEach(n=>{n.subscribe(o=>{t(o,"sum")})}),e}function jGe(i,e){const t=new Ou([]);return i.forEach(n=>{n.subscribe(o=>{const r=[...i,...e].map(s=>s.current);t.next(o.concat({payload:r,path:"combine"}))})}),t}function KGe(i,e){return i.pipe(t=>{const n=new Ou(void 0);return t.subscribe(async o=>{const r=e(o.payload);let s=r;r instanceof Promise&&(s=await r),n.next(o.concat({payload:s,path:"transform"}))}),n})}function qGe(i){const e=new Ou([]);return i.forEach(t=>{t.subscribe(n=>{e.next(n.concat({payload:n.payload,path:"merge"}))})}),e}function GGe(...i){return i.reduce((e,t)=>e+t,0)}function XGe(i,e,t){const{data:n,key:o}=i,{mount:r,unmount:s}=e,a=new Ou(n.current.map((l,c)=>{const d=new Ou(c),u=Cc.exports.get(l,o);return{key:u,index:d,instance:r(t,{index:d,data:n,key:u})}})||[]);return n.subscribe(l=>{const c=n.current.map((g,p)=>({key:Cc.exports.get(g,o),index:p})),d=a.current,u=new Map(c.map(g=>[g.key,g])),h=new Map(d.map(g=>[g.key,g])),f=[];for(const g of c){const p=h.get(g.key);if(p)f.push(p),p.index.current!==g.index&&p.index.next(l.concat({payload:g.index,path:"nextInstanceList"}));else{const v=new Ou(g.index),m={index:v,key:g.key,instance:r(t,{index:v,data:n,key:g.key})};f.push(m),console.log("mount ==> ",m.key)}}d.filter(g=>!u.get(g.key)).forEach(g=>{console.log("unmount ==> ",g.key),s(g.instance)}),a.next(l.concat({payload:f,path:"instanceList"}))}),{data:n,instanceList:a}}var YGe=Object.freeze(Object.defineProperty({__proto__:null,combine:jGe,constValue:$Ge,merge:qGe,mountList:XGe,proxyData:zGe,sum:UGe,sumValue:GGe,transform:KGe},Symbol.toStringTag,{value:"Module"}));const Km="EosCore",pS="EosOperators",n_e=Bt.createContext({store:void 0,nodes:[],edges:[]});function ZGe(){return x.exports.useContext(n_e)}function QGe(i){const e={exports:void 0};return new Function("module",Km,pS,i)(e,HGe,YGe),e}const JGe=i=>{const{value:e,children:t,nodes:n,edges:o}=i,[r,s]=x.exports.useState(),a=x.exports.useMemo(()=>({store:r,nodes:n,edges:o}),[r,n,o]);return x.exports.useEffect(()=>{if(!e)return;const l=QGe(e);console.log({result:l,value:e}),l&&s(()=>l.exports)},[e]),he(n_e.Provider,{value:a,children:t})};function eXe(i){switch(i){case qs.Boolean:return!1;case qs.Number:return 0;case qs.String:return"";case qs.Object:return"{}";default:return}}class i_e extends vp{constructor(){super({operatorName:"State",operatorType:"StateOperator",nodeType:oh.Node});bt(this,"nodeColor","#0079FF")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",label:"data",hint:"data"}),new ri({type:"target",label:"update",hint:"update"})]},value:0,valueType:qs.Number})}getStateSymbol(t){var r,s,a;const{node:n,formatVariableName:o}=t;return o(((a=(s=(r=n.data.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="source"&&l.hint==="data"))==null?void 0:a.id)||"")}generateBlockDeclarations(t){const{node:n}=t;return[`const ${this.getStateSymbol(t)} = new ${Km}.ModelState(${JSON.stringify(n.data.value)})`]}generateBlockOutput(t){return[]}generateBlockRelation(t){const{node:n,formatVariableName:o,nodeGraph:r}=t,s=r.findSourceNodes(n.id)||[];return[...s==null?void 0:s.map(a=>` ${o(a.relatedHandleId)}.subscribe((action) => { ${this.getStateSymbol(t)}.next(action.concat({ payload: action.payload, path: '${a.nodeId}' })); - });`)]}generateAttributeControl(t){const{node:n,actions:o}=t;return fn("div",{children:[he(wD.Item,{label:"valueType",colon:!1,children:he(H$e,{size:"small",value:n.data.valueType,options:[{value:qs.Number,label:"Number"},{value:qs.String,label:"String"},{value:qs.Boolean,label:"Boolean"},{value:qs.Object,label:"Object"}],onChange:r=>{o.updateNode(n.id,s=>this.updateData(s,{valueType:r,value:QGe(r)}))}})}),he(wD.Item,{label:"value",colon:!1,children:he(dw.TextArea,{value:[qs.String,qs.Object].includes(n.data.valueType)?n.data.value:JSON.stringify(n.data.value),onChange:r=>{let s=n.data.value;const a=r.target.value;if(n.data.valueType===qs.Object)try{JSON.parse(a),s=a}catch{Xs.error("JSON parse error, please check again")}else n.data.valueType===qs.Boolean?s=!!a:n.data.valueType===qs.Number?s=Number(a):s=a;o.updateNode(n.id,l=>this.updateData(l,{value:s}))}})})]})}getNodeProps(t){const{data:n}=t;return{showValue:!0,getBriefValue(){return{value:n.valueType===qs.Object?"Object(click to view)":JSON.stringify(n.value),hasDetail:n.valueType===qs.Object}},getDetailValue(){return JSON.stringify(n.value,void 0,2)}}}}class JGe extends i_e{constructor(){super(),this.defaultOperatorData.operatorName="ConstState",this.defaultOperatorData.operatorType="ConstStateOperator"}create(){const e=super.create();return this.updateData(e,{endPointOptions:{endPointList:[new ri({type:"source",label:"data",hint:"data"})]}})}generateBlockDeclarations(e){const{node:t}=e;return[`const ${super.getStateSymbol(e)} = new ${pS}.constValue(${JSON.stringify(t.data.value)})`]}generateBlockRelation(e){return[]}}class Rq{constructor(e,t){bt(this,"edges");bt(this,"nodes");bt(this,"nodeMap");bt(this,"connections");this.edges=t||[],this.nodes=e||[],this.nodeMap=new Map(e.map(n=>[n.id,n])),this.connections=this.initialRelation()}initialRelation(){const e=new Map;for(const t of this.edges){if(!t.target||!t.source||!(t!=null&&t.targetHandle)||!(t!=null&&t.sourceHandle)){console.warn("found useless target/source edge: ",t);continue}let n=e.get(t.source);n||(n={incoming:[],outcoming:[]}),n.outcoming.push({nodeId:t.target,handleId:t.sourceHandle,relatedHandleId:t.targetHandle}),e.set(t.source,n);let o=e.get(t.target);o||(o={incoming:[],outcoming:[]}),o.incoming.push({nodeId:t.source,handleId:t.targetHandle,relatedHandleId:t.sourceHandle}),e.set(t.target,o)}return e}findSourceNodes(e){var t;return(t=this.connections.get(e))==null?void 0:t.incoming}findTargetNodes(e){var t;return(t=this.connections.get(e))==null?void 0:t.outcoming}getSortedNodes(){var o,r,s;const e=[],t=new Map;for(const a of this.edges)if(a.source&&a.target){const l=t.get(a.target)||0,c=this.nodeMap.get(a.target);(c?((r=(o=fr(c))==null?void 0:o.getIgnoreDegreeIds)==null?void 0:r.call(o,c))||[]:[]).includes(a.targetHandle||"")||t.set(a.target,l+1)}const n=this.nodes.filter(a=>!t.get(a.id));for(;n!=null&&n.length;){const a=n.pop();if(!a)continue;e.push(a),(((s=this.connections.get(a==null?void 0:a.id))==null?void 0:s.outcoming)||[]).forEach(c=>{const d=t.get(c.nodeId);d&&(t.set(c.nodeId,d-1),d-1===0&&n.push(this.nodeMap.get(c.nodeId)))})}return e.length!==this.nodes.length&&(console.log("====== Circle ======",{result:e,nodes:this.nodes}),Xs.info("\u5B58\u5728\u5FAA\u73AF")),e}}function Cd(i){return`var_${i.replaceAll("-","_").replaceAll("$","__")}`}function Xf(i){return`block_${Cd(i)}`}function Zie(i){return`// =================== ${i} ================ // -`}function Qie(i,e){var t,n;return i!=null&&i.length?[Zie(`START: ${[(t=e.operator)==null?void 0:t.operatorName,(n=e.node)==null?void 0:n.data.nodeLabel,e.extra].filter(Boolean).join(",")}`),...i,Zie("END")]:i}class Jie{constructor(){bt(this,"extraAppContainer",[]);bt(this,"handledAppContainerIdSet",new Set)}getUniqueExtraAppContainerList(){const e=new Set;return this.extraAppContainer.filter(t=>this.handledAppContainerIdSet.has(t.appContainerId)||e.has(t.appContainerId)?!1:(e.add(t.appContainerId),!0))}reset(){this.extraAppContainer=[],this.handledAppContainerIdSet=new Set}generateBlock(e,t){const{nodes:n,edges:o}=t,r=new Rq(n,o),s=r.getSortedNodes(),a=s.map(h=>{var g;const f=fr(h);return Qie((g=f==null?void 0:f.generateBlockDeclarations)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cd,formatBlockVarName:Xf}),{operator:f,node:h,extra:"declarations"})}).flat().filter(h=>Boolean(h)),l=s.map(h=>{var g;const f=fr(h);return Qie((g=f==null?void 0:f.generateBlockRelation)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cd,formatBlockVarName:Xf}),{operator:f,node:h,extra:"relations"})}).flat().filter(h=>Boolean(h)),c=s.map(h=>{var g;const f=fr(h);return(g=f==null?void 0:f.generateBlockOutput)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cd,formatBlockVarName:Xf})}).flat().filter(h=>Boolean(h)),d=s.map(h=>{var g;const f=fr(h);return(g=f==null?void 0:f.getExtraAppContainers)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cd,formatBlockVarName:Xf})}).flat().filter(h=>Boolean(h));return this.extraAppContainer=this.extraAppContainer.concat(d),` + });`)]}generateAttributeControl(t){const{node:n,actions:o}=t;return fn("div",{children:[he(wD.Item,{label:"valueType",colon:!1,children:he(H$e,{size:"small",value:n.data.valueType,options:[{value:qs.Number,label:"Number"},{value:qs.String,label:"String"},{value:qs.Boolean,label:"Boolean"},{value:qs.Object,label:"Object"}],onChange:r=>{o.updateNode(n.id,s=>this.updateData(s,{valueType:r,value:eXe(r)}))}})}),he(wD.Item,{label:"value",colon:!1,children:he(dw.TextArea,{value:[qs.String,qs.Object].includes(n.data.valueType)?n.data.value:JSON.stringify(n.data.value),onChange:r=>{let s=n.data.value;const a=r.target.value;if(n.data.valueType===qs.Object)try{JSON.parse(a),s=a}catch{Xs.error("JSON parse error, please check again")}else n.data.valueType===qs.Boolean?s=!!a:n.data.valueType===qs.Number?s=Number(a):s=a;o.updateNode(n.id,l=>this.updateData(l,{value:s}))}})})]})}getNodeProps(t){const{data:n}=t;return{showValue:!0,getBriefValue(){return{value:n.valueType===qs.Object?"Object(click to view)":JSON.stringify(n.value),hasDetail:n.valueType===qs.Object}},getDetailValue(){return JSON.stringify(n.value,void 0,2)}}}}class tXe extends i_e{constructor(){super(),this.defaultOperatorData.operatorName="ConstState",this.defaultOperatorData.operatorType="ConstStateOperator"}create(){const e=super.create();return this.updateData(e,{endPointOptions:{endPointList:[new ri({type:"source",label:"data",hint:"data"})]}})}generateBlockDeclarations(e){const{node:t}=e;return[`const ${super.getStateSymbol(e)} = new ${pS}.constValue(${JSON.stringify(t.data.value)})`]}generateBlockRelation(e){return[]}}class Mq{constructor(e,t){bt(this,"edges");bt(this,"nodes");bt(this,"nodeMap");bt(this,"connections");this.edges=t||[],this.nodes=e||[],this.nodeMap=new Map(e.map(n=>[n.id,n])),this.connections=this.initialRelation()}initialRelation(){const e=new Map;for(const t of this.edges){if(!t.target||!t.source||!(t!=null&&t.targetHandle)||!(t!=null&&t.sourceHandle)){console.warn("found useless target/source edge: ",t);continue}let n=e.get(t.source);n||(n={incoming:[],outcoming:[]}),n.outcoming.push({nodeId:t.target,handleId:t.sourceHandle,relatedHandleId:t.targetHandle}),e.set(t.source,n);let o=e.get(t.target);o||(o={incoming:[],outcoming:[]}),o.incoming.push({nodeId:t.source,handleId:t.targetHandle,relatedHandleId:t.sourceHandle}),e.set(t.target,o)}return e}findSourceNodes(e){var t;return(t=this.connections.get(e))==null?void 0:t.incoming}findTargetNodes(e){var t;return(t=this.connections.get(e))==null?void 0:t.outcoming}getSortedNodes(){var o,r,s;const e=[],t=new Map;for(const a of this.edges)if(a.source&&a.target){const l=t.get(a.target)||0,c=this.nodeMap.get(a.target);(c?((r=(o=fr(c))==null?void 0:o.getIgnoreDegreeIds)==null?void 0:r.call(o,c))||[]:[]).includes(a.targetHandle||"")||t.set(a.target,l+1)}const n=this.nodes.filter(a=>!t.get(a.id));for(;n!=null&&n.length;){const a=n.pop();if(!a)continue;e.push(a),(((s=this.connections.get(a==null?void 0:a.id))==null?void 0:s.outcoming)||[]).forEach(c=>{const d=t.get(c.nodeId);d&&(t.set(c.nodeId,d-1),d-1===0&&n.push(this.nodeMap.get(c.nodeId)))})}return e.length!==this.nodes.length&&(console.log("====== Circle ======",{result:e,nodes:this.nodes}),Xs.info("\u5B58\u5728\u5FAA\u73AF")),e}}function Cd(i){return`var_${i.replaceAll("-","_").replaceAll("$","__")}`}function Xf(i){return`block_${Cd(i)}`}function Qie(i){return`// =================== ${i} ================ // +`}function Jie(i,e){var t,n;return i!=null&&i.length?[Qie(`START: ${[(t=e.operator)==null?void 0:t.operatorName,(n=e.node)==null?void 0:n.data.nodeLabel,e.extra].filter(Boolean).join(",")}`),...i,Qie("END")]:i}class eoe{constructor(){bt(this,"extraAppContainer",[]);bt(this,"handledAppContainerIdSet",new Set)}getUniqueExtraAppContainerList(){const e=new Set;return this.extraAppContainer.filter(t=>this.handledAppContainerIdSet.has(t.appContainerId)||e.has(t.appContainerId)?!1:(e.add(t.appContainerId),!0))}reset(){this.extraAppContainer=[],this.handledAppContainerIdSet=new Set}generateBlock(e,t){const{nodes:n,edges:o}=t,r=new Mq(n,o),s=r.getSortedNodes(),a=s.map(h=>{var g;const f=fr(h);return Jie((g=f==null?void 0:f.generateBlockDeclarations)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cd,formatBlockVarName:Xf}),{operator:f,node:h,extra:"declarations"})}).flat().filter(h=>Boolean(h)),l=s.map(h=>{var g;const f=fr(h);return Jie((g=f==null?void 0:f.generateBlockRelation)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cd,formatBlockVarName:Xf}),{operator:f,node:h,extra:"relations"})}).flat().filter(h=>Boolean(h)),c=s.map(h=>{var g;const f=fr(h);return(g=f==null?void 0:f.generateBlockOutput)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cd,formatBlockVarName:Xf})}).flat().filter(h=>Boolean(h)),d=s.map(h=>{var g;const f=fr(h);return(g=f==null?void 0:f.getExtraAppContainers)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cd,formatBlockVarName:Xf})}).flat().filter(h=>Boolean(h));return this.extraAppContainer=this.extraAppContainer.concat(d),` function ${Xf(e)}(input, context) { ${a.join(`; `)} @@ -352,7 +352,7 @@ function print() { __p += __j.call(arguments, '') } const { start, tracker - } = ${jm} + } = ${Km} ${n.join(` `)} function main(input) { @@ -366,56 +366,56 @@ function print() { __p += __j.call(arguments, '') } } module.exports = main; - `;return console.log(s),s}}class eXe extends mp{constructor(){super({operatorName:"Input",operatorType:"InputOperator",nodeType:oh.Node});bt(this,"isUnique",!0);bt(this,"nodeColor","#5D9C59")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",label:"State",hint:"state",allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"},children:[]}),new ri({type:"group",label:"Event",hint:"event",allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"},children:[]}),new ri({type:"group",label:"Lifecycle",hint:"lifecycle",allowAddAndRemoveChildren:!1,children:[new ri({type:"source",variableName:"beforeMount"}),new ri({type:"source",variableName:"mount"}),new ri({type:"source",variableName:"beforeUnmount"}),new ri({type:"source",variableName:"unmount"})]})]}})}getEventPorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="event"))==null?void 0:a.children)||[]}getStatePort(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="state"))==null?void 0:a.children)||[]}getLifecyclePorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="lifecycle"))==null?void 0:a.children)||[]}generateBlockDeclarations(t){const{node:n}=t,o=this.getEventPorts(n),r=this.getStatePort(n),s=this.getLifecyclePorts(n);return[...o.map(a=>`const ${Cd(a.id)} = input['${a.variableName}'] || new ${jm}.ModelEvent()`),...r.map(a=>`const ${Cd(a.id)} = input['${a.variableName}'] || new ${jm}.ModelState(undefined)`),...s.map(a=>`const ${Cd(a.id)} = new ${jm}.ModelEvent()`)]}generateBlockRelation(t){const{node:n}=t;return[...this.getLifecyclePorts(n).map(r=>` + `;return console.log(s),s}}class nXe extends vp{constructor(){super({operatorName:"Input",operatorType:"InputOperator",nodeType:oh.Node});bt(this,"isUnique",!0);bt(this,"nodeColor","#5D9C59")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",label:"State",hint:"state",allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"},children:[]}),new ri({type:"group",label:"Event",hint:"event",allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"},children:[]}),new ri({type:"group",label:"Lifecycle",hint:"lifecycle",allowAddAndRemoveChildren:!1,children:[new ri({type:"source",variableName:"beforeMount"}),new ri({type:"source",variableName:"mount"}),new ri({type:"source",variableName:"beforeUnmount"}),new ri({type:"source",variableName:"unmount"})]})]}})}getEventPorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="event"))==null?void 0:a.children)||[]}getStatePort(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="state"))==null?void 0:a.children)||[]}getLifecyclePorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="lifecycle"))==null?void 0:a.children)||[]}generateBlockDeclarations(t){const{node:n}=t,o=this.getEventPorts(n),r=this.getStatePort(n),s=this.getLifecyclePorts(n);return[...o.map(a=>`const ${Cd(a.id)} = input['${a.variableName}'] || new ${Km}.ModelEvent()`),...r.map(a=>`const ${Cd(a.id)} = input['${a.variableName}'] || new ${Km}.ModelState(undefined)`),...s.map(a=>`const ${Cd(a.id)} = new ${Km}.ModelEvent()`)]}generateBlockRelation(t){const{node:n}=t;return[...this.getLifecyclePorts(n).map(r=>` context.onLifecycle('${r.variableName}', () => { ${Cd(r.id||"")}.next(); }) - `)]}generateBlockOutput(t){const{node:n}=t;return this.getEventPorts(n).map(r=>`['${r.variableName||""}']: ${Cd(r.id)}`)}}class tXe extends mp{constructor(){super({operatorName:"Output",operatorType:"OutputOperator",nodeType:oh.Node});bt(this,"isUnique",!0);bt(this,"nodeColor","#5D9C59")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",label:"State",hint:"state",allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"},children:[new ri({type:"target",hint:"state"})]}),new ri({type:"group",label:"Event",hint:"event",allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"},children:[]})]}})}getEventPorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="event"))==null?void 0:a.children)||[]}getStatePort(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="state"))==null?void 0:a.children)||[]}generateBlockDeclarations(t){const{node:n,formatVariableName:o}=t;return[...this.getEventPorts(n).map(s=>`const ${o(s.id)} = new ${jm}.ModelEvent()`)]}generateBlockRelation(t){const{node:n,formatVariableName:o,nodeGraph:r}=t;return[...this.getEventPorts(n).map(a=>{var d,u;const l=(u=(d=r.findSourceNodes(n.id))==null?void 0:d.find(h=>h.handleId===a.id))==null?void 0:u.relatedHandleId,c=a.id;return!l||!c?"":`${o(l)}.subscribe((action) => { + `)]}generateBlockOutput(t){const{node:n}=t;return this.getEventPorts(n).map(r=>`['${r.variableName||""}']: ${Cd(r.id)}`)}}class iXe extends vp{constructor(){super({operatorName:"Output",operatorType:"OutputOperator",nodeType:oh.Node});bt(this,"isUnique",!0);bt(this,"nodeColor","#5D9C59")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",label:"State",hint:"state",allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"},children:[new ri({type:"target",hint:"state"})]}),new ri({type:"group",label:"Event",hint:"event",allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"},children:[]})]}})}getEventPorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="event"))==null?void 0:a.children)||[]}getStatePort(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="state"))==null?void 0:a.children)||[]}generateBlockDeclarations(t){const{node:n,formatVariableName:o}=t;return[...this.getEventPorts(n).map(s=>`const ${o(s.id)} = new ${Km}.ModelEvent()`)]}generateBlockRelation(t){const{node:n,formatVariableName:o,nodeGraph:r}=t;return[...this.getEventPorts(n).map(a=>{var d,u;const l=(u=(d=r.findSourceNodes(n.id))==null?void 0:d.find(h=>h.handleId===a.id))==null?void 0:u.relatedHandleId,c=a.id;return!l||!c?"":`${o(l)}.subscribe((action) => { ${o(c)}.next(action.concat({ payload: action.payload, path: '${n.id}' })) - })`})]}generateBlockOutput(t){const{node:n,formatVariableName:o,nodeGraph:r}=t,s=this.getEventPorts(n),a=this.getStatePort(n);return[...s.map(l=>`['${l.variableName}']: ${o(l.id)}`),...a.map(l=>{var d,u;const c=(u=(d=r.findSourceNodes(n.id))==null?void 0:d.find(h=>h.handleId===l.id))==null?void 0:u.relatedHandleId;return c?`['${l.variableName}']: ${o(c)}`:""})]}}class nXe extends mp{constructor(){super({operatorName:"Sum",operatorType:"SumOperator",nodeType:oh.Node});bt(this,"nodeColor","#FF0060")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",label:"output",hint:"output"}),new ri({type:"group",allowAddAndRemoveChildren:!0,hint:"input",defaultChildData:{type:"target",label:"input",hint:"input"},children:[new ri({type:"target",label:"input",hint:"input"}),new ri({type:"target",label:"input",hint:"input"})]})]}})}generateBlockDeclarations(t){var l,c,d,u;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((d=(c=(l=n.data.endPointOptions)==null?void 0:l.endPointList)==null?void 0:c.find(h=>h.hint==="output"))==null?void 0:d.id)||"",a=((u=r.findSourceNodes(n.id))==null?void 0:u.map(h=>h.relatedHandleId))||[];return[`const ${o(s)} = ${pS}.sum(${a.map(h=>o(h)).join(",")})`]}generateBlockRelation(t){return[]}generateBlockOutput(t){return[]}}const AA=new Map;function iXe(i){const e=AA.get(i.operatorType);e&&(e===i?console.warn(`duplicated register: ${i.operatorType}:${i.operatorName}`):console.error(`register with same type: ${i.operatorType}, current: ${e.operatorName}, next: ${i.operatorName}`,{current:e,operator:i})),AA.set(i.operatorType,i)}function Mq(i){Object.values(i).forEach(e=>{iXe(e)})}function Aq(i){return AA.get(i)}function fr(i){var e;return Aq(((e=i==null?void 0:i.data)==null?void 0:e.operatorType)||"")}function eoe(){return[...AA.values()]}function oXe(i){var a;const{node:e}=i,{updateNode:t,setLayer:n}=TT(),{currentStateRef:o,actionsRef:r}=NT(),s=fr(e);return fn("div",{children:[he(wD.Item,{label:"name",children:he(dw,{size:"small",placeholder:"name",defaultValue:(a=e.data)==null?void 0:a.nodeLabel,onBlur:l=>{if(s){const c=l.target.value;t(e.id,d=>s==null?void 0:s.updateData(d,{nodeLabel:c})),setTimeout(()=>{n(d=>{const u=wc(d,e.data.layerId);return u&&(u.name=c),{...d}})})}}})}),he(wD.Item,{label:"\u624B\u52A8\u5237\u65B0",children:he(ts,{size:"small",onClick:()=>{s==null||s.refreshNode({currentState:o.current,actions:r.current,node:e})},children:"\u5237\u65B0"})})]})}function o_e(i){return[new ri({type:"group",label:"State",children:(i==null?void 0:i.outputStateList)||[],allowAddAndRemoveChildren:!1,hint:"outputState"}),new ri({type:"group",label:"Event",children:(i==null?void 0:i.outputEventList)||[],allowAddAndRemoveChildren:!1,hint:"outputEvent"}),new ri({type:"group",label:"State",children:(i==null?void 0:i.inputStateList)||[],allowAddAndRemoveChildren:!1,hint:"inputState"}),new ri({type:"group",label:"Event",children:(i==null?void 0:i.inputEventList)||[],allowAddAndRemoveChildren:!1,hint:"inputEvent"})]}function jW(i,e){var u,h,f,g;const t=i.nodes.find(p=>{var v;return((v=fr(p))==null?void 0:v.operatorType)==="InputOperator"}),n=i.nodes.find(p=>{var v;return((v=fr(p))==null?void 0:v.operatorType)==="OutputOperator"}),o=fr(t),r=fr(n);function s(p){return`${p}__${e.slice(-5)}`}const a=t?(u=o==null?void 0:o.getStatePort(t))==null?void 0:u.map(p=>new ri({...p,id:s(p.id),type:"target"})):[],l=t?(h=o==null?void 0:o.getEventPorts(t))==null?void 0:h.map(p=>new ri({...p,id:s(p.id),type:"target"})):[],c=n?(f=r==null?void 0:r.getStatePort(n))==null?void 0:f.map(p=>new ri({...p,id:s(p.id),type:"source"})):[],d=n?(g=r==null?void 0:r.getEventPorts(n))==null?void 0:g.map(p=>new ri({...p,id:s(p.id),type:"source"})):[];return{endPointList:o_e({inputEventList:l||[],inputStateList:a||[],outputEventList:d||[],outputStateList:c||[]})}}function r_e(i){var t,n,o,r;return((r=(o=(n=(t=i.data)==null?void 0:t.endPointOptions)==null?void 0:n.endPointList)==null?void 0:o.filter(s=>s.type==="group"&&["outputState","outputEvent"].includes(s.hint||"")).map(s=>s==null?void 0:s.children))==null?void 0:r.flat().filter(s=>!!s))||[]}function s_e(i){var t,n,o;return((o=(n=(t=i.data)==null?void 0:t.endPointOptions)==null?void 0:n.endPointList)==null?void 0:o.filter(r=>r.type==="group"&&["inputState","inputEvent"].includes(r.hint||"")).map(r=>r==null?void 0:r.children).flat().filter(r=>!!r))||[]}class rXe extends mp{constructor(){super({operatorName:"Group",operatorType:"GroupOperator",nodeType:oh.Node,endPointOptions:{endPointList:o_e()}});bt(this,"description","\u53CC\u51FB\u7F16\u8F91");bt(this,"isUnique",!1);bt(this,"nodeColor","#FBCB0A")}onAfterCreate(t){const{node:n,actions:o,currentState:r}=t,{setLayer:s}=o,{activeLayerId:a,layer:l}=r,c=wc(l,a),d=new xI(n.data.operatorName);d.relativeNodeId=n.id,d.parentLayerId=c==null?void 0:c.id,n.data.layerId=d.id,s(u=>{const h=wc(u,a);return h&&(h.nodes.find(f=>f.id===n.id)||(h.nodes=h.nodes.concat(n)),h.children.push(d)),{...u}})}generateAttributeControl(t){const{node:n}=t;return he("div",{children:he(oXe,{node:n})})}generateBlockDeclarations(t){var a;const{node:n,nodeGraph:o,formatVariableName:r,formatBlockVarName:s}=t;return[`const temp_${r(n.id)} = context.mount(${s(n.data.layerId)}, { + })`})]}generateBlockOutput(t){const{node:n,formatVariableName:o,nodeGraph:r}=t,s=this.getEventPorts(n),a=this.getStatePort(n);return[...s.map(l=>`['${l.variableName}']: ${o(l.id)}`),...a.map(l=>{var d,u;const c=(u=(d=r.findSourceNodes(n.id))==null?void 0:d.find(h=>h.handleId===l.id))==null?void 0:u.relatedHandleId;return c?`['${l.variableName}']: ${o(c)}`:""})]}}class oXe extends vp{constructor(){super({operatorName:"Sum",operatorType:"SumOperator",nodeType:oh.Node});bt(this,"nodeColor","#FF0060")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",label:"output",hint:"output"}),new ri({type:"group",allowAddAndRemoveChildren:!0,hint:"input",defaultChildData:{type:"target",label:"input",hint:"input"},children:[new ri({type:"target",label:"input",hint:"input"}),new ri({type:"target",label:"input",hint:"input"})]})]}})}generateBlockDeclarations(t){var l,c,d,u;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((d=(c=(l=n.data.endPointOptions)==null?void 0:l.endPointList)==null?void 0:c.find(h=>h.hint==="output"))==null?void 0:d.id)||"",a=((u=r.findSourceNodes(n.id))==null?void 0:u.map(h=>h.relatedHandleId))||[];return[`const ${o(s)} = ${pS}.sum(${a.map(h=>o(h)).join(",")})`]}generateBlockRelation(t){return[]}generateBlockOutput(t){return[]}}const AA=new Map;function rXe(i){const e=AA.get(i.operatorType);e&&(e===i?console.warn(`duplicated register: ${i.operatorType}:${i.operatorName}`):console.error(`register with same type: ${i.operatorType}, current: ${e.operatorName}, next: ${i.operatorName}`,{current:e,operator:i})),AA.set(i.operatorType,i)}function Aq(i){Object.values(i).forEach(e=>{rXe(e)})}function Pq(i){return AA.get(i)}function fr(i){var e;return Pq(((e=i==null?void 0:i.data)==null?void 0:e.operatorType)||"")}function toe(){return[...AA.values()]}function sXe(i){var a;const{node:e}=i,{updateNode:t,setLayer:n}=TT(),{currentStateRef:o,actionsRef:r}=NT(),s=fr(e);return fn("div",{children:[he(wD.Item,{label:"name",children:he(dw,{size:"small",placeholder:"name",defaultValue:(a=e.data)==null?void 0:a.nodeLabel,onBlur:l=>{if(s){const c=l.target.value;t(e.id,d=>s==null?void 0:s.updateData(d,{nodeLabel:c})),setTimeout(()=>{n(d=>{const u=wc(d,e.data.layerId);return u&&(u.name=c),{...d}})})}}})}),he(wD.Item,{label:"\u624B\u52A8\u5237\u65B0",children:he(ts,{size:"small",onClick:()=>{s==null||s.refreshNode({currentState:o.current,actions:r.current,node:e})},children:"\u5237\u65B0"})})]})}function o_e(i){return[new ri({type:"group",label:"State",children:(i==null?void 0:i.outputStateList)||[],allowAddAndRemoveChildren:!1,hint:"outputState"}),new ri({type:"group",label:"Event",children:(i==null?void 0:i.outputEventList)||[],allowAddAndRemoveChildren:!1,hint:"outputEvent"}),new ri({type:"group",label:"State",children:(i==null?void 0:i.inputStateList)||[],allowAddAndRemoveChildren:!1,hint:"inputState"}),new ri({type:"group",label:"Event",children:(i==null?void 0:i.inputEventList)||[],allowAddAndRemoveChildren:!1,hint:"inputEvent"})]}function KW(i,e){var u,h,f,g;const t=i.nodes.find(p=>{var v;return((v=fr(p))==null?void 0:v.operatorType)==="InputOperator"}),n=i.nodes.find(p=>{var v;return((v=fr(p))==null?void 0:v.operatorType)==="OutputOperator"}),o=fr(t),r=fr(n);function s(p){return`${p}__${e.slice(-5)}`}const a=t?(u=o==null?void 0:o.getStatePort(t))==null?void 0:u.map(p=>new ri({...p,id:s(p.id),type:"target"})):[],l=t?(h=o==null?void 0:o.getEventPorts(t))==null?void 0:h.map(p=>new ri({...p,id:s(p.id),type:"target"})):[],c=n?(f=r==null?void 0:r.getStatePort(n))==null?void 0:f.map(p=>new ri({...p,id:s(p.id),type:"source"})):[],d=n?(g=r==null?void 0:r.getEventPorts(n))==null?void 0:g.map(p=>new ri({...p,id:s(p.id),type:"source"})):[];return{endPointList:o_e({inputEventList:l||[],inputStateList:a||[],outputEventList:d||[],outputStateList:c||[]})}}function r_e(i){var t,n,o,r;return((r=(o=(n=(t=i.data)==null?void 0:t.endPointOptions)==null?void 0:n.endPointList)==null?void 0:o.filter(s=>s.type==="group"&&["outputState","outputEvent"].includes(s.hint||"")).map(s=>s==null?void 0:s.children))==null?void 0:r.flat().filter(s=>!!s))||[]}function s_e(i){var t,n,o;return((o=(n=(t=i.data)==null?void 0:t.endPointOptions)==null?void 0:n.endPointList)==null?void 0:o.filter(r=>r.type==="group"&&["inputState","inputEvent"].includes(r.hint||"")).map(r=>r==null?void 0:r.children).flat().filter(r=>!!r))||[]}class aXe extends vp{constructor(){super({operatorName:"Group",operatorType:"GroupOperator",nodeType:oh.Node,endPointOptions:{endPointList:o_e()}});bt(this,"description","\u53CC\u51FB\u7F16\u8F91");bt(this,"isUnique",!1);bt(this,"nodeColor","#FBCB0A")}onAfterCreate(t){const{node:n,actions:o,currentState:r}=t,{setLayer:s}=o,{activeLayerId:a,layer:l}=r,c=wc(l,a),d=new xI(n.data.operatorName);d.relativeNodeId=n.id,d.parentLayerId=c==null?void 0:c.id,n.data.layerId=d.id,s(u=>{const h=wc(u,a);return h&&(h.nodes.find(f=>f.id===n.id)||(h.nodes=h.nodes.concat(n)),h.children.push(d)),{...u}})}generateAttributeControl(t){const{node:n}=t;return he("div",{children:he(sXe,{node:n})})}generateBlockDeclarations(t){var a;const{node:n,nodeGraph:o,formatVariableName:r,formatBlockVarName:s}=t;return[`const temp_${r(n.id)} = context.mount(${s(n.data.layerId)}, { ${s_e(n).map(l=>{var d,u;const c=(u=(d=o.findSourceNodes(n.id))==null?void 0:d.find(h=>h.handleId===l.id))==null?void 0:u.relatedHandleId;return c?`['${l.variableName}']: ${r(c||"")}`:""}).filter(Boolean).join(`, `)} - })`,...(a=r_e(n)||[])==null?void 0:a.map(l=>`const ${r(l.id)} = temp_${r(n.id)}.output['${l.variableName}']`)]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}getFreshNodeData(t){const{node:n,currentState:o}=t,{layer:r}=o,s=wc(r,n.data.layerId);if(s){const{endPointList:a}=jW(s,n.id);return{targetLayer:s,updatedNodeData:{endPointOptions:{endPointList:a}}}}}refreshNode(t){var r;const{node:n}=t,o=this.getFreshNodeData(t);o!=null&&o.updatedNodeData&&t.actions.updateNode(n.id,s=>this.updateData(s,o.updatedNodeData),{updateInternal:!0,layerId:(r=o.targetLayer)==null?void 0:r.parentLayerId})}onNodeDoubleClick(t){var r;const{node:n,actions:o}=t;o==null||o.setActiveLayerId((r=n==null?void 0:n.data)==null?void 0:r.layerId)}onNodeFocus(t){this==null||this.refreshNode(t)}}class sXe extends mp{constructor(){super({operatorName:"Combine",operatorType:"CombineOperator",nodeType:oh.Node});bt(this,"nodeColor","#C21292")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",hint:"output",children:[new ri({label:"output",hint:"output",variableType:"array",type:"source"})]}),new ri({type:"group",hint:"mainInput",label:"Main Stream",defaultChildData:{hint:"mainSource",type:"target"},allowAddAndRemoveChildren:!0,children:[new ri({hint:"mainSource",type:"target"})]}),new ri({type:"group",hint:"appendInput",label:"Append Stream",defaultChildData:{hint:"appendSource",type:"target"},allowAddAndRemoveChildren:!0,children:[new ri({hint:"appendSource",type:"target"})]})]}})}getHintPorts(t,n){var o,r,s;return(s=(r=(o=t.data.endPointOptions)==null?void 0:o.endPointList)==null?void 0:r.find(a=>a.hint===n))==null?void 0:s.children}getMainInputPorts(t){return this.getHintPorts(t,"mainInput")}getAppendInputPorts(t){return this.getHintPorts(t,"appendInput")}generateBlockDeclarations(t){var f,g,p,v;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((g=(f=this.getHintPorts(n,"output"))==null?void 0:f.find(m=>m.hint==="output"))==null?void 0:g.id)||"",a=((p=this.getMainInputPorts(n))==null?void 0:p.map(m=>m.id))||[],l=((v=this.getAppendInputPorts(n))==null?void 0:v.map(m=>m.id))||[],c=r.findSourceNodes(n.id)||[],d=new Map(c.map(m=>[m.handleId,m])),u=a.map(m=>d.get(m)).map(m=>m==null?void 0:m.relatedHandleId),h=l.map(m=>d.get(m)).map(m=>m==null?void 0:m.relatedHandleId);return[`const ${o(s)} = ${pS}.combine( + })`,...(a=r_e(n)||[])==null?void 0:a.map(l=>`const ${r(l.id)} = temp_${r(n.id)}.output['${l.variableName}']`)]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}getFreshNodeData(t){const{node:n,currentState:o}=t,{layer:r}=o,s=wc(r,n.data.layerId);if(s){const{endPointList:a}=KW(s,n.id);return{targetLayer:s,updatedNodeData:{endPointOptions:{endPointList:a}}}}}refreshNode(t){var r;const{node:n}=t,o=this.getFreshNodeData(t);o!=null&&o.updatedNodeData&&t.actions.updateNode(n.id,s=>this.updateData(s,o.updatedNodeData),{updateInternal:!0,layerId:(r=o.targetLayer)==null?void 0:r.parentLayerId})}onNodeDoubleClick(t){var r;const{node:n,actions:o}=t;o==null||o.setActiveLayerId((r=n==null?void 0:n.data)==null?void 0:r.layerId)}onNodeFocus(t){this==null||this.refreshNode(t)}}class lXe extends vp{constructor(){super({operatorName:"Combine",operatorType:"CombineOperator",nodeType:oh.Node});bt(this,"nodeColor","#C21292")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",hint:"output",children:[new ri({label:"output",hint:"output",variableType:"array",type:"source"})]}),new ri({type:"group",hint:"mainInput",label:"Main Stream",defaultChildData:{hint:"mainSource",type:"target"},allowAddAndRemoveChildren:!0,children:[new ri({hint:"mainSource",type:"target"})]}),new ri({type:"group",hint:"appendInput",label:"Append Stream",defaultChildData:{hint:"appendSource",type:"target"},allowAddAndRemoveChildren:!0,children:[new ri({hint:"appendSource",type:"target"})]})]}})}getHintPorts(t,n){var o,r,s;return(s=(r=(o=t.data.endPointOptions)==null?void 0:o.endPointList)==null?void 0:r.find(a=>a.hint===n))==null?void 0:s.children}getMainInputPorts(t){return this.getHintPorts(t,"mainInput")}getAppendInputPorts(t){return this.getHintPorts(t,"appendInput")}generateBlockDeclarations(t){var f,g,p,v;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((g=(f=this.getHintPorts(n,"output"))==null?void 0:f.find(m=>m.hint==="output"))==null?void 0:g.id)||"",a=((p=this.getMainInputPorts(n))==null?void 0:p.map(m=>m.id))||[],l=((v=this.getAppendInputPorts(n))==null?void 0:v.map(m=>m.id))||[],c=r.findSourceNodes(n.id)||[],d=new Map(c.map(m=>[m.handleId,m])),u=a.map(m=>d.get(m)).map(m=>m==null?void 0:m.relatedHandleId),h=l.map(m=>d.get(m)).map(m=>m==null?void 0:m.relatedHandleId);return[`const ${o(s)} = ${pS}.combine( [${u.map(m=>m?o(m):"undefined").join(",")}], [${h.map(m=>m?o(m):"undefined").join(",")}] - )`]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}}const aXe="_editor_94u6i_1",lXe="_container_94u6i_4";var toe={editor:aXe,container:lXe};function gc(i,e=0){return i[i.length-(1+e)]}function cXe(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function Lo(i,e,t=(n,o)=>n===o){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let n=0,o=i.length;nt(i[n],e))}function uXe(i,e){let t=0,n=i-1;for(;t<=n;){const o=(t+n)/2|0,r=e(o);if(r<0)t=o+1;else if(r>0)n=o-1;else return o}return-(t+1)}function KW(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const n=e[Math.floor(e.length*Math.random())],o=[],r=[],s=[];for(const a of e){const l=t(a,n);l<0?o.push(a):l>0?r.push(a):s.push(a)}return i!!e)}function ioe(i){let e=0;for(let t=0;t0}function bv(i,e=t=>t){const t=new Set;return i.filter(n=>{const o=e(n);return t.has(o)?!1:(t.add(o),!0)})}function d_e(i,e){return i.length>0?i[0]:e}function Gs(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const n=[];if(t<=e)for(let o=t;oe;o--)n.push(o);return n}function W4(i,e,t){const n=i.slice(0,e),o=i.slice(e);return n.concat(t,o)}function D6(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function e2(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function qW(i,e){for(const t of e)i.push(t)}function Pq(i){return Array.isArray(i)?i:[i]}function fXe(i,e,t){const n=u_e(i,e),o=i.length,r=t.length;i.length=o+r;for(let s=o-1;s>=n;s--)i[s+r]=i[s];for(let s=0;s0}i.isGreaterThan=n;function o(r){return r===0}i.isNeitherLessOrGreaterThan=o,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(DD||(DD={}));function Rc(i,e){return(t,n)=>e(i(t),i(n))}function gXe(...i){return(e,t)=>{for(const n of i){const o=n(e,t);if(!DD.isNeitherLessOrGreaterThan(o))return o}return DD.neitherLessOrGreaterThan}}const jg=(i,e)=>i-e,pXe=(i,e)=>jg(i?1:0,e?1:0);function h_e(i){return(e,t)=>-i(e,t)}class ap{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 n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}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 af{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new af(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new af(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(o=>((n||DD.isGreaterThan(e(o,t)))&&(n=!1,t=o),!0)),t}}af.empty=new af(i=>{});function la(i){return typeof i=="string"}function ia(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function mXe(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function Cv(i){return typeof i=="number"&&!isNaN(i)}function roe(i){return!!i&&typeof i[Symbol.iterator]=="function"}function f_e(i){return i===!0||i===!1}function il(i){return typeof i=="undefined"}function kD(i){return!Al(i)}function Al(i){return il(i)||i===null}function fi(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function c0(i){if(Al(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function ID(i){return typeof i=="function"}function vXe(i,e){const t=Math.min(i.length,e.length);for(let n=0;n{e[t]=n&&typeof n=="object"?gg(n):n}),e}function bXe(i){if(!i||typeof i!="object")return i;const e=[i];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const n in t)if(g_e.call(t,n)){const o=t[n];typeof o=="object"&&!Object.isFrozen(o)&&!mXe(o)&&e.push(o)}}return i}const g_e=Object.prototype.hasOwnProperty;function p_e(i,e){return GW(i,e,new Set)}function GW(i,e,t){if(Al(i))return i;const n=e(i);if(typeof n!="undefined")return n;if(Array.isArray(i)){const o=[];for(const r of i)o.push(GW(r,e,t));return o}if(ia(i)){if(t.has(i))throw new Error("Cannot clone recursive data-structure");t.add(i);const o={};for(const r in i)g_e.call(i,r)&&(o[r]=GW(i[r],e,t));return t.delete(i),o}return i}function V4(i,e,t=!0){return ia(i)?(ia(e)&&Object.keys(e).forEach(n=>{n in i?t&&(ia(i[n])&&ia(e[n])?V4(i[n],e[n],t):i[n]=e[n]):i[n]=e[n]}),i):e}function ql(i,e){if(i===e)return!0;if(i==null||e===null||e===void 0||typeof i!=typeof e||typeof i!="object"||Array.isArray(i)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(t=0;tfunction(){const r=Array.prototype.slice.call(arguments,0);return e(o,r)},n={};for(const o of i)n[o]=t(o);return n}globalThis&&globalThis.__awaiter;let wXe=typeof document!="undefined"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function SXe(i,e){let t;return e.length===0?t=i:t=i.replace(/\{(\d+)\}/g,(n,o)=>{const r=o[0],s=e[r];let a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),wXe&&(t="\uFF3B"+t.replace(/[aouei]/g,"$&$&")+"\uFF3D"),t}function C(i,e,...t){return SXe(e,t)}var k6;const kC="en";let PA=!1,OA=!1,ZR=!1,m_e=!1,Fq=!1,Bq=!1,v_e=!1,t2,QR=kC,soe=kC,xXe,ru;const Id=typeof self=="object"?self:typeof global=="object"?global:{};let Ys;typeof Id.vscode!="undefined"&&typeof Id.vscode.process!="undefined"?Ys=Id.vscode.process:typeof process!="undefined"&&(Ys=process);const LXe=typeof((k6=Ys==null?void 0:Ys.versions)===null||k6===void 0?void 0:k6.electron)=="string",EXe=LXe&&(Ys==null?void 0:Ys.type)==="renderer";if(typeof navigator=="object"&&!EXe)ru=navigator.userAgent,PA=ru.indexOf("Windows")>=0,OA=ru.indexOf("Macintosh")>=0,Bq=(ru.indexOf("Macintosh")>=0||ru.indexOf("iPad")>=0||ru.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ZR=ru.indexOf("Linux")>=0,v_e=(ru==null?void 0:ru.indexOf("Mobi"))>=0,Fq=!0,C({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),t2=kC,QR=t2,soe=navigator.language;else if(typeof Ys=="object"){PA=Ys.platform==="win32",OA=Ys.platform==="darwin",ZR=Ys.platform==="linux",ZR&&!!Ys.env.SNAP&&Ys.env.SNAP_REVISION,Ys.env.CI||Ys.env.BUILD_ARTIFACTSTAGINGDIRECTORY,t2=kC,QR=kC;const i=Ys.env.VSCODE_NLS_CONFIG;if(i)try{const e=JSON.parse(i),t=e.availableLanguages["*"];t2=e.locale,soe=e.osLocale,QR=t||kC,xXe=e._translationsConfigFile}catch{}m_e=!0}else console.error("Unable to resolve platform.");const ls=PA,Nn=OA,xs=ZR,Fu=m_e,Xv=Fq,DXe=Fq&&typeof Id.importScripts=="function",Ku=Bq,kXe=v_e,ff=ru,IXe=QR,TXe=typeof Id.postMessage=="function"&&!Id.importScripts,__e=(()=>{if(TXe){const i=[];Id.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,o=i.length;n{const n=++e;i.push({id:n,callback:t}),Id.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})(),Vl=OA||Bq?2:PA?1:3;let aoe=!0,loe=!1;function b_e(){if(!loe){loe=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,aoe=new Uint16Array(i.buffer)[0]===(2<<8)+1}return aoe}const C_e=!!(ff&&ff.indexOf("Chrome")>=0),NXe=!!(ff&&ff.indexOf("Firefox")>=0),RXe=!!(!C_e&&ff&&ff.indexOf("Safari")>=0),MXe=!!(ff&&ff.indexOf("Edg/")>=0);ff&&ff.indexOf("Android")>=0;const vs={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var vn;(function(i){function e(_){return _&&typeof _=="object"&&typeof _[Symbol.iterator]=="function"}i.is=e;const t=Object.freeze([]);function n(){return t}i.empty=n;function*o(_){yield _}i.single=o;function r(_){return e(_)?_:o(_)}i.wrap=r;function s(_){return _||t}i.from=s;function*a(_){for(let y=_.length-1;y>=0;y--)yield _[y]}i.reverse=a;function l(_){return!_||_[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(_){return _[Symbol.iterator]().next().value}i.first=c;function d(_,y){for(const w of _)if(y(w))return!0;return!1}i.some=d;function u(_,y){for(const w of _)if(y(w))return w}i.find=u;function*h(_,y){for(const w of _)y(w)&&(yield w)}i.filter=h;function*f(_,y){let w=0;for(const L of _)yield y(L,w++)}i.map=f;function*g(..._){for(const y of _)for(const w of y)yield w}i.concat=g;function p(_,y,w){let L=w;for(const D of _)L=y(L,D);return L}i.reduce=p;function*v(_,y,w=_.length){for(y<0&&(y+=_.length),w<0?w+=_.length:w>_.length&&(w=_.length);y{o||(o=!0,this._remove(n))}}shift(){if(this._first!==Co.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Co.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Co.Undefined&&e.next!==Co.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Co.Undefined&&e.next===Co.Undefined?(this._first=Co.Undefined,this._last=Co.Undefined):e.next===Co.Undefined?(this._last=this._last.prev,this._last.next=Co.Undefined):e.prev===Co.Undefined&&(this._first=this._first.next,this._first.prev=Co.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Co.Undefined;)yield e.element,e=e.next}}const y_e="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function AXe(i=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of y_e)i.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const Wq=AXe();function w_e(i){let e=Wq;if(i&&i instanceof RegExp)if(i.global)e=i;else{let t="g";i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.unicode&&(t+="u"),e=new RegExp(i.source,t)}return e.lastIndex=0,e}const S_e=new oa;S_e.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function TD(i,e,t,n,o){if(o||(o=vn.first(S_e)),t.length>o.maxLen){let c=i-o.maxLen/2;return c<0?c=0:n+=c,t=t.substring(c,i+o.maxLen/2),TD(i,e,t,n,o)}const r=Date.now(),s=i-1-n;let a=-1,l=null;for(let c=1;!(Date.now()-r>=o.timeBudget);c++){const d=s-o.windowSize*c;e.lastIndex=Math.max(0,d);const u=PXe(e,t,s,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function PXe(i,e,t,n){let o;for(;o=i.exec(e);){const r=o.index||0;if(r<=t&&i.lastIndex>=t)return o;if(n>0&&r>n)return null}return null}const Kp=8;class x_e{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class L_e{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class to{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return H4(e,t)}compute(e,t,n){return n}}class cE{constructor(e,t){this.newValue=e,this.didChange=t}}function H4(i,e){if(typeof i!="object"||typeof e!="object"||!i||!e)return new cE(e,i!==e);if(Array.isArray(i)||Array.isArray(e)){const n=Array.isArray(i)&&Array.isArray(e)&&Lo(i,e);return new cE(e,!n)}let t=!1;for(const n in e)if(e.hasOwnProperty(n)){const o=H4(i[n],e[n]);o.didChange&&(i[n]=o.newValue,t=!0)}return new cE(i,t)}class BI{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return H4(e,t)}validate(e){return this.defaultValue}}class mS{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return H4(e,t)}validate(e){return typeof e=="undefined"?this.defaultValue:e}compute(e,t,n){return n}}function xt(i,e){return typeof i=="undefined"?e:i==="false"?!1:Boolean(i)}class On extends mS{constructor(e,t,n,o=void 0){typeof o!="undefined"&&(o.type="boolean",o.default=n),super(e,t,n,o)}validate(e){return xt(e,this.defaultValue)}}function M_(i,e,t,n){if(typeof i=="undefined")return e;let o=parseInt(i,10);return isNaN(o)?e:(o=Math.max(t,o),o=Math.min(n,o),o|0)}class wi extends mS{static clampedInt(e,t,n,o){return M_(e,t,n,o)}constructor(e,t,n,o,r,s=void 0){typeof s!="undefined"&&(s.type="integer",s.default=n,s.minimum=o,s.maximum=r),super(e,t,n,s),this.minimum=o,this.maximum=r}validate(e){return wi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function OXe(i,e,t,n){if(typeof i=="undefined")return e;const o=wd.float(i,e);return wd.clamp(o,t,n)}class wd extends mS{static clamp(e,t,n){return en?n:e}static float(e,t){if(typeof e=="number")return e;if(typeof e=="undefined")return t;const n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,o,r){typeof r!="undefined"&&(r.type="number",r.default=n),super(e,t,n,r),this.validationFn=o}validate(e){return this.validationFn(wd.float(e,this.defaultValue))}}class Qa extends mS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,o=void 0){typeof o!="undefined"&&(o.type="string",o.default=n),super(e,t,n,o)}validate(e){return Qa.string(e,this.defaultValue)}}function To(i,e,t,n){return typeof i!="string"?e:n&&i in n?n[i]:t.indexOf(i)===-1?e:i}class uo extends mS{constructor(e,t,n,o,r=void 0){typeof r!="undefined"&&(r.type="string",r.enum=o,r.default=n),super(e,t,n,r),this._allowedValues=o}validate(e){return To(e,this.defaultValue,this._allowedValues)}}class n2 extends to{constructor(e,t,n,o,r,s,a=void 0){typeof a!="undefined"&&(a.type="string",a.enum=r,a.default=o),super(e,t,n,a),this._allowedValues=r,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function FXe(i){switch(i){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class BXe extends to{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[C("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),C("accessibilitySupport.on","Optimize for usage with a Screen Reader"),C("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:C("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,n){return n===0?e.accessibilitySupport:n}}class WXe extends to{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:C("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:C("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:xt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:xt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function VXe(i){switch(i){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Wr;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Wr||(Wr={}));function HXe(i){switch(i){case"line":return Wr.Line;case"block":return Wr.Block;case"underline":return Wr.Underline;case"line-thin":return Wr.LineThin;case"block-outline":return Wr.BlockOutline;case"underline-thin":return Wr.UnderlineThin}}class $Xe extends BI{constructor(){super(140)}compute(e,t,n){const o=["monaco-editor"];return t.get(39)&&o.push(t.get(39)),e.extraEditorClassName&&o.push(e.extraEditorClassName),t.get(73)==="default"?o.push("mouse-default"):t.get(73)==="copy"&&o.push("mouse-copy"),t.get(110)&&o.push("showUnused"),t.get(138)&&o.push("showDeprecated"),o.join(" ")}}class zXe extends On{constructor(){super(37,"emptySelectionClipboard",!0,{description:C("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class UXe extends to{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:C("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:[C("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),C("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),C("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:C("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:[C("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),C("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),C("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:C("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:C("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Nn},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:C("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:C("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:xt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":To(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":To(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:xt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:xt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:xt(t.loop,this.defaultValue.loop)}}}class Pl extends to{constructor(){super(51,"fontLigatures",Pl.OFF,{anyOf:[{type:"boolean",description:C("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:C("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:C("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=="undefined"?this.defaultValue:typeof e=="string"?e==="false"?Pl.OFF:e==="true"?Pl.ON:e:Boolean(e)?Pl.ON:Pl.OFF}}Pl.OFF='"liga" off, "calt" off';Pl.ON='"liga" on, "calt" on';class Eu extends to{constructor(){super(54,"fontVariations",Eu.OFF,{anyOf:[{type:"boolean",description:C("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:C("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:C("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=="undefined"?this.defaultValue:typeof e=="string"?e==="false"?Eu.OFF:e==="true"?Eu.TRANSLATE:e:Boolean(e)?Eu.TRANSLATE:Eu.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}}Eu.OFF="normal";Eu.TRANSLATE="translate";class jXe extends BI{constructor(){super(50)}compute(e,t,n){return e.fontInfo}}class KXe extends mS{constructor(){super(52,"fontSize",al.fontSize,{type:"number",minimum:6,maximum:100,default:al.fontSize,description:C("fontSize","Controls the font size in pixels.")})}validate(e){const t=wd.float(e,this.defaultValue);return t===0?al.fontSize:wd.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}class Rh extends to{constructor(){super(53,"fontWeight",al.fontWeight,{anyOf:[{type:"number",minimum:Rh.MINIMUM_VALUE,maximum:Rh.MAXIMUM_VALUE,errorMessage:C("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:Rh.SUGGESTION_VALUES}],default:al.fontWeight,description:C("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(wi.clampedInt(e,al.fontWeight,Rh.MINIMUM_VALUE,Rh.MAXIMUM_VALUE))}}Rh.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Rh.MINIMUM_VALUE=1;Rh.MAXIMUM_VALUE=1e3;class qXe extends to{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:[C("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),C("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),C("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},n=["","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:C("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:C("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:C("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:C("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:C("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:C("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:n,description:C("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:n,description:C("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:n,description:C("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:n,description:C("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:n,description:C("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,n,o,r,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:To(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:To(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(n=a.multipleTypeDefinitions)!==null&&n!==void 0?n:To(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(o=a.multipleDeclarations)!==null&&o!==void 0?o:To(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(r=a.multipleImplementations)!==null&&r!==void 0?r:To(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:To(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Qa.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Qa.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Qa.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Qa.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Qa.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class GXe extends to{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:C("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:C("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:C("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:C("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:C("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:xt(t.enabled,this.defaultValue.enabled),delay:wi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:xt(t.sticky,this.defaultValue.sticky),hidingDelay:wi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:xt(t.above,this.defaultValue.above)}}}class py extends BI{constructor(){super(143)}compute(e,t,n){return py.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,n=Math.floor(e.paddingTop/e.lineHeight);let o=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(o=Math.max(o,t-1));const r=(n+e.viewLineCount+o)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/r);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:o,desiredRatio:r,minimapLineCount:s}}static _computeMinimapLayout(e,t){const n=e.outerWidth,o=e.outerHeight,r=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(r*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,v=e.verticalScrollbarWidth,m=e.viewLineCount,_=e.remainingWidth,y=e.isViewportWrapping,w=u?2:3;let L=Math.floor(r*o);const D=L/r;let E=!1,I=!1,k=w*h,R=h/r,A=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:$,extraLinesBeforeFirstLine:z,extraLinesBeyondLastLine:K,desiredRatio:j,minimapLineCount:G}=py.computeContainedMinimapLineCount({viewLineCount:m,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:o,lineHeight:l,pixelRatio:r});if(m/G>1)E=!0,I=!0,h=1,k=1,R=h/r;else{let ue=!1,fe=h+1;if(g==="fit"){const pe=Math.ceil((z+m+K)*k);y&&a&&_<=t.stableFitRemainingWidth?(ue=!0,fe=t.stableFitMaxMinimapScale):ue=pe>L}if(g==="fill"||ue){E=!0;const pe=h;k=Math.min(l*r,Math.max(1,Math.floor(1/j))),y&&a&&_<=t.stableFitRemainingWidth&&(fe=t.stableFitMaxMinimapScale),h=Math.min(fe,Math.max(1,Math.floor(k/w))),h>pe&&(A=Math.min(2,h/pe)),R=h/r/A,L=Math.ceil(Math.max($,z+m+K)*k),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const P=Math.floor(f*R),N=Math.min(P,Math.max(0,Math.floor((_-v-2)*R/(c+R)))+Kp);let M=Math.floor(r*N);const H=M/r;M=Math.floor(M*A);const B=u?1:2,F=p==="left"?0:n-N-v;return{renderMinimap:B,minimapLeft:F,minimapWidth:N,minimapHeightIsEditorHeight:E,minimapIsSampling:I,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:M,minimapCanvasInnerHeight:L,minimapCanvasOuterWidth:H,minimapCanvasOuterHeight:D}}static computeLayout(e,t){const n=t.outerWidth|0,o=t.outerHeight|0,r=t.lineHeight|0,s=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,v=e.get(57),m=e.get(67).renderType!==0,_=e.get(68),y=e.get(104),w=e.get(83),L=e.get(72),D=e.get(102),E=D.verticalScrollbarSize,I=D.verticalHasArrows,k=D.arrowSize,R=D.horizontalScrollbarSize,A=e.get(43),P=e.get(109)!=="never";let N=e.get(65);A&&P&&(N+=16);let M=0;if(m){const Se=Math.max(s,_);M=Math.round(Se*l)}let H=0;v&&(H=r*t.glyphMarginDecorationLaneCount);let B=0,F=B+H,$=F+M,z=$+N;const K=n-H-M-N;let j=!1,G=!1,X=-1;h==="inherit"&&p?(j=!0,G=!0):f==="on"||f==="bounded"?G=!0:f==="wordWrapColumn"&&(X=g);const ue=py._computeMinimapLayout({outerWidth:n,outerHeight:o,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:w.top,paddingBottom:w.bottom,minimap:L,verticalScrollbarWidth:E,viewLineCount:d,remainingWidth:K,isViewportWrapping:G},t.memory||new L_e);ue.renderMinimap!==0&&ue.minimapLeft===0&&(B+=ue.minimapWidth,F+=ue.minimapWidth,$+=ue.minimapWidth,z+=ue.minimapWidth);const fe=K-ue.minimapWidth,pe=Math.max(1,Math.floor((fe-E-2)/a)),be=I?k:0;return G&&(X=Math.max(1,pe),f==="bounded"&&(X=Math.min(X,g))),{width:n,height:o,glyphMarginLeft:B,glyphMarginWidth:H,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:F,lineNumbersWidth:M,decorationsLeft:$,decorationsWidth:N,contentLeft:z,contentWidth:fe,minimap:ue,viewportColumn:pe,isWordWrapMinified:j,isViewportWrapping:G,wrappingColumn:X,verticalScrollbarWidth:E,horizontalScrollbarHeight:R,overviewRuler:{top:be,width:E,height:o-2*be,right:0}}}}class XXe extends to{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[C("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."),C("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:C("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 To(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}}class YXe extends to{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:C("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:xt(e.enabled,this.defaultValue.enabled)}}}class ZXe extends to{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:C("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:C("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:C("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:C("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:xt(t.enabled,this.defaultValue.enabled),maxLineCount:wi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:To(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:xt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class QXe extends to{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:C("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[C("editor.inlayHints.on","Inlay hints are enabled"),C("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Nn?"Ctrl+Option":"Ctrl+Alt"),C("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Nn?"Ctrl+Option":"Ctrl+Alt"),C("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:C("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:C("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:C("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:To(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:wi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Qa.string(t.fontFamily,this.defaultValue.fontFamily),padding:xt(t.padding,this.defaultValue.padding)}}}class JXe extends to{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):wi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?wi.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}}class eYe extends wd{constructor(){super(66,"lineHeight",al.lineHeight,e=>wd.clamp(e,0,150),{markdownDescription:C("lineHeight",`Controls the line height. + )`]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}}const cXe="_editor_94u6i_1",dXe="_container_94u6i_4";var noe={editor:cXe,container:dXe};function gc(i,e=0){return i[i.length-(1+e)]}function uXe(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function Lo(i,e,t=(n,o)=>n===o){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let n=0,o=i.length;nt(i[n],e))}function fXe(i,e){let t=0,n=i-1;for(;t<=n;){const o=(t+n)/2|0,r=e(o);if(r<0)t=o+1;else if(r>0)n=o-1;else return o}return-(t+1)}function qW(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const n=e[Math.floor(e.length*Math.random())],o=[],r=[],s=[];for(const a of e){const l=t(a,n);l<0?o.push(a):l>0?r.push(a):s.push(a)}return i!!e)}function ooe(i){let e=0;for(let t=0;t0}function bv(i,e=t=>t){const t=new Set;return i.filter(n=>{const o=e(n);return t.has(o)?!1:(t.add(o),!0)})}function d_e(i,e){return i.length>0?i[0]:e}function Gs(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const n=[];if(t<=e)for(let o=t;oe;o--)n.push(o);return n}function V4(i,e,t){const n=i.slice(0,e),o=i.slice(e);return n.concat(t,o)}function k6(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function e2(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function GW(i,e){for(const t of e)i.push(t)}function Oq(i){return Array.isArray(i)?i:[i]}function pXe(i,e,t){const n=u_e(i,e),o=i.length,r=t.length;i.length=o+r;for(let s=o-1;s>=n;s--)i[s+r]=i[s];for(let s=0;s0}i.isGreaterThan=n;function o(r){return r===0}i.isNeitherLessOrGreaterThan=o,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(DD||(DD={}));function Rc(i,e){return(t,n)=>e(i(t),i(n))}function mXe(...i){return(e,t)=>{for(const n of i){const o=n(e,t);if(!DD.isNeitherLessOrGreaterThan(o))return o}return DD.neitherLessOrGreaterThan}}const jg=(i,e)=>i-e,vXe=(i,e)=>jg(i?1:0,e?1:0);function h_e(i){return(e,t)=>-i(e,t)}class lp{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 n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}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 af{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new af(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new af(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(o=>((n||DD.isGreaterThan(e(o,t)))&&(n=!1,t=o),!0)),t}}af.empty=new af(i=>{});function la(i){return typeof i=="string"}function ia(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function _Xe(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function Cv(i){return typeof i=="number"&&!isNaN(i)}function soe(i){return!!i&&typeof i[Symbol.iterator]=="function"}function f_e(i){return i===!0||i===!1}function il(i){return typeof i=="undefined"}function kD(i){return!Al(i)}function Al(i){return il(i)||i===null}function fi(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function c0(i){if(Al(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function ID(i){return typeof i=="function"}function bXe(i,e){const t=Math.min(i.length,e.length);for(let n=0;n{e[t]=n&&typeof n=="object"?gg(n):n}),e}function yXe(i){if(!i||typeof i!="object")return i;const e=[i];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const n in t)if(g_e.call(t,n)){const o=t[n];typeof o=="object"&&!Object.isFrozen(o)&&!_Xe(o)&&e.push(o)}}return i}const g_e=Object.prototype.hasOwnProperty;function p_e(i,e){return XW(i,e,new Set)}function XW(i,e,t){if(Al(i))return i;const n=e(i);if(typeof n!="undefined")return n;if(Array.isArray(i)){const o=[];for(const r of i)o.push(XW(r,e,t));return o}if(ia(i)){if(t.has(i))throw new Error("Cannot clone recursive data-structure");t.add(i);const o={};for(const r in i)g_e.call(i,r)&&(o[r]=XW(i[r],e,t));return t.delete(i),o}return i}function H4(i,e,t=!0){return ia(i)?(ia(e)&&Object.keys(e).forEach(n=>{n in i?t&&(ia(i[n])&&ia(e[n])?H4(i[n],e[n],t):i[n]=e[n]):i[n]=e[n]}),i):e}function ql(i,e){if(i===e)return!0;if(i==null||e===null||e===void 0||typeof i!=typeof e||typeof i!="object"||Array.isArray(i)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(t=0;tfunction(){const r=Array.prototype.slice.call(arguments,0);return e(o,r)},n={};for(const o of i)n[o]=t(o);return n}globalThis&&globalThis.__awaiter;let xXe=typeof document!="undefined"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function LXe(i,e){let t;return e.length===0?t=i:t=i.replace(/\{(\d+)\}/g,(n,o)=>{const r=o[0],s=e[r];let a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),xXe&&(t="\uFF3B"+t.replace(/[aouei]/g,"$&$&")+"\uFF3D"),t}function C(i,e,...t){return LXe(e,t)}var I6;const kC="en";let PA=!1,OA=!1,ZR=!1,m_e=!1,Bq=!1,Wq=!1,v_e=!1,t2,QR=kC,aoe=kC,EXe,ru;const Id=typeof self=="object"?self:typeof global=="object"?global:{};let Ys;typeof Id.vscode!="undefined"&&typeof Id.vscode.process!="undefined"?Ys=Id.vscode.process:typeof process!="undefined"&&(Ys=process);const DXe=typeof((I6=Ys==null?void 0:Ys.versions)===null||I6===void 0?void 0:I6.electron)=="string",kXe=DXe&&(Ys==null?void 0:Ys.type)==="renderer";if(typeof navigator=="object"&&!kXe)ru=navigator.userAgent,PA=ru.indexOf("Windows")>=0,OA=ru.indexOf("Macintosh")>=0,Wq=(ru.indexOf("Macintosh")>=0||ru.indexOf("iPad")>=0||ru.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ZR=ru.indexOf("Linux")>=0,v_e=(ru==null?void 0:ru.indexOf("Mobi"))>=0,Bq=!0,C({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),t2=kC,QR=t2,aoe=navigator.language;else if(typeof Ys=="object"){PA=Ys.platform==="win32",OA=Ys.platform==="darwin",ZR=Ys.platform==="linux",ZR&&!!Ys.env.SNAP&&Ys.env.SNAP_REVISION,Ys.env.CI||Ys.env.BUILD_ARTIFACTSTAGINGDIRECTORY,t2=kC,QR=kC;const i=Ys.env.VSCODE_NLS_CONFIG;if(i)try{const e=JSON.parse(i),t=e.availableLanguages["*"];t2=e.locale,aoe=e.osLocale,QR=t||kC,EXe=e._translationsConfigFile}catch{}m_e=!0}else console.error("Unable to resolve platform.");const ls=PA,Nn=OA,xs=ZR,Fu=m_e,Xv=Bq,IXe=Bq&&typeof Id.importScripts=="function",Ku=Wq,TXe=v_e,ff=ru,NXe=QR,RXe=typeof Id.postMessage=="function"&&!Id.importScripts,__e=(()=>{if(RXe){const i=[];Id.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,o=i.length;n{const n=++e;i.push({id:n,callback:t}),Id.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})(),Vl=OA||Wq?2:PA?1:3;let loe=!0,coe=!1;function b_e(){if(!coe){coe=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,loe=new Uint16Array(i.buffer)[0]===(2<<8)+1}return loe}const C_e=!!(ff&&ff.indexOf("Chrome")>=0),MXe=!!(ff&&ff.indexOf("Firefox")>=0),AXe=!!(!C_e&&ff&&ff.indexOf("Safari")>=0),PXe=!!(ff&&ff.indexOf("Edg/")>=0);ff&&ff.indexOf("Android")>=0;const vs={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var vn;(function(i){function e(_){return _&&typeof _=="object"&&typeof _[Symbol.iterator]=="function"}i.is=e;const t=Object.freeze([]);function n(){return t}i.empty=n;function*o(_){yield _}i.single=o;function r(_){return e(_)?_:o(_)}i.wrap=r;function s(_){return _||t}i.from=s;function*a(_){for(let y=_.length-1;y>=0;y--)yield _[y]}i.reverse=a;function l(_){return!_||_[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(_){return _[Symbol.iterator]().next().value}i.first=c;function d(_,y){for(const w of _)if(y(w))return!0;return!1}i.some=d;function u(_,y){for(const w of _)if(y(w))return w}i.find=u;function*h(_,y){for(const w of _)y(w)&&(yield w)}i.filter=h;function*f(_,y){let w=0;for(const L of _)yield y(L,w++)}i.map=f;function*g(..._){for(const y of _)for(const w of y)yield w}i.concat=g;function p(_,y,w){let L=w;for(const D of _)L=y(L,D);return L}i.reduce=p;function*v(_,y,w=_.length){for(y<0&&(y+=_.length),w<0?w+=_.length:w>_.length&&(w=_.length);y{o||(o=!0,this._remove(n))}}shift(){if(this._first!==Co.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Co.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Co.Undefined&&e.next!==Co.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Co.Undefined&&e.next===Co.Undefined?(this._first=Co.Undefined,this._last=Co.Undefined):e.next===Co.Undefined?(this._last=this._last.prev,this._last.next=Co.Undefined):e.prev===Co.Undefined&&(this._first=this._first.next,this._first.prev=Co.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Co.Undefined;)yield e.element,e=e.next}}const y_e="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function OXe(i=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of y_e)i.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const Vq=OXe();function w_e(i){let e=Vq;if(i&&i instanceof RegExp)if(i.global)e=i;else{let t="g";i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.unicode&&(t+="u"),e=new RegExp(i.source,t)}return e.lastIndex=0,e}const S_e=new oa;S_e.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function TD(i,e,t,n,o){if(o||(o=vn.first(S_e)),t.length>o.maxLen){let c=i-o.maxLen/2;return c<0?c=0:n+=c,t=t.substring(c,i+o.maxLen/2),TD(i,e,t,n,o)}const r=Date.now(),s=i-1-n;let a=-1,l=null;for(let c=1;!(Date.now()-r>=o.timeBudget);c++){const d=s-o.windowSize*c;e.lastIndex=Math.max(0,d);const u=FXe(e,t,s,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function FXe(i,e,t,n){let o;for(;o=i.exec(e);){const r=o.index||0;if(r<=t&&i.lastIndex>=t)return o;if(n>0&&r>n)return null}return null}const qp=8;class x_e{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class L_e{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class to{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return $4(e,t)}compute(e,t,n){return n}}class cE{constructor(e,t){this.newValue=e,this.didChange=t}}function $4(i,e){if(typeof i!="object"||typeof e!="object"||!i||!e)return new cE(e,i!==e);if(Array.isArray(i)||Array.isArray(e)){const n=Array.isArray(i)&&Array.isArray(e)&&Lo(i,e);return new cE(e,!n)}let t=!1;for(const n in e)if(e.hasOwnProperty(n)){const o=$4(i[n],e[n]);o.didChange&&(i[n]=o.newValue,t=!0)}return new cE(i,t)}class BI{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return $4(e,t)}validate(e){return this.defaultValue}}class mS{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return $4(e,t)}validate(e){return typeof e=="undefined"?this.defaultValue:e}compute(e,t,n){return n}}function xt(i,e){return typeof i=="undefined"?e:i==="false"?!1:Boolean(i)}class On extends mS{constructor(e,t,n,o=void 0){typeof o!="undefined"&&(o.type="boolean",o.default=n),super(e,t,n,o)}validate(e){return xt(e,this.defaultValue)}}function M_(i,e,t,n){if(typeof i=="undefined")return e;let o=parseInt(i,10);return isNaN(o)?e:(o=Math.max(t,o),o=Math.min(n,o),o|0)}class wi extends mS{static clampedInt(e,t,n,o){return M_(e,t,n,o)}constructor(e,t,n,o,r,s=void 0){typeof s!="undefined"&&(s.type="integer",s.default=n,s.minimum=o,s.maximum=r),super(e,t,n,s),this.minimum=o,this.maximum=r}validate(e){return wi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function BXe(i,e,t,n){if(typeof i=="undefined")return e;const o=wd.float(i,e);return wd.clamp(o,t,n)}class wd extends mS{static clamp(e,t,n){return en?n:e}static float(e,t){if(typeof e=="number")return e;if(typeof e=="undefined")return t;const n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,o,r){typeof r!="undefined"&&(r.type="number",r.default=n),super(e,t,n,r),this.validationFn=o}validate(e){return this.validationFn(wd.float(e,this.defaultValue))}}class Qa extends mS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,o=void 0){typeof o!="undefined"&&(o.type="string",o.default=n),super(e,t,n,o)}validate(e){return Qa.string(e,this.defaultValue)}}function To(i,e,t,n){return typeof i!="string"?e:n&&i in n?n[i]:t.indexOf(i)===-1?e:i}class uo extends mS{constructor(e,t,n,o,r=void 0){typeof r!="undefined"&&(r.type="string",r.enum=o,r.default=n),super(e,t,n,r),this._allowedValues=o}validate(e){return To(e,this.defaultValue,this._allowedValues)}}class n2 extends to{constructor(e,t,n,o,r,s,a=void 0){typeof a!="undefined"&&(a.type="string",a.enum=r,a.default=o),super(e,t,n,a),this._allowedValues=r,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function WXe(i){switch(i){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class VXe extends to{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[C("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),C("accessibilitySupport.on","Optimize for usage with a Screen Reader"),C("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:C("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,n){return n===0?e.accessibilitySupport:n}}class HXe extends to{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:C("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:C("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:xt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:xt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function $Xe(i){switch(i){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Wr;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Wr||(Wr={}));function zXe(i){switch(i){case"line":return Wr.Line;case"block":return Wr.Block;case"underline":return Wr.Underline;case"line-thin":return Wr.LineThin;case"block-outline":return Wr.BlockOutline;case"underline-thin":return Wr.UnderlineThin}}class UXe extends BI{constructor(){super(140)}compute(e,t,n){const o=["monaco-editor"];return t.get(39)&&o.push(t.get(39)),e.extraEditorClassName&&o.push(e.extraEditorClassName),t.get(73)==="default"?o.push("mouse-default"):t.get(73)==="copy"&&o.push("mouse-copy"),t.get(110)&&o.push("showUnused"),t.get(138)&&o.push("showDeprecated"),o.join(" ")}}class jXe extends On{constructor(){super(37,"emptySelectionClipboard",!0,{description:C("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class KXe extends to{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:C("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:[C("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),C("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),C("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:C("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:[C("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),C("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),C("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:C("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:C("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Nn},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:C("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:C("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:xt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":To(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":To(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:xt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:xt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:xt(t.loop,this.defaultValue.loop)}}}class Pl extends to{constructor(){super(51,"fontLigatures",Pl.OFF,{anyOf:[{type:"boolean",description:C("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:C("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:C("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=="undefined"?this.defaultValue:typeof e=="string"?e==="false"?Pl.OFF:e==="true"?Pl.ON:e:Boolean(e)?Pl.ON:Pl.OFF}}Pl.OFF='"liga" off, "calt" off';Pl.ON='"liga" on, "calt" on';class Eu extends to{constructor(){super(54,"fontVariations",Eu.OFF,{anyOf:[{type:"boolean",description:C("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:C("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:C("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=="undefined"?this.defaultValue:typeof e=="string"?e==="false"?Eu.OFF:e==="true"?Eu.TRANSLATE:e:Boolean(e)?Eu.TRANSLATE:Eu.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}}Eu.OFF="normal";Eu.TRANSLATE="translate";class qXe extends BI{constructor(){super(50)}compute(e,t,n){return e.fontInfo}}class GXe extends mS{constructor(){super(52,"fontSize",al.fontSize,{type:"number",minimum:6,maximum:100,default:al.fontSize,description:C("fontSize","Controls the font size in pixels.")})}validate(e){const t=wd.float(e,this.defaultValue);return t===0?al.fontSize:wd.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}class Rh extends to{constructor(){super(53,"fontWeight",al.fontWeight,{anyOf:[{type:"number",minimum:Rh.MINIMUM_VALUE,maximum:Rh.MAXIMUM_VALUE,errorMessage:C("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:Rh.SUGGESTION_VALUES}],default:al.fontWeight,description:C("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(wi.clampedInt(e,al.fontWeight,Rh.MINIMUM_VALUE,Rh.MAXIMUM_VALUE))}}Rh.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Rh.MINIMUM_VALUE=1;Rh.MAXIMUM_VALUE=1e3;class XXe extends to{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:[C("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),C("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),C("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},n=["","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:C("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:C("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:C("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:C("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:C("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:C("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:n,description:C("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:n,description:C("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:n,description:C("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:n,description:C("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:n,description:C("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,n,o,r,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:To(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:To(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(n=a.multipleTypeDefinitions)!==null&&n!==void 0?n:To(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(o=a.multipleDeclarations)!==null&&o!==void 0?o:To(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(r=a.multipleImplementations)!==null&&r!==void 0?r:To(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:To(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Qa.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Qa.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Qa.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Qa.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Qa.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class YXe extends to{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:C("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:C("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:C("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:C("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:C("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:xt(t.enabled,this.defaultValue.enabled),delay:wi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:xt(t.sticky,this.defaultValue.sticky),hidingDelay:wi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:xt(t.above,this.defaultValue.above)}}}class py extends BI{constructor(){super(143)}compute(e,t,n){return py.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,n=Math.floor(e.paddingTop/e.lineHeight);let o=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(o=Math.max(o,t-1));const r=(n+e.viewLineCount+o)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/r);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:o,desiredRatio:r,minimapLineCount:s}}static _computeMinimapLayout(e,t){const n=e.outerWidth,o=e.outerHeight,r=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(r*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,v=e.verticalScrollbarWidth,m=e.viewLineCount,_=e.remainingWidth,y=e.isViewportWrapping,w=u?2:3;let L=Math.floor(r*o);const D=L/r;let E=!1,I=!1,k=w*h,R=h/r,A=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:$,extraLinesBeforeFirstLine:z,extraLinesBeyondLastLine:K,desiredRatio:j,minimapLineCount:G}=py.computeContainedMinimapLineCount({viewLineCount:m,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:o,lineHeight:l,pixelRatio:r});if(m/G>1)E=!0,I=!0,h=1,k=1,R=h/r;else{let ue=!1,fe=h+1;if(g==="fit"){const pe=Math.ceil((z+m+K)*k);y&&a&&_<=t.stableFitRemainingWidth?(ue=!0,fe=t.stableFitMaxMinimapScale):ue=pe>L}if(g==="fill"||ue){E=!0;const pe=h;k=Math.min(l*r,Math.max(1,Math.floor(1/j))),y&&a&&_<=t.stableFitRemainingWidth&&(fe=t.stableFitMaxMinimapScale),h=Math.min(fe,Math.max(1,Math.floor(k/w))),h>pe&&(A=Math.min(2,h/pe)),R=h/r/A,L=Math.ceil(Math.max($,z+m+K)*k),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const P=Math.floor(f*R),N=Math.min(P,Math.max(0,Math.floor((_-v-2)*R/(c+R)))+qp);let M=Math.floor(r*N);const H=M/r;M=Math.floor(M*A);const B=u?1:2,F=p==="left"?0:n-N-v;return{renderMinimap:B,minimapLeft:F,minimapWidth:N,minimapHeightIsEditorHeight:E,minimapIsSampling:I,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:M,minimapCanvasInnerHeight:L,minimapCanvasOuterWidth:H,minimapCanvasOuterHeight:D}}static computeLayout(e,t){const n=t.outerWidth|0,o=t.outerHeight|0,r=t.lineHeight|0,s=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,v=e.get(57),m=e.get(67).renderType!==0,_=e.get(68),y=e.get(104),w=e.get(83),L=e.get(72),D=e.get(102),E=D.verticalScrollbarSize,I=D.verticalHasArrows,k=D.arrowSize,R=D.horizontalScrollbarSize,A=e.get(43),P=e.get(109)!=="never";let N=e.get(65);A&&P&&(N+=16);let M=0;if(m){const Se=Math.max(s,_);M=Math.round(Se*l)}let H=0;v&&(H=r*t.glyphMarginDecorationLaneCount);let B=0,F=B+H,$=F+M,z=$+N;const K=n-H-M-N;let j=!1,G=!1,X=-1;h==="inherit"&&p?(j=!0,G=!0):f==="on"||f==="bounded"?G=!0:f==="wordWrapColumn"&&(X=g);const ue=py._computeMinimapLayout({outerWidth:n,outerHeight:o,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:w.top,paddingBottom:w.bottom,minimap:L,verticalScrollbarWidth:E,viewLineCount:d,remainingWidth:K,isViewportWrapping:G},t.memory||new L_e);ue.renderMinimap!==0&&ue.minimapLeft===0&&(B+=ue.minimapWidth,F+=ue.minimapWidth,$+=ue.minimapWidth,z+=ue.minimapWidth);const fe=K-ue.minimapWidth,pe=Math.max(1,Math.floor((fe-E-2)/a)),be=I?k:0;return G&&(X=Math.max(1,pe),f==="bounded"&&(X=Math.min(X,g))),{width:n,height:o,glyphMarginLeft:B,glyphMarginWidth:H,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:F,lineNumbersWidth:M,decorationsLeft:$,decorationsWidth:N,contentLeft:z,contentWidth:fe,minimap:ue,viewportColumn:pe,isWordWrapMinified:j,isViewportWrapping:G,wrappingColumn:X,verticalScrollbarWidth:E,horizontalScrollbarHeight:R,overviewRuler:{top:be,width:E,height:o-2*be,right:0}}}}class ZXe extends to{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[C("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."),C("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:C("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 To(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}}class QXe extends to{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:C("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:xt(e.enabled,this.defaultValue.enabled)}}}class JXe extends to{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:C("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:C("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:C("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:C("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:xt(t.enabled,this.defaultValue.enabled),maxLineCount:wi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:To(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:xt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class eYe extends to{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:C("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[C("editor.inlayHints.on","Inlay hints are enabled"),C("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Nn?"Ctrl+Option":"Ctrl+Alt"),C("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Nn?"Ctrl+Option":"Ctrl+Alt"),C("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:C("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:C("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:C("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:To(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:wi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Qa.string(t.fontFamily,this.defaultValue.fontFamily),padding:xt(t.padding,this.defaultValue.padding)}}}class tYe extends to{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):wi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?wi.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}}class nYe extends wd{constructor(){super(66,"lineHeight",al.lineHeight,e=>wd.clamp(e,0,150),{markdownDescription:C("lineHeight",`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,n){return e.fontInfo.lineHeight}}class tYe extends to{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:C("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:C("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[C("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),C("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),C("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:C("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:C("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:C("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:C("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:C("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:C("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:xt(t.enabled,this.defaultValue.enabled),autohide:xt(t.autohide,this.defaultValue.autohide),size:To(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:To(t.side,this.defaultValue.side,["right","left"]),showSlider:To(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:xt(t.renderCharacters,this.defaultValue.renderCharacters),scale:wi.clampedInt(t.scale,1,1,3),maxColumn:wi.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function nYe(i){return i==="ctrlCmd"?Nn?"metaKey":"ctrlKey":"altKey"}class iYe extends to{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:C("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:C("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:wi.clampedInt(t.top,0,0,1e3),bottom:wi.clampedInt(t.bottom,0,0,1e3)}}}class oYe extends to{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:C("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:C("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:xt(t.enabled,this.defaultValue.enabled),cycle:xt(t.cycle,this.defaultValue.cycle)}}}class rYe extends BI{constructor(){super(141)}compute(e,t,n){return e.pixelRatio}}class sYe extends to{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[C("on","Quick suggestions show inside the suggest widget"),C("inline","Quick suggestions show as ghost text"),C("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:C("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:C("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:C("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:C("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:n,strings:o}=e,r=["on","inline","off"];let s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=To(t,this.defaultValue.other,r),typeof n=="boolean"?a=n?"on":"off":a=To(n,this.defaultValue.comments,r),typeof o=="boolean"?l=o?"on":"off":l=To(o,this.defaultValue.strings,r),{other:s,comments:a,strings:l}}}class aYe extends to{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[C("lineNumbers.off","Line numbers are not rendered."),C("lineNumbers.on","Line numbers are rendered as absolute number."),C("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),C("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:C("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e!="undefined"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}}function FA(i){const e=i.get(97);return e==="editable"?i.get(90):e!=="on"}class lYe extends to{constructor(){const e=[],t={type:"number",description:C("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:C("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:C("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 n of e)if(typeof n=="number")t.push({column:wi.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){const o=n;t.push({column:wi.clampedInt(o.column,0,0,1e4),color:o.color})}return t.sort((n,o)=>n.column-o.column),t}return this.defaultValue}}class cYe extends to{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function coe(i,e){if(typeof i!="string")return e;switch(i){case"hidden":return 2;case"visible":return 3;default:return 1}}class dYe extends to{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:[C("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),C("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),C("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:C("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[C("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),C("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),C("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:C("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:C("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:C("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:C("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,n=wi.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),o=wi.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:wi.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:coe(t.vertical,this.defaultValue.vertical),horizontal:coe(t.horizontal,this.defaultValue.horizontal),useShadows:xt(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:xt(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:xt(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:xt(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:xt(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:wi.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:o,verticalSliderSize:wi.clampedInt(t.verticalSliderSize,o,0,1e3),scrollByPage:xt(t.scrollByPage,this.defaultValue.scrollByPage)}}}const kl="inUntrustedWorkspace",Ta={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 uYe extends to{constructor(){const e={nonBasicASCII:kl,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:kl,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Ta.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kl],default:e.nonBasicASCII,description:C("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.")},[Ta.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:C("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Ta.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:C("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.")},[Ta.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kl],default:e.includeComments,description:C("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Ta.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kl],default:e.includeStrings,description:C("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Ta.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:C("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Ta.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:C("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(ql(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),n=!0)),t.allowedLocales&&e&&(ql(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),n=!0));const o=super.applyUpdate(e,t);return n?new cE(o.newValue,!0):o}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:my(t.nonBasicASCII,kl,[!0,!1,kl]),invisibleCharacters:xt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:xt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:my(t.includeComments,kl,[!0,!1,kl]),includeStrings:my(t.includeStrings,kl,[!0,!1,kl]),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 n={};for(const[o,r]of Object.entries(e))r===!0&&(n[o]=!0);return n}}class hYe extends to{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:C("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[C("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),C("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:C("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:C("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:xt(t.enabled,this.defaultValue.enabled),mode:To(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:To(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:xt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:xt(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class fYe extends to{constructor(){const e={enabled:vs.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:vs.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("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:C("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:xt(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:xt(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class gYe extends to{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:[C("editor.guides.bracketPairs.true","Enables bracket pair guides."),C("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),C("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:C("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[C("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),C("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),C("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:C("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:C("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:C("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[C("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),C("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),C("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:C("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:my(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:my(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:xt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:xt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:my(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function my(i,e,t){const n=t.indexOf(i);return n===-1?e:t[n]}class pYe extends to{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:[C("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),C("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:C("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:C("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:C("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:C("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:[C("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),C("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),C("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),C("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:C("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:C("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:C("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:C("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:C("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:C("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:C("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:C("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:C("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:C("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:C("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:To(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:xt(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:xt(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:xt(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:xt(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:To(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:xt(t.showIcons,this.defaultValue.showIcons),showStatusBar:xt(t.showStatusBar,this.defaultValue.showStatusBar),preview:xt(t.preview,this.defaultValue.preview),previewMode:To(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:xt(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:xt(t.showMethods,this.defaultValue.showMethods),showFunctions:xt(t.showFunctions,this.defaultValue.showFunctions),showConstructors:xt(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:xt(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:xt(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:xt(t.showFields,this.defaultValue.showFields),showVariables:xt(t.showVariables,this.defaultValue.showVariables),showClasses:xt(t.showClasses,this.defaultValue.showClasses),showStructs:xt(t.showStructs,this.defaultValue.showStructs),showInterfaces:xt(t.showInterfaces,this.defaultValue.showInterfaces),showModules:xt(t.showModules,this.defaultValue.showModules),showProperties:xt(t.showProperties,this.defaultValue.showProperties),showEvents:xt(t.showEvents,this.defaultValue.showEvents),showOperators:xt(t.showOperators,this.defaultValue.showOperators),showUnits:xt(t.showUnits,this.defaultValue.showUnits),showValues:xt(t.showValues,this.defaultValue.showValues),showConstants:xt(t.showConstants,this.defaultValue.showConstants),showEnums:xt(t.showEnums,this.defaultValue.showEnums),showEnumMembers:xt(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:xt(t.showKeywords,this.defaultValue.showKeywords),showWords:xt(t.showWords,this.defaultValue.showWords),showColors:xt(t.showColors,this.defaultValue.showColors),showFiles:xt(t.showFiles,this.defaultValue.showFiles),showReferences:xt(t.showReferences,this.defaultValue.showReferences),showFolders:xt(t.showFolders,this.defaultValue.showFolders),showTypeParameters:xt(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:xt(t.showSnippets,this.defaultValue.showSnippets),showUsers:xt(t.showUsers,this.defaultValue.showUsers),showIssues:xt(t.showIssues,this.defaultValue.showIssues)}}}class mYe extends to{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:C("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:C("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:xt(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:xt(e.selectSubwords,this.defaultValue.selectSubwords)}}}class vYe extends to{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[C("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),C("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),C("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),C("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:C("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,n){return t.get(2)===2?0:n}}class _Ye extends BI{constructor(){super(144)}compute(e,t,n){const o=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:o.isWordWrapMinified,isViewportWrapping:o.isViewportWrapping,wrappingColumn:o.wrappingColumn}}}class bYe extends to{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("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:C("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:[C("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),C("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:xt(t.enabled,this.defaultValue.enabled),showDropSelector:To(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class CYe extends to{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:C("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:[C("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),C("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:xt(t.enabled,this.defaultValue.enabled),showPasteSelector:To(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const yYe="Consolas, 'Courier New', monospace",wYe="Menlo, Monaco, 'Courier New', monospace",SYe="'Droid Sans Mono', 'monospace', monospace",al={fontFamily:Nn?wYe:xs?SYe:yYe,fontWeight:"normal",fontSize:Nn?12:14,lineHeight:0,letterSpacing:0},IC=[];function $e(i){return IC[i.id]=i,i}const rh={acceptSuggestionOnCommitCharacter:$e(new On(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:C("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:$e(new uo(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",C("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:C("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:$e(new BXe),accessibilityPageSize:$e(new wi(3,"accessibilityPageSize",10,1,1073741824,{description:C("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:$e(new Qa(4,"ariaLabel",C("editorViewAccessibleLabel","Editor content"))),ariaRequired:$e(new On(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:$e(new On(8,"screenReaderAnnounceInlineSuggestion",!0,{description:C("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:$e(new uo(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),C("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:C("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:$e(new uo(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),C("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:C("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:$e(new uo(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",C("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:C("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:$e(new uo(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",C("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:C("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:$e(new uo(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),C("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:C("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:$e(new n2(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],FXe,{enumDescriptions:[C("editor.autoIndent.none","The editor will not insert indentation automatically."),C("editor.autoIndent.keep","The editor will keep the current line's indentation."),C("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),C("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),C("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:C("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:$e(new On(13,"automaticLayout",!1)),autoSurround:$e(new uo(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[C("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),C("editor.autoSurround.quotes","Surround with quotes but not brackets."),C("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:C("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:$e(new fYe),bracketPairGuides:$e(new gYe),stickyTabStops:$e(new On(115,"stickyTabStops",!1,{description:C("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:$e(new On(17,"codeLens",!0,{description:C("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:$e(new Qa(18,"codeLensFontFamily","",{description:C("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:$e(new wi(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:C("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:$e(new On(20,"colorDecorators",!0,{description:C("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:$e(new uo(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[C("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),C("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),C("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:C("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:$e(new wi(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:C("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:$e(new On(22,"columnSelection",!1,{description:C("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:$e(new WXe),contextmenu:$e(new On(24,"contextmenu",!0)),copyWithSyntaxHighlighting:$e(new On(25,"copyWithSyntaxHighlighting",!0,{description:C("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:$e(new n2(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],VXe,{description:C("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:$e(new uo(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[C("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),C("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),C("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:C("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:$e(new n2(28,"cursorStyle",Wr.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],HXe,{description:C("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:$e(new wi(29,"cursorSurroundingLines",0,0,1073741824,{description:C("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:$e(new uo(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[C("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),C("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:C("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:$e(new wi(31,"cursorWidth",0,0,1073741824,{markdownDescription:C("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:$e(new On(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:$e(new On(33,"disableMonospaceOptimizations",!1)),domReadOnly:$e(new On(34,"domReadOnly",!1)),dragAndDrop:$e(new On(35,"dragAndDrop",!0,{description:C("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:$e(new zXe),dropIntoEditor:$e(new bYe),stickyScroll:$e(new ZXe),experimentalWhitespaceRendering:$e(new uo(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[C("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),C("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),C("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:C("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:$e(new Qa(39,"extraEditorClassName","")),fastScrollSensitivity:$e(new wd(40,"fastScrollSensitivity",5,i=>i<=0?5:i,{markdownDescription:C("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:$e(new UXe),fixedOverflowWidgets:$e(new On(42,"fixedOverflowWidgets",!1)),folding:$e(new On(43,"folding",!0,{description:C("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:$e(new uo(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[C("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),C("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:C("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:$e(new On(45,"foldingHighlight",!0,{description:C("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:$e(new On(46,"foldingImportsByDefault",!1,{description:C("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:$e(new wi(47,"foldingMaximumRegions",5e3,10,65e3,{description:C("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:$e(new On(48,"unfoldOnClickAfterEndOfLine",!1,{description:C("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:$e(new Qa(49,"fontFamily",al.fontFamily,{description:C("fontFamily","Controls the font family.")})),fontInfo:$e(new jXe),fontLigatures2:$e(new Pl),fontSize:$e(new KXe),fontWeight:$e(new Rh),fontVariations:$e(new Eu),formatOnPaste:$e(new On(55,"formatOnPaste",!1,{description:C("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:$e(new On(56,"formatOnType",!1,{description:C("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:$e(new On(57,"glyphMargin",!0,{description:C("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:$e(new qXe),hideCursorInOverviewRuler:$e(new On(59,"hideCursorInOverviewRuler",!1,{description:C("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:$e(new GXe),inDiffEditor:$e(new On(61,"inDiffEditor",!1)),letterSpacing:$e(new wd(63,"letterSpacing",al.letterSpacing,i=>wd.clamp(i,-5,20),{description:C("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:$e(new YXe),lineDecorationsWidth:$e(new JXe),lineHeight:$e(new eYe),lineNumbers:$e(new aYe),lineNumbersMinChars:$e(new wi(68,"lineNumbersMinChars",5,1,300)),linkedEditing:$e(new On(69,"linkedEditing",!1,{description:C("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:$e(new On(70,"links",!0,{description:C("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:$e(new uo(71,"matchBrackets","always",["always","near","never"],{description:C("matchBrackets","Highlight matching brackets.")})),minimap:$e(new tYe),mouseStyle:$e(new uo(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:$e(new wd(74,"mouseWheelScrollSensitivity",1,i=>i===0?1:i,{markdownDescription:C("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:$e(new On(75,"mouseWheelZoom",!1,{markdownDescription:C("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:$e(new On(76,"multiCursorMergeOverlapping",!0,{description:C("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:$e(new n2(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],nYe,{markdownEnumDescriptions:[C("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),C("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:C({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:$e(new uo(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[C("multiCursorPaste.spread","Each cursor pastes a single line of the text."),C("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:C("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:$e(new wi(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:C("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:$e(new On(80,"occurrencesHighlight",!0,{description:C("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:$e(new On(81,"overviewRulerBorder",!0,{description:C("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:$e(new wi(82,"overviewRulerLanes",3,0,3)),padding:$e(new iYe),pasteAs:$e(new CYe),parameterHints:$e(new oYe),peekWidgetDefaultFocus:$e(new uo(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[C("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),C("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:C("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:$e(new On(87,"definitionLinkOpensInPeek",!1,{description:C("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:$e(new sYe),quickSuggestionsDelay:$e(new wi(89,"quickSuggestionsDelay",10,0,1073741824,{description:C("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:$e(new On(90,"readOnly",!1)),readOnlyMessage:$e(new cYe),renameOnType:$e(new On(92,"renameOnType",!1,{description:C("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:C("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:$e(new On(93,"renderControlCharacters",!0,{description:C("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:$e(new uo(94,"renderFinalNewline",xs?"dimmed":"on",["off","on","dimmed"],{description:C("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:$e(new uo(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",C("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:C("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:$e(new On(96,"renderLineHighlightOnlyWhenFocus",!1,{description:C("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:$e(new uo(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:$e(new uo(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",C("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),C("renderWhitespace.selection","Render whitespace characters only on selected text."),C("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:C("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:$e(new wi(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:$e(new On(100,"roundedSelection",!0,{description:C("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:$e(new lYe),scrollbar:$e(new dYe),scrollBeyondLastColumn:$e(new wi(103,"scrollBeyondLastColumn",4,0,1073741824,{description:C("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:$e(new On(104,"scrollBeyondLastLine",!0,{description:C("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:$e(new On(105,"scrollPredominantAxis",!0,{description:C("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:$e(new On(106,"selectionClipboard",!0,{description:C("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:xs})),selectionHighlight:$e(new On(107,"selectionHighlight",!0,{description:C("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:$e(new On(108,"selectOnLineNumbers",!0)),showFoldingControls:$e(new uo(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[C("showFoldingControls.always","Always show the folding controls."),C("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),C("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:C("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:$e(new On(110,"showUnused",!0,{description:C("showUnused","Controls fading out of unused code.")})),showDeprecated:$e(new On(138,"showDeprecated",!0,{description:C("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:$e(new QXe),snippetSuggestions:$e(new uo(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[C("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),C("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),C("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),C("snippetSuggestions.none","Do not show snippet suggestions.")],description:C("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:$e(new mYe),smoothScrolling:$e(new On(113,"smoothScrolling",!1,{description:C("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:$e(new wi(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:$e(new pYe),inlineSuggest:$e(new hYe),inlineCompletionsAccessibilityVerbose:$e(new On(147,"inlineCompletionsAccessibilityVerbose",!1,{description:C("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:$e(new wi(118,"suggestFontSize",0,0,1e3,{markdownDescription:C("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:$e(new wi(119,"suggestLineHeight",0,0,1e3,{markdownDescription:C("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:$e(new On(120,"suggestOnTriggerCharacters",!0,{description:C("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:$e(new uo(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[C("suggestSelection.first","Always select the first suggestion."),C("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),C("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:C("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:$e(new uo(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[C("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),C("tabCompletion.off","Disable tab completions."),C("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:C("tabCompletion","Enables tab completions.")})),tabIndex:$e(new wi(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:$e(new uYe),unusualLineTerminators:$e(new uo(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[C("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),C("unusualLineTerminators.off","Unusual line terminators are ignored."),C("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:C("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:$e(new On(126,"useShadowDOM",!0)),useTabStops:$e(new On(127,"useTabStops",!0,{description:C("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:$e(new uo(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[C("wordBreak.normal","Use the default line break rule."),C("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:C("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:$e(new Qa(129,"wordSeparators",y_e,{description:C("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:$e(new uo(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[C("wordWrap.off","Lines will never wrap."),C("wordWrap.on","Lines will wrap at the viewport width."),C({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),C({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:C({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:$e(new Qa(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63")),wordWrapBreakBeforeCharacters:$e(new Qa(132,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:$e(new wi(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:C({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:$e(new uo(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:$e(new uo(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:$e(new $Xe),defaultColorDecorators:$e(new On(145,"defaultColorDecorators",!1,{markdownDescription:C("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:$e(new rYe),tabFocusMode:$e(new On(142,"tabFocusMode",!1,{markdownDescription:C("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:$e(new py),wrappingInfo:$e(new _Ye),wrappingIndent:$e(new vYe),wrappingStrategy:$e(new XXe)};class xYe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?hw.isErrorNoTelemetry(e)?new hw(e.message+` + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,n){return e.fontInfo.lineHeight}}class iYe extends to{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:C("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:C("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[C("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),C("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),C("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:C("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:C("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:C("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:C("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:C("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:C("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:xt(t.enabled,this.defaultValue.enabled),autohide:xt(t.autohide,this.defaultValue.autohide),size:To(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:To(t.side,this.defaultValue.side,["right","left"]),showSlider:To(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:xt(t.renderCharacters,this.defaultValue.renderCharacters),scale:wi.clampedInt(t.scale,1,1,3),maxColumn:wi.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function oYe(i){return i==="ctrlCmd"?Nn?"metaKey":"ctrlKey":"altKey"}class rYe extends to{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:C("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:C("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:wi.clampedInt(t.top,0,0,1e3),bottom:wi.clampedInt(t.bottom,0,0,1e3)}}}class sYe extends to{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:C("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:C("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:xt(t.enabled,this.defaultValue.enabled),cycle:xt(t.cycle,this.defaultValue.cycle)}}}class aYe extends BI{constructor(){super(141)}compute(e,t,n){return e.pixelRatio}}class lYe extends to{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[C("on","Quick suggestions show inside the suggest widget"),C("inline","Quick suggestions show as ghost text"),C("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:C("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:C("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:C("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:C("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:n,strings:o}=e,r=["on","inline","off"];let s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=To(t,this.defaultValue.other,r),typeof n=="boolean"?a=n?"on":"off":a=To(n,this.defaultValue.comments,r),typeof o=="boolean"?l=o?"on":"off":l=To(o,this.defaultValue.strings,r),{other:s,comments:a,strings:l}}}class cYe extends to{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[C("lineNumbers.off","Line numbers are not rendered."),C("lineNumbers.on","Line numbers are rendered as absolute number."),C("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),C("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:C("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e!="undefined"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}}function FA(i){const e=i.get(97);return e==="editable"?i.get(90):e!=="on"}class dYe extends to{constructor(){const e=[],t={type:"number",description:C("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:C("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:C("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 n of e)if(typeof n=="number")t.push({column:wi.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){const o=n;t.push({column:wi.clampedInt(o.column,0,0,1e4),color:o.color})}return t.sort((n,o)=>n.column-o.column),t}return this.defaultValue}}class uYe extends to{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function doe(i,e){if(typeof i!="string")return e;switch(i){case"hidden":return 2;case"visible":return 3;default:return 1}}class hYe extends to{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:[C("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),C("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),C("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:C("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[C("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),C("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),C("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:C("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:C("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:C("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:C("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,n=wi.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),o=wi.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:wi.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:doe(t.vertical,this.defaultValue.vertical),horizontal:doe(t.horizontal,this.defaultValue.horizontal),useShadows:xt(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:xt(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:xt(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:xt(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:xt(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:wi.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:o,verticalSliderSize:wi.clampedInt(t.verticalSliderSize,o,0,1e3),scrollByPage:xt(t.scrollByPage,this.defaultValue.scrollByPage)}}}const kl="inUntrustedWorkspace",Ta={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 fYe extends to{constructor(){const e={nonBasicASCII:kl,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:kl,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Ta.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kl],default:e.nonBasicASCII,description:C("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.")},[Ta.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:C("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Ta.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:C("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.")},[Ta.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kl],default:e.includeComments,description:C("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Ta.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kl],default:e.includeStrings,description:C("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Ta.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:C("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Ta.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:C("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(ql(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),n=!0)),t.allowedLocales&&e&&(ql(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),n=!0));const o=super.applyUpdate(e,t);return n?new cE(o.newValue,!0):o}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:my(t.nonBasicASCII,kl,[!0,!1,kl]),invisibleCharacters:xt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:xt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:my(t.includeComments,kl,[!0,!1,kl]),includeStrings:my(t.includeStrings,kl,[!0,!1,kl]),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 n={};for(const[o,r]of Object.entries(e))r===!0&&(n[o]=!0);return n}}class gYe extends to{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:C("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[C("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),C("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:C("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:C("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:xt(t.enabled,this.defaultValue.enabled),mode:To(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:To(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:xt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:xt(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class pYe extends to{constructor(){const e={enabled:vs.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:vs.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("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:C("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:xt(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:xt(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class mYe extends to{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:[C("editor.guides.bracketPairs.true","Enables bracket pair guides."),C("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),C("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:C("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[C("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),C("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),C("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:C("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:C("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:C("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[C("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),C("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),C("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:C("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:my(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:my(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:xt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:xt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:my(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function my(i,e,t){const n=t.indexOf(i);return n===-1?e:t[n]}class vYe extends to{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:[C("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),C("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:C("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:C("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:C("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:C("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:[C("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),C("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),C("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),C("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:C("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:C("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:C("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:C("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:C("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:C("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:C("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:C("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:C("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:C("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:C("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:To(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:xt(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:xt(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:xt(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:xt(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:To(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:xt(t.showIcons,this.defaultValue.showIcons),showStatusBar:xt(t.showStatusBar,this.defaultValue.showStatusBar),preview:xt(t.preview,this.defaultValue.preview),previewMode:To(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:xt(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:xt(t.showMethods,this.defaultValue.showMethods),showFunctions:xt(t.showFunctions,this.defaultValue.showFunctions),showConstructors:xt(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:xt(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:xt(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:xt(t.showFields,this.defaultValue.showFields),showVariables:xt(t.showVariables,this.defaultValue.showVariables),showClasses:xt(t.showClasses,this.defaultValue.showClasses),showStructs:xt(t.showStructs,this.defaultValue.showStructs),showInterfaces:xt(t.showInterfaces,this.defaultValue.showInterfaces),showModules:xt(t.showModules,this.defaultValue.showModules),showProperties:xt(t.showProperties,this.defaultValue.showProperties),showEvents:xt(t.showEvents,this.defaultValue.showEvents),showOperators:xt(t.showOperators,this.defaultValue.showOperators),showUnits:xt(t.showUnits,this.defaultValue.showUnits),showValues:xt(t.showValues,this.defaultValue.showValues),showConstants:xt(t.showConstants,this.defaultValue.showConstants),showEnums:xt(t.showEnums,this.defaultValue.showEnums),showEnumMembers:xt(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:xt(t.showKeywords,this.defaultValue.showKeywords),showWords:xt(t.showWords,this.defaultValue.showWords),showColors:xt(t.showColors,this.defaultValue.showColors),showFiles:xt(t.showFiles,this.defaultValue.showFiles),showReferences:xt(t.showReferences,this.defaultValue.showReferences),showFolders:xt(t.showFolders,this.defaultValue.showFolders),showTypeParameters:xt(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:xt(t.showSnippets,this.defaultValue.showSnippets),showUsers:xt(t.showUsers,this.defaultValue.showUsers),showIssues:xt(t.showIssues,this.defaultValue.showIssues)}}}class _Ye extends to{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:C("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:C("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:xt(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:xt(e.selectSubwords,this.defaultValue.selectSubwords)}}}class bYe extends to{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[C("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),C("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),C("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),C("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:C("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,n){return t.get(2)===2?0:n}}class CYe extends BI{constructor(){super(144)}compute(e,t,n){const o=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:o.isWordWrapMinified,isViewportWrapping:o.isViewportWrapping,wrappingColumn:o.wrappingColumn}}}class yYe extends to{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("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:C("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:[C("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),C("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:xt(t.enabled,this.defaultValue.enabled),showDropSelector:To(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class wYe extends to{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:C("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:[C("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),C("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:xt(t.enabled,this.defaultValue.enabled),showPasteSelector:To(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const SYe="Consolas, 'Courier New', monospace",xYe="Menlo, Monaco, 'Courier New', monospace",LYe="'Droid Sans Mono', 'monospace', monospace",al={fontFamily:Nn?xYe:xs?LYe:SYe,fontWeight:"normal",fontSize:Nn?12:14,lineHeight:0,letterSpacing:0},IC=[];function $e(i){return IC[i.id]=i,i}const rh={acceptSuggestionOnCommitCharacter:$e(new On(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:C("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:$e(new uo(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",C("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:C("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:$e(new VXe),accessibilityPageSize:$e(new wi(3,"accessibilityPageSize",10,1,1073741824,{description:C("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:$e(new Qa(4,"ariaLabel",C("editorViewAccessibleLabel","Editor content"))),ariaRequired:$e(new On(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:$e(new On(8,"screenReaderAnnounceInlineSuggestion",!0,{description:C("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:$e(new uo(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),C("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:C("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:$e(new uo(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),C("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:C("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:$e(new uo(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",C("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:C("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:$e(new uo(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",C("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:C("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:$e(new uo(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),C("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:C("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:$e(new n2(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],WXe,{enumDescriptions:[C("editor.autoIndent.none","The editor will not insert indentation automatically."),C("editor.autoIndent.keep","The editor will keep the current line's indentation."),C("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),C("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),C("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:C("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:$e(new On(13,"automaticLayout",!1)),autoSurround:$e(new uo(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[C("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),C("editor.autoSurround.quotes","Surround with quotes but not brackets."),C("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:C("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:$e(new pYe),bracketPairGuides:$e(new mYe),stickyTabStops:$e(new On(115,"stickyTabStops",!1,{description:C("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:$e(new On(17,"codeLens",!0,{description:C("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:$e(new Qa(18,"codeLensFontFamily","",{description:C("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:$e(new wi(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:C("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:$e(new On(20,"colorDecorators",!0,{description:C("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:$e(new uo(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[C("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),C("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),C("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:C("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:$e(new wi(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:C("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:$e(new On(22,"columnSelection",!1,{description:C("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:$e(new HXe),contextmenu:$e(new On(24,"contextmenu",!0)),copyWithSyntaxHighlighting:$e(new On(25,"copyWithSyntaxHighlighting",!0,{description:C("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:$e(new n2(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],$Xe,{description:C("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:$e(new uo(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[C("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),C("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),C("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:C("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:$e(new n2(28,"cursorStyle",Wr.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],zXe,{description:C("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:$e(new wi(29,"cursorSurroundingLines",0,0,1073741824,{description:C("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:$e(new uo(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[C("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),C("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:C("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:$e(new wi(31,"cursorWidth",0,0,1073741824,{markdownDescription:C("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:$e(new On(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:$e(new On(33,"disableMonospaceOptimizations",!1)),domReadOnly:$e(new On(34,"domReadOnly",!1)),dragAndDrop:$e(new On(35,"dragAndDrop",!0,{description:C("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:$e(new jXe),dropIntoEditor:$e(new yYe),stickyScroll:$e(new JXe),experimentalWhitespaceRendering:$e(new uo(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[C("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),C("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),C("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:C("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:$e(new Qa(39,"extraEditorClassName","")),fastScrollSensitivity:$e(new wd(40,"fastScrollSensitivity",5,i=>i<=0?5:i,{markdownDescription:C("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:$e(new KXe),fixedOverflowWidgets:$e(new On(42,"fixedOverflowWidgets",!1)),folding:$e(new On(43,"folding",!0,{description:C("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:$e(new uo(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[C("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),C("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:C("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:$e(new On(45,"foldingHighlight",!0,{description:C("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:$e(new On(46,"foldingImportsByDefault",!1,{description:C("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:$e(new wi(47,"foldingMaximumRegions",5e3,10,65e3,{description:C("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:$e(new On(48,"unfoldOnClickAfterEndOfLine",!1,{description:C("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:$e(new Qa(49,"fontFamily",al.fontFamily,{description:C("fontFamily","Controls the font family.")})),fontInfo:$e(new qXe),fontLigatures2:$e(new Pl),fontSize:$e(new GXe),fontWeight:$e(new Rh),fontVariations:$e(new Eu),formatOnPaste:$e(new On(55,"formatOnPaste",!1,{description:C("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:$e(new On(56,"formatOnType",!1,{description:C("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:$e(new On(57,"glyphMargin",!0,{description:C("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:$e(new XXe),hideCursorInOverviewRuler:$e(new On(59,"hideCursorInOverviewRuler",!1,{description:C("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:$e(new YXe),inDiffEditor:$e(new On(61,"inDiffEditor",!1)),letterSpacing:$e(new wd(63,"letterSpacing",al.letterSpacing,i=>wd.clamp(i,-5,20),{description:C("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:$e(new QXe),lineDecorationsWidth:$e(new tYe),lineHeight:$e(new nYe),lineNumbers:$e(new cYe),lineNumbersMinChars:$e(new wi(68,"lineNumbersMinChars",5,1,300)),linkedEditing:$e(new On(69,"linkedEditing",!1,{description:C("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:$e(new On(70,"links",!0,{description:C("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:$e(new uo(71,"matchBrackets","always",["always","near","never"],{description:C("matchBrackets","Highlight matching brackets.")})),minimap:$e(new iYe),mouseStyle:$e(new uo(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:$e(new wd(74,"mouseWheelScrollSensitivity",1,i=>i===0?1:i,{markdownDescription:C("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:$e(new On(75,"mouseWheelZoom",!1,{markdownDescription:C("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:$e(new On(76,"multiCursorMergeOverlapping",!0,{description:C("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:$e(new n2(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],oYe,{markdownEnumDescriptions:[C("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),C("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:C({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:$e(new uo(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[C("multiCursorPaste.spread","Each cursor pastes a single line of the text."),C("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:C("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:$e(new wi(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:C("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:$e(new On(80,"occurrencesHighlight",!0,{description:C("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:$e(new On(81,"overviewRulerBorder",!0,{description:C("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:$e(new wi(82,"overviewRulerLanes",3,0,3)),padding:$e(new rYe),pasteAs:$e(new wYe),parameterHints:$e(new sYe),peekWidgetDefaultFocus:$e(new uo(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[C("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),C("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:C("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:$e(new On(87,"definitionLinkOpensInPeek",!1,{description:C("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:$e(new lYe),quickSuggestionsDelay:$e(new wi(89,"quickSuggestionsDelay",10,0,1073741824,{description:C("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:$e(new On(90,"readOnly",!1)),readOnlyMessage:$e(new uYe),renameOnType:$e(new On(92,"renameOnType",!1,{description:C("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:C("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:$e(new On(93,"renderControlCharacters",!0,{description:C("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:$e(new uo(94,"renderFinalNewline",xs?"dimmed":"on",["off","on","dimmed"],{description:C("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:$e(new uo(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",C("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:C("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:$e(new On(96,"renderLineHighlightOnlyWhenFocus",!1,{description:C("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:$e(new uo(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:$e(new uo(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",C("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),C("renderWhitespace.selection","Render whitespace characters only on selected text."),C("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:C("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:$e(new wi(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:$e(new On(100,"roundedSelection",!0,{description:C("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:$e(new dYe),scrollbar:$e(new hYe),scrollBeyondLastColumn:$e(new wi(103,"scrollBeyondLastColumn",4,0,1073741824,{description:C("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:$e(new On(104,"scrollBeyondLastLine",!0,{description:C("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:$e(new On(105,"scrollPredominantAxis",!0,{description:C("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:$e(new On(106,"selectionClipboard",!0,{description:C("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:xs})),selectionHighlight:$e(new On(107,"selectionHighlight",!0,{description:C("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:$e(new On(108,"selectOnLineNumbers",!0)),showFoldingControls:$e(new uo(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[C("showFoldingControls.always","Always show the folding controls."),C("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),C("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:C("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:$e(new On(110,"showUnused",!0,{description:C("showUnused","Controls fading out of unused code.")})),showDeprecated:$e(new On(138,"showDeprecated",!0,{description:C("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:$e(new eYe),snippetSuggestions:$e(new uo(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[C("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),C("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),C("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),C("snippetSuggestions.none","Do not show snippet suggestions.")],description:C("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:$e(new _Ye),smoothScrolling:$e(new On(113,"smoothScrolling",!1,{description:C("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:$e(new wi(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:$e(new vYe),inlineSuggest:$e(new gYe),inlineCompletionsAccessibilityVerbose:$e(new On(147,"inlineCompletionsAccessibilityVerbose",!1,{description:C("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:$e(new wi(118,"suggestFontSize",0,0,1e3,{markdownDescription:C("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:$e(new wi(119,"suggestLineHeight",0,0,1e3,{markdownDescription:C("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:$e(new On(120,"suggestOnTriggerCharacters",!0,{description:C("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:$e(new uo(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[C("suggestSelection.first","Always select the first suggestion."),C("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),C("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:C("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:$e(new uo(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[C("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),C("tabCompletion.off","Disable tab completions."),C("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:C("tabCompletion","Enables tab completions.")})),tabIndex:$e(new wi(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:$e(new fYe),unusualLineTerminators:$e(new uo(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[C("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),C("unusualLineTerminators.off","Unusual line terminators are ignored."),C("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:C("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:$e(new On(126,"useShadowDOM",!0)),useTabStops:$e(new On(127,"useTabStops",!0,{description:C("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:$e(new uo(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[C("wordBreak.normal","Use the default line break rule."),C("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:C("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:$e(new Qa(129,"wordSeparators",y_e,{description:C("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:$e(new uo(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[C("wordWrap.off","Lines will never wrap."),C("wordWrap.on","Lines will wrap at the viewport width."),C({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),C({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:C({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:$e(new Qa(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63")),wordWrapBreakBeforeCharacters:$e(new Qa(132,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:$e(new wi(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:C({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:$e(new uo(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:$e(new uo(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:$e(new UXe),defaultColorDecorators:$e(new On(145,"defaultColorDecorators",!1,{markdownDescription:C("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:$e(new aYe),tabFocusMode:$e(new On(142,"tabFocusMode",!1,{markdownDescription:C("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:$e(new py),wrappingInfo:$e(new CYe),wrappingIndent:$e(new bYe),wrappingStrategy:$e(new ZXe)};class EYe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?hw.isErrorNoTelemetry(e)?new hw(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const E_e=new xYe;function en(i){sh(i)||E_e.onUnexpectedError(i)}function $o(i){sh(i)||E_e.onUnexpectedExternalError(i)}function doe(i){if(i instanceof Error){const{name:e,message:t}=i,n=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:hw.isErrorNoTelemetry(i)}}return i}const BA="Canceled";function sh(i){return i instanceof Yv?!0:i instanceof Error&&i.name===BA&&i.message===BA}class Yv extends Error{constructor(){super(BA),this.name=this.message}}function LYe(){const i=new Error(BA);return i.name=i.message,i}function Mc(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function Vq(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class EYe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class hw extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof hw)return e;const t=new hw;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Vo extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Vo.prototype)}}function yv(i){const e=this;let t=!1,n;return function(){return t||(t=!0,n=i.apply(e,arguments)),n}}function Hq(i){return typeof i.dispose=="function"&&i.dispose.length===0}function si(i){if(vn.is(i)){const e=[];for(const t of i)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function Td(...i){return zt(()=>si(i))}function zt(i){return{dispose:yv(()=>{i()})}}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{si(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 _e{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)}}_e.None=Object.freeze({dispose(){}});class Kr{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 DYe{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class kYe{constructor(e){this.object=e}dispose(){}}class $q{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(!!this._store.size)try{si(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!1){var o;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),n||(o=this._store.get(e))===null||o===void 0||o.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 IYe=globalThis.performance&&typeof globalThis.performance.now=="function";class Ls{static create(e){return new Ls(e)}constructor(e){this._now=IYe&&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 st;(function(i){i.None=()=>_e.None;function e(P,N){return u(P,()=>{},0,void 0,!0,void 0,N)}i.defer=e;function t(P){return(N,M=null,H)=>{let B=!1,F;return F=P($=>{if(!B)return F?F.dispose():B=!0,N.call(M,$)},null,H),B&&F.dispose(),F}}i.once=t;function n(P,N,M){return c((H,B=null,F)=>P($=>H.call(B,N($)),null,F),M)}i.map=n;function o(P,N,M){return c((H,B=null,F)=>P($=>{N($),H.call(B,$)},null,F),M)}i.forEach=o;function r(P,N,M){return c((H,B=null,F)=>P($=>N($)&&H.call(B,$),null,F),M)}i.filter=r;function s(P){return P}i.signal=s;function a(...P){return(N,M=null,H)=>{const B=Td(...P.map(F=>F($=>N.call(M,$))));return d(B,H)}}i.any=a;function l(P,N,M,H){let B=M;return n(P,F=>(B=N(B,F),B),H)}i.reduce=l;function c(P,N){let M;const H={onWillAddFirstListener(){M=P(B.fire,B)},onDidRemoveLastListener(){M==null||M.dispose()}},B=new le(H);return N==null||N.add(B),B.event}function d(P,N){return N instanceof Array?N.push(P):N&&N.add(P),P}function u(P,N,M=100,H=!1,B=!1,F,$){let z,K,j,G=0,X;const ue={leakWarningThreshold:F,onWillAddFirstListener(){z=P(pe=>{G++,K=N(K,pe),H&&!j&&(fe.fire(K),K=void 0),X=()=>{const be=K;K=void 0,j=void 0,(!H||G>1)&&fe.fire(be),G=0},typeof M=="number"?(clearTimeout(j),j=setTimeout(X,M)):j===void 0&&(j=0,queueMicrotask(X))})},onWillRemoveListener(){B&&G>0&&(X==null||X())},onDidRemoveLastListener(){X=void 0,z.dispose()}},fe=new le(ue);return $==null||$.add(fe),fe.event}i.debounce=u;function h(P,N=0,M){return i.debounce(P,(H,B)=>H?(H.push(B),H):[B],N,void 0,!0,void 0,M)}i.accumulate=h;function f(P,N=(H,B)=>H===B,M){let H=!0,B;return r(P,F=>{const $=H||!N(F,B);return H=!1,B=F,$},M)}i.latch=f;function g(P,N,M){return[i.filter(P,N,M),i.filter(P,H=>!N(H),M)]}i.split=g;function p(P,N=!1,M=[],H){let B=M.slice(),F=P(K=>{B?B.push(K):z.fire(K)});H&&H.add(F);const $=()=>{B==null||B.forEach(K=>z.fire(K)),B=null},z=new le({onWillAddFirstListener(){F||(F=P(K=>z.fire(K)),H&&H.add(F))},onDidAddFirstListener(){B&&(N?setTimeout($):$())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return H&&H.add(z),z.event}i.buffer=p;function v(P,N){return(H,B,F)=>{const $=N(new _);return P(function(z){const K=$.evaluate(z);K!==m&&H.call(B,K)},void 0,F)}}i.chain=v;const m=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(M=>(N(M),M)),this}filter(N){return this.steps.push(M=>N(M)?M:m),this}reduce(N,M){let H=M;return this.steps.push(B=>(H=N(H,B),H)),this}latch(N=(M,H)=>M===H){let M=!0,H;return this.steps.push(B=>{const F=M||!N(B,H);return M=!1,H=B,F?B:m}),this}evaluate(N){for(const M of this.steps)if(N=M(N),N===m)break;return N}}function y(P,N,M=H=>H){const H=(...z)=>$.fire(M(...z)),B=()=>P.on(N,H),F=()=>P.removeListener(N,H),$=new le({onWillAddFirstListener:B,onDidRemoveLastListener:F});return $.event}i.fromNodeEventEmitter=y;function w(P,N,M=H=>H){const H=(...z)=>$.fire(M(...z)),B=()=>P.addEventListener(N,H),F=()=>P.removeEventListener(N,H),$=new le({onWillAddFirstListener:B,onDidRemoveLastListener:F});return $.event}i.fromDOMEventEmitter=w;function L(P){return new Promise(N=>t(P)(N))}i.toPromise=L;function D(P){const N=new le;return P.then(M=>{N.fire(M)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}i.fromPromise=D;function E(P,N){return N(void 0),P(M=>N(M))}i.runAndSubscribe=E;function I(P,N){let M=null;function H(F){M==null||M.dispose(),M=new Be,N(F,M)}H(void 0);const B=P(F=>H(F));return zt(()=>{B.dispose(),M==null||M.dispose()})}i.runAndSubscribeWithStore=I;class k{constructor(N,M){this._observable=N,this._counter=0,this._hasChanged=!1;const H={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new le(H),M&&M.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,M){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(P,N){return new k(P,N).emitter.event}i.fromObservable=R;function A(P){return N=>{let M=0,H=!1;const B={beginUpdate(){M++},endUpdate(){M--,M===0&&(P.reportChanges(),H&&(H=!1,N()))},handlePossibleChange(){},handleChange(){H=!0}};return P.addObserver(B),P.reportChanges(),{dispose(){P.removeObserver(B)}}}}i.fromObservableLight=A})(st||(st={}));class fw{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${fw._idPool++}`,fw.all.add(this)}start(e){this._stopWatch=new Ls,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}}}fw.all=new Set;fw._idPool=0;let TYe=-1;class NYe{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 n=this.threshold;if(n<=0||t{const r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}}class zq{static create(){var e;return new zq((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` +`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const E_e=new EYe;function en(i){sh(i)||E_e.onUnexpectedError(i)}function $o(i){sh(i)||E_e.onUnexpectedExternalError(i)}function uoe(i){if(i instanceof Error){const{name:e,message:t}=i,n=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:hw.isErrorNoTelemetry(i)}}return i}const BA="Canceled";function sh(i){return i instanceof Yv?!0:i instanceof Error&&i.name===BA&&i.message===BA}class Yv extends Error{constructor(){super(BA),this.name=this.message}}function DYe(){const i=new Error(BA);return i.name=i.message,i}function Mc(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function Hq(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class kYe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class hw extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof hw)return e;const t=new hw;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Vo extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Vo.prototype)}}function yv(i){const e=this;let t=!1,n;return function(){return t||(t=!0,n=i.apply(e,arguments)),n}}function $q(i){return typeof i.dispose=="function"&&i.dispose.length===0}function si(i){if(vn.is(i)){const e=[];for(const t of i)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function Td(...i){return zt(()=>si(i))}function zt(i){return{dispose:yv(()=>{i()})}}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{si(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 _e{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)}}_e.None=Object.freeze({dispose(){}});class Kr{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 IYe{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class TYe{constructor(e){this.object=e}dispose(){}}class zq{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(!!this._store.size)try{si(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!1){var o;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),n||(o=this._store.get(e))===null||o===void 0||o.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 NYe=globalThis.performance&&typeof globalThis.performance.now=="function";class Ls{static create(e){return new Ls(e)}constructor(e){this._now=NYe&&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 st;(function(i){i.None=()=>_e.None;function e(P,N){return u(P,()=>{},0,void 0,!0,void 0,N)}i.defer=e;function t(P){return(N,M=null,H)=>{let B=!1,F;return F=P($=>{if(!B)return F?F.dispose():B=!0,N.call(M,$)},null,H),B&&F.dispose(),F}}i.once=t;function n(P,N,M){return c((H,B=null,F)=>P($=>H.call(B,N($)),null,F),M)}i.map=n;function o(P,N,M){return c((H,B=null,F)=>P($=>{N($),H.call(B,$)},null,F),M)}i.forEach=o;function r(P,N,M){return c((H,B=null,F)=>P($=>N($)&&H.call(B,$),null,F),M)}i.filter=r;function s(P){return P}i.signal=s;function a(...P){return(N,M=null,H)=>{const B=Td(...P.map(F=>F($=>N.call(M,$))));return d(B,H)}}i.any=a;function l(P,N,M,H){let B=M;return n(P,F=>(B=N(B,F),B),H)}i.reduce=l;function c(P,N){let M;const H={onWillAddFirstListener(){M=P(B.fire,B)},onDidRemoveLastListener(){M==null||M.dispose()}},B=new le(H);return N==null||N.add(B),B.event}function d(P,N){return N instanceof Array?N.push(P):N&&N.add(P),P}function u(P,N,M=100,H=!1,B=!1,F,$){let z,K,j,G=0,X;const ue={leakWarningThreshold:F,onWillAddFirstListener(){z=P(pe=>{G++,K=N(K,pe),H&&!j&&(fe.fire(K),K=void 0),X=()=>{const be=K;K=void 0,j=void 0,(!H||G>1)&&fe.fire(be),G=0},typeof M=="number"?(clearTimeout(j),j=setTimeout(X,M)):j===void 0&&(j=0,queueMicrotask(X))})},onWillRemoveListener(){B&&G>0&&(X==null||X())},onDidRemoveLastListener(){X=void 0,z.dispose()}},fe=new le(ue);return $==null||$.add(fe),fe.event}i.debounce=u;function h(P,N=0,M){return i.debounce(P,(H,B)=>H?(H.push(B),H):[B],N,void 0,!0,void 0,M)}i.accumulate=h;function f(P,N=(H,B)=>H===B,M){let H=!0,B;return r(P,F=>{const $=H||!N(F,B);return H=!1,B=F,$},M)}i.latch=f;function g(P,N,M){return[i.filter(P,N,M),i.filter(P,H=>!N(H),M)]}i.split=g;function p(P,N=!1,M=[],H){let B=M.slice(),F=P(K=>{B?B.push(K):z.fire(K)});H&&H.add(F);const $=()=>{B==null||B.forEach(K=>z.fire(K)),B=null},z=new le({onWillAddFirstListener(){F||(F=P(K=>z.fire(K)),H&&H.add(F))},onDidAddFirstListener(){B&&(N?setTimeout($):$())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return H&&H.add(z),z.event}i.buffer=p;function v(P,N){return(H,B,F)=>{const $=N(new _);return P(function(z){const K=$.evaluate(z);K!==m&&H.call(B,K)},void 0,F)}}i.chain=v;const m=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(M=>(N(M),M)),this}filter(N){return this.steps.push(M=>N(M)?M:m),this}reduce(N,M){let H=M;return this.steps.push(B=>(H=N(H,B),H)),this}latch(N=(M,H)=>M===H){let M=!0,H;return this.steps.push(B=>{const F=M||!N(B,H);return M=!1,H=B,F?B:m}),this}evaluate(N){for(const M of this.steps)if(N=M(N),N===m)break;return N}}function y(P,N,M=H=>H){const H=(...z)=>$.fire(M(...z)),B=()=>P.on(N,H),F=()=>P.removeListener(N,H),$=new le({onWillAddFirstListener:B,onDidRemoveLastListener:F});return $.event}i.fromNodeEventEmitter=y;function w(P,N,M=H=>H){const H=(...z)=>$.fire(M(...z)),B=()=>P.addEventListener(N,H),F=()=>P.removeEventListener(N,H),$=new le({onWillAddFirstListener:B,onDidRemoveLastListener:F});return $.event}i.fromDOMEventEmitter=w;function L(P){return new Promise(N=>t(P)(N))}i.toPromise=L;function D(P){const N=new le;return P.then(M=>{N.fire(M)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}i.fromPromise=D;function E(P,N){return N(void 0),P(M=>N(M))}i.runAndSubscribe=E;function I(P,N){let M=null;function H(F){M==null||M.dispose(),M=new Be,N(F,M)}H(void 0);const B=P(F=>H(F));return zt(()=>{B.dispose(),M==null||M.dispose()})}i.runAndSubscribeWithStore=I;class k{constructor(N,M){this._observable=N,this._counter=0,this._hasChanged=!1;const H={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new le(H),M&&M.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,M){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(P,N){return new k(P,N).emitter.event}i.fromObservable=R;function A(P){return N=>{let M=0,H=!1;const B={beginUpdate(){M++},endUpdate(){M--,M===0&&(P.reportChanges(),H&&(H=!1,N()))},handlePossibleChange(){},handleChange(){H=!0}};return P.addObserver(B),P.reportChanges(),{dispose(){P.removeObserver(B)}}}}i.fromObservableLight=A})(st||(st={}));class fw{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${fw._idPool++}`,fw.all.add(this)}start(e){this._stopWatch=new Ls,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}}}fw.all=new Set;fw._idPool=0;let RYe=-1;class MYe{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 n=this.threshold;if(n<=0||t{const r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}}class Uq{static create(){var e;return new Uq((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` `).slice(2).join(` -`))}}class I6{constructor(e){this.value=e}}const RYe=2;class le{constructor(e){var t,n,o,r,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new NYe((o=(n=this._options)===null||n===void 0?void 0:n.leakWarningThreshold)!==null&&o!==void 0?o:TYe):void 0,this._perfMon=!((r=this._options)===null||r===void 0)&&r._profName?new fw(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,n,o;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),(n=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||n===void 0||n.call(t),(o=this._leakageMon)===null||o===void 0||o.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,n,o)=>{var r,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),_e.None;if(this._disposed)return _e.None;n&&(t=t.bind(n));const d=new I6(t);let u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(d.stack=zq.create(),u=this._leakageMon.check(d.stack,this._size+1)),this._listeners?this._listeners instanceof I6?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new D_e),this._listeners=[this._listeners,d]):this._listeners.push(d):((s=(r=this._options)===null||r===void 0?void 0:r.onWillAddFirstListener)===null||s===void 0||s.call(r,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=zt(()=>{u==null||u(),this._removeListener(d)});return o instanceof Be?o.add(h):Array.isArray(o)&&o.push(h),h}),this._event}_removeListener(e){var t,n,o,r;if((n=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||n===void 0||n.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(r=(o=this._options)===null||o===void 0?void 0:o.onDidRemoveLastListener)===null||r===void 0||r.call(o,this),this._size=0;return}const s=this._listeners,a=s.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--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*RYe<=s.length){let c=0;for(let d=0;d0}}const MYe=()=>new D_e;class D_e{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Y0 extends le{constructor(e){super(e),this._isPaused=0,this._eventQueue=new oa,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 k_e extends Y0{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 AYe extends le{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 PYe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new le({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),zt(yv(()=>{this.hasListeners&&this.unhook(t);const o=this.events.indexOf(t);this.events.splice(o,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 Uq{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,o)=>e(r=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(n,r)):t.call(n,r)},void 0,o)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(o=>o()),n}}class uoe{constructor(){this.listening=!1,this.inputEvent=st.None,this.inputEventListener=_e.None,this.emitter=new le({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 I_e=Object.freeze(function(i,e){const t=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(t)}}});var _n;(function(i){function e(t){return t===i.None||t===i.Cancelled||t instanceof JR?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:st.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:I_e})})(_n||(_n={}));class JR{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?I_e:(this._emitter||(this._emitter=new le),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class Ro{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 JR),this._token}cancel(){this._token?this._token instanceof JR&&this._token.cancel():this._token=_n.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof JR&&this._token.dispose():this._token=_n.None}}class jq{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 eM=new jq,XW=new jq,YW=new jq,T_e=new Array(230),OYe=Object.create(null),FYe=Object.create(null),Kq=[];for(let i=0;i<=193;i++)Kq[i]=-1;(function(){const i="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",i,i],[1,1,"Hyper",0,i,0,i,i,i],[1,2,"Super",0,i,0,i,i,i],[1,3,"Fn",0,i,0,i,i,i],[1,4,"FnLock",0,i,0,i,i,i],[1,5,"Suspend",0,i,0,i,i,i],[1,6,"Resume",0,i,0,i,i,i],[1,7,"Turbo",0,i,0,i,i,i],[1,8,"Sleep",0,i,0,"VK_SLEEP",i,i],[1,9,"WakeUp",0,i,0,i,i,i],[0,10,"KeyA",31,"A",65,"VK_A",i,i],[0,11,"KeyB",32,"B",66,"VK_B",i,i],[0,12,"KeyC",33,"C",67,"VK_C",i,i],[0,13,"KeyD",34,"D",68,"VK_D",i,i],[0,14,"KeyE",35,"E",69,"VK_E",i,i],[0,15,"KeyF",36,"F",70,"VK_F",i,i],[0,16,"KeyG",37,"G",71,"VK_G",i,i],[0,17,"KeyH",38,"H",72,"VK_H",i,i],[0,18,"KeyI",39,"I",73,"VK_I",i,i],[0,19,"KeyJ",40,"J",74,"VK_J",i,i],[0,20,"KeyK",41,"K",75,"VK_K",i,i],[0,21,"KeyL",42,"L",76,"VK_L",i,i],[0,22,"KeyM",43,"M",77,"VK_M",i,i],[0,23,"KeyN",44,"N",78,"VK_N",i,i],[0,24,"KeyO",45,"O",79,"VK_O",i,i],[0,25,"KeyP",46,"P",80,"VK_P",i,i],[0,26,"KeyQ",47,"Q",81,"VK_Q",i,i],[0,27,"KeyR",48,"R",82,"VK_R",i,i],[0,28,"KeyS",49,"S",83,"VK_S",i,i],[0,29,"KeyT",50,"T",84,"VK_T",i,i],[0,30,"KeyU",51,"U",85,"VK_U",i,i],[0,31,"KeyV",52,"V",86,"VK_V",i,i],[0,32,"KeyW",53,"W",87,"VK_W",i,i],[0,33,"KeyX",54,"X",88,"VK_X",i,i],[0,34,"KeyY",55,"Y",89,"VK_Y",i,i],[0,35,"KeyZ",56,"Z",90,"VK_Z",i,i],[0,36,"Digit1",22,"1",49,"VK_1",i,i],[0,37,"Digit2",23,"2",50,"VK_2",i,i],[0,38,"Digit3",24,"3",51,"VK_3",i,i],[0,39,"Digit4",25,"4",52,"VK_4",i,i],[0,40,"Digit5",26,"5",53,"VK_5",i,i],[0,41,"Digit6",27,"6",54,"VK_6",i,i],[0,42,"Digit7",28,"7",55,"VK_7",i,i],[0,43,"Digit8",29,"8",56,"VK_8",i,i],[0,44,"Digit9",30,"9",57,"VK_9",i,i],[0,45,"Digit0",21,"0",48,"VK_0",i,i],[1,46,"Enter",3,"Enter",13,"VK_RETURN",i,i],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",i,i],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",i,i],[1,49,"Tab",2,"Tab",9,"VK_TAB",i,i],[1,50,"Space",10,"Space",32,"VK_SPACE",i,i],[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,i,0,i,i,i],[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",i,i],[1,64,"F1",59,"F1",112,"VK_F1",i,i],[1,65,"F2",60,"F2",113,"VK_F2",i,i],[1,66,"F3",61,"F3",114,"VK_F3",i,i],[1,67,"F4",62,"F4",115,"VK_F4",i,i],[1,68,"F5",63,"F5",116,"VK_F5",i,i],[1,69,"F6",64,"F6",117,"VK_F6",i,i],[1,70,"F7",65,"F7",118,"VK_F7",i,i],[1,71,"F8",66,"F8",119,"VK_F8",i,i],[1,72,"F9",67,"F9",120,"VK_F9",i,i],[1,73,"F10",68,"F10",121,"VK_F10",i,i],[1,74,"F11",69,"F11",122,"VK_F11",i,i],[1,75,"F12",70,"F12",123,"VK_F12",i,i],[1,76,"PrintScreen",0,i,0,i,i,i],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",i,i],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",i,i],[1,79,"Insert",19,"Insert",45,"VK_INSERT",i,i],[1,80,"Home",14,"Home",36,"VK_HOME",i,i],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",i,i],[1,82,"Delete",20,"Delete",46,"VK_DELETE",i,i],[1,83,"End",13,"End",35,"VK_END",i,i],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",i,i],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",i],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",i],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",i],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",i],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",i,i],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",i,i],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",i,i],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",i,i],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",i,i],[1,94,"NumpadEnter",3,i,0,i,i,i],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",i,i],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",i,i],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",i,i],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",i,i],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",i,i],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",i,i],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",i,i],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",i,i],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",i,i],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",i,i],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",i,i],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",i,i],[1,107,"ContextMenu",58,"ContextMenu",93,i,i,i],[1,108,"Power",0,i,0,i,i,i],[1,109,"NumpadEqual",0,i,0,i,i,i],[1,110,"F13",71,"F13",124,"VK_F13",i,i],[1,111,"F14",72,"F14",125,"VK_F14",i,i],[1,112,"F15",73,"F15",126,"VK_F15",i,i],[1,113,"F16",74,"F16",127,"VK_F16",i,i],[1,114,"F17",75,"F17",128,"VK_F17",i,i],[1,115,"F18",76,"F18",129,"VK_F18",i,i],[1,116,"F19",77,"F19",130,"VK_F19",i,i],[1,117,"F20",78,"F20",131,"VK_F20",i,i],[1,118,"F21",79,"F21",132,"VK_F21",i,i],[1,119,"F22",80,"F22",133,"VK_F22",i,i],[1,120,"F23",81,"F23",134,"VK_F23",i,i],[1,121,"F24",82,"F24",135,"VK_F24",i,i],[1,122,"Open",0,i,0,i,i,i],[1,123,"Help",0,i,0,i,i,i],[1,124,"Select",0,i,0,i,i,i],[1,125,"Again",0,i,0,i,i,i],[1,126,"Undo",0,i,0,i,i,i],[1,127,"Cut",0,i,0,i,i,i],[1,128,"Copy",0,i,0,i,i,i],[1,129,"Paste",0,i,0,i,i,i],[1,130,"Find",0,i,0,i,i,i],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",i,i],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",i,i],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",i,i],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",i,i],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",i,i],[1,136,"KanaMode",0,i,0,i,i,i],[0,137,"IntlYen",0,i,0,i,i,i],[1,138,"Convert",0,i,0,i,i,i],[1,139,"NonConvert",0,i,0,i,i,i],[1,140,"Lang1",0,i,0,i,i,i],[1,141,"Lang2",0,i,0,i,i,i],[1,142,"Lang3",0,i,0,i,i,i],[1,143,"Lang4",0,i,0,i,i,i],[1,144,"Lang5",0,i,0,i,i,i],[1,145,"Abort",0,i,0,i,i,i],[1,146,"Props",0,i,0,i,i,i],[1,147,"NumpadParenLeft",0,i,0,i,i,i],[1,148,"NumpadParenRight",0,i,0,i,i,i],[1,149,"NumpadBackspace",0,i,0,i,i,i],[1,150,"NumpadMemoryStore",0,i,0,i,i,i],[1,151,"NumpadMemoryRecall",0,i,0,i,i,i],[1,152,"NumpadMemoryClear",0,i,0,i,i,i],[1,153,"NumpadMemoryAdd",0,i,0,i,i,i],[1,154,"NumpadMemorySubtract",0,i,0,i,i,i],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",i,i],[1,156,"NumpadClearEntry",0,i,0,i,i,i],[1,0,i,5,"Ctrl",17,"VK_CONTROL",i,i],[1,0,i,4,"Shift",16,"VK_SHIFT",i,i],[1,0,i,6,"Alt",18,"VK_MENU",i,i],[1,0,i,57,"Meta",91,"VK_COMMAND",i,i],[1,157,"ControlLeft",5,i,0,"VK_LCONTROL",i,i],[1,158,"ShiftLeft",4,i,0,"VK_LSHIFT",i,i],[1,159,"AltLeft",6,i,0,"VK_LMENU",i,i],[1,160,"MetaLeft",57,i,0,"VK_LWIN",i,i],[1,161,"ControlRight",5,i,0,"VK_RCONTROL",i,i],[1,162,"ShiftRight",4,i,0,"VK_RSHIFT",i,i],[1,163,"AltRight",6,i,0,"VK_RMENU",i,i],[1,164,"MetaRight",57,i,0,"VK_RWIN",i,i],[1,165,"BrightnessUp",0,i,0,i,i,i],[1,166,"BrightnessDown",0,i,0,i,i,i],[1,167,"MediaPlay",0,i,0,i,i,i],[1,168,"MediaRecord",0,i,0,i,i,i],[1,169,"MediaFastForward",0,i,0,i,i,i],[1,170,"MediaRewind",0,i,0,i,i,i],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",i,i],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",i,i],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",i,i],[1,174,"Eject",0,i,0,i,i,i],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",i,i],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",i,i],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",i,i],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",i,i],[1,179,"LaunchApp1",0,i,0,"VK_MEDIA_LAUNCH_APP1",i,i],[1,180,"SelectTask",0,i,0,i,i,i],[1,181,"LaunchScreenSaver",0,i,0,i,i,i],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",i,i],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",i,i],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",i,i],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",i,i],[1,186,"BrowserStop",0,i,0,"VK_BROWSER_STOP",i,i],[1,187,"BrowserRefresh",0,i,0,"VK_BROWSER_REFRESH",i,i],[1,188,"BrowserFavorites",0,i,0,"VK_BROWSER_FAVORITES",i,i],[1,189,"ZoomToggle",0,i,0,i,i,i],[1,190,"MailReply",0,i,0,i,i,i],[1,191,"MailForward",0,i,0,i,i,i],[1,192,"MailSend",0,i,0,i,i,i],[1,0,i,114,"KeyInComposition",229,i,i,i],[1,0,i,116,"ABNT_C2",194,"VK_ABNT_C2",i,i],[1,0,i,96,"OEM_8",223,"VK_OEM_8",i,i],[1,0,i,0,i,0,"VK_KANA",i,i],[1,0,i,0,i,0,"VK_HANGUL",i,i],[1,0,i,0,i,0,"VK_JUNJA",i,i],[1,0,i,0,i,0,"VK_FINAL",i,i],[1,0,i,0,i,0,"VK_HANJA",i,i],[1,0,i,0,i,0,"VK_KANJI",i,i],[1,0,i,0,i,0,"VK_CONVERT",i,i],[1,0,i,0,i,0,"VK_NONCONVERT",i,i],[1,0,i,0,i,0,"VK_ACCEPT",i,i],[1,0,i,0,i,0,"VK_MODECHANGE",i,i],[1,0,i,0,i,0,"VK_SELECT",i,i],[1,0,i,0,i,0,"VK_PRINT",i,i],[1,0,i,0,i,0,"VK_EXECUTE",i,i],[1,0,i,0,i,0,"VK_SNAPSHOT",i,i],[1,0,i,0,i,0,"VK_HELP",i,i],[1,0,i,0,i,0,"VK_APPS",i,i],[1,0,i,0,i,0,"VK_PROCESSKEY",i,i],[1,0,i,0,i,0,"VK_PACKET",i,i],[1,0,i,0,i,0,"VK_DBE_SBCSCHAR",i,i],[1,0,i,0,i,0,"VK_DBE_DBCSCHAR",i,i],[1,0,i,0,i,0,"VK_ATTN",i,i],[1,0,i,0,i,0,"VK_CRSEL",i,i],[1,0,i,0,i,0,"VK_EXSEL",i,i],[1,0,i,0,i,0,"VK_EREOF",i,i],[1,0,i,0,i,0,"VK_PLAY",i,i],[1,0,i,0,i,0,"VK_ZOOM",i,i],[1,0,i,0,i,0,"VK_NONAME",i,i],[1,0,i,0,i,0,"VK_PA1",i,i],[1,0,i,0,i,0,"VK_OEM_CLEAR",i,i]],t=[],n=[];for(const o of e){const[r,s,a,l,c,d,u,h,f]=o;if(n[s]||(n[s]=!0,OYe[a]=s,FYe[a.toLowerCase()]=s,r&&(Kq[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);eM.define(l,c),XW.define(l,h||c),YW.define(l,f||h||c)}d&&(T_e[d]=l)}})();var xg;(function(i){function e(a){return eM.keyCodeToStr(a)}i.toString=e;function t(a){return eM.strToKeyCode(a)}i.fromString=t;function n(a){return XW.keyCodeToStr(a)}i.toUserSettingsUS=n;function o(a){return YW.keyCodeToStr(a)}i.toUserSettingsGeneral=o;function r(a){return XW.strToKeyCode(a)||YW.strToKeyCode(a)}i.fromUserSettings=r;function s(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 eM.keyCodeToStr(a)}i.toElectronAccelerator=s})(xg||(xg={}));function Zo(i,e){const t=(e&65535)<<16>>>0;return(i|t)>>>0}let vy;if(typeof Id.vscode!="undefined"&&typeof Id.vscode.process!="undefined"){const i=Id.vscode.process;vy={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process!="undefined"?vy={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:vy={get platform(){return ls?"win32":Nn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const WA=vy.cwd,N_e=vy.env,BYe=vy.platform,WYe=65,VYe=97,HYe=90,$Ye=122,Km=46,Ps=47,Dl=92,Bp=58,zYe=63;class R_e extends Error{constructor(e,t,n){let o;typeof t=="string"&&t.indexOf("not ")===0?(o="must not be",t=t.replace(/^not /,"")):o="must be";const r=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${r} ${o} of type ${t}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function UYe(i,e){if(i===null||typeof i!="object")throw new R_e(e,"Object",i)}function wr(i,e){if(typeof i!="string")throw new R_e(e,"string",i)}const Zv=BYe==="win32";function li(i){return i===Ps||i===Dl}function ZW(i){return i===Ps}function Wp(i){return i>=WYe&&i<=HYe||i>=VYe&&i<=$Ye}function VA(i,e,t,n){let o="",r=0,s=-1,a=0,l=0;for(let c=0;c<=i.length;++c){if(c2){const d=o.lastIndexOf(t);d===-1?(o="",r=0):(o=o.slice(0,d),r=o.length-1-o.lastIndexOf(t)),s=c,a=0;continue}else if(o.length!==0){o="",r=0,s=c,a=0;continue}}e&&(o+=o.length>0?`${t}..`:"..",r=2)}else o.length>0?o+=`${t}${i.slice(s+1,c)}`:o=i.slice(s+1,c),r=c-s-1;s=c,a=0}else l===Km&&a!==-1?++a:a=-1}return o}function M_e(i,e){UYe(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${n}`:`${t}${i}${n}`:n}const ol={resolve(...i){let e="",t="",n=!1;for(let o=i.length-1;o>=-1;o--){let r;if(o>=0){if(r=i[o],wr(r,"path"),r.length===0)continue}else e.length===0?r=WA():(r=N_e[`=${e}`]||WA(),(r===void 0||r.slice(0,2).toLowerCase()!==e.toLowerCase()&&r.charCodeAt(2)===Dl)&&(r=`${e}\\`));const s=r.length;let a=0,l="",c=!1;const d=r.charCodeAt(0);if(s===1)li(d)&&(a=1,c=!0);else if(li(d))if(c=!0,li(r.charCodeAt(1))){let u=2,h=u;for(;u2&&li(r.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${r.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=VA(t,!n,"\\",li),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(i){wr(i,"path");const e=i.length;if(e===0)return".";let t=0,n,o=!1;const r=i.charCodeAt(0);if(e===1)return ZW(r)?"\\":i;if(li(r))if(o=!0,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))&&(o=!0,t=3));let s=t0&&li(i.charCodeAt(e-1))&&(s+="\\"),n===void 0?o?`\\${s}`:s:o?`${n}\\${s}`:`${n}${s}`},isAbsolute(i){wr(i,"path");const e=i.length;if(e===0)return!1;const t=i.charCodeAt(0);return li(t)||e>2&&Wp(t)&&i.charCodeAt(1)===Bp&&li(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,t;for(let r=0;r0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof t=="string"&&li(t.charCodeAt(0))){++o;const r=t.length;r>1&&li(t.charCodeAt(1))&&(++o,r>2&&(li(t.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return ol.normalize(e)},relative(i,e){if(wr(i,"from"),wr(e,"to"),i===e)return"";const t=ol.resolve(i),n=ol.resolve(e);if(t===n||(i=t.toLowerCase(),e=n.toLowerCase(),i===e))return"";let o=0;for(;oo&&i.charCodeAt(r-1)===Dl;)r--;const s=r-o;let a=0;for(;aa&&e.charCodeAt(l-1)===Dl;)l--;const c=l-a,d=sd){if(e.charCodeAt(a+h)===Dl)return n.slice(a+h+1);if(h===2)return n.slice(a+h)}s>d&&(i.charCodeAt(o+h)===Dl?u=h:h===2&&(u=3)),u===-1&&(u=0)}let f="";for(h=o+u+1;h<=r;++h)(h===r||i.charCodeAt(h)===Dl)&&(f+=f.length===0?"..":"\\..");return a+=u,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===Dl&&++a,n.slice(a,l))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=ol.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===Dl){if(e.charCodeAt(1)===Dl){const t=e.charCodeAt(2);if(t!==zYe&&t!==Km)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Wp(e.charCodeAt(0))&&e.charCodeAt(1)===Bp&&e.charCodeAt(2)===Dl)return`\\\\?\\${e}`;return i},dirname(i){wr(i,"path");const e=i.length;if(e===0)return".";let t=-1,n=0;const o=i.charCodeAt(0);if(e===1)return li(o)?i:".";if(li(o)){if(t=n=1,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))?3:2,n=t);let r=-1,s=!0;for(let a=e-1;a>=n;--a)if(li(i.charCodeAt(a))){if(!s){r=a;break}}else s=!1;if(r===-1){if(t===-1)return".";r=t}return i.slice(0,r)},basename(i,e){e!==void 0&&wr(e,"ext"),wr(i,"path");let t=0,n=-1,o=!0,r;if(i.length>=2&&Wp(i.charCodeAt(0))&&i.charCodeAt(1)===Bp&&(t=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(r=i.length-1;r>=t;--r){const l=i.charCodeAt(r);if(li(l)){if(!o){t=r+1;break}}else a===-1&&(o=!1,a=r+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=r):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=t;--r)if(li(i.charCodeAt(r))){if(!o){t=r+1;break}}else n===-1&&(o=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){wr(i,"path");let e=0,t=-1,n=0,o=-1,r=!0,s=0;i.length>=2&&i.charCodeAt(1)===Bp&&Wp(i.charCodeAt(0))&&(e=n=2);for(let a=i.length-1;a>=e;--a){const l=i.charCodeAt(a);if(li(l)){if(!r){n=a+1;break}continue}o===-1&&(r=!1,o=a+1),l===Km?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||o===-1||s===0||s===1&&t===o-1&&t===n+1?"":i.slice(t,o)},format:M_e.bind(null,"\\"),parse(i){wr(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.length;let n=0,o=i.charCodeAt(0);if(t===1)return li(o)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(li(o)){if(n=1,li(i.charCodeAt(1))){let u=2,h=u;for(;u0&&(e.root=i.slice(0,n));let r=-1,s=n,a=-1,l=!0,c=i.length-1,d=0;for(;c>=n;--c){if(o=i.charCodeAt(c),li(o)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),o===Km?r===-1?r=c:d!==1&&(d=1):r!==-1&&(d=-1)}return a!==-1&&(r===-1||d===0||d===1&&r===a-1&&r===s+1?e.base=e.name=i.slice(s,a):(e.name=i.slice(s,r),e.base=i.slice(s,a),e.ext=i.slice(r,a))),s>0&&s!==n?e.dir=i.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},jYe=(()=>{if(Zv){const i=/\\/g;return()=>{const e=WA().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>WA()})(),Go={resolve(...i){let e="",t=!1;for(let n=i.length-1;n>=-1&&!t;n--){const o=n>=0?i[n]:jYe();wr(o,"path"),o.length!==0&&(e=`${o}/${e}`,t=o.charCodeAt(0)===Ps)}return e=VA(e,!t,"/",ZW),t?`/${e}`:e.length>0?e:"."},normalize(i){if(wr(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ps,t=i.charCodeAt(i.length-1)===Ps;return i=VA(i,!e,"/",ZW),i.length===0?e?"/":t?"./":".":(t&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return wr(i,"path"),i.length>0&&i.charCodeAt(0)===Ps},join(...i){if(i.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Go.normalize(e)},relative(i,e){if(wr(i,"from"),wr(e,"to"),i===e||(i=Go.resolve(i),e=Go.resolve(e),i===e))return"";const t=1,n=i.length,o=n-t,r=1,s=e.length-r,a=oa){if(e.charCodeAt(r+c)===Ps)return e.slice(r+c+1);if(c===0)return e.slice(r+c)}else o>a&&(i.charCodeAt(t+c)===Ps?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=n;++c)(c===n||i.charCodeAt(c)===Ps)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(r+l)}`},toNamespacedPath(i){return i},dirname(i){if(wr(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ps;let t=-1,n=!0;for(let o=i.length-1;o>=1;--o)if(i.charCodeAt(o)===Ps){if(!n){t=o;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":i.slice(0,t)},basename(i,e){e!==void 0&&wr(e,"ext"),wr(i,"path");let t=0,n=-1,o=!0,r;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(r=i.length-1;r>=0;--r){const l=i.charCodeAt(r);if(l===Ps){if(!o){t=r+1;break}}else a===-1&&(o=!1,a=r+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=r):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=0;--r)if(i.charCodeAt(r)===Ps){if(!o){t=r+1;break}}else n===-1&&(o=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){wr(i,"path");let e=-1,t=0,n=-1,o=!0,r=0;for(let s=i.length-1;s>=0;--s){const a=i.charCodeAt(s);if(a===Ps){if(!o){t=s+1;break}continue}n===-1&&(o=!1,n=s+1),a===Km?e===-1?e=s:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||n===-1||r===0||r===1&&e===n-1&&e===t+1?"":i.slice(e,n)},format:M_e.bind(null,"/"),parse(i){wr(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.charCodeAt(0)===Ps;let n;t?(e.root="/",n=1):n=0;let o=-1,r=0,s=-1,a=!0,l=i.length-1,c=0;for(;l>=n;--l){const d=i.charCodeAt(l);if(d===Ps){if(!a){r=l+1;break}continue}s===-1&&(a=!1,s=l+1),d===Km?o===-1?o=l:c!==1&&(c=1):o!==-1&&(c=-1)}if(s!==-1){const d=r===0&&t?1:r;o===-1||c===0||c===1&&o===s-1&&o===r+1?e.base=e.name=i.slice(d,s):(e.name=i.slice(d,o),e.base=i.slice(d,s),e.ext=i.slice(o,s))}return r>0?e.dir=i.slice(0,r-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Go.win32=ol.win32=ol;Go.posix=ol.posix=Go;const A_e=Zv?ol.normalize:Go.normalize,KYe=Zv?ol.resolve:Go.resolve,qYe=Zv?ol.relative:Go.relative,P_e=Zv?ol.dirname:Go.dirname,qm=Zv?ol.basename:Go.basename,GYe=Zv?ol.extname:Go.extname,Bu=Zv?ol.sep:Go.sep,XYe=/^\w[\w\d+.-]*$/,YYe=/^\//,ZYe=/^\/\//;function QYe(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!XYe.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!YYe.test(i.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(ZYe.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function JYe(i,e){return!i&&!e?"file":i}function eZe(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==yu&&(e=yu+e):e=yu;break}return e}const ko="",yu="/",tZe=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Rt{static isUri(e){return e instanceof Rt?!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,n,o,r,s=!1){typeof e=="object"?(this.scheme=e.scheme||ko,this.authority=e.authority||ko,this.path=e.path||ko,this.query=e.query||ko,this.fragment=e.fragment||ko):(this.scheme=JYe(e,s),this.authority=t||ko,this.path=eZe(this.scheme,n||ko),this.query=o||ko,this.fragment=r||ko,QYe(this,s))}get fsPath(){return HA(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:o,query:r,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=ko),n===void 0?n=this.authority:n===null&&(n=ko),o===void 0?o=this.path:o===null&&(o=ko),r===void 0?r=this.query:r===null&&(r=ko),s===void 0?s=this.fragment:s===null&&(s=ko),t===this.scheme&&n===this.authority&&o===this.path&&r===this.query&&s===this.fragment?this:new W1(t,n,o,r,s)}static parse(e,t=!1){const n=tZe.exec(e);return n?new W1(n[2]||ko,i2(n[4]||ko),i2(n[5]||ko),i2(n[7]||ko),i2(n[9]||ko),t):new W1(ko,ko,ko,ko,ko)}static file(e){let t=ko;if(ls&&(e=e.replace(/\\/g,yu)),e[0]===yu&&e[1]===yu){const n=e.indexOf(yu,2);n===-1?(t=e.substring(2),e=yu):(t=e.substring(2,n),e=e.substring(n)||yu)}return new W1("file",t,e,ko,ko)}static from(e,t){return new W1(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 n;return ls&&e.scheme==="file"?n=Rt.file(ol.join(HA(e,!0),...t)).path:n=Go.join(e.path,...t),e.with({path:n})}toString(e=!1){return QW(this,e)}toJSON(){return this}static revive(e){var t,n;if(e){if(e instanceof Rt)return e;{const o=new W1(e);return o._formatted=(t=e.external)!==null&&t!==void 0?t:null,o._fsPath=e._sep===O_e&&(n=e.fsPath)!==null&&n!==void 0?n:null,o}}else return e}}const O_e=ls?1:void 0;class W1 extends Rt{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=HA(this,!1)),this._fsPath}toString(e=!1){return e?QW(this,!0):(this._formatted||(this._formatted=QW(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=O_e),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 F_e={[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 hoe(i,e,t){let n,o=-1;for(let r=0;r=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)o!==-1&&(n+=encodeURIComponent(i.substring(o,r)),o=-1),n!==void 0&&(n+=i.charAt(r));else{n===void 0&&(n=i.substr(0,r));const a=F_e[s];a!==void 0?(o!==-1&&(n+=encodeURIComponent(i.substring(o,r)),o=-1),n+=a):o===-1&&(o=r)}}return o!==-1&&(n+=encodeURIComponent(i.substring(o))),n!==void 0?n:i}function nZe(i){let e;for(let t=0;t1&&i.scheme==="file"?t=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?t=i.path.substr(1):t=i.path[1].toLowerCase()+i.path.substr(2):t=i.path,ls&&(t=t.replace(/\//g,"\\")),t}function QW(i,e){const t=e?nZe:hoe;let n="",{scheme:o,authority:r,path:s,query:a,fragment:l}=i;if(o&&(n+=o,n+=":"),(r||o==="file")&&(n+=yu,n+=yu),r){let c=r.indexOf("@");if(c!==-1){const d=r.substr(0,c);r=r.substr(c+1),c=d.lastIndexOf(":"),c===-1?n+=t(d,!1,!1):(n+=t(d.substr(0,c),!1,!1),n+=":",n+=t(d.substr(c+1),!1,!0)),n+="@"}r=r.toLowerCase(),c=r.lastIndexOf(":"),c===-1?n+=t(r,!1,!0):(n+=t(r.substr(0,c),!1,!0),n+=r.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}n+=t(s,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:hoe(l,!1,!1)),n}function B_e(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+B_e(i.substr(3)):i}}const foe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function i2(i){return i.match(foe)?i.replace(foe,e=>B_e(e)):i}class ae{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 ae(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return ae.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return ae.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return V.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return V.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 V.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 V.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 V.plusRange(this,e)}static plusRange(e,t){let n,o,r,s;return t.startLineNumbere.endLineNumber?(r=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,s=e.endColumn),new V(n,o,r,s)}intersectRanges(e){return V.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return nc?(r=c,s=d):r===c&&(s=Math.min(s,d)),n>r||n===r&&o>s?null:new V(n,o,r,s)}equalsRange(e){return V.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 V.getEndPosition(this)}static getEndPosition(e){return new ae(e.endLineNumber,e.endColumn)}getStartPosition(){return V.getStartPosition(this)}static getStartPosition(e){return new ae(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new V(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new V(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return V.collapseToStart(this)}static collapseToStart(e){return new V(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return V.collapseToEnd(this)}static collapseToEnd(e){return new V(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new V(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new V(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new V(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}}class gt extends V{constructor(e,t,n,o){super(e,t,n,o),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=o}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return gt.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 gt(this.startLineNumber,this.startColumn,e,t):new gt(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ae(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new ae(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new gt(e,t,this.endLineNumber,this.endColumn):new gt(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new gt(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new gt(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new gt(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new gt(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 n=0,o=e.length;n{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var n;(n=this._factories.get(e))===null||n===void 0||n.dispose();const o=new oZe(this,e,t);return this._factories.set(e,o),zt(()=>{const r=this._factories.get(e);!r||r!==o||(this._factories.delete(e),r.dispose())})}getOrCreate(e){return eV(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(yield n.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const n=this._factories.get(e);return!!(!n||n.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 oZe extends _e{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return eV(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return eV(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))})}}class ND{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class qq{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class $4{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var RD;(function(i){const e=new Map;e.set(0,Xe.symbolMethod),e.set(1,Xe.symbolFunction),e.set(2,Xe.symbolConstructor),e.set(3,Xe.symbolField),e.set(4,Xe.symbolVariable),e.set(5,Xe.symbolClass),e.set(6,Xe.symbolStruct),e.set(7,Xe.symbolInterface),e.set(8,Xe.symbolModule),e.set(9,Xe.symbolProperty),e.set(10,Xe.symbolEvent),e.set(11,Xe.symbolOperator),e.set(12,Xe.symbolUnit),e.set(13,Xe.symbolValue),e.set(15,Xe.symbolEnum),e.set(14,Xe.symbolConstant),e.set(15,Xe.symbolEnum),e.set(16,Xe.symbolEnumMember),e.set(17,Xe.symbolKeyword),e.set(27,Xe.symbolSnippet),e.set(18,Xe.symbolText),e.set(19,Xe.symbolColor),e.set(20,Xe.symbolFile),e.set(21,Xe.symbolReference),e.set(22,Xe.symbolCustomColor),e.set(23,Xe.symbolFolder),e.set(24,Xe.symbolTypeParameter),e.set(25,Xe.account),e.set(26,Xe.issues);function t(r){let s=e.get(r);return s||(console.info("No codicon found for CompletionItemKind "+r),s=Xe.symbolProperty),s}i.toIcon=t;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",27),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26);function o(r,s){let a=n.get(r);return typeof a=="undefined"&&!s&&(a=9),a}i.fromString=o})(RD||(RD={}));var Kg;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(Kg||(Kg={}));class V_e{constructor(e,t,n,o){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=o}equals(e){return V.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var lf;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(lf||(lf={}));var MD;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(MD||(MD={}));function rZe(i){return i&&Rt.isUri(i.uri)&&V.isIRange(i.range)&&(V.isIRange(i.originSelectionRange)||V.isIRange(i.targetSelectionRange))}const sZe={[17]:C("Array","array"),[16]:C("Boolean","boolean"),[4]:C("Class","class"),[13]:C("Constant","constant"),[8]:C("Constructor","constructor"),[9]:C("Enum","enumeration"),[21]:C("EnumMember","enumeration member"),[23]:C("Event","event"),[7]:C("Field","field"),[0]:C("File","file"),[11]:C("Function","function"),[10]:C("Interface","interface"),[19]:C("Key","key"),[5]:C("Method","method"),[1]:C("Module","module"),[2]:C("Namespace","namespace"),[20]:C("Null","null"),[15]:C("Number","number"),[18]:C("Object","object"),[24]:C("Operator","operator"),[3]:C("Package","package"),[6]:C("Property","property"),[14]:C("String","string"),[22]:C("Struct","struct"),[25]:C("TypeParameter","type parameter"),[12]:C("Variable","variable")};function aZe(i,e){return C("symbolAriaLabel","{0} ({1})",i,sZe[e])}var $A;(function(i){const e=new Map;e.set(0,Xe.symbolFile),e.set(1,Xe.symbolModule),e.set(2,Xe.symbolNamespace),e.set(3,Xe.symbolPackage),e.set(4,Xe.symbolClass),e.set(5,Xe.symbolMethod),e.set(6,Xe.symbolProperty),e.set(7,Xe.symbolField),e.set(8,Xe.symbolConstructor),e.set(9,Xe.symbolEnum),e.set(10,Xe.symbolInterface),e.set(11,Xe.symbolFunction),e.set(12,Xe.symbolVariable),e.set(13,Xe.symbolConstant),e.set(14,Xe.symbolString),e.set(15,Xe.symbolNumber),e.set(16,Xe.symbolBoolean),e.set(17,Xe.symbolArray),e.set(18,Xe.symbolObject),e.set(19,Xe.symbolKey),e.set(20,Xe.symbolNull),e.set(21,Xe.symbolEnumMember),e.set(22,Xe.symbolStruct),e.set(23,Xe.symbolEvent),e.set(24,Xe.symbolOperator),e.set(25,Xe.symbolTypeParameter);function t(n){let o=e.get(n);return o||(console.info("No codicon found for SymbolKind "+n),o=Xe.symbolProperty),o}i.toIcon=t})($A||($A={}));class ra{static fromValue(e){switch(e){case"comment":return ra.Comment;case"imports":return ra.Imports;case"region":return ra.Region}return new ra(e)}constructor(e){this.value=e}}ra.Comment=new ra("comment");ra.Imports=new ra("imports");ra.Region=new ra("region");var tV;(function(i){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}i.is=e})(tV||(tV={}));var zA;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(zA||(zA={}));class lZe{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 oo=new iZe;var nV;(function(i){i[i.Unknown=0]="Unknown",i[i.Disabled=1]="Disabled",i[i.Enabled=2]="Enabled"})(nV||(nV={}));var iV;(function(i){i[i.Invoke=1]="Invoke",i[i.Auto=2]="Auto"})(iV||(iV={}));var oV;(function(i){i[i.None=0]="None",i[i.KeepWhitespace=1]="KeepWhitespace",i[i.InsertAsSnippet=4]="InsertAsSnippet"})(oV||(oV={}));var rV;(function(i){i[i.Method=0]="Method",i[i.Function=1]="Function",i[i.Constructor=2]="Constructor",i[i.Field=3]="Field",i[i.Variable=4]="Variable",i[i.Class=5]="Class",i[i.Struct=6]="Struct",i[i.Interface=7]="Interface",i[i.Module=8]="Module",i[i.Property=9]="Property",i[i.Event=10]="Event",i[i.Operator=11]="Operator",i[i.Unit=12]="Unit",i[i.Value=13]="Value",i[i.Constant=14]="Constant",i[i.Enum=15]="Enum",i[i.EnumMember=16]="EnumMember",i[i.Keyword=17]="Keyword",i[i.Text=18]="Text",i[i.Color=19]="Color",i[i.File=20]="File",i[i.Reference=21]="Reference",i[i.Customcolor=22]="Customcolor",i[i.Folder=23]="Folder",i[i.TypeParameter=24]="TypeParameter",i[i.User=25]="User",i[i.Issue=26]="Issue",i[i.Snippet=27]="Snippet"})(rV||(rV={}));var sV;(function(i){i[i.Deprecated=1]="Deprecated"})(sV||(sV={}));var aV;(function(i){i[i.Invoke=0]="Invoke",i[i.TriggerCharacter=1]="TriggerCharacter",i[i.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(aV||(aV={}));var lV;(function(i){i[i.EXACT=0]="EXACT",i[i.ABOVE=1]="ABOVE",i[i.BELOW=2]="BELOW"})(lV||(lV={}));var cV;(function(i){i[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo"})(cV||(cV={}));var dV;(function(i){i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(dV||(dV={}));var uV;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(uV||(uV={}));var hV;(function(i){i[i.None=0]="None",i[i.Keep=1]="Keep",i[i.Brackets=2]="Brackets",i[i.Advanced=3]="Advanced",i[i.Full=4]="Full"})(hV||(hV={}));var fV;(function(i){i[i.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",i[i.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",i[i.accessibilitySupport=2]="accessibilitySupport",i[i.accessibilityPageSize=3]="accessibilityPageSize",i[i.ariaLabel=4]="ariaLabel",i[i.ariaRequired=5]="ariaRequired",i[i.autoClosingBrackets=6]="autoClosingBrackets",i[i.autoClosingComments=7]="autoClosingComments",i[i.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",i[i.autoClosingDelete=9]="autoClosingDelete",i[i.autoClosingOvertype=10]="autoClosingOvertype",i[i.autoClosingQuotes=11]="autoClosingQuotes",i[i.autoIndent=12]="autoIndent",i[i.automaticLayout=13]="automaticLayout",i[i.autoSurround=14]="autoSurround",i[i.bracketPairColorization=15]="bracketPairColorization",i[i.guides=16]="guides",i[i.codeLens=17]="codeLens",i[i.codeLensFontFamily=18]="codeLensFontFamily",i[i.codeLensFontSize=19]="codeLensFontSize",i[i.colorDecorators=20]="colorDecorators",i[i.colorDecoratorsLimit=21]="colorDecoratorsLimit",i[i.columnSelection=22]="columnSelection",i[i.comments=23]="comments",i[i.contextmenu=24]="contextmenu",i[i.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",i[i.cursorBlinking=26]="cursorBlinking",i[i.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",i[i.cursorStyle=28]="cursorStyle",i[i.cursorSurroundingLines=29]="cursorSurroundingLines",i[i.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",i[i.cursorWidth=31]="cursorWidth",i[i.disableLayerHinting=32]="disableLayerHinting",i[i.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",i[i.domReadOnly=34]="domReadOnly",i[i.dragAndDrop=35]="dragAndDrop",i[i.dropIntoEditor=36]="dropIntoEditor",i[i.emptySelectionClipboard=37]="emptySelectionClipboard",i[i.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",i[i.extraEditorClassName=39]="extraEditorClassName",i[i.fastScrollSensitivity=40]="fastScrollSensitivity",i[i.find=41]="find",i[i.fixedOverflowWidgets=42]="fixedOverflowWidgets",i[i.folding=43]="folding",i[i.foldingStrategy=44]="foldingStrategy",i[i.foldingHighlight=45]="foldingHighlight",i[i.foldingImportsByDefault=46]="foldingImportsByDefault",i[i.foldingMaximumRegions=47]="foldingMaximumRegions",i[i.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",i[i.fontFamily=49]="fontFamily",i[i.fontInfo=50]="fontInfo",i[i.fontLigatures=51]="fontLigatures",i[i.fontSize=52]="fontSize",i[i.fontWeight=53]="fontWeight",i[i.fontVariations=54]="fontVariations",i[i.formatOnPaste=55]="formatOnPaste",i[i.formatOnType=56]="formatOnType",i[i.glyphMargin=57]="glyphMargin",i[i.gotoLocation=58]="gotoLocation",i[i.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",i[i.hover=60]="hover",i[i.inDiffEditor=61]="inDiffEditor",i[i.inlineSuggest=62]="inlineSuggest",i[i.letterSpacing=63]="letterSpacing",i[i.lightbulb=64]="lightbulb",i[i.lineDecorationsWidth=65]="lineDecorationsWidth",i[i.lineHeight=66]="lineHeight",i[i.lineNumbers=67]="lineNumbers",i[i.lineNumbersMinChars=68]="lineNumbersMinChars",i[i.linkedEditing=69]="linkedEditing",i[i.links=70]="links",i[i.matchBrackets=71]="matchBrackets",i[i.minimap=72]="minimap",i[i.mouseStyle=73]="mouseStyle",i[i.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",i[i.mouseWheelZoom=75]="mouseWheelZoom",i[i.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",i[i.multiCursorModifier=77]="multiCursorModifier",i[i.multiCursorPaste=78]="multiCursorPaste",i[i.multiCursorLimit=79]="multiCursorLimit",i[i.occurrencesHighlight=80]="occurrencesHighlight",i[i.overviewRulerBorder=81]="overviewRulerBorder",i[i.overviewRulerLanes=82]="overviewRulerLanes",i[i.padding=83]="padding",i[i.pasteAs=84]="pasteAs",i[i.parameterHints=85]="parameterHints",i[i.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",i[i.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",i[i.quickSuggestions=88]="quickSuggestions",i[i.quickSuggestionsDelay=89]="quickSuggestionsDelay",i[i.readOnly=90]="readOnly",i[i.readOnlyMessage=91]="readOnlyMessage",i[i.renameOnType=92]="renameOnType",i[i.renderControlCharacters=93]="renderControlCharacters",i[i.renderFinalNewline=94]="renderFinalNewline",i[i.renderLineHighlight=95]="renderLineHighlight",i[i.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",i[i.renderValidationDecorations=97]="renderValidationDecorations",i[i.renderWhitespace=98]="renderWhitespace",i[i.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",i[i.roundedSelection=100]="roundedSelection",i[i.rulers=101]="rulers",i[i.scrollbar=102]="scrollbar",i[i.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",i[i.scrollBeyondLastLine=104]="scrollBeyondLastLine",i[i.scrollPredominantAxis=105]="scrollPredominantAxis",i[i.selectionClipboard=106]="selectionClipboard",i[i.selectionHighlight=107]="selectionHighlight",i[i.selectOnLineNumbers=108]="selectOnLineNumbers",i[i.showFoldingControls=109]="showFoldingControls",i[i.showUnused=110]="showUnused",i[i.snippetSuggestions=111]="snippetSuggestions",i[i.smartSelect=112]="smartSelect",i[i.smoothScrolling=113]="smoothScrolling",i[i.stickyScroll=114]="stickyScroll",i[i.stickyTabStops=115]="stickyTabStops",i[i.stopRenderingLineAfter=116]="stopRenderingLineAfter",i[i.suggest=117]="suggest",i[i.suggestFontSize=118]="suggestFontSize",i[i.suggestLineHeight=119]="suggestLineHeight",i[i.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",i[i.suggestSelection=121]="suggestSelection",i[i.tabCompletion=122]="tabCompletion",i[i.tabIndex=123]="tabIndex",i[i.unicodeHighlighting=124]="unicodeHighlighting",i[i.unusualLineTerminators=125]="unusualLineTerminators",i[i.useShadowDOM=126]="useShadowDOM",i[i.useTabStops=127]="useTabStops",i[i.wordBreak=128]="wordBreak",i[i.wordSeparators=129]="wordSeparators",i[i.wordWrap=130]="wordWrap",i[i.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",i[i.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",i[i.wordWrapColumn=133]="wordWrapColumn",i[i.wordWrapOverride1=134]="wordWrapOverride1",i[i.wordWrapOverride2=135]="wordWrapOverride2",i[i.wrappingIndent=136]="wrappingIndent",i[i.wrappingStrategy=137]="wrappingStrategy",i[i.showDeprecated=138]="showDeprecated",i[i.inlayHints=139]="inlayHints",i[i.editorClassName=140]="editorClassName",i[i.pixelRatio=141]="pixelRatio",i[i.tabFocusMode=142]="tabFocusMode",i[i.layoutInfo=143]="layoutInfo",i[i.wrappingInfo=144]="wrappingInfo",i[i.defaultColorDecorators=145]="defaultColorDecorators",i[i.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",i[i.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(fV||(fV={}));var gV;(function(i){i[i.TextDefined=0]="TextDefined",i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(gV||(gV={}));var pV;(function(i){i[i.LF=0]="LF",i[i.CRLF=1]="CRLF"})(pV||(pV={}));var mV;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(mV||(mV={}));var vV;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(vV||(vV={}));var _V;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(_V||(_V={}));var bV;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(bV||(bV={}));var CV;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(CV||(CV={}));var yV;(function(i){i[i.DependsOnKbLayout=-1]="DependsOnKbLayout",i[i.Unknown=0]="Unknown",i[i.Backspace=1]="Backspace",i[i.Tab=2]="Tab",i[i.Enter=3]="Enter",i[i.Shift=4]="Shift",i[i.Ctrl=5]="Ctrl",i[i.Alt=6]="Alt",i[i.PauseBreak=7]="PauseBreak",i[i.CapsLock=8]="CapsLock",i[i.Escape=9]="Escape",i[i.Space=10]="Space",i[i.PageUp=11]="PageUp",i[i.PageDown=12]="PageDown",i[i.End=13]="End",i[i.Home=14]="Home",i[i.LeftArrow=15]="LeftArrow",i[i.UpArrow=16]="UpArrow",i[i.RightArrow=17]="RightArrow",i[i.DownArrow=18]="DownArrow",i[i.Insert=19]="Insert",i[i.Delete=20]="Delete",i[i.Digit0=21]="Digit0",i[i.Digit1=22]="Digit1",i[i.Digit2=23]="Digit2",i[i.Digit3=24]="Digit3",i[i.Digit4=25]="Digit4",i[i.Digit5=26]="Digit5",i[i.Digit6=27]="Digit6",i[i.Digit7=28]="Digit7",i[i.Digit8=29]="Digit8",i[i.Digit9=30]="Digit9",i[i.KeyA=31]="KeyA",i[i.KeyB=32]="KeyB",i[i.KeyC=33]="KeyC",i[i.KeyD=34]="KeyD",i[i.KeyE=35]="KeyE",i[i.KeyF=36]="KeyF",i[i.KeyG=37]="KeyG",i[i.KeyH=38]="KeyH",i[i.KeyI=39]="KeyI",i[i.KeyJ=40]="KeyJ",i[i.KeyK=41]="KeyK",i[i.KeyL=42]="KeyL",i[i.KeyM=43]="KeyM",i[i.KeyN=44]="KeyN",i[i.KeyO=45]="KeyO",i[i.KeyP=46]="KeyP",i[i.KeyQ=47]="KeyQ",i[i.KeyR=48]="KeyR",i[i.KeyS=49]="KeyS",i[i.KeyT=50]="KeyT",i[i.KeyU=51]="KeyU",i[i.KeyV=52]="KeyV",i[i.KeyW=53]="KeyW",i[i.KeyX=54]="KeyX",i[i.KeyY=55]="KeyY",i[i.KeyZ=56]="KeyZ",i[i.Meta=57]="Meta",i[i.ContextMenu=58]="ContextMenu",i[i.F1=59]="F1",i[i.F2=60]="F2",i[i.F3=61]="F3",i[i.F4=62]="F4",i[i.F5=63]="F5",i[i.F6=64]="F6",i[i.F7=65]="F7",i[i.F8=66]="F8",i[i.F9=67]="F9",i[i.F10=68]="F10",i[i.F11=69]="F11",i[i.F12=70]="F12",i[i.F13=71]="F13",i[i.F14=72]="F14",i[i.F15=73]="F15",i[i.F16=74]="F16",i[i.F17=75]="F17",i[i.F18=76]="F18",i[i.F19=77]="F19",i[i.F20=78]="F20",i[i.F21=79]="F21",i[i.F22=80]="F22",i[i.F23=81]="F23",i[i.F24=82]="F24",i[i.NumLock=83]="NumLock",i[i.ScrollLock=84]="ScrollLock",i[i.Semicolon=85]="Semicolon",i[i.Equal=86]="Equal",i[i.Comma=87]="Comma",i[i.Minus=88]="Minus",i[i.Period=89]="Period",i[i.Slash=90]="Slash",i[i.Backquote=91]="Backquote",i[i.BracketLeft=92]="BracketLeft",i[i.Backslash=93]="Backslash",i[i.BracketRight=94]="BracketRight",i[i.Quote=95]="Quote",i[i.OEM_8=96]="OEM_8",i[i.IntlBackslash=97]="IntlBackslash",i[i.Numpad0=98]="Numpad0",i[i.Numpad1=99]="Numpad1",i[i.Numpad2=100]="Numpad2",i[i.Numpad3=101]="Numpad3",i[i.Numpad4=102]="Numpad4",i[i.Numpad5=103]="Numpad5",i[i.Numpad6=104]="Numpad6",i[i.Numpad7=105]="Numpad7",i[i.Numpad8=106]="Numpad8",i[i.Numpad9=107]="Numpad9",i[i.NumpadMultiply=108]="NumpadMultiply",i[i.NumpadAdd=109]="NumpadAdd",i[i.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",i[i.NumpadSubtract=111]="NumpadSubtract",i[i.NumpadDecimal=112]="NumpadDecimal",i[i.NumpadDivide=113]="NumpadDivide",i[i.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",i[i.ABNT_C1=115]="ABNT_C1",i[i.ABNT_C2=116]="ABNT_C2",i[i.AudioVolumeMute=117]="AudioVolumeMute",i[i.AudioVolumeUp=118]="AudioVolumeUp",i[i.AudioVolumeDown=119]="AudioVolumeDown",i[i.BrowserSearch=120]="BrowserSearch",i[i.BrowserHome=121]="BrowserHome",i[i.BrowserBack=122]="BrowserBack",i[i.BrowserForward=123]="BrowserForward",i[i.MediaTrackNext=124]="MediaTrackNext",i[i.MediaTrackPrevious=125]="MediaTrackPrevious",i[i.MediaStop=126]="MediaStop",i[i.MediaPlayPause=127]="MediaPlayPause",i[i.LaunchMediaPlayer=128]="LaunchMediaPlayer",i[i.LaunchMail=129]="LaunchMail",i[i.LaunchApp2=130]="LaunchApp2",i[i.Clear=131]="Clear",i[i.MAX_VALUE=132]="MAX_VALUE"})(yV||(yV={}));var wV;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(wV||(wV={}));var SV;(function(i){i[i.Unnecessary=1]="Unnecessary",i[i.Deprecated=2]="Deprecated"})(SV||(SV={}));var xV;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(xV||(xV={}));var LV;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.TEXTAREA=1]="TEXTAREA",i[i.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",i[i.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",i[i.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",i[i.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",i[i.CONTENT_TEXT=6]="CONTENT_TEXT",i[i.CONTENT_EMPTY=7]="CONTENT_EMPTY",i[i.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",i[i.CONTENT_WIDGET=9]="CONTENT_WIDGET",i[i.OVERVIEW_RULER=10]="OVERVIEW_RULER",i[i.SCROLLBAR=11]="SCROLLBAR",i[i.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",i[i.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(LV||(LV={}));var EV;(function(i){i[i.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",i[i.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",i[i.TOP_CENTER=2]="TOP_CENTER"})(EV||(EV={}));var DV;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(DV||(DV={}));var kV;(function(i){i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.None=2]="None",i[i.LeftOfInjectedText=3]="LeftOfInjectedText",i[i.RightOfInjectedText=4]="RightOfInjectedText"})(kV||(kV={}));var IV;(function(i){i[i.Off=0]="Off",i[i.On=1]="On",i[i.Relative=2]="Relative",i[i.Interval=3]="Interval",i[i.Custom=4]="Custom"})(IV||(IV={}));var TV;(function(i){i[i.None=0]="None",i[i.Text=1]="Text",i[i.Blocks=2]="Blocks"})(TV||(TV={}));var NV;(function(i){i[i.Smooth=0]="Smooth",i[i.Immediate=1]="Immediate"})(NV||(NV={}));var RV;(function(i){i[i.Auto=1]="Auto",i[i.Hidden=2]="Hidden",i[i.Visible=3]="Visible"})(RV||(RV={}));var MV;(function(i){i[i.LTR=0]="LTR",i[i.RTL=1]="RTL"})(MV||(MV={}));var AV;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(AV||(AV={}));var PV;(function(i){i[i.File=0]="File",i[i.Module=1]="Module",i[i.Namespace=2]="Namespace",i[i.Package=3]="Package",i[i.Class=4]="Class",i[i.Method=5]="Method",i[i.Property=6]="Property",i[i.Field=7]="Field",i[i.Constructor=8]="Constructor",i[i.Enum=9]="Enum",i[i.Interface=10]="Interface",i[i.Function=11]="Function",i[i.Variable=12]="Variable",i[i.Constant=13]="Constant",i[i.String=14]="String",i[i.Number=15]="Number",i[i.Boolean=16]="Boolean",i[i.Array=17]="Array",i[i.Object=18]="Object",i[i.Key=19]="Key",i[i.Null=20]="Null",i[i.EnumMember=21]="EnumMember",i[i.Struct=22]="Struct",i[i.Event=23]="Event",i[i.Operator=24]="Operator",i[i.TypeParameter=25]="TypeParameter"})(PV||(PV={}));var OV;(function(i){i[i.Deprecated=1]="Deprecated"})(OV||(OV={}));var FV;(function(i){i[i.Hidden=0]="Hidden",i[i.Blink=1]="Blink",i[i.Smooth=2]="Smooth",i[i.Phase=3]="Phase",i[i.Expand=4]="Expand",i[i.Solid=5]="Solid"})(FV||(FV={}));var BV;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(BV||(BV={}));var WV;(function(i){i[i.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",i[i.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",i[i.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",i[i.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(WV||(WV={}));var VV;(function(i){i[i.None=0]="None",i[i.Same=1]="Same",i[i.Indent=2]="Indent",i[i.DeepIndent=3]="DeepIndent"})(VV||(VV={}));class WI{static chord(e,t){return Zo(e,t)}}WI.CtrlCmd=2048;WI.Shift=1024;WI.Alt=512;WI.WinCtrl=256;function H_e(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ro,Emitter:le,KeyCode:yV,KeyMod:WI,Position:ae,Range:V,Selection:gt,SelectionDirection:MV,MarkerSeverity:wV,MarkerTag:SV,Uri:Rt,Token:ND}}class cZe{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 goe{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class ah{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 gw;function $_e(i){return!i||typeof i!="string"?!0:i.trim().length===0}const dZe=/{(\d+)}/g;function Z0(i,...e){return e.length===0?i:i.replace(dZe,function(t,n){const o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?t:e[o]})}function UA(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Xl(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function uZe(i,e=" "){const t=VI(i,e);return z_e(t,e)}function VI(i,e){if(!i||!e)return i;const t=e.length;if(t===0||i.length===0)return i;let n=0;for(;i.indexOf(e,n)===n;)n=n+t;return i.substring(n)}function z_e(i,e){if(!i||!e)return i;const t=e.length,n=i.length;if(t===0||n===0)return i;let o=n,r=-1;for(;r=i.lastIndexOf(e,o-1),!(r===-1||r+t!==o);){if(r===0)return"";o=r}return i.substring(0,o)}function hZe(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function fZe(i){return i.replace(/\*/g,"")}function U_e(i,e,t={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=Xl(i)),t.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(i,n)}function gZe(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function gf(i){return i.split(/\r\n|\r|\n/)}function Ws(i){for(let e=0,t=i.length;e=0;t--){const n=i.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function AD(i,e){return ie?1:0}function Gq(i,e,t=0,n=i.length,o=0,r=e.length){for(;tc)return 1}const s=n-t,a=r-o;return sa?1:0}function HV(i,e){return HI(i,e,0,i.length,0,e.length)}function HI(i,e,t=0,n=i.length,o=0,r=e.length){for(;t=128||c>=128)return Gq(i.toLowerCase(),e.toLowerCase(),t,n,o,r);ym(l)&&(l-=32),ym(c)&&(c-=32);const d=l-c;if(d!==0)return d}const s=n-t,a=r-o;return sa?1:0}function o2(i){return i>=48&&i<=57}function ym(i){return i>=97&&i<=122}function kh(i){return i>=65&&i<=90}function TC(i,e){return i.length===e.length&&HI(i,e)===0}function Xq(i,e){const t=e.length;return e.length>i.length?!1:HI(i,e,0,t)===0}function Q0(i,e){const t=Math.min(i.length,e.length);let n;for(n=0;n1){const n=i.charCodeAt(e-2);if(gr(n))return Yq(n,t)}return t}class Zq{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=pZe(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=KA(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class qA{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new Zq(e,t)}nextGraphemeLength(){const e=wm.getInstance(),t=this._iterator,n=t.offset;let o=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const r=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(poe(o,s)){t.setOffset(r);break}o=s}return t.offset-n}prevGraphemeLength(){const e=wm.getInstance(),t=this._iterator,n=t.offset;let o=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const r=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(poe(s,o)){t.setOffset(r);break}o=s}return n-t.offset}eol(){return this._iterator.eol()}}function Qq(i,e){return new qA(i,e).nextGraphemeLength()}function j_e(i,e){return new qA(i,e).prevGraphemeLength()}function mZe(i,e){e>0&&J0(i.charCodeAt(e))&&e--;const t=e+Qq(i,e);return[t-j_e(i,t),t]}let T6;function vZe(){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 pw(i){return T6||(T6=vZe()),T6.test(i)}const _Ze=/^[\t\n\r\x20-\x7E]*$/;function $I(i){return _Ze.test(i)}const K_e=/[\u2028\u2029]/;function q_e(i){return K_e.test(i)}function wv(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function Jq(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const bZe=String.fromCharCode(65279);function eG(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function CZe(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function G_e(i){return i=i%(2*26),i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function poe(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}class wm{static getInstance(){return wm._INSTANCE||(wm._INSTANCE=new wm),wm._INSTANCE}constructor(){this._data=yZe()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let o=1;for(;o<=n;)if(et[3*o+1])o=2*o+1;else return t[3*o+2];return 0}}wm._INSTANCE=null;function yZe(){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 wZe(i,e){if(i===0)return 0;const t=SZe(i,e);if(t!==void 0)return t;const n=new Zq(e,i);return n.prevCodePoint(),n.offset}function SZe(i,e){const t=new Zq(e,i);let n=t.prevCodePoint();for(;xZe(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!Jq(n))return;let o=t.offset;return o>0&&t.prevCodePoint()===8205&&(o=t.offset),o}function xZe(i){return 127995<=i&&i<=127999}const X_e="\xA0";class eb{static getInstance(e){return gw.cache.get(Array.from(e))}static getLocales(){return gw._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())}}gw=eb;eb.ambiguousCharacterData=new ah(()=>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]}'));eb.cache=new cZe(i=>{function e(c){const d=new Map;for(let u=0;u!c.startsWith("_")&&c in o);r.length===0&&(r=["_default"]);let s;for(const c of r){const d=e(o[c]);s=n(s,d)}const a=e(o._common),l=t(a,s);return new gw(l)});eb._locales=new ah(()=>Object.keys(gw.ambiguousCharacterData.value).filter(i=>!i.startsWith("_")));class cf{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(cf.getRawData())),this._data}static isInvisibleCharacter(e){return cf.getData().has(e)}static get codePoints(){return cf.getData()}}cf._data=void 0;class $V{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}$V.INSTANCE=new $V;class LZe extends _e{constructor(){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class EZe extends _e{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new LZe);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,n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/n}}class DZe{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new EZe),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function Y_e(i,e){typeof i=="string"&&(i=window.matchMedia(i)),i.addEventListener("change",e)}const PD=new DZe;function kZe(){return $V.INSTANCE.getZoomFactor()}const vS=navigator.userAgent,Fc=vS.indexOf("Firefox")>=0,D0=vS.indexOf("AppleWebKit")>=0,tG=vS.indexOf("Chrome")>=0,lp=!tG&&vS.indexOf("Safari")>=0,Z_e=!tG&&!lp&&D0;vS.indexOf("Electron/")>=0;const moe=vS.indexOf("Android")>=0;let tM=!1;if(window.matchMedia){const i=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");tM=i.matches,Y_e(i,({matches:t})=>{tM&&e.matches||(tM=t)})}function IZe(){return tM}class Q_e{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=nu(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=nu(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=nu(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=nu(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=nu(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=nu(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=nu(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=nu(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=nu(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=nu(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=nu(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 nu(i){return typeof i=="number"?`${i}px`:i}function ti(i){return new Q_e(i)}function ss(i,e){i instanceof Q_e?(i.setFontFamily(e.getMassagedFontFamily()),i.setFontWeight(e.fontWeight),i.setFontSize(e.fontSize),i.setFontFeatureSettings(e.fontFeatureSettings),i.setFontVariationSettings(e.fontVariationSettings),i.setLineHeight(e.lineHeight),i.setLetterSpacing(e.letterSpacing)):(i.style.fontFamily=e.getMassagedFontFamily(),i.style.fontWeight=e.fontWeight,i.style.fontSize=e.fontSize+"px",i.style.fontFeatureSettings=e.fontFeatureSettings,i.style.fontVariationSettings=e.fontVariationSettings,i.style.lineHeight=e.lineHeight+"px",i.style.letterSpacing=e.letterSpacing+"px")}class TZe{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class nG{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");ss(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");ss(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const o=document.createElement("div");ss(o,this._bareFontInfo),o.style.fontStyle="italic",e.appendChild(o);const r=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=n),s.type===1&&(a=o),a.appendChild(document.createElement("br"));const l=document.createElement("span");nG._render(l,s),a.appendChild(l),r.push(l)}this._container=e,this._testElements=r}static _render(e,t){if(t.chr===" "){let n="\xA0";for(let o=0;o<8;o++)n+=n;e.innerText=n}else{let n=t.chr;for(let o=0;o<8;o++)n+=n;e.textContent=n}}_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 n of e)n.isTrusted||(t=!0,this._cache.remove(n));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 zV({pixelRatio:PD.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,n,o){const r=new TZe(e,t);return n.push(r),o==null||o.push(r),r}_actualReadFontInfo(e){const t=[],n=[],o=this._createRequest("n",0,t,n),r=this._createRequest("\uFF4D",0,t,null),s=this._createRequest(" ",0,t,n),a=this._createRequest("0",0,t,n),l=this._createRequest("1",0,t,n),c=this._createRequest("2",0,t,n),d=this._createRequest("3",0,t,n),u=this._createRequest("4",0,t,n),h=this._createRequest("5",0,t,n),f=this._createRequest("6",0,t,n),g=this._createRequest("7",0,t,n),p=this._createRequest("8",0,t,n),v=this._createRequest("9",0,t,n),m=this._createRequest("\u2192",0,t,n),_=this._createRequest("\uFFEB",0,t,null),y=this._createRequest("\xB7",0,t,n),w=this._createRequest(String.fromCharCode(11825),0,t,null),L="|/-_ilm%";for(let R=0,A=L.length;R.001){E=!1;break}}let k=!0;return E&&_.width!==I&&(k=!1),_.width>m.width&&(k=!1),new zV({pixelRatio:PD.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:E,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:s.width,middotWidth:y.width,wsmiddotWidth:w.width,maxDigitWidth:D},!0)}}class voe{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 n=e.getId();this._keys[n]=e,this._values[n]=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 UV=new AZe;var Tu;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(Tu||(Tu={}));const $t=yn("instantiationService");function PZe(i,e,t){e[Tu.DI_TARGET]===e?e[Tu.DI_DEPENDENCIES].push({id:i,index:t}):(e[Tu.DI_DEPENDENCIES]=[{id:i,index:t}],e[Tu.DI_TARGET]=e)}function yn(i){if(Tu.serviceIds.has(i))return Tu.serviceIds.get(i);const e=function(t,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");PZe(e,t,o)};return e.toString=()=>i,Tu.serviceIds.set(i,e),e}const Jn=yn("codeEditorService"),Yi=yn("modelService"),za=yn("textModelService");var mw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class ca extends _e{constructor(e,t="",n="",o=!0,r){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=o,this._actionCallback=r}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 mw(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class vw extends _e{constructor(){super(...arguments),this._onWillRun=this._register(new le),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new le),this.onDidRun=this._onDidRun.event}run(e,t){return mw(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{yield this.runAction(e,t)}catch(o){n=o}this._onDidRun.fire({action:e,error:n})})}runAction(e,t){return mw(this,void 0,void 0,function*(){yield e.run(t)})}}class kr{constructor(){this.id=kr.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const n of e)n.length&&(t.length?t=[...t,new kr,...n]:t=n);return t}run(){return mw(this,void 0,void 0,function*(){})}}kr.ID="vs.actions.separator";class _w{get actions(){return this._actions}constructor(e,t,n,o){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=o,this._actions=n}run(){return mw(this,void 0,void 0,function*(){})}}class z4 extends ca{constructor(){super(z4.ID,C("submenu.empty","(empty)"),void 0,!1)}}z4.ID="vs.actions.empty";function _y(i){var e,t;return{id:i.id,label:i.label,class:void 0,enabled:(e=i.enabled)!==null&&e!==void 0?e:!0,checked:(t=i.checked)!==null&&t!==void 0?t:!1,run:(...n)=>mw(this,void 0,void 0,function*(){return i.run(...n)}),tooltip:i.label}}var jV;(function(i){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}i.isThemeColor=e})(jV||(jV={}));var Mt;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(Xe.error);const[,g,p]=f,v=["codicon","codicon-"+g];return p&&v.push("codicon-modifier-"+p.substring(1)),v}i.asClassNameArray=t;function n(h){return t(h).join(" ")}i.asClassName=n;function o(h){return"."+t(h).join(".")}i.asCSSSelector=o;function r(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color=="undefined"||jV.isThemeColor(h.color))}i.isThemeIcon=r;const s=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}i.fromString=a;function l(h){return{id:h}}i.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}i.modify=c;function d(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}i.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)}i.isEqual=u})(Mt||(Mt={}));const _o=yn("commandService"),Rn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new le,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.description){const s=[];for(const l of i.description.args)s.push(l.constraint);const a=i.handler;i.handler=function(l,...c){return vXe(c,s),a(l,...c)}}const{id:t}=i;let n=this._commands.get(t);n||(n=new oa,this._commands.set(t,n));const o=n.unshift(i),r=zt(()=>{o();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(i,e){return Rn.registerCommand(i,(t,...n)=>t.get(_o).executeCommand(e,...n))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return vn.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&i.set(e,t)}return i}};Rn.registerCommand("noop",()=>{});function R6(...i){switch(i.length){case 1:return C("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",i[0]);case 2:return C("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",i[0],i[1]);case 3:return C("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const OZe=C("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),FZe=C("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Mh{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 Vq(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(R6("==","=~"));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(R6("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(R6("||"));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,n=this._input.substring(this._start,this._current),o={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(o)}_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),n=Mh._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(OZe);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,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(FZe);return}const r=this._input.charCodeAt(e);if(t)t=!1;else if(r===47&&!n){e++;break}else r===91?n=!0:r===92?t=!0:r===93&&(n=!1);e++}for(;e=this._input.length}}Mh._regexFlags=new Set(["i","g","s","m","y","u"].map(i=>i.charCodeAt(0)));Mh._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Es=new Map;Es.set("false",!1);Es.set("true",!0);Es.set("isMac",Nn);Es.set("isLinux",xs);Es.set("isWindows",ls);Es.set("isWeb",Xv);Es.set("isMacNative",Nn&&!Xv);Es.set("isEdge",MXe);Es.set("isFirefox",NXe);Es.set("isChrome",C_e);Es.set("isSafari",RXe);const BZe=Object.prototype.hasOwnProperty,WZe={regexParsingWithErrorRecovery:!0},VZe=C("contextkey.parser.error.emptyString","Empty context key expression"),HZe=C("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."),$Ze=C("contextkey.parser.error.noInAfterNot","'in' after 'not'."),_oe=C("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),zZe=C("contextkey.parser.error.unexpectedToken","Unexpected token"),UZe=C("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),jZe=C("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),KZe=C("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");class d0{constructor(e=WZe){this._config=e,this._scanner=new Mh,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:VZe,offset:0,lexeme:"",additionalInfo:HZe});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),o=n.type===17?UZe:void 0;throw this._parsingErrors.push({message:zZe,offset:n.offset,lexeme:Mh.getLexeme(n),additionalInfo:o}),d0._parseError}return t}catch(t){if(t!==d0._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]:Me.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Me.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),ua.INSTANCE;case 12:return this._advance(),Wa.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,_oe),t==null?void 0:t.negate()}case 17:return this._advance(),Vb.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(),Me.true();case 12:return this._advance(),Me.false();case 0:{this._advance();const t=this._expr();return this._consume(1,_oe),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const o=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),o.type!==10)throw this._errExpectedButGot("REGEX",o);const r=o.lexeme,s=r.lastIndexOf("/"),a=s===r.length-1?void 0:this._removeFlagsGY(r.substring(s+1));let l;try{l=new RegExp(r.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",o)}return OD.create(t,l)}switch(o.type){case 10:case 19:{const r=[o.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h=0){const c=r.slice(a+1,l),d=r[l+1]==="i"?"i":"";try{s=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",o)}}}if(s===null)throw this._errExpectedButGot("REGEX",o);return OD.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,$Ze);const o=this._value();return Me.notIn(t,o)}switch(this._peek().type){case 3:{this._advance();const o=this._value();if(this._previous().type===18)return Me.equals(t,o);switch(o){case"true":return Me.has(t);case"false":return Me.not(t);default:return Me.equals(t,o)}}case 4:{this._advance();const o=this._value();if(this._previous().type===18)return Me.notEquals(t,o);switch(o){case"true":return Me.not(t);case"false":return Me.has(t);default:return Me.notEquals(t,o)}}case 5:return this._advance(),Y4.create(t,this._value());case 6:return this._advance(),Z4.create(t,this._value());case 7:return this._advance(),G4.create(t,this._value());case 8:return this._advance(),X4.create(t,this._value());case 13:return this._advance(),Me.in(t,this._value());default:return Me.has(t)}}case 20:throw this._parsingErrors.push({message:jZe,offset:e.offset,lexeme:"",additionalInfo:KZe}),d0._parseError;default:throw this._errExpectedButGot(`true | false | KEY +`))}}class T6{constructor(e){this.value=e}}const AYe=2;class le{constructor(e){var t,n,o,r,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new MYe((o=(n=this._options)===null||n===void 0?void 0:n.leakWarningThreshold)!==null&&o!==void 0?o:RYe):void 0,this._perfMon=!((r=this._options)===null||r===void 0)&&r._profName?new fw(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,n,o;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),(n=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||n===void 0||n.call(t),(o=this._leakageMon)===null||o===void 0||o.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,n,o)=>{var r,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),_e.None;if(this._disposed)return _e.None;n&&(t=t.bind(n));const d=new T6(t);let u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(d.stack=Uq.create(),u=this._leakageMon.check(d.stack,this._size+1)),this._listeners?this._listeners instanceof T6?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new D_e),this._listeners=[this._listeners,d]):this._listeners.push(d):((s=(r=this._options)===null||r===void 0?void 0:r.onWillAddFirstListener)===null||s===void 0||s.call(r,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=zt(()=>{u==null||u(),this._removeListener(d)});return o instanceof Be?o.add(h):Array.isArray(o)&&o.push(h),h}),this._event}_removeListener(e){var t,n,o,r;if((n=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||n===void 0||n.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(r=(o=this._options)===null||o===void 0?void 0:o.onDidRemoveLastListener)===null||r===void 0||r.call(o,this),this._size=0;return}const s=this._listeners,a=s.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--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*AYe<=s.length){let c=0;for(let d=0;d0}}const PYe=()=>new D_e;class D_e{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Y0 extends le{constructor(e){super(e),this._isPaused=0,this._eventQueue=new oa,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 k_e extends Y0{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 OYe extends le{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 FYe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new le({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),zt(yv(()=>{this.hasListeners&&this.unhook(t);const o=this.events.indexOf(t);this.events.splice(o,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 jq{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,o)=>e(r=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(n,r)):t.call(n,r)},void 0,o)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(o=>o()),n}}class hoe{constructor(){this.listening=!1,this.inputEvent=st.None,this.inputEventListener=_e.None,this.emitter=new le({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 I_e=Object.freeze(function(i,e){const t=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(t)}}});var _n;(function(i){function e(t){return t===i.None||t===i.Cancelled||t instanceof JR?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:st.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:I_e})})(_n||(_n={}));class JR{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?I_e:(this._emitter||(this._emitter=new le),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class Ro{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 JR),this._token}cancel(){this._token?this._token instanceof JR&&this._token.cancel():this._token=_n.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof JR&&this._token.dispose():this._token=_n.None}}class Kq{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 eM=new Kq,YW=new Kq,ZW=new Kq,T_e=new Array(230),BYe=Object.create(null),WYe=Object.create(null),qq=[];for(let i=0;i<=193;i++)qq[i]=-1;(function(){const i="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",i,i],[1,1,"Hyper",0,i,0,i,i,i],[1,2,"Super",0,i,0,i,i,i],[1,3,"Fn",0,i,0,i,i,i],[1,4,"FnLock",0,i,0,i,i,i],[1,5,"Suspend",0,i,0,i,i,i],[1,6,"Resume",0,i,0,i,i,i],[1,7,"Turbo",0,i,0,i,i,i],[1,8,"Sleep",0,i,0,"VK_SLEEP",i,i],[1,9,"WakeUp",0,i,0,i,i,i],[0,10,"KeyA",31,"A",65,"VK_A",i,i],[0,11,"KeyB",32,"B",66,"VK_B",i,i],[0,12,"KeyC",33,"C",67,"VK_C",i,i],[0,13,"KeyD",34,"D",68,"VK_D",i,i],[0,14,"KeyE",35,"E",69,"VK_E",i,i],[0,15,"KeyF",36,"F",70,"VK_F",i,i],[0,16,"KeyG",37,"G",71,"VK_G",i,i],[0,17,"KeyH",38,"H",72,"VK_H",i,i],[0,18,"KeyI",39,"I",73,"VK_I",i,i],[0,19,"KeyJ",40,"J",74,"VK_J",i,i],[0,20,"KeyK",41,"K",75,"VK_K",i,i],[0,21,"KeyL",42,"L",76,"VK_L",i,i],[0,22,"KeyM",43,"M",77,"VK_M",i,i],[0,23,"KeyN",44,"N",78,"VK_N",i,i],[0,24,"KeyO",45,"O",79,"VK_O",i,i],[0,25,"KeyP",46,"P",80,"VK_P",i,i],[0,26,"KeyQ",47,"Q",81,"VK_Q",i,i],[0,27,"KeyR",48,"R",82,"VK_R",i,i],[0,28,"KeyS",49,"S",83,"VK_S",i,i],[0,29,"KeyT",50,"T",84,"VK_T",i,i],[0,30,"KeyU",51,"U",85,"VK_U",i,i],[0,31,"KeyV",52,"V",86,"VK_V",i,i],[0,32,"KeyW",53,"W",87,"VK_W",i,i],[0,33,"KeyX",54,"X",88,"VK_X",i,i],[0,34,"KeyY",55,"Y",89,"VK_Y",i,i],[0,35,"KeyZ",56,"Z",90,"VK_Z",i,i],[0,36,"Digit1",22,"1",49,"VK_1",i,i],[0,37,"Digit2",23,"2",50,"VK_2",i,i],[0,38,"Digit3",24,"3",51,"VK_3",i,i],[0,39,"Digit4",25,"4",52,"VK_4",i,i],[0,40,"Digit5",26,"5",53,"VK_5",i,i],[0,41,"Digit6",27,"6",54,"VK_6",i,i],[0,42,"Digit7",28,"7",55,"VK_7",i,i],[0,43,"Digit8",29,"8",56,"VK_8",i,i],[0,44,"Digit9",30,"9",57,"VK_9",i,i],[0,45,"Digit0",21,"0",48,"VK_0",i,i],[1,46,"Enter",3,"Enter",13,"VK_RETURN",i,i],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",i,i],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",i,i],[1,49,"Tab",2,"Tab",9,"VK_TAB",i,i],[1,50,"Space",10,"Space",32,"VK_SPACE",i,i],[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,i,0,i,i,i],[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",i,i],[1,64,"F1",59,"F1",112,"VK_F1",i,i],[1,65,"F2",60,"F2",113,"VK_F2",i,i],[1,66,"F3",61,"F3",114,"VK_F3",i,i],[1,67,"F4",62,"F4",115,"VK_F4",i,i],[1,68,"F5",63,"F5",116,"VK_F5",i,i],[1,69,"F6",64,"F6",117,"VK_F6",i,i],[1,70,"F7",65,"F7",118,"VK_F7",i,i],[1,71,"F8",66,"F8",119,"VK_F8",i,i],[1,72,"F9",67,"F9",120,"VK_F9",i,i],[1,73,"F10",68,"F10",121,"VK_F10",i,i],[1,74,"F11",69,"F11",122,"VK_F11",i,i],[1,75,"F12",70,"F12",123,"VK_F12",i,i],[1,76,"PrintScreen",0,i,0,i,i,i],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",i,i],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",i,i],[1,79,"Insert",19,"Insert",45,"VK_INSERT",i,i],[1,80,"Home",14,"Home",36,"VK_HOME",i,i],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",i,i],[1,82,"Delete",20,"Delete",46,"VK_DELETE",i,i],[1,83,"End",13,"End",35,"VK_END",i,i],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",i,i],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",i],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",i],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",i],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",i],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",i,i],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",i,i],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",i,i],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",i,i],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",i,i],[1,94,"NumpadEnter",3,i,0,i,i,i],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",i,i],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",i,i],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",i,i],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",i,i],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",i,i],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",i,i],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",i,i],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",i,i],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",i,i],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",i,i],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",i,i],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",i,i],[1,107,"ContextMenu",58,"ContextMenu",93,i,i,i],[1,108,"Power",0,i,0,i,i,i],[1,109,"NumpadEqual",0,i,0,i,i,i],[1,110,"F13",71,"F13",124,"VK_F13",i,i],[1,111,"F14",72,"F14",125,"VK_F14",i,i],[1,112,"F15",73,"F15",126,"VK_F15",i,i],[1,113,"F16",74,"F16",127,"VK_F16",i,i],[1,114,"F17",75,"F17",128,"VK_F17",i,i],[1,115,"F18",76,"F18",129,"VK_F18",i,i],[1,116,"F19",77,"F19",130,"VK_F19",i,i],[1,117,"F20",78,"F20",131,"VK_F20",i,i],[1,118,"F21",79,"F21",132,"VK_F21",i,i],[1,119,"F22",80,"F22",133,"VK_F22",i,i],[1,120,"F23",81,"F23",134,"VK_F23",i,i],[1,121,"F24",82,"F24",135,"VK_F24",i,i],[1,122,"Open",0,i,0,i,i,i],[1,123,"Help",0,i,0,i,i,i],[1,124,"Select",0,i,0,i,i,i],[1,125,"Again",0,i,0,i,i,i],[1,126,"Undo",0,i,0,i,i,i],[1,127,"Cut",0,i,0,i,i,i],[1,128,"Copy",0,i,0,i,i,i],[1,129,"Paste",0,i,0,i,i,i],[1,130,"Find",0,i,0,i,i,i],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",i,i],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",i,i],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",i,i],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",i,i],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",i,i],[1,136,"KanaMode",0,i,0,i,i,i],[0,137,"IntlYen",0,i,0,i,i,i],[1,138,"Convert",0,i,0,i,i,i],[1,139,"NonConvert",0,i,0,i,i,i],[1,140,"Lang1",0,i,0,i,i,i],[1,141,"Lang2",0,i,0,i,i,i],[1,142,"Lang3",0,i,0,i,i,i],[1,143,"Lang4",0,i,0,i,i,i],[1,144,"Lang5",0,i,0,i,i,i],[1,145,"Abort",0,i,0,i,i,i],[1,146,"Props",0,i,0,i,i,i],[1,147,"NumpadParenLeft",0,i,0,i,i,i],[1,148,"NumpadParenRight",0,i,0,i,i,i],[1,149,"NumpadBackspace",0,i,0,i,i,i],[1,150,"NumpadMemoryStore",0,i,0,i,i,i],[1,151,"NumpadMemoryRecall",0,i,0,i,i,i],[1,152,"NumpadMemoryClear",0,i,0,i,i,i],[1,153,"NumpadMemoryAdd",0,i,0,i,i,i],[1,154,"NumpadMemorySubtract",0,i,0,i,i,i],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",i,i],[1,156,"NumpadClearEntry",0,i,0,i,i,i],[1,0,i,5,"Ctrl",17,"VK_CONTROL",i,i],[1,0,i,4,"Shift",16,"VK_SHIFT",i,i],[1,0,i,6,"Alt",18,"VK_MENU",i,i],[1,0,i,57,"Meta",91,"VK_COMMAND",i,i],[1,157,"ControlLeft",5,i,0,"VK_LCONTROL",i,i],[1,158,"ShiftLeft",4,i,0,"VK_LSHIFT",i,i],[1,159,"AltLeft",6,i,0,"VK_LMENU",i,i],[1,160,"MetaLeft",57,i,0,"VK_LWIN",i,i],[1,161,"ControlRight",5,i,0,"VK_RCONTROL",i,i],[1,162,"ShiftRight",4,i,0,"VK_RSHIFT",i,i],[1,163,"AltRight",6,i,0,"VK_RMENU",i,i],[1,164,"MetaRight",57,i,0,"VK_RWIN",i,i],[1,165,"BrightnessUp",0,i,0,i,i,i],[1,166,"BrightnessDown",0,i,0,i,i,i],[1,167,"MediaPlay",0,i,0,i,i,i],[1,168,"MediaRecord",0,i,0,i,i,i],[1,169,"MediaFastForward",0,i,0,i,i,i],[1,170,"MediaRewind",0,i,0,i,i,i],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",i,i],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",i,i],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",i,i],[1,174,"Eject",0,i,0,i,i,i],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",i,i],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",i,i],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",i,i],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",i,i],[1,179,"LaunchApp1",0,i,0,"VK_MEDIA_LAUNCH_APP1",i,i],[1,180,"SelectTask",0,i,0,i,i,i],[1,181,"LaunchScreenSaver",0,i,0,i,i,i],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",i,i],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",i,i],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",i,i],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",i,i],[1,186,"BrowserStop",0,i,0,"VK_BROWSER_STOP",i,i],[1,187,"BrowserRefresh",0,i,0,"VK_BROWSER_REFRESH",i,i],[1,188,"BrowserFavorites",0,i,0,"VK_BROWSER_FAVORITES",i,i],[1,189,"ZoomToggle",0,i,0,i,i,i],[1,190,"MailReply",0,i,0,i,i,i],[1,191,"MailForward",0,i,0,i,i,i],[1,192,"MailSend",0,i,0,i,i,i],[1,0,i,114,"KeyInComposition",229,i,i,i],[1,0,i,116,"ABNT_C2",194,"VK_ABNT_C2",i,i],[1,0,i,96,"OEM_8",223,"VK_OEM_8",i,i],[1,0,i,0,i,0,"VK_KANA",i,i],[1,0,i,0,i,0,"VK_HANGUL",i,i],[1,0,i,0,i,0,"VK_JUNJA",i,i],[1,0,i,0,i,0,"VK_FINAL",i,i],[1,0,i,0,i,0,"VK_HANJA",i,i],[1,0,i,0,i,0,"VK_KANJI",i,i],[1,0,i,0,i,0,"VK_CONVERT",i,i],[1,0,i,0,i,0,"VK_NONCONVERT",i,i],[1,0,i,0,i,0,"VK_ACCEPT",i,i],[1,0,i,0,i,0,"VK_MODECHANGE",i,i],[1,0,i,0,i,0,"VK_SELECT",i,i],[1,0,i,0,i,0,"VK_PRINT",i,i],[1,0,i,0,i,0,"VK_EXECUTE",i,i],[1,0,i,0,i,0,"VK_SNAPSHOT",i,i],[1,0,i,0,i,0,"VK_HELP",i,i],[1,0,i,0,i,0,"VK_APPS",i,i],[1,0,i,0,i,0,"VK_PROCESSKEY",i,i],[1,0,i,0,i,0,"VK_PACKET",i,i],[1,0,i,0,i,0,"VK_DBE_SBCSCHAR",i,i],[1,0,i,0,i,0,"VK_DBE_DBCSCHAR",i,i],[1,0,i,0,i,0,"VK_ATTN",i,i],[1,0,i,0,i,0,"VK_CRSEL",i,i],[1,0,i,0,i,0,"VK_EXSEL",i,i],[1,0,i,0,i,0,"VK_EREOF",i,i],[1,0,i,0,i,0,"VK_PLAY",i,i],[1,0,i,0,i,0,"VK_ZOOM",i,i],[1,0,i,0,i,0,"VK_NONAME",i,i],[1,0,i,0,i,0,"VK_PA1",i,i],[1,0,i,0,i,0,"VK_OEM_CLEAR",i,i]],t=[],n=[];for(const o of e){const[r,s,a,l,c,d,u,h,f]=o;if(n[s]||(n[s]=!0,BYe[a]=s,WYe[a.toLowerCase()]=s,r&&(qq[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);eM.define(l,c),YW.define(l,h||c),ZW.define(l,f||h||c)}d&&(T_e[d]=l)}})();var xg;(function(i){function e(a){return eM.keyCodeToStr(a)}i.toString=e;function t(a){return eM.strToKeyCode(a)}i.fromString=t;function n(a){return YW.keyCodeToStr(a)}i.toUserSettingsUS=n;function o(a){return ZW.keyCodeToStr(a)}i.toUserSettingsGeneral=o;function r(a){return YW.strToKeyCode(a)||ZW.strToKeyCode(a)}i.fromUserSettings=r;function s(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 eM.keyCodeToStr(a)}i.toElectronAccelerator=s})(xg||(xg={}));function Zo(i,e){const t=(e&65535)<<16>>>0;return(i|t)>>>0}let vy;if(typeof Id.vscode!="undefined"&&typeof Id.vscode.process!="undefined"){const i=Id.vscode.process;vy={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process!="undefined"?vy={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:vy={get platform(){return ls?"win32":Nn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const WA=vy.cwd,N_e=vy.env,VYe=vy.platform,HYe=65,$Ye=97,zYe=90,UYe=122,qm=46,Ps=47,Dl=92,Wp=58,jYe=63;class R_e extends Error{constructor(e,t,n){let o;typeof t=="string"&&t.indexOf("not ")===0?(o="must not be",t=t.replace(/^not /,"")):o="must be";const r=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${r} ${o} of type ${t}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function KYe(i,e){if(i===null||typeof i!="object")throw new R_e(e,"Object",i)}function wr(i,e){if(typeof i!="string")throw new R_e(e,"string",i)}const Zv=VYe==="win32";function li(i){return i===Ps||i===Dl}function QW(i){return i===Ps}function Vp(i){return i>=HYe&&i<=zYe||i>=$Ye&&i<=UYe}function VA(i,e,t,n){let o="",r=0,s=-1,a=0,l=0;for(let c=0;c<=i.length;++c){if(c2){const d=o.lastIndexOf(t);d===-1?(o="",r=0):(o=o.slice(0,d),r=o.length-1-o.lastIndexOf(t)),s=c,a=0;continue}else if(o.length!==0){o="",r=0,s=c,a=0;continue}}e&&(o+=o.length>0?`${t}..`:"..",r=2)}else o.length>0?o+=`${t}${i.slice(s+1,c)}`:o=i.slice(s+1,c),r=c-s-1;s=c,a=0}else l===qm&&a!==-1?++a:a=-1}return o}function M_e(i,e){KYe(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${n}`:`${t}${i}${n}`:n}const ol={resolve(...i){let e="",t="",n=!1;for(let o=i.length-1;o>=-1;o--){let r;if(o>=0){if(r=i[o],wr(r,"path"),r.length===0)continue}else e.length===0?r=WA():(r=N_e[`=${e}`]||WA(),(r===void 0||r.slice(0,2).toLowerCase()!==e.toLowerCase()&&r.charCodeAt(2)===Dl)&&(r=`${e}\\`));const s=r.length;let a=0,l="",c=!1;const d=r.charCodeAt(0);if(s===1)li(d)&&(a=1,c=!0);else if(li(d))if(c=!0,li(r.charCodeAt(1))){let u=2,h=u;for(;u2&&li(r.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${r.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=VA(t,!n,"\\",li),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(i){wr(i,"path");const e=i.length;if(e===0)return".";let t=0,n,o=!1;const r=i.charCodeAt(0);if(e===1)return QW(r)?"\\":i;if(li(r))if(o=!0,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))&&(o=!0,t=3));let s=t0&&li(i.charCodeAt(e-1))&&(s+="\\"),n===void 0?o?`\\${s}`:s:o?`${n}\\${s}`:`${n}${s}`},isAbsolute(i){wr(i,"path");const e=i.length;if(e===0)return!1;const t=i.charCodeAt(0);return li(t)||e>2&&Vp(t)&&i.charCodeAt(1)===Wp&&li(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,t;for(let r=0;r0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof t=="string"&&li(t.charCodeAt(0))){++o;const r=t.length;r>1&&li(t.charCodeAt(1))&&(++o,r>2&&(li(t.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return ol.normalize(e)},relative(i,e){if(wr(i,"from"),wr(e,"to"),i===e)return"";const t=ol.resolve(i),n=ol.resolve(e);if(t===n||(i=t.toLowerCase(),e=n.toLowerCase(),i===e))return"";let o=0;for(;oo&&i.charCodeAt(r-1)===Dl;)r--;const s=r-o;let a=0;for(;aa&&e.charCodeAt(l-1)===Dl;)l--;const c=l-a,d=sd){if(e.charCodeAt(a+h)===Dl)return n.slice(a+h+1);if(h===2)return n.slice(a+h)}s>d&&(i.charCodeAt(o+h)===Dl?u=h:h===2&&(u=3)),u===-1&&(u=0)}let f="";for(h=o+u+1;h<=r;++h)(h===r||i.charCodeAt(h)===Dl)&&(f+=f.length===0?"..":"\\..");return a+=u,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===Dl&&++a,n.slice(a,l))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=ol.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===Dl){if(e.charCodeAt(1)===Dl){const t=e.charCodeAt(2);if(t!==jYe&&t!==qm)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Vp(e.charCodeAt(0))&&e.charCodeAt(1)===Wp&&e.charCodeAt(2)===Dl)return`\\\\?\\${e}`;return i},dirname(i){wr(i,"path");const e=i.length;if(e===0)return".";let t=-1,n=0;const o=i.charCodeAt(0);if(e===1)return li(o)?i:".";if(li(o)){if(t=n=1,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))?3:2,n=t);let r=-1,s=!0;for(let a=e-1;a>=n;--a)if(li(i.charCodeAt(a))){if(!s){r=a;break}}else s=!1;if(r===-1){if(t===-1)return".";r=t}return i.slice(0,r)},basename(i,e){e!==void 0&&wr(e,"ext"),wr(i,"path");let t=0,n=-1,o=!0,r;if(i.length>=2&&Vp(i.charCodeAt(0))&&i.charCodeAt(1)===Wp&&(t=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(r=i.length-1;r>=t;--r){const l=i.charCodeAt(r);if(li(l)){if(!o){t=r+1;break}}else a===-1&&(o=!1,a=r+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=r):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=t;--r)if(li(i.charCodeAt(r))){if(!o){t=r+1;break}}else n===-1&&(o=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){wr(i,"path");let e=0,t=-1,n=0,o=-1,r=!0,s=0;i.length>=2&&i.charCodeAt(1)===Wp&&Vp(i.charCodeAt(0))&&(e=n=2);for(let a=i.length-1;a>=e;--a){const l=i.charCodeAt(a);if(li(l)){if(!r){n=a+1;break}continue}o===-1&&(r=!1,o=a+1),l===qm?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||o===-1||s===0||s===1&&t===o-1&&t===n+1?"":i.slice(t,o)},format:M_e.bind(null,"\\"),parse(i){wr(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.length;let n=0,o=i.charCodeAt(0);if(t===1)return li(o)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(li(o)){if(n=1,li(i.charCodeAt(1))){let u=2,h=u;for(;u0&&(e.root=i.slice(0,n));let r=-1,s=n,a=-1,l=!0,c=i.length-1,d=0;for(;c>=n;--c){if(o=i.charCodeAt(c),li(o)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),o===qm?r===-1?r=c:d!==1&&(d=1):r!==-1&&(d=-1)}return a!==-1&&(r===-1||d===0||d===1&&r===a-1&&r===s+1?e.base=e.name=i.slice(s,a):(e.name=i.slice(s,r),e.base=i.slice(s,a),e.ext=i.slice(r,a))),s>0&&s!==n?e.dir=i.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},qYe=(()=>{if(Zv){const i=/\\/g;return()=>{const e=WA().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>WA()})(),Go={resolve(...i){let e="",t=!1;for(let n=i.length-1;n>=-1&&!t;n--){const o=n>=0?i[n]:qYe();wr(o,"path"),o.length!==0&&(e=`${o}/${e}`,t=o.charCodeAt(0)===Ps)}return e=VA(e,!t,"/",QW),t?`/${e}`:e.length>0?e:"."},normalize(i){if(wr(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ps,t=i.charCodeAt(i.length-1)===Ps;return i=VA(i,!e,"/",QW),i.length===0?e?"/":t?"./":".":(t&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return wr(i,"path"),i.length>0&&i.charCodeAt(0)===Ps},join(...i){if(i.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Go.normalize(e)},relative(i,e){if(wr(i,"from"),wr(e,"to"),i===e||(i=Go.resolve(i),e=Go.resolve(e),i===e))return"";const t=1,n=i.length,o=n-t,r=1,s=e.length-r,a=oa){if(e.charCodeAt(r+c)===Ps)return e.slice(r+c+1);if(c===0)return e.slice(r+c)}else o>a&&(i.charCodeAt(t+c)===Ps?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=n;++c)(c===n||i.charCodeAt(c)===Ps)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(r+l)}`},toNamespacedPath(i){return i},dirname(i){if(wr(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ps;let t=-1,n=!0;for(let o=i.length-1;o>=1;--o)if(i.charCodeAt(o)===Ps){if(!n){t=o;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":i.slice(0,t)},basename(i,e){e!==void 0&&wr(e,"ext"),wr(i,"path");let t=0,n=-1,o=!0,r;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(r=i.length-1;r>=0;--r){const l=i.charCodeAt(r);if(l===Ps){if(!o){t=r+1;break}}else a===-1&&(o=!1,a=r+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=r):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=0;--r)if(i.charCodeAt(r)===Ps){if(!o){t=r+1;break}}else n===-1&&(o=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){wr(i,"path");let e=-1,t=0,n=-1,o=!0,r=0;for(let s=i.length-1;s>=0;--s){const a=i.charCodeAt(s);if(a===Ps){if(!o){t=s+1;break}continue}n===-1&&(o=!1,n=s+1),a===qm?e===-1?e=s:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||n===-1||r===0||r===1&&e===n-1&&e===t+1?"":i.slice(e,n)},format:M_e.bind(null,"/"),parse(i){wr(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.charCodeAt(0)===Ps;let n;t?(e.root="/",n=1):n=0;let o=-1,r=0,s=-1,a=!0,l=i.length-1,c=0;for(;l>=n;--l){const d=i.charCodeAt(l);if(d===Ps){if(!a){r=l+1;break}continue}s===-1&&(a=!1,s=l+1),d===qm?o===-1?o=l:c!==1&&(c=1):o!==-1&&(c=-1)}if(s!==-1){const d=r===0&&t?1:r;o===-1||c===0||c===1&&o===s-1&&o===r+1?e.base=e.name=i.slice(d,s):(e.name=i.slice(d,o),e.base=i.slice(d,s),e.ext=i.slice(o,s))}return r>0?e.dir=i.slice(0,r-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Go.win32=ol.win32=ol;Go.posix=ol.posix=Go;const A_e=Zv?ol.normalize:Go.normalize,GYe=Zv?ol.resolve:Go.resolve,XYe=Zv?ol.relative:Go.relative,P_e=Zv?ol.dirname:Go.dirname,Gm=Zv?ol.basename:Go.basename,YYe=Zv?ol.extname:Go.extname,Bu=Zv?ol.sep:Go.sep,ZYe=/^\w[\w\d+.-]*$/,QYe=/^\//,JYe=/^\/\//;function eZe(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!ZYe.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!QYe.test(i.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(JYe.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function tZe(i,e){return!i&&!e?"file":i}function nZe(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==yu&&(e=yu+e):e=yu;break}return e}const ko="",yu="/",iZe=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Rt{static isUri(e){return e instanceof Rt?!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,n,o,r,s=!1){typeof e=="object"?(this.scheme=e.scheme||ko,this.authority=e.authority||ko,this.path=e.path||ko,this.query=e.query||ko,this.fragment=e.fragment||ko):(this.scheme=tZe(e,s),this.authority=t||ko,this.path=nZe(this.scheme,n||ko),this.query=o||ko,this.fragment=r||ko,eZe(this,s))}get fsPath(){return HA(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:o,query:r,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=ko),n===void 0?n=this.authority:n===null&&(n=ko),o===void 0?o=this.path:o===null&&(o=ko),r===void 0?r=this.query:r===null&&(r=ko),s===void 0?s=this.fragment:s===null&&(s=ko),t===this.scheme&&n===this.authority&&o===this.path&&r===this.query&&s===this.fragment?this:new W1(t,n,o,r,s)}static parse(e,t=!1){const n=iZe.exec(e);return n?new W1(n[2]||ko,i2(n[4]||ko),i2(n[5]||ko),i2(n[7]||ko),i2(n[9]||ko),t):new W1(ko,ko,ko,ko,ko)}static file(e){let t=ko;if(ls&&(e=e.replace(/\\/g,yu)),e[0]===yu&&e[1]===yu){const n=e.indexOf(yu,2);n===-1?(t=e.substring(2),e=yu):(t=e.substring(2,n),e=e.substring(n)||yu)}return new W1("file",t,e,ko,ko)}static from(e,t){return new W1(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 n;return ls&&e.scheme==="file"?n=Rt.file(ol.join(HA(e,!0),...t)).path:n=Go.join(e.path,...t),e.with({path:n})}toString(e=!1){return JW(this,e)}toJSON(){return this}static revive(e){var t,n;if(e){if(e instanceof Rt)return e;{const o=new W1(e);return o._formatted=(t=e.external)!==null&&t!==void 0?t:null,o._fsPath=e._sep===O_e&&(n=e.fsPath)!==null&&n!==void 0?n:null,o}}else return e}}const O_e=ls?1:void 0;class W1 extends Rt{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=HA(this,!1)),this._fsPath}toString(e=!1){return e?JW(this,!0):(this._formatted||(this._formatted=JW(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=O_e),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 F_e={[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 foe(i,e,t){let n,o=-1;for(let r=0;r=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)o!==-1&&(n+=encodeURIComponent(i.substring(o,r)),o=-1),n!==void 0&&(n+=i.charAt(r));else{n===void 0&&(n=i.substr(0,r));const a=F_e[s];a!==void 0?(o!==-1&&(n+=encodeURIComponent(i.substring(o,r)),o=-1),n+=a):o===-1&&(o=r)}}return o!==-1&&(n+=encodeURIComponent(i.substring(o))),n!==void 0?n:i}function oZe(i){let e;for(let t=0;t1&&i.scheme==="file"?t=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?t=i.path.substr(1):t=i.path[1].toLowerCase()+i.path.substr(2):t=i.path,ls&&(t=t.replace(/\//g,"\\")),t}function JW(i,e){const t=e?oZe:foe;let n="",{scheme:o,authority:r,path:s,query:a,fragment:l}=i;if(o&&(n+=o,n+=":"),(r||o==="file")&&(n+=yu,n+=yu),r){let c=r.indexOf("@");if(c!==-1){const d=r.substr(0,c);r=r.substr(c+1),c=d.lastIndexOf(":"),c===-1?n+=t(d,!1,!1):(n+=t(d.substr(0,c),!1,!1),n+=":",n+=t(d.substr(c+1),!1,!0)),n+="@"}r=r.toLowerCase(),c=r.lastIndexOf(":"),c===-1?n+=t(r,!1,!0):(n+=t(r.substr(0,c),!1,!0),n+=r.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}n+=t(s,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:foe(l,!1,!1)),n}function B_e(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+B_e(i.substr(3)):i}}const goe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function i2(i){return i.match(goe)?i.replace(goe,e=>B_e(e)):i}class ae{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 ae(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return ae.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return ae.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return V.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return V.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 V.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 V.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 V.plusRange(this,e)}static plusRange(e,t){let n,o,r,s;return t.startLineNumbere.endLineNumber?(r=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,s=e.endColumn),new V(n,o,r,s)}intersectRanges(e){return V.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return nc?(r=c,s=d):r===c&&(s=Math.min(s,d)),n>r||n===r&&o>s?null:new V(n,o,r,s)}equalsRange(e){return V.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 V.getEndPosition(this)}static getEndPosition(e){return new ae(e.endLineNumber,e.endColumn)}getStartPosition(){return V.getStartPosition(this)}static getStartPosition(e){return new ae(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new V(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new V(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return V.collapseToStart(this)}static collapseToStart(e){return new V(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return V.collapseToEnd(this)}static collapseToEnd(e){return new V(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new V(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new V(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new V(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}}class gt extends V{constructor(e,t,n,o){super(e,t,n,o),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=o}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return gt.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 gt(this.startLineNumber,this.startColumn,e,t):new gt(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ae(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new ae(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new gt(e,t,this.endLineNumber,this.endColumn):new gt(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new gt(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new gt(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new gt(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new gt(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 n=0,o=e.length;n{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var n;(n=this._factories.get(e))===null||n===void 0||n.dispose();const o=new sZe(this,e,t);return this._factories.set(e,o),zt(()=>{const r=this._factories.get(e);!r||r!==o||(this._factories.delete(e),r.dispose())})}getOrCreate(e){return tV(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(yield n.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const n=this._factories.get(e);return!!(!n||n.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 sZe extends _e{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return tV(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return tV(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))})}}class ND{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class Gq{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class z4{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var RD;(function(i){const e=new Map;e.set(0,Xe.symbolMethod),e.set(1,Xe.symbolFunction),e.set(2,Xe.symbolConstructor),e.set(3,Xe.symbolField),e.set(4,Xe.symbolVariable),e.set(5,Xe.symbolClass),e.set(6,Xe.symbolStruct),e.set(7,Xe.symbolInterface),e.set(8,Xe.symbolModule),e.set(9,Xe.symbolProperty),e.set(10,Xe.symbolEvent),e.set(11,Xe.symbolOperator),e.set(12,Xe.symbolUnit),e.set(13,Xe.symbolValue),e.set(15,Xe.symbolEnum),e.set(14,Xe.symbolConstant),e.set(15,Xe.symbolEnum),e.set(16,Xe.symbolEnumMember),e.set(17,Xe.symbolKeyword),e.set(27,Xe.symbolSnippet),e.set(18,Xe.symbolText),e.set(19,Xe.symbolColor),e.set(20,Xe.symbolFile),e.set(21,Xe.symbolReference),e.set(22,Xe.symbolCustomColor),e.set(23,Xe.symbolFolder),e.set(24,Xe.symbolTypeParameter),e.set(25,Xe.account),e.set(26,Xe.issues);function t(r){let s=e.get(r);return s||(console.info("No codicon found for CompletionItemKind "+r),s=Xe.symbolProperty),s}i.toIcon=t;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",27),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26);function o(r,s){let a=n.get(r);return typeof a=="undefined"&&!s&&(a=9),a}i.fromString=o})(RD||(RD={}));var Kg;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(Kg||(Kg={}));class V_e{constructor(e,t,n,o){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=o}equals(e){return V.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var lf;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(lf||(lf={}));var MD;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(MD||(MD={}));function aZe(i){return i&&Rt.isUri(i.uri)&&V.isIRange(i.range)&&(V.isIRange(i.originSelectionRange)||V.isIRange(i.targetSelectionRange))}const lZe={[17]:C("Array","array"),[16]:C("Boolean","boolean"),[4]:C("Class","class"),[13]:C("Constant","constant"),[8]:C("Constructor","constructor"),[9]:C("Enum","enumeration"),[21]:C("EnumMember","enumeration member"),[23]:C("Event","event"),[7]:C("Field","field"),[0]:C("File","file"),[11]:C("Function","function"),[10]:C("Interface","interface"),[19]:C("Key","key"),[5]:C("Method","method"),[1]:C("Module","module"),[2]:C("Namespace","namespace"),[20]:C("Null","null"),[15]:C("Number","number"),[18]:C("Object","object"),[24]:C("Operator","operator"),[3]:C("Package","package"),[6]:C("Property","property"),[14]:C("String","string"),[22]:C("Struct","struct"),[25]:C("TypeParameter","type parameter"),[12]:C("Variable","variable")};function cZe(i,e){return C("symbolAriaLabel","{0} ({1})",i,lZe[e])}var $A;(function(i){const e=new Map;e.set(0,Xe.symbolFile),e.set(1,Xe.symbolModule),e.set(2,Xe.symbolNamespace),e.set(3,Xe.symbolPackage),e.set(4,Xe.symbolClass),e.set(5,Xe.symbolMethod),e.set(6,Xe.symbolProperty),e.set(7,Xe.symbolField),e.set(8,Xe.symbolConstructor),e.set(9,Xe.symbolEnum),e.set(10,Xe.symbolInterface),e.set(11,Xe.symbolFunction),e.set(12,Xe.symbolVariable),e.set(13,Xe.symbolConstant),e.set(14,Xe.symbolString),e.set(15,Xe.symbolNumber),e.set(16,Xe.symbolBoolean),e.set(17,Xe.symbolArray),e.set(18,Xe.symbolObject),e.set(19,Xe.symbolKey),e.set(20,Xe.symbolNull),e.set(21,Xe.symbolEnumMember),e.set(22,Xe.symbolStruct),e.set(23,Xe.symbolEvent),e.set(24,Xe.symbolOperator),e.set(25,Xe.symbolTypeParameter);function t(n){let o=e.get(n);return o||(console.info("No codicon found for SymbolKind "+n),o=Xe.symbolProperty),o}i.toIcon=t})($A||($A={}));class ra{static fromValue(e){switch(e){case"comment":return ra.Comment;case"imports":return ra.Imports;case"region":return ra.Region}return new ra(e)}constructor(e){this.value=e}}ra.Comment=new ra("comment");ra.Imports=new ra("imports");ra.Region=new ra("region");var nV;(function(i){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}i.is=e})(nV||(nV={}));var zA;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(zA||(zA={}));class dZe{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 oo=new rZe;var iV;(function(i){i[i.Unknown=0]="Unknown",i[i.Disabled=1]="Disabled",i[i.Enabled=2]="Enabled"})(iV||(iV={}));var oV;(function(i){i[i.Invoke=1]="Invoke",i[i.Auto=2]="Auto"})(oV||(oV={}));var rV;(function(i){i[i.None=0]="None",i[i.KeepWhitespace=1]="KeepWhitespace",i[i.InsertAsSnippet=4]="InsertAsSnippet"})(rV||(rV={}));var sV;(function(i){i[i.Method=0]="Method",i[i.Function=1]="Function",i[i.Constructor=2]="Constructor",i[i.Field=3]="Field",i[i.Variable=4]="Variable",i[i.Class=5]="Class",i[i.Struct=6]="Struct",i[i.Interface=7]="Interface",i[i.Module=8]="Module",i[i.Property=9]="Property",i[i.Event=10]="Event",i[i.Operator=11]="Operator",i[i.Unit=12]="Unit",i[i.Value=13]="Value",i[i.Constant=14]="Constant",i[i.Enum=15]="Enum",i[i.EnumMember=16]="EnumMember",i[i.Keyword=17]="Keyword",i[i.Text=18]="Text",i[i.Color=19]="Color",i[i.File=20]="File",i[i.Reference=21]="Reference",i[i.Customcolor=22]="Customcolor",i[i.Folder=23]="Folder",i[i.TypeParameter=24]="TypeParameter",i[i.User=25]="User",i[i.Issue=26]="Issue",i[i.Snippet=27]="Snippet"})(sV||(sV={}));var aV;(function(i){i[i.Deprecated=1]="Deprecated"})(aV||(aV={}));var lV;(function(i){i[i.Invoke=0]="Invoke",i[i.TriggerCharacter=1]="TriggerCharacter",i[i.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(lV||(lV={}));var cV;(function(i){i[i.EXACT=0]="EXACT",i[i.ABOVE=1]="ABOVE",i[i.BELOW=2]="BELOW"})(cV||(cV={}));var dV;(function(i){i[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo"})(dV||(dV={}));var uV;(function(i){i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(uV||(uV={}));var hV;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(hV||(hV={}));var fV;(function(i){i[i.None=0]="None",i[i.Keep=1]="Keep",i[i.Brackets=2]="Brackets",i[i.Advanced=3]="Advanced",i[i.Full=4]="Full"})(fV||(fV={}));var gV;(function(i){i[i.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",i[i.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",i[i.accessibilitySupport=2]="accessibilitySupport",i[i.accessibilityPageSize=3]="accessibilityPageSize",i[i.ariaLabel=4]="ariaLabel",i[i.ariaRequired=5]="ariaRequired",i[i.autoClosingBrackets=6]="autoClosingBrackets",i[i.autoClosingComments=7]="autoClosingComments",i[i.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",i[i.autoClosingDelete=9]="autoClosingDelete",i[i.autoClosingOvertype=10]="autoClosingOvertype",i[i.autoClosingQuotes=11]="autoClosingQuotes",i[i.autoIndent=12]="autoIndent",i[i.automaticLayout=13]="automaticLayout",i[i.autoSurround=14]="autoSurround",i[i.bracketPairColorization=15]="bracketPairColorization",i[i.guides=16]="guides",i[i.codeLens=17]="codeLens",i[i.codeLensFontFamily=18]="codeLensFontFamily",i[i.codeLensFontSize=19]="codeLensFontSize",i[i.colorDecorators=20]="colorDecorators",i[i.colorDecoratorsLimit=21]="colorDecoratorsLimit",i[i.columnSelection=22]="columnSelection",i[i.comments=23]="comments",i[i.contextmenu=24]="contextmenu",i[i.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",i[i.cursorBlinking=26]="cursorBlinking",i[i.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",i[i.cursorStyle=28]="cursorStyle",i[i.cursorSurroundingLines=29]="cursorSurroundingLines",i[i.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",i[i.cursorWidth=31]="cursorWidth",i[i.disableLayerHinting=32]="disableLayerHinting",i[i.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",i[i.domReadOnly=34]="domReadOnly",i[i.dragAndDrop=35]="dragAndDrop",i[i.dropIntoEditor=36]="dropIntoEditor",i[i.emptySelectionClipboard=37]="emptySelectionClipboard",i[i.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",i[i.extraEditorClassName=39]="extraEditorClassName",i[i.fastScrollSensitivity=40]="fastScrollSensitivity",i[i.find=41]="find",i[i.fixedOverflowWidgets=42]="fixedOverflowWidgets",i[i.folding=43]="folding",i[i.foldingStrategy=44]="foldingStrategy",i[i.foldingHighlight=45]="foldingHighlight",i[i.foldingImportsByDefault=46]="foldingImportsByDefault",i[i.foldingMaximumRegions=47]="foldingMaximumRegions",i[i.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",i[i.fontFamily=49]="fontFamily",i[i.fontInfo=50]="fontInfo",i[i.fontLigatures=51]="fontLigatures",i[i.fontSize=52]="fontSize",i[i.fontWeight=53]="fontWeight",i[i.fontVariations=54]="fontVariations",i[i.formatOnPaste=55]="formatOnPaste",i[i.formatOnType=56]="formatOnType",i[i.glyphMargin=57]="glyphMargin",i[i.gotoLocation=58]="gotoLocation",i[i.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",i[i.hover=60]="hover",i[i.inDiffEditor=61]="inDiffEditor",i[i.inlineSuggest=62]="inlineSuggest",i[i.letterSpacing=63]="letterSpacing",i[i.lightbulb=64]="lightbulb",i[i.lineDecorationsWidth=65]="lineDecorationsWidth",i[i.lineHeight=66]="lineHeight",i[i.lineNumbers=67]="lineNumbers",i[i.lineNumbersMinChars=68]="lineNumbersMinChars",i[i.linkedEditing=69]="linkedEditing",i[i.links=70]="links",i[i.matchBrackets=71]="matchBrackets",i[i.minimap=72]="minimap",i[i.mouseStyle=73]="mouseStyle",i[i.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",i[i.mouseWheelZoom=75]="mouseWheelZoom",i[i.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",i[i.multiCursorModifier=77]="multiCursorModifier",i[i.multiCursorPaste=78]="multiCursorPaste",i[i.multiCursorLimit=79]="multiCursorLimit",i[i.occurrencesHighlight=80]="occurrencesHighlight",i[i.overviewRulerBorder=81]="overviewRulerBorder",i[i.overviewRulerLanes=82]="overviewRulerLanes",i[i.padding=83]="padding",i[i.pasteAs=84]="pasteAs",i[i.parameterHints=85]="parameterHints",i[i.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",i[i.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",i[i.quickSuggestions=88]="quickSuggestions",i[i.quickSuggestionsDelay=89]="quickSuggestionsDelay",i[i.readOnly=90]="readOnly",i[i.readOnlyMessage=91]="readOnlyMessage",i[i.renameOnType=92]="renameOnType",i[i.renderControlCharacters=93]="renderControlCharacters",i[i.renderFinalNewline=94]="renderFinalNewline",i[i.renderLineHighlight=95]="renderLineHighlight",i[i.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",i[i.renderValidationDecorations=97]="renderValidationDecorations",i[i.renderWhitespace=98]="renderWhitespace",i[i.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",i[i.roundedSelection=100]="roundedSelection",i[i.rulers=101]="rulers",i[i.scrollbar=102]="scrollbar",i[i.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",i[i.scrollBeyondLastLine=104]="scrollBeyondLastLine",i[i.scrollPredominantAxis=105]="scrollPredominantAxis",i[i.selectionClipboard=106]="selectionClipboard",i[i.selectionHighlight=107]="selectionHighlight",i[i.selectOnLineNumbers=108]="selectOnLineNumbers",i[i.showFoldingControls=109]="showFoldingControls",i[i.showUnused=110]="showUnused",i[i.snippetSuggestions=111]="snippetSuggestions",i[i.smartSelect=112]="smartSelect",i[i.smoothScrolling=113]="smoothScrolling",i[i.stickyScroll=114]="stickyScroll",i[i.stickyTabStops=115]="stickyTabStops",i[i.stopRenderingLineAfter=116]="stopRenderingLineAfter",i[i.suggest=117]="suggest",i[i.suggestFontSize=118]="suggestFontSize",i[i.suggestLineHeight=119]="suggestLineHeight",i[i.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",i[i.suggestSelection=121]="suggestSelection",i[i.tabCompletion=122]="tabCompletion",i[i.tabIndex=123]="tabIndex",i[i.unicodeHighlighting=124]="unicodeHighlighting",i[i.unusualLineTerminators=125]="unusualLineTerminators",i[i.useShadowDOM=126]="useShadowDOM",i[i.useTabStops=127]="useTabStops",i[i.wordBreak=128]="wordBreak",i[i.wordSeparators=129]="wordSeparators",i[i.wordWrap=130]="wordWrap",i[i.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",i[i.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",i[i.wordWrapColumn=133]="wordWrapColumn",i[i.wordWrapOverride1=134]="wordWrapOverride1",i[i.wordWrapOverride2=135]="wordWrapOverride2",i[i.wrappingIndent=136]="wrappingIndent",i[i.wrappingStrategy=137]="wrappingStrategy",i[i.showDeprecated=138]="showDeprecated",i[i.inlayHints=139]="inlayHints",i[i.editorClassName=140]="editorClassName",i[i.pixelRatio=141]="pixelRatio",i[i.tabFocusMode=142]="tabFocusMode",i[i.layoutInfo=143]="layoutInfo",i[i.wrappingInfo=144]="wrappingInfo",i[i.defaultColorDecorators=145]="defaultColorDecorators",i[i.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",i[i.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(gV||(gV={}));var pV;(function(i){i[i.TextDefined=0]="TextDefined",i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(pV||(pV={}));var mV;(function(i){i[i.LF=0]="LF",i[i.CRLF=1]="CRLF"})(mV||(mV={}));var vV;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(vV||(vV={}));var _V;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(_V||(_V={}));var bV;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(bV||(bV={}));var CV;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(CV||(CV={}));var yV;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(yV||(yV={}));var wV;(function(i){i[i.DependsOnKbLayout=-1]="DependsOnKbLayout",i[i.Unknown=0]="Unknown",i[i.Backspace=1]="Backspace",i[i.Tab=2]="Tab",i[i.Enter=3]="Enter",i[i.Shift=4]="Shift",i[i.Ctrl=5]="Ctrl",i[i.Alt=6]="Alt",i[i.PauseBreak=7]="PauseBreak",i[i.CapsLock=8]="CapsLock",i[i.Escape=9]="Escape",i[i.Space=10]="Space",i[i.PageUp=11]="PageUp",i[i.PageDown=12]="PageDown",i[i.End=13]="End",i[i.Home=14]="Home",i[i.LeftArrow=15]="LeftArrow",i[i.UpArrow=16]="UpArrow",i[i.RightArrow=17]="RightArrow",i[i.DownArrow=18]="DownArrow",i[i.Insert=19]="Insert",i[i.Delete=20]="Delete",i[i.Digit0=21]="Digit0",i[i.Digit1=22]="Digit1",i[i.Digit2=23]="Digit2",i[i.Digit3=24]="Digit3",i[i.Digit4=25]="Digit4",i[i.Digit5=26]="Digit5",i[i.Digit6=27]="Digit6",i[i.Digit7=28]="Digit7",i[i.Digit8=29]="Digit8",i[i.Digit9=30]="Digit9",i[i.KeyA=31]="KeyA",i[i.KeyB=32]="KeyB",i[i.KeyC=33]="KeyC",i[i.KeyD=34]="KeyD",i[i.KeyE=35]="KeyE",i[i.KeyF=36]="KeyF",i[i.KeyG=37]="KeyG",i[i.KeyH=38]="KeyH",i[i.KeyI=39]="KeyI",i[i.KeyJ=40]="KeyJ",i[i.KeyK=41]="KeyK",i[i.KeyL=42]="KeyL",i[i.KeyM=43]="KeyM",i[i.KeyN=44]="KeyN",i[i.KeyO=45]="KeyO",i[i.KeyP=46]="KeyP",i[i.KeyQ=47]="KeyQ",i[i.KeyR=48]="KeyR",i[i.KeyS=49]="KeyS",i[i.KeyT=50]="KeyT",i[i.KeyU=51]="KeyU",i[i.KeyV=52]="KeyV",i[i.KeyW=53]="KeyW",i[i.KeyX=54]="KeyX",i[i.KeyY=55]="KeyY",i[i.KeyZ=56]="KeyZ",i[i.Meta=57]="Meta",i[i.ContextMenu=58]="ContextMenu",i[i.F1=59]="F1",i[i.F2=60]="F2",i[i.F3=61]="F3",i[i.F4=62]="F4",i[i.F5=63]="F5",i[i.F6=64]="F6",i[i.F7=65]="F7",i[i.F8=66]="F8",i[i.F9=67]="F9",i[i.F10=68]="F10",i[i.F11=69]="F11",i[i.F12=70]="F12",i[i.F13=71]="F13",i[i.F14=72]="F14",i[i.F15=73]="F15",i[i.F16=74]="F16",i[i.F17=75]="F17",i[i.F18=76]="F18",i[i.F19=77]="F19",i[i.F20=78]="F20",i[i.F21=79]="F21",i[i.F22=80]="F22",i[i.F23=81]="F23",i[i.F24=82]="F24",i[i.NumLock=83]="NumLock",i[i.ScrollLock=84]="ScrollLock",i[i.Semicolon=85]="Semicolon",i[i.Equal=86]="Equal",i[i.Comma=87]="Comma",i[i.Minus=88]="Minus",i[i.Period=89]="Period",i[i.Slash=90]="Slash",i[i.Backquote=91]="Backquote",i[i.BracketLeft=92]="BracketLeft",i[i.Backslash=93]="Backslash",i[i.BracketRight=94]="BracketRight",i[i.Quote=95]="Quote",i[i.OEM_8=96]="OEM_8",i[i.IntlBackslash=97]="IntlBackslash",i[i.Numpad0=98]="Numpad0",i[i.Numpad1=99]="Numpad1",i[i.Numpad2=100]="Numpad2",i[i.Numpad3=101]="Numpad3",i[i.Numpad4=102]="Numpad4",i[i.Numpad5=103]="Numpad5",i[i.Numpad6=104]="Numpad6",i[i.Numpad7=105]="Numpad7",i[i.Numpad8=106]="Numpad8",i[i.Numpad9=107]="Numpad9",i[i.NumpadMultiply=108]="NumpadMultiply",i[i.NumpadAdd=109]="NumpadAdd",i[i.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",i[i.NumpadSubtract=111]="NumpadSubtract",i[i.NumpadDecimal=112]="NumpadDecimal",i[i.NumpadDivide=113]="NumpadDivide",i[i.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",i[i.ABNT_C1=115]="ABNT_C1",i[i.ABNT_C2=116]="ABNT_C2",i[i.AudioVolumeMute=117]="AudioVolumeMute",i[i.AudioVolumeUp=118]="AudioVolumeUp",i[i.AudioVolumeDown=119]="AudioVolumeDown",i[i.BrowserSearch=120]="BrowserSearch",i[i.BrowserHome=121]="BrowserHome",i[i.BrowserBack=122]="BrowserBack",i[i.BrowserForward=123]="BrowserForward",i[i.MediaTrackNext=124]="MediaTrackNext",i[i.MediaTrackPrevious=125]="MediaTrackPrevious",i[i.MediaStop=126]="MediaStop",i[i.MediaPlayPause=127]="MediaPlayPause",i[i.LaunchMediaPlayer=128]="LaunchMediaPlayer",i[i.LaunchMail=129]="LaunchMail",i[i.LaunchApp2=130]="LaunchApp2",i[i.Clear=131]="Clear",i[i.MAX_VALUE=132]="MAX_VALUE"})(wV||(wV={}));var SV;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(SV||(SV={}));var xV;(function(i){i[i.Unnecessary=1]="Unnecessary",i[i.Deprecated=2]="Deprecated"})(xV||(xV={}));var LV;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(LV||(LV={}));var EV;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.TEXTAREA=1]="TEXTAREA",i[i.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",i[i.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",i[i.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",i[i.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",i[i.CONTENT_TEXT=6]="CONTENT_TEXT",i[i.CONTENT_EMPTY=7]="CONTENT_EMPTY",i[i.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",i[i.CONTENT_WIDGET=9]="CONTENT_WIDGET",i[i.OVERVIEW_RULER=10]="OVERVIEW_RULER",i[i.SCROLLBAR=11]="SCROLLBAR",i[i.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",i[i.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(EV||(EV={}));var DV;(function(i){i[i.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",i[i.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",i[i.TOP_CENTER=2]="TOP_CENTER"})(DV||(DV={}));var kV;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(kV||(kV={}));var IV;(function(i){i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.None=2]="None",i[i.LeftOfInjectedText=3]="LeftOfInjectedText",i[i.RightOfInjectedText=4]="RightOfInjectedText"})(IV||(IV={}));var TV;(function(i){i[i.Off=0]="Off",i[i.On=1]="On",i[i.Relative=2]="Relative",i[i.Interval=3]="Interval",i[i.Custom=4]="Custom"})(TV||(TV={}));var NV;(function(i){i[i.None=0]="None",i[i.Text=1]="Text",i[i.Blocks=2]="Blocks"})(NV||(NV={}));var RV;(function(i){i[i.Smooth=0]="Smooth",i[i.Immediate=1]="Immediate"})(RV||(RV={}));var MV;(function(i){i[i.Auto=1]="Auto",i[i.Hidden=2]="Hidden",i[i.Visible=3]="Visible"})(MV||(MV={}));var AV;(function(i){i[i.LTR=0]="LTR",i[i.RTL=1]="RTL"})(AV||(AV={}));var PV;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(PV||(PV={}));var OV;(function(i){i[i.File=0]="File",i[i.Module=1]="Module",i[i.Namespace=2]="Namespace",i[i.Package=3]="Package",i[i.Class=4]="Class",i[i.Method=5]="Method",i[i.Property=6]="Property",i[i.Field=7]="Field",i[i.Constructor=8]="Constructor",i[i.Enum=9]="Enum",i[i.Interface=10]="Interface",i[i.Function=11]="Function",i[i.Variable=12]="Variable",i[i.Constant=13]="Constant",i[i.String=14]="String",i[i.Number=15]="Number",i[i.Boolean=16]="Boolean",i[i.Array=17]="Array",i[i.Object=18]="Object",i[i.Key=19]="Key",i[i.Null=20]="Null",i[i.EnumMember=21]="EnumMember",i[i.Struct=22]="Struct",i[i.Event=23]="Event",i[i.Operator=24]="Operator",i[i.TypeParameter=25]="TypeParameter"})(OV||(OV={}));var FV;(function(i){i[i.Deprecated=1]="Deprecated"})(FV||(FV={}));var BV;(function(i){i[i.Hidden=0]="Hidden",i[i.Blink=1]="Blink",i[i.Smooth=2]="Smooth",i[i.Phase=3]="Phase",i[i.Expand=4]="Expand",i[i.Solid=5]="Solid"})(BV||(BV={}));var WV;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(WV||(WV={}));var VV;(function(i){i[i.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",i[i.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",i[i.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",i[i.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(VV||(VV={}));var HV;(function(i){i[i.None=0]="None",i[i.Same=1]="Same",i[i.Indent=2]="Indent",i[i.DeepIndent=3]="DeepIndent"})(HV||(HV={}));class WI{static chord(e,t){return Zo(e,t)}}WI.CtrlCmd=2048;WI.Shift=1024;WI.Alt=512;WI.WinCtrl=256;function H_e(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ro,Emitter:le,KeyCode:wV,KeyMod:WI,Position:ae,Range:V,Selection:gt,SelectionDirection:AV,MarkerSeverity:SV,MarkerTag:xV,Uri:Rt,Token:ND}}class uZe{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 poe{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class ah{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 gw;function $_e(i){return!i||typeof i!="string"?!0:i.trim().length===0}const hZe=/{(\d+)}/g;function Z0(i,...e){return e.length===0?i:i.replace(hZe,function(t,n){const o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?t:e[o]})}function UA(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Xl(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function fZe(i,e=" "){const t=VI(i,e);return z_e(t,e)}function VI(i,e){if(!i||!e)return i;const t=e.length;if(t===0||i.length===0)return i;let n=0;for(;i.indexOf(e,n)===n;)n=n+t;return i.substring(n)}function z_e(i,e){if(!i||!e)return i;const t=e.length,n=i.length;if(t===0||n===0)return i;let o=n,r=-1;for(;r=i.lastIndexOf(e,o-1),!(r===-1||r+t!==o);){if(r===0)return"";o=r}return i.substring(0,o)}function gZe(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function pZe(i){return i.replace(/\*/g,"")}function U_e(i,e,t={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=Xl(i)),t.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(i,n)}function mZe(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function gf(i){return i.split(/\r\n|\r|\n/)}function Ws(i){for(let e=0,t=i.length;e=0;t--){const n=i.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function AD(i,e){return ie?1:0}function Xq(i,e,t=0,n=i.length,o=0,r=e.length){for(;tc)return 1}const s=n-t,a=r-o;return sa?1:0}function $V(i,e){return HI(i,e,0,i.length,0,e.length)}function HI(i,e,t=0,n=i.length,o=0,r=e.length){for(;t=128||c>=128)return Xq(i.toLowerCase(),e.toLowerCase(),t,n,o,r);wm(l)&&(l-=32),wm(c)&&(c-=32);const d=l-c;if(d!==0)return d}const s=n-t,a=r-o;return sa?1:0}function o2(i){return i>=48&&i<=57}function wm(i){return i>=97&&i<=122}function kh(i){return i>=65&&i<=90}function TC(i,e){return i.length===e.length&&HI(i,e)===0}function Yq(i,e){const t=e.length;return e.length>i.length?!1:HI(i,e,0,t)===0}function Q0(i,e){const t=Math.min(i.length,e.length);let n;for(n=0;n1){const n=i.charCodeAt(e-2);if(gr(n))return Zq(n,t)}return t}class Qq{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=vZe(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=KA(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class qA{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new Qq(e,t)}nextGraphemeLength(){const e=Sm.getInstance(),t=this._iterator,n=t.offset;let o=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const r=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(moe(o,s)){t.setOffset(r);break}o=s}return t.offset-n}prevGraphemeLength(){const e=Sm.getInstance(),t=this._iterator,n=t.offset;let o=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const r=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(moe(s,o)){t.setOffset(r);break}o=s}return n-t.offset}eol(){return this._iterator.eol()}}function Jq(i,e){return new qA(i,e).nextGraphemeLength()}function j_e(i,e){return new qA(i,e).prevGraphemeLength()}function _Ze(i,e){e>0&&J0(i.charCodeAt(e))&&e--;const t=e+Jq(i,e);return[t-j_e(i,t),t]}let N6;function bZe(){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 pw(i){return N6||(N6=bZe()),N6.test(i)}const CZe=/^[\t\n\r\x20-\x7E]*$/;function $I(i){return CZe.test(i)}const K_e=/[\u2028\u2029]/;function q_e(i){return K_e.test(i)}function wv(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function eG(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const yZe=String.fromCharCode(65279);function tG(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function wZe(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function G_e(i){return i=i%(2*26),i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function moe(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}class Sm{static getInstance(){return Sm._INSTANCE||(Sm._INSTANCE=new Sm),Sm._INSTANCE}constructor(){this._data=SZe()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let o=1;for(;o<=n;)if(et[3*o+1])o=2*o+1;else return t[3*o+2];return 0}}Sm._INSTANCE=null;function SZe(){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 xZe(i,e){if(i===0)return 0;const t=LZe(i,e);if(t!==void 0)return t;const n=new Qq(e,i);return n.prevCodePoint(),n.offset}function LZe(i,e){const t=new Qq(e,i);let n=t.prevCodePoint();for(;EZe(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!eG(n))return;let o=t.offset;return o>0&&t.prevCodePoint()===8205&&(o=t.offset),o}function EZe(i){return 127995<=i&&i<=127999}const X_e="\xA0";class eb{static getInstance(e){return gw.cache.get(Array.from(e))}static getLocales(){return gw._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())}}gw=eb;eb.ambiguousCharacterData=new ah(()=>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]}'));eb.cache=new uZe(i=>{function e(c){const d=new Map;for(let u=0;u!c.startsWith("_")&&c in o);r.length===0&&(r=["_default"]);let s;for(const c of r){const d=e(o[c]);s=n(s,d)}const a=e(o._common),l=t(a,s);return new gw(l)});eb._locales=new ah(()=>Object.keys(gw.ambiguousCharacterData.value).filter(i=>!i.startsWith("_")));class cf{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(cf.getRawData())),this._data}static isInvisibleCharacter(e){return cf.getData().has(e)}static get codePoints(){return cf.getData()}}cf._data=void 0;class zV{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}zV.INSTANCE=new zV;class DZe extends _e{constructor(){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class kZe extends _e{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new DZe);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,n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/n}}class IZe{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new kZe),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function Y_e(i,e){typeof i=="string"&&(i=window.matchMedia(i)),i.addEventListener("change",e)}const PD=new IZe;function TZe(){return zV.INSTANCE.getZoomFactor()}const vS=navigator.userAgent,Fc=vS.indexOf("Firefox")>=0,D0=vS.indexOf("AppleWebKit")>=0,nG=vS.indexOf("Chrome")>=0,cp=!nG&&vS.indexOf("Safari")>=0,Z_e=!nG&&!cp&&D0;vS.indexOf("Electron/")>=0;const voe=vS.indexOf("Android")>=0;let tM=!1;if(window.matchMedia){const i=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");tM=i.matches,Y_e(i,({matches:t})=>{tM&&e.matches||(tM=t)})}function NZe(){return tM}class Q_e{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=nu(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=nu(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=nu(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=nu(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=nu(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=nu(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=nu(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=nu(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=nu(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=nu(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=nu(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 nu(i){return typeof i=="number"?`${i}px`:i}function ti(i){return new Q_e(i)}function ss(i,e){i instanceof Q_e?(i.setFontFamily(e.getMassagedFontFamily()),i.setFontWeight(e.fontWeight),i.setFontSize(e.fontSize),i.setFontFeatureSettings(e.fontFeatureSettings),i.setFontVariationSettings(e.fontVariationSettings),i.setLineHeight(e.lineHeight),i.setLetterSpacing(e.letterSpacing)):(i.style.fontFamily=e.getMassagedFontFamily(),i.style.fontWeight=e.fontWeight,i.style.fontSize=e.fontSize+"px",i.style.fontFeatureSettings=e.fontFeatureSettings,i.style.fontVariationSettings=e.fontVariationSettings,i.style.lineHeight=e.lineHeight+"px",i.style.letterSpacing=e.letterSpacing+"px")}class RZe{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class iG{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");ss(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");ss(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const o=document.createElement("div");ss(o,this._bareFontInfo),o.style.fontStyle="italic",e.appendChild(o);const r=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=n),s.type===1&&(a=o),a.appendChild(document.createElement("br"));const l=document.createElement("span");iG._render(l,s),a.appendChild(l),r.push(l)}this._container=e,this._testElements=r}static _render(e,t){if(t.chr===" "){let n="\xA0";for(let o=0;o<8;o++)n+=n;e.innerText=n}else{let n=t.chr;for(let o=0;o<8;o++)n+=n;e.textContent=n}}_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 n of e)n.isTrusted||(t=!0,this._cache.remove(n));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 UV({pixelRatio:PD.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,n,o){const r=new RZe(e,t);return n.push(r),o==null||o.push(r),r}_actualReadFontInfo(e){const t=[],n=[],o=this._createRequest("n",0,t,n),r=this._createRequest("\uFF4D",0,t,null),s=this._createRequest(" ",0,t,n),a=this._createRequest("0",0,t,n),l=this._createRequest("1",0,t,n),c=this._createRequest("2",0,t,n),d=this._createRequest("3",0,t,n),u=this._createRequest("4",0,t,n),h=this._createRequest("5",0,t,n),f=this._createRequest("6",0,t,n),g=this._createRequest("7",0,t,n),p=this._createRequest("8",0,t,n),v=this._createRequest("9",0,t,n),m=this._createRequest("\u2192",0,t,n),_=this._createRequest("\uFFEB",0,t,null),y=this._createRequest("\xB7",0,t,n),w=this._createRequest(String.fromCharCode(11825),0,t,null),L="|/-_ilm%";for(let R=0,A=L.length;R.001){E=!1;break}}let k=!0;return E&&_.width!==I&&(k=!1),_.width>m.width&&(k=!1),new UV({pixelRatio:PD.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:E,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:s.width,middotWidth:y.width,wsmiddotWidth:w.width,maxDigitWidth:D},!0)}}class _oe{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 n=e.getId();this._keys[n]=e,this._values[n]=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 jV=new OZe;var Tu;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(Tu||(Tu={}));const $t=yn("instantiationService");function FZe(i,e,t){e[Tu.DI_TARGET]===e?e[Tu.DI_DEPENDENCIES].push({id:i,index:t}):(e[Tu.DI_DEPENDENCIES]=[{id:i,index:t}],e[Tu.DI_TARGET]=e)}function yn(i){if(Tu.serviceIds.has(i))return Tu.serviceIds.get(i);const e=function(t,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");FZe(e,t,o)};return e.toString=()=>i,Tu.serviceIds.set(i,e),e}const Jn=yn("codeEditorService"),Yi=yn("modelService"),za=yn("textModelService");var mw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class ca extends _e{constructor(e,t="",n="",o=!0,r){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=o,this._actionCallback=r}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 mw(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class vw extends _e{constructor(){super(...arguments),this._onWillRun=this._register(new le),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new le),this.onDidRun=this._onDidRun.event}run(e,t){return mw(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{yield this.runAction(e,t)}catch(o){n=o}this._onDidRun.fire({action:e,error:n})})}runAction(e,t){return mw(this,void 0,void 0,function*(){yield e.run(t)})}}class kr{constructor(){this.id=kr.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const n of e)n.length&&(t.length?t=[...t,new kr,...n]:t=n);return t}run(){return mw(this,void 0,void 0,function*(){})}}kr.ID="vs.actions.separator";class _w{get actions(){return this._actions}constructor(e,t,n,o){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=o,this._actions=n}run(){return mw(this,void 0,void 0,function*(){})}}class U4 extends ca{constructor(){super(U4.ID,C("submenu.empty","(empty)"),void 0,!1)}}U4.ID="vs.actions.empty";function _y(i){var e,t;return{id:i.id,label:i.label,class:void 0,enabled:(e=i.enabled)!==null&&e!==void 0?e:!0,checked:(t=i.checked)!==null&&t!==void 0?t:!1,run:(...n)=>mw(this,void 0,void 0,function*(){return i.run(...n)}),tooltip:i.label}}var KV;(function(i){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}i.isThemeColor=e})(KV||(KV={}));var Mt;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(Xe.error);const[,g,p]=f,v=["codicon","codicon-"+g];return p&&v.push("codicon-modifier-"+p.substring(1)),v}i.asClassNameArray=t;function n(h){return t(h).join(" ")}i.asClassName=n;function o(h){return"."+t(h).join(".")}i.asCSSSelector=o;function r(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color=="undefined"||KV.isThemeColor(h.color))}i.isThemeIcon=r;const s=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}i.fromString=a;function l(h){return{id:h}}i.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}i.modify=c;function d(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}i.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)}i.isEqual=u})(Mt||(Mt={}));const _o=yn("commandService"),Rn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new le,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.description){const s=[];for(const l of i.description.args)s.push(l.constraint);const a=i.handler;i.handler=function(l,...c){return bXe(c,s),a(l,...c)}}const{id:t}=i;let n=this._commands.get(t);n||(n=new oa,this._commands.set(t,n));const o=n.unshift(i),r=zt(()=>{o();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(i,e){return Rn.registerCommand(i,(t,...n)=>t.get(_o).executeCommand(e,...n))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return vn.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&i.set(e,t)}return i}};Rn.registerCommand("noop",()=>{});function M6(...i){switch(i.length){case 1:return C("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",i[0]);case 2:return C("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",i[0],i[1]);case 3:return C("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const BZe=C("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),WZe=C("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Mh{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 Hq(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(M6("==","=~"));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(M6("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(M6("||"));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,n=this._input.substring(this._start,this._current),o={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(o)}_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),n=Mh._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(BZe);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,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(WZe);return}const r=this._input.charCodeAt(e);if(t)t=!1;else if(r===47&&!n){e++;break}else r===91?n=!0:r===92?t=!0:r===93&&(n=!1);e++}for(;e=this._input.length}}Mh._regexFlags=new Set(["i","g","s","m","y","u"].map(i=>i.charCodeAt(0)));Mh._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Es=new Map;Es.set("false",!1);Es.set("true",!0);Es.set("isMac",Nn);Es.set("isLinux",xs);Es.set("isWindows",ls);Es.set("isWeb",Xv);Es.set("isMacNative",Nn&&!Xv);Es.set("isEdge",PXe);Es.set("isFirefox",MXe);Es.set("isChrome",C_e);Es.set("isSafari",AXe);const VZe=Object.prototype.hasOwnProperty,HZe={regexParsingWithErrorRecovery:!0},$Ze=C("contextkey.parser.error.emptyString","Empty context key expression"),zZe=C("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."),UZe=C("contextkey.parser.error.noInAfterNot","'in' after 'not'."),boe=C("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),jZe=C("contextkey.parser.error.unexpectedToken","Unexpected token"),KZe=C("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),qZe=C("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),GZe=C("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");class d0{constructor(e=HZe){this._config=e,this._scanner=new Mh,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:$Ze,offset:0,lexeme:"",additionalInfo:zZe});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),o=n.type===17?KZe:void 0;throw this._parsingErrors.push({message:jZe,offset:n.offset,lexeme:Mh.getLexeme(n),additionalInfo:o}),d0._parseError}return t}catch(t){if(t!==d0._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]:Me.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Me.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),ua.INSTANCE;case 12:return this._advance(),Wa.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,boe),t==null?void 0:t.negate()}case 17:return this._advance(),Vb.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(),Me.true();case 12:return this._advance(),Me.false();case 0:{this._advance();const t=this._expr();return this._consume(1,boe),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const o=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),o.type!==10)throw this._errExpectedButGot("REGEX",o);const r=o.lexeme,s=r.lastIndexOf("/"),a=s===r.length-1?void 0:this._removeFlagsGY(r.substring(s+1));let l;try{l=new RegExp(r.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",o)}return OD.create(t,l)}switch(o.type){case 10:case 19:{const r=[o.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h=0){const c=r.slice(a+1,l),d=r[l+1]==="i"?"i":"";try{s=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",o)}}}if(s===null)throw this._errExpectedButGot("REGEX",o);return OD.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,UZe);const o=this._value();return Me.notIn(t,o)}switch(this._peek().type){case 3:{this._advance();const o=this._value();if(this._previous().type===18)return Me.equals(t,o);switch(o){case"true":return Me.has(t);case"false":return Me.not(t);default:return Me.equals(t,o)}}case 4:{this._advance();const o=this._value();if(this._previous().type===18)return Me.notEquals(t,o);switch(o){case"true":return Me.not(t);case"false":return Me.has(t);default:return Me.notEquals(t,o)}}case 5:return this._advance(),Z4.create(t,this._value());case 6:return this._advance(),Q4.create(t,this._value());case 7:return this._advance(),X4.create(t,this._value());case 8:return this._advance(),Y4.create(t,this._value());case 13:return this._advance(),Me.in(t,this._value());default:return Me.has(t)}}case 20:throw this._parsingErrors.push({message:qZe,offset:e.offset,lexeme:"",additionalInfo:GZe}),d0._parseError;default:throw this._errExpectedButGot(`true | false | KEY | KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,n){const o=C("contextkey.parser.error.expectedButGot",`Expected: {0} -Received: '{1}'.`,e,Mh.getLexeme(t)),r=t.offset,s=Mh.getLexeme(t);return this._parsingErrors.push({message:o,offset:r,lexeme:s,additionalInfo:n}),d0._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}}d0._parseError=new Error;class Me{static false(){return ua.INSTANCE}static true(){return Wa.INSTANCE}static has(e){return Wb.create(e)}static equals(e,t){return _S.create(e,t)}static notEquals(e,t){return K4.create(e,t)}static regex(e,t){return OD.create(e,t)}static in(e,t){return U4.create(e,t)}static notIn(e,t){return j4.create(e,t)}static not(e){return Vb.create(e)}static and(...e){return u0.create(e,null,!0)}static or(...e){return Lg.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}Me._parser=new d0({regexParsingWithErrorRecovery:!1});function qZe(i,e){const t=i?i.substituteConstants():void 0,n=e?e.substituteConstants():void 0;return!t&&!n?!0:!t||!n?!1:t.equals(n)}function dE(i,e){return i.cmp(e)}class ua{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 Wa.INSTANCE}}ua.INSTANCE=new ua;class Wa{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 ua.INSTANCE}}Wa.INSTANCE=new Wa;class Wb{static create(e,t=null){const n=Es.get(e);return typeof n=="boolean"?n?Wa.INSTANCE:ua.INSTANCE:new Wb(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:e0e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Es.get(this.key);return typeof e=="boolean"?e?Wa.INSTANCE:ua.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Vb.create(this.key,this)),this.negated}}class _S{static create(e,t,n=null){if(typeof t=="boolean")return t?Wb.create(e,n):Vb.create(e,n);const o=Es.get(e);return typeof o=="boolean"?t===(o?"true":"false")?Wa.INSTANCE:ua.INSTANCE:new _S(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Hb(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=Es.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Wa.INSTANCE:ua.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=K4.create(this.key,this.value,this)),this.negated}}class U4{static create(e,t){return new U4(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:Hb(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),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n=="string"&&typeof t=="object"&&t!==null?BZe.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=j4.create(this.key,this.valueKey)),this.negated}}class j4{static create(e,t){return new j4(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=U4.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class K4{static create(e,t,n=null){if(typeof t=="boolean")return t?Vb.create(e,n):Wb.create(e,n);const o=Es.get(e);return typeof o=="boolean"?t===(o?"true":"false")?ua.INSTANCE:Wa.INSTANCE:new K4(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Hb(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=Es.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ua.INSTANCE:Wa.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_S.create(this.key,this.value,this)),this.negated}}class Vb{static create(e,t=null){const n=Es.get(e);return typeof n=="boolean"?n?ua.INSTANCE:Wa.INSTANCE:new Vb(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:e0e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Es.get(this.key);return typeof e=="boolean"?e?ua.INSTANCE:Wa.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Wb.create(this.key,this)),this.negated}}function q4(i,e){if(typeof i=="string"){const t=parseFloat(i);isNaN(t)||(i=t)}return typeof i=="string"||typeof i=="number"?e(i):ua.INSTANCE}class G4{static create(e,t,n=null){return q4(t,o=>new G4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Hb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Z4.create(this.key,this.value,this)),this.negated}}class X4{static create(e,t,n=null){return q4(t,o=>new X4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Hb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Y4.create(this.key,this.value,this)),this.negated}}class Y4{static create(e,t,n=null){return q4(t,o=>new Y4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Hb(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 Z4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Hb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=G4.create(this.key,this.value,this)),this.negated}}class OD{static create(e,t){return new OD(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:"",n=e.regexp?e.regexp.source:"";return tn?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=iG.create(this)),this.negated}}class iG{static create(e){return new iG(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function J_e(i){let e=null;for(let t=0,n=i.length;te.expr.length)return 1;for(let t=0,n=this.expr.length;t1;){const s=o[o.length-1];if(s.type!==9)break;o.pop();const a=o.pop(),l=o.length===0,c=Lg.create(s.expr.map(d=>u0.create([d,a],null,n)),null,l);c&&(o.push(c),o.sort(dE))}if(o.length===1)return o[0];if(n){for(let s=0;se.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=Lg.create(e,this,!0)}return this.negated}}class Lg{static create(e,t,n){return Lg._normalizeArr(e,t,n)}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,n=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(),n=e.shift(),o=[];for(const r of Coe(t))for(const s of Coe(n))o.push(u0.create([r,s],null,!1));e.unshift(Lg.create(o,null,!1))}this.negated=Lg.create(e,this,!0)}return this.negated}}class lt extends Wb{static all(){return lt._info.values()}constructor(e,t,n){super(e,null),this._defaultValue=t,typeof n=="object"?lt._info.push(Object.assign(Object.assign({},n),{key:e})):n!==!0&<._info.push({key:e,description:n,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 _S.create(this.key,e)}}lt._info=[];const Ut=yn("contextKeyService");function e0e(i,e){return ie?1:0}function Hb(i,e,t,n){return it?1:en?1:0}function KV(i,e){if(i.type===0||e.type===1)return!0;if(i.type===9)return e.type===9?boe(i.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(KV(i,t))return!0;return!1}if(i.type===6){if(e.type===6)return boe(e.expr,i.expr);for(const t of i.expr)if(KV(t,e))return!0;return!1}return i.equals(e)}function boe(i,e){let t=0,n=0;for(;t>>0,n=(i&4294901760)>>>16;return n!==0?new M6([r2(t,e),r2(n,e)]):new M6([r2(t,e)])}else{const t=[];for(let n=0;n{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(QZe)),this._cachedMergedKeybindings.slice(0)}}const Va=new oG,ZZe={EditorModes:"platform.keybindingsRegistry"};no.add(ZZe.EditorModes,Va);function QZe(i,e){if(i.weight1!==e.weight1)return i.weight1-e.weight1;if(i.command&&e.command){if(i.commande.command)return 1}return i.weight2-e.weight2}var JZe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},yoe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},eQe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);ot===e}}Eg._all=new Map;const Hr=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new AYe({merge:Eg.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(i){return this._commands.set(i.id,i),this._onDidChangeMenu.fire(Eg.for(Z.CommandPalette)),zt(()=>{this._commands.delete(i.id)&&this._onDidChangeMenu.fire(Eg.for(Z.CommandPalette))})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((e,t)=>i.set(t,e)),i}appendMenuItem(i,e){let t=this._menuItems.get(i);t||(t=new oa,this._menuItems.set(i,t));const n=t.push(e);return this._onDidChangeMenu.fire(Eg.for(i)),zt(()=>{n(),this._onDidChangeMenu.fire(Eg.for(i))})}appendMenuItems(i){const e=new Be;for(const{id:t,item:n}of i)e.add(this.appendMenuItem(t,n));return e}getMenuItems(i){let e;return this._menuItems.has(i)?e=[...this._menuItems.get(i)]:e=[],i===Z.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(i){const e=new Set;for(const t of i)NC(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,n)=>{e.has(n)||i.push({command:t})})}};class BD extends _w{constructor(e,t,n){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,n,"submenu"),this.item=e,this.hideActions=t}}let Fd=nM=class{static label(e,t){return(t==null?void 0: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,n,o,r,s){var a,l;this.hideActions=o,this._commandService=s,this.id=e.id,this.label=nM.label(e,n),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||r.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const d=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(d.condition),this.checked&&d.tooltip&&(this.tooltip=typeof d.tooltip=="string"?d.tooltip:d.tooltip.value),this.checked&&Mt.isThemeIcon(d.icon)&&(c=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}c||(c=Mt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new nM(t,void 0,n,o,r,s):void 0,this._options=n,this.class=c&&Mt.asClassName(c)}run(...e){var t,n;let o=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(o=[...o,this._options.arg]),!((n=this._options)===null||n===void 0)&&n.shouldForwardArgs&&(o=[...o,...e]),this._commandService.executeCommand(this.id,...o)}};Fd=nM=JZe([yoe(4,Ut),yoe(5,_o)],Fd);class ec{constructor(e){this.desc=e}}function $i(i){const e=new Be,t=new i,n=t.desc,{f1:o,menu:r,keybinding:s,description:a}=n,l=eQe(n,["f1","menu","keybinding","description"]);if(e.add(Rn.registerCommand({id:l.id,handler:(c,...d)=>t.run(c,...d),description:a})),Array.isArray(r))for(const c of r)e.add(Hr.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else r&&e.add(Hr.appendMenuItem(r.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:r.precondition===null?void 0:l.precondition})},r)));if(o&&(e.add(Hr.appendMenuItem(Z.CommandPalette,{command:l,when:l.precondition})),e.add(Hr.addCommand(l))),Array.isArray(s))for(const c of s)e.add(Va.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?Me.and(l.precondition,c.when):c.when})));else s&&e.add(Va.registerKeybindingRule(Object.assign(Object.assign({},s),{id:l.id,when:l.precondition?Me.and(l.precondition,s.when):s.when})));return e}const tc=yn("telemetryService"),nc=yn("logService");var ns;(function(i){i[i.Off=0]="Off",i[i.Trace=1]="Trace",i[i.Debug=2]="Debug",i[i.Info=3]="Info",i[i.Warning=4]="Warning",i[i.Error=5]="Error"})(ns||(ns={}));const n0e=ns.Info;class i0e extends _e{constructor(){super(...arguments),this.level=n0e,this._onDidChangeLogLevel=this._register(new le),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!==ns.Off&&this.level<=e}}class nQe extends i0e{constructor(e=n0e,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(ns.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(ns.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(ns.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(ns.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(ns.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class iQe extends i0e{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 n of this.loggers)n.trace(e,...t)}debug(e,...t){for(const n of this.loggers)n.debug(e,...t)}info(e,...t){for(const n of this.loggers)n.info(e,...t)}warn(e,...t){for(const n of this.loggers)n.warn(e,...t)}error(e,...t){for(const n of this.loggers)n.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function oQe(i){switch(i){case ns.Trace:return"trace";case ns.Debug:return"debug";case ns.Info:return"info";case ns.Warning:return"warn";case ns.Error:return"error";case ns.Off:return"off"}}new lt("logLevel",oQe(ns.Info));const rG={clipboard:{writeText:Fu||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Fu||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>Fu||IZe()?0:navigator.keyboard||lp?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function rQe(i){if(i.charCode){const t=String.fromCharCode(i.charCode).toUpperCase();return xg.fromString(t)}const e=i.keyCode;if(e===3)return 7;if(Fc)switch(e){case 59:return 85;case 60:if(xs)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Nn)return 57;break}else if(D0){if(Nn&&e===93)return 57;if(!Nn&&e===92)return 57}return T_e[e]||0}const sQe=Nn?256:2048,aQe=512,lQe=1024,cQe=Nn?2048:256;class Pi{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=rQe(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|=sQe),this.altKey&&(t|=aQe),this.shiftKey&&(t|=lQe),this.metaKey&&(t|=cQe),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new cp(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let woe=!1,Tx=null;function dQe(i){if(!i.parent||i.parent===i)return null;try{const e=i.location,t=i.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return woe=!0,null}catch{return woe=!0,null}return i.parent}class uQe{static getSameOriginWindowChain(){if(!Tx){Tx=[];let e=window,t;do t=dQe(e),t?Tx.push({window:e,iframeElement:e.frameElement||null}):Tx.push({window:e,iframeElement:null}),e=t;while(e)}return Tx.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,o=0;const r=this.getSameOriginWindowChain();for(const s of r){if(n+=s.window.scrollY,o+=s.window.scrollX,s.window===t||!s.iframeElement)break;const a=s.iframeElement.getBoundingClientRect();n+=a.top,o+=a.left}return{top:n,left:o}}}class kc{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=uQe.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class tb{constructor(e,t=0,n=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t,e){const o=e,r=e;if(typeof o.wheelDeltaY!="undefined")this.deltaY=o.wheelDeltaY/120;else if(typeof r.VERTICAL_AXIS!="undefined"&&r.axis===r.VERTICAL_AXIS)this.deltaY=-r.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?Fc&&!Nn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX!="undefined")lp&&ls?this.deltaX=-(o.wheelDeltaX/120):this.deltaX=o.wheelDeltaX/120;else if(typeof r.HORIZONTAL_AXIS!="undefined"&&r.axis===r.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?Fc&&!Nn?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:o0e,setPrototypeOf:Soe,isFrozen:hQe,getPrototypeOf:fQe,getOwnPropertyDescriptor:gQe}=Object;let{freeze:hl,seal:qu,create:pQe}=Object,{apply:GV,construct:XV}=typeof Reflect!="undefined"&&Reflect;GV||(GV=function(e,t,n){return e.apply(t,n)});hl||(hl=function(e){return e});qu||(qu=function(e){return e});XV||(XV=function(e,t){return new e(...t)});const mQe=Bd(Array.prototype.forEach),xoe=Bd(Array.prototype.pop),Nx=Bd(Array.prototype.push),iM=Bd(String.prototype.toLowerCase),P6=Bd(String.prototype.toString),vQe=Bd(String.prototype.match),iu=Bd(String.prototype.replace),_Qe=Bd(String.prototype.indexOf),bQe=Bd(String.prototype.trim),pc=Bd(RegExp.prototype.test),Rx=CQe(TypeError);function Bd(i){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o/gm),LQe=qu(/\${[\w\W]*}/gm),EQe=qu(/^data-[\-\w.\u00B7-\uFFFF]/),DQe=qu(/^aria-[\-\w]+$/),r0e=qu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kQe=qu(/^(?:\w+script|data):/i),IQe=qu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),s0e=qu(/^html$/i);var Ioe=Object.freeze({__proto__:null,MUSTACHE_EXPR:SQe,ERB_EXPR:xQe,TMPLIT_EXPR:LQe,DATA_ATTR:EQe,ARIA_ATTR:DQe,IS_ALLOWED_URI:r0e,IS_SCRIPT_OR_DATA:kQe,ATTR_WHITESPACE:IQe,DOCTYPE_NAME:s0e});const TQe=()=>typeof window=="undefined"?null:window,NQe=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function a0e(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:TQe();const e=Ze=>a0e(Ze);if(e.version="3.0.5",e.removed=[],!i||!i.document||i.document.nodeType!==9)return e.isSupported=!1,e;const t=i.document,n=t.currentScript;let{document:o}=i;const{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:f}=i,g=l.prototype,p=s2(g,"cloneNode"),v=s2(g,"nextSibling"),m=s2(g,"childNodes"),_=s2(g,"parentNode");if(typeof s=="function"){const Ze=o.createElement("template");Ze.content&&Ze.content.ownerDocument&&(o=Ze.content.ownerDocument)}let y,w="";const{implementation:L,createNodeIterator:D,createDocumentFragment:E,getElementsByTagName:I}=o,{importNode:k}=t;let R={};e.isSupported=typeof o0e=="function"&&typeof _=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:P,TMPLIT_EXPR:N,DATA_ATTR:M,ARIA_ATTR:H,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:F}=Ioe;let{IS_ALLOWED_URI:$}=Ioe,z=null;const K=hi({},[...Loe,...O6,...F6,...B6,...Eoe]);let j=null;const G=hi({},[...Doe,...W6,...koe,...a2]);let X=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}})),ue=null,fe=null,pe=!0,be=!0,Se=!1,Fe=!0,De=!1,ce=!1,Pe=!1,Oe=!1,xe=!1,Ee=!1,tt=!1,nt=!0,Qe=!1;const Ge="user-content-";let re=!0,ie=!1,se={},U=null;const Y=hi({},["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 oe=null;const te=hi({},["audio","video","img","source","image","track"]);let ye=null;const Le=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Te="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",je="http://www.w3.org/1999/xhtml";let mt=je,Dt=!1,At=null;const Je=hi({},[Te,We,je],P6);let Lt;const Ot=["application/xhtml+xml","text/html"],Vn="text/html";let Et,tn=null;const di=o.createElement("form"),cn=function(de){return de instanceof RegExp||de instanceof Function},Gn=function(de){if(!(tn&&tn===de)){if((!de||typeof de!="object")&&(de={}),de=V1(de),Lt=Ot.indexOf(de.PARSER_MEDIA_TYPE)===-1?Lt=Vn:Lt=de.PARSER_MEDIA_TYPE,Et=Lt==="application/xhtml+xml"?P6:iM,z="ALLOWED_TAGS"in de?hi({},de.ALLOWED_TAGS,Et):K,j="ALLOWED_ATTR"in de?hi({},de.ALLOWED_ATTR,Et):G,At="ALLOWED_NAMESPACES"in de?hi({},de.ALLOWED_NAMESPACES,P6):Je,ye="ADD_URI_SAFE_ATTR"in de?hi(V1(Le),de.ADD_URI_SAFE_ATTR,Et):Le,oe="ADD_DATA_URI_TAGS"in de?hi(V1(te),de.ADD_DATA_URI_TAGS,Et):te,U="FORBID_CONTENTS"in de?hi({},de.FORBID_CONTENTS,Et):Y,ue="FORBID_TAGS"in de?hi({},de.FORBID_TAGS,Et):{},fe="FORBID_ATTR"in de?hi({},de.FORBID_ATTR,Et):{},se="USE_PROFILES"in de?de.USE_PROFILES:!1,pe=de.ALLOW_ARIA_ATTR!==!1,be=de.ALLOW_DATA_ATTR!==!1,Se=de.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=de.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=de.SAFE_FOR_TEMPLATES||!1,ce=de.WHOLE_DOCUMENT||!1,xe=de.RETURN_DOM||!1,Ee=de.RETURN_DOM_FRAGMENT||!1,tt=de.RETURN_TRUSTED_TYPE||!1,Oe=de.FORCE_BODY||!1,nt=de.SANITIZE_DOM!==!1,Qe=de.SANITIZE_NAMED_PROPS||!1,re=de.KEEP_CONTENT!==!1,ie=de.IN_PLACE||!1,$=de.ALLOWED_URI_REGEXP||r0e,mt=de.NAMESPACE||je,X=de.CUSTOM_ELEMENT_HANDLING||{},de.CUSTOM_ELEMENT_HANDLING&&cn(de.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=de.CUSTOM_ELEMENT_HANDLING.tagNameCheck),de.CUSTOM_ELEMENT_HANDLING&&cn(de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),de.CUSTOM_ELEMENT_HANDLING&&typeof de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(be=!1),Ee&&(xe=!0),se&&(z=hi({},[...Eoe]),j=[],se.html===!0&&(hi(z,Loe),hi(j,Doe)),se.svg===!0&&(hi(z,O6),hi(j,W6),hi(j,a2)),se.svgFilters===!0&&(hi(z,F6),hi(j,W6),hi(j,a2)),se.mathMl===!0&&(hi(z,B6),hi(j,koe),hi(j,a2))),de.ADD_TAGS&&(z===K&&(z=V1(z)),hi(z,de.ADD_TAGS,Et)),de.ADD_ATTR&&(j===G&&(j=V1(j)),hi(j,de.ADD_ATTR,Et)),de.ADD_URI_SAFE_ATTR&&hi(ye,de.ADD_URI_SAFE_ATTR,Et),de.FORBID_CONTENTS&&(U===Y&&(U=V1(U)),hi(U,de.FORBID_CONTENTS,Et)),re&&(z["#text"]=!0),ce&&hi(z,["html","head","body"]),z.table&&(hi(z,["tbody"]),delete ue.tbody),de.TRUSTED_TYPES_POLICY){if(typeof de.TRUSTED_TYPES_POLICY.createHTML!="function")throw Rx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof de.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Rx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=de.TRUSTED_TYPES_POLICY,w=y.createHTML("")}else y===void 0&&(y=NQe(f,n)),y!==null&&typeof w=="string"&&(w=y.createHTML(""));hl&&hl(de),tn=de}},bn=hi({},["mi","mo","mn","ms","mtext"]),Pt=hi({},["foreignobject","desc","title","annotation-xml"]),qt=hi({},["title","style","font","a","script"]),Nt=hi({},O6);hi(Nt,F6),hi(Nt,yQe);const jt=hi({},B6);hi(jt,wQe);const Gt=function(de){let Ve=_(de);(!Ve||!Ve.tagName)&&(Ve={namespaceURI:mt,tagName:"template"});const ot=iM(de.tagName),Sn=iM(Ve.tagName);return At[de.namespaceURI]?de.namespaceURI===We?Ve.namespaceURI===je?ot==="svg":Ve.namespaceURI===Te?ot==="svg"&&(Sn==="annotation-xml"||bn[Sn]):Boolean(Nt[ot]):de.namespaceURI===Te?Ve.namespaceURI===je?ot==="math":Ve.namespaceURI===We?ot==="math"&&Pt[Sn]:Boolean(jt[ot]):de.namespaceURI===je?Ve.namespaceURI===We&&!Pt[Sn]||Ve.namespaceURI===Te&&!bn[Sn]?!1:!jt[ot]&&(qt[ot]||!Nt[ot]):!!(Lt==="application/xhtml+xml"&&At[de.namespaceURI]):!1},It=function(de){Nx(e.removed,{element:de});try{de.parentNode.removeChild(de)}catch{de.remove()}},Ft=function(de,Ve){try{Nx(e.removed,{attribute:Ve.getAttributeNode(de),from:Ve})}catch{Nx(e.removed,{attribute:null,from:Ve})}if(Ve.removeAttribute(de),de==="is"&&!j[de])if(xe||Ee)try{It(Ve)}catch{}else try{Ve.setAttribute(de,"")}catch{}},Ct=function(de){let Ve,ot;if(Oe)de=""+de;else{const Ci=vQe(de,/^[\r\n\t ]+/);ot=Ci&&Ci[0]}Lt==="application/xhtml+xml"&&mt===je&&(de=''+de+"");const Sn=y?y.createHTML(de):de;if(mt===je)try{Ve=new h().parseFromString(Sn,Lt)}catch{}if(!Ve||!Ve.documentElement){Ve=L.createDocument(mt,"template",null);try{Ve.documentElement.innerHTML=Dt?w:Sn}catch{}}const $n=Ve.body||Ve.documentElement;return de&&ot&&$n.insertBefore(o.createTextNode(ot),$n.childNodes[0]||null),mt===je?I.call(Ve,ce?"html":"body")[0]:ce?Ve.documentElement:$n},Zt=function(de){return D.call(de.ownerDocument||de,de,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},wn=function(de){return de instanceof u&&(typeof de.nodeName!="string"||typeof de.textContent!="string"||typeof de.removeChild!="function"||!(de.attributes instanceof d)||typeof de.removeAttribute!="function"||typeof de.setAttribute!="function"||typeof de.namespaceURI!="string"||typeof de.insertBefore!="function"||typeof de.hasChildNodes!="function")},Dn=function(de){return typeof a=="object"?de instanceof a:de&&typeof de=="object"&&typeof de.nodeType=="number"&&typeof de.nodeName=="string"},Xn=function(de,Ve,ot){!R[de]||mQe(R[de],Sn=>{Sn.call(e,Ve,ot,tn)})},jn=function(de){let Ve;if(Xn("beforeSanitizeElements",de,null),wn(de))return It(de),!0;const ot=Et(de.nodeName);if(Xn("uponSanitizeElement",de,{tagName:ot,allowedTags:z}),de.hasChildNodes()&&!Dn(de.firstElementChild)&&(!Dn(de.content)||!Dn(de.content.firstElementChild))&&pc(/<[/\w]/g,de.innerHTML)&&pc(/<[/\w]/g,de.textContent))return It(de),!0;if(!z[ot]||ue[ot]){if(!ue[ot]&&an(ot)&&(X.tagNameCheck instanceof RegExp&&pc(X.tagNameCheck,ot)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ot)))return!1;if(re&&!U[ot]){const Sn=_(de)||de.parentNode,$n=m(de)||de.childNodes;if($n&&Sn){const Ci=$n.length;for(let An=Ci-1;An>=0;--An)Sn.insertBefore(p($n[An],!0),v(de))}}return It(de),!0}return de instanceof l&&!Gt(de)||(ot==="noscript"||ot==="noembed"||ot==="noframes")&&pc(/<\/no(script|embed|frames)/i,de.innerHTML)?(It(de),!0):(De&&de.nodeType===3&&(Ve=de.textContent,Ve=iu(Ve,A," "),Ve=iu(Ve,P," "),Ve=iu(Ve,N," "),de.textContent!==Ve&&(Nx(e.removed,{element:de.cloneNode()}),de.textContent=Ve)),Xn("afterSanitizeElements",de,null),!1)},Zi=function(de,Ve,ot){if(nt&&(Ve==="id"||Ve==="name")&&(ot in o||ot in di))return!1;if(!(be&&!fe[Ve]&&pc(M,Ve))){if(!(pe&&pc(H,Ve))){if(!j[Ve]||fe[Ve]){if(!(an(de)&&(X.tagNameCheck instanceof RegExp&&pc(X.tagNameCheck,de)||X.tagNameCheck instanceof Function&&X.tagNameCheck(de))&&(X.attributeNameCheck instanceof RegExp&&pc(X.attributeNameCheck,Ve)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(Ve))||Ve==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&pc(X.tagNameCheck,ot)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ot))))return!1}else if(!ye[Ve]){if(!pc($,iu(ot,F,""))){if(!((Ve==="src"||Ve==="xlink:href"||Ve==="href")&&de!=="script"&&_Qe(ot,"data:")===0&&oe[de])){if(!(Se&&!pc(B,iu(ot,F,"")))){if(ot)return!1}}}}}}return!0},an=function(de){return de.indexOf("-")>0},Xt=function(de){let Ve,ot,Sn,$n;Xn("beforeSanitizeAttributes",de,null);const{attributes:Ci}=de;if(!Ci)return;const An={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for($n=Ci.length;$n--;){Ve=Ci[$n];const{name:lo,namespaceURI:Qo}=Ve;if(ot=lo==="value"?Ve.value:bQe(Ve.value),Sn=Et(lo),An.attrName=Sn,An.attrValue=ot,An.keepAttr=!0,An.forceKeepAttr=void 0,Xn("uponSanitizeAttribute",de,An),ot=An.attrValue,An.forceKeepAttr||(Ft(lo,de),!An.keepAttr))continue;if(!Fe&&pc(/\/>/i,ot)){Ft(lo,de);continue}De&&(ot=iu(ot,A," "),ot=iu(ot,P," "),ot=iu(ot,N," "));const zo=Et(de.nodeName);if(!!Zi(zo,Sn,ot)){if(Qe&&(Sn==="id"||Sn==="name")&&(Ft(lo,de),ot=Ge+ot),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Qo)switch(f.getAttributeType(zo,Sn)){case"TrustedHTML":{ot=y.createHTML(ot);break}case"TrustedScriptURL":{ot=y.createScriptURL(ot);break}}try{Qo?de.setAttributeNS(Qo,lo,ot):de.setAttribute(lo,ot),xoe(e.removed)}catch{}}}Xn("afterSanitizeAttributes",de,null)},oi=function Ze(de){let Ve;const ot=Zt(de);for(Xn("beforeSanitizeShadowDOM",de,null);Ve=ot.nextNode();)Xn("uponSanitizeShadowNode",Ve,null),!jn(Ve)&&(Ve.content instanceof r&&Ze(Ve.content),Xt(Ve));Xn("afterSanitizeShadowDOM",de,null)};return e.sanitize=function(Ze){let de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ve,ot,Sn,$n;if(Dt=!Ze,Dt&&(Ze=""),typeof Ze!="string"&&!Dn(Ze))if(typeof Ze.toString=="function"){if(Ze=Ze.toString(),typeof Ze!="string")throw Rx("dirty is not a string, aborting")}else throw Rx("toString is not a function");if(!e.isSupported)return Ze;if(Pe||Gn(de),e.removed=[],typeof Ze=="string"&&(ie=!1),ie){if(Ze.nodeName){const lo=Et(Ze.nodeName);if(!z[lo]||ue[lo])throw Rx("root node is forbidden and cannot be sanitized in-place")}}else if(Ze instanceof a)Ve=Ct(""),ot=Ve.ownerDocument.importNode(Ze,!0),ot.nodeType===1&&ot.nodeName==="BODY"||ot.nodeName==="HTML"?Ve=ot:Ve.appendChild(ot);else{if(!xe&&!De&&!ce&&Ze.indexOf("<")===-1)return y&&tt?y.createHTML(Ze):Ze;if(Ve=Ct(Ze),!Ve)return xe?null:tt?w:""}Ve&&Oe&&It(Ve.firstChild);const Ci=Zt(ie?Ze:Ve);for(;Sn=Ci.nextNode();)jn(Sn)||(Sn.content instanceof r&&oi(Sn.content),Xt(Sn));if(ie)return Ze;if(xe){if(Ee)for($n=E.call(Ve.ownerDocument);Ve.firstChild;)$n.appendChild(Ve.firstChild);else $n=Ve;return(j.shadowroot||j.shadowrootmode)&&($n=k.call(t,$n,!0)),$n}let An=ce?Ve.outerHTML:Ve.innerHTML;return ce&&z["!doctype"]&&Ve.ownerDocument&&Ve.ownerDocument.doctype&&Ve.ownerDocument.doctype.name&&pc(s0e,Ve.ownerDocument.doctype.name)&&(An=" -`+An),De&&(An=iu(An,A," "),An=iu(An,P," "),An=iu(An,N," ")),y&&tt?y.createHTML(An):An},e.setConfig=function(Ze){Gn(Ze),Pe=!0},e.clearConfig=function(){tn=null,Pe=!1},e.isValidAttribute=function(Ze,de,Ve){tn||Gn({});const ot=Et(Ze),Sn=Et(de);return Zi(ot,Sn,Ve)},e.addHook=function(Ze,de){typeof de=="function"&&(R[Ze]=R[Ze]||[],Nx(R[Ze],de))},e.removeHook=function(Ze){if(R[Ze])return xoe(R[Ze])},e.removeHooks=function(Ze){R[Ze]&&(R[Ze]=[])},e.removeAllHooks=function(){R={}},e}var Tf=a0e();Tf.version;Tf.isSupported;const l0e=Tf.sanitize;Tf.setConfig;Tf.clearConfig;Tf.isValidAttribute;const c0e=Tf.addHook,d0e=Tf.removeHook;Tf.removeHooks;Tf.removeAllHooks;var hn;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatSesssion="vscode-chat-editor",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm"})(hn||(hn={}));const RQe="tkn";class MQe{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${hn.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return en(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const o=this._ports[t],r=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof r=="string"&&(s+=`&${RQe}=${encodeURIComponent(r)}`),Rt.from({scheme:Xv?this._preferredWebSchema:hn.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:s})}}const u0e=new MQe;class WD{uriToBrowserUri(e){return e.scheme===hn.vscodeRemote?u0e.rewrite(e):e.scheme===hn.file&&(Fu||DXe&&Id.origin===`${hn.vscodeFileResource}://${WD.FALLBACK_AUTHORITY}`)?e.with({scheme:hn.vscodeFileResource,authority:e.authority||WD.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}WD.FALLBACK_AUTHORITY="vscode-app";const h0e=new WD;var Toe;(function(i){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"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(r){let s;typeof r=="string"?s=new URL(r).searchParams:r instanceof URL?s=r.searchParams:Rt.isUri(r)&&(s=new URL(r.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(!!a)return e.get(a)}i.getHeadersFromQuery=n;function o(r,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";r instanceof URLSearchParams?r.set(t,l):r[t]=l}i.addSearchParam=o})(Toe||(Toe={}));const{registerWindow:TNt,getWindows:AQe,onDidCreateWindow:NNt}=function(){const i=[],e=new le;return{onDidCreateWindow:e.event,registerWindow(t){i.push(t);const n=new Be;return n.add(zt(()=>{const o=i.indexOf(t);o!==-1&&i.splice(o,1)})),e.fire({window:t,disposableStore:n}),n},getWindows(){return i}}}();function Ur(i){for(;i.firstChild;)i.firstChild.remove()}function sG(i){var e;return(e=i==null?void 0:i.isConnected)!==null&&e!==void 0?e:!1}class PQe{constructor(e,t,n,o){this._node=e,this._type=t,this._handler=n,this._options=o||!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 ke(i,e,t,n){return new PQe(i,e,t,n)}function f0e(i){return function(e){return i(new kc(e))}}function OQe(i){return function(e){return i(new Pi(e))}}const No=function(e,t,n,o){let r=n;return t==="click"||t==="mousedown"?r=f0e(n):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=OQe(n)),ke(e,t,r,o)},FQe=function(e,t,n){const o=f0e(t);return BQe(e,o,n)};function BQe(i,e,t){return ke(i,Ku&&rG.pointerEvents?et.POINTER_DOWN:et.MOUSE_DOWN,e,t)}let GA,Bc;class V6{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){en(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let i=[],e=null,t=!1,n=!1;const o=()=>{for(t=!1,e=i,i=[],n=!0;e.length>0;)e.sort(V6.sort),e.shift().execute();n=!1};Bc=(r,s=0)=>{const a=new V6(r,s);return i.push(a),t||(t=!0,requestAnimationFrame(o)),a},GA=(r,s)=>{if(n){const a=new V6(r,s);return e.push(a),a}else return Bc(r,s)}})();function J4(i){return i.ownerDocument.defaultView.getComputedStyle(i,null)}function bS(i){var e;const t=i.ownerDocument,n=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(i!==t.body)return new Kn(i.clientWidth,i.clientHeight);if(Ku&&(n==null?void 0:n.visualViewport))return new Kn(n.visualViewport.width,n.visualViewport.height);if((n==null?void 0:n.innerWidth)&&n.innerHeight)return new Kn(n.innerWidth,n.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new Kn(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new Kn(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class wo{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,n){const o=J4(e),r=o?o.getPropertyValue(t):"0";return wo.convertToPixels(e,r)}static getBorderLeftWidth(e){return wo.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return wo.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return wo.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return wo.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return wo.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return wo.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return wo.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return wo.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return wo.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return wo.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return wo.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return wo.getDimension(e,"margin-bottom","marginBottom")}}class Kn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Kn(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Kn?e:new Kn(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Kn.None=new Kn(0,0);function g0e(i){let e=i.offsetParent,t=i.offsetTop,n=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){t-=i.scrollTop;const o=p0e(i)?null:J4(i);o&&(n-=o.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(n+=wo.getBorderLeftWidth(i),t+=wo.getBorderTopWidth(i),t+=i.offsetTop,n+=i.offsetLeft,e=i.offsetParent)}return{left:n,top:t}}function WQe(i,e,t){typeof e=="number"&&(i.style.width=`${e}px`),typeof t=="number"&&(i.style.height=`${t}px`)}function Yo(i){var e,t,n,o;const r=i.getBoundingClientRect();return{left:r.left+((t=(e=i.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:r.top+((o=(n=i.ownerDocument.defaultView)===null||n===void 0?void 0:n.scrollY)!==null&&o!==void 0?o:0),width:r.width,height:r.height}}function VQe(i){let e=i,t=1;do{const n=J4(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Ea(i){const e=wo.getMarginLeft(i)+wo.getMarginRight(i);return i.offsetWidth+e}function H6(i){const e=wo.getBorderLeftWidth(i)+wo.getBorderRightWidth(i),t=wo.getPaddingLeft(i)+wo.getPaddingRight(i);return i.offsetWidth-e-t}function HQe(i){const e=wo.getBorderTopWidth(i)+wo.getBorderBottomWidth(i),t=wo.getPaddingTop(i)+wo.getPaddingBottom(i);return i.offsetHeight-e-t}function h0(i){const e=wo.getMarginTop(i)+wo.getMarginBottom(i);return i.offsetHeight+e}function rs(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function $Qe(i,e,t){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(t){if(typeof t=="string"){if(i.classList.contains(t))return null}else if(i===t)return null}i=i.parentNode}return null}function $6(i,e,t){return!!$Qe(i,e,t)}function p0e(i){return i&&!!i.host&&!!i.mode}function XA(i){return!!nb(i)}function nb(i){for(var e;i.parentNode;){if(i===((e=i.ownerDocument)===null||e===void 0?void 0:e.body))return null;i=i.parentNode}return p0e(i)?i:null}function Nd(){let i=e5().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function e5(){var i;return(i=[document,...AQe().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&i!==void 0?i:document}function Wc(i=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),i.appendChild(t),t}let z6=null;function m0e(){return z6||(z6=Wc()),z6}function zQe(i){var e,t;return!((e=i==null?void 0:i.sheet)===null||e===void 0)&&e.rules?i.sheet.rules:!((t=i==null?void 0:i.sheet)===null||t===void 0)&&t.cssRules?i.sheet.cssRules:[]}function YV(i,e,t=m0e()){!t||!e||t.sheet.insertRule(i+"{"+e+"}",0)}function Noe(i,e=m0e()){if(!e)return;const t=zQe(e),n=[];for(let o=0;o=0;o--)e.sheet.deleteRule(n[o])}function aG(i){return typeof HTMLElement=="object"?i instanceof HTMLElement:i&&typeof i=="object"&&i.nodeType===1&&typeof i.nodeName=="string"}const et={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:D0?"webkitAnimationStart":"animationstart",ANIMATION_END:D0?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:D0?"webkitAnimationIteration":"animationiteration"};function UQe(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const un={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function jQe(i){const e=[];for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)e[t]=i.scrollTop,i=i.parentNode;return e}function KQe(i,e){for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)i.scrollTop!==e[t]&&(i.scrollTop=e[t]),i=i.parentNode}class YA extends _e{static hasFocusWithin(e){if(aG(e)){const t=nb(e),n=t?t.activeElement:e.ownerDocument.activeElement;return rs(n,e)}else return rs(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event;let t=YA.hasFocusWithin(e),n=!1;const o=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(n=!0,window.setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{YA.hasFocusWithin(e)!==t&&(t?r():o())},this._register(ke(e,et.FOCUS,o,!0)),this._register(ke(e,et.BLUR,r,!0)),e instanceof HTMLElement&&(this._register(ke(e,et.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ke(e,et.FOCUS_OUT,()=>this._refreshStateHandler())))}}function pf(i){return new YA(i)}function Ae(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function v0e(i,e){return i.insertBefore(e,i.firstChild),e}function jr(i,...e){i.innerText="",Ae(i,...e)}const qQe=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var VD;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(VD||(VD={}));function _0e(i,e,t,...n){const o=qQe.exec(e);if(!o)throw new Error("Bad use of emmet");const r=o[1]||"div";let s;return i!==VD.HTML?s=document.createElementNS(i,r):s=document.createElement(r),o[3]&&(s.id=o[3]),o[4]&&(s.className=o[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l!="undefined"&&(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...n),s}function He(i,e,...t){return _0e(VD.HTML,i,e,...t)}He.SVG=function(i,e,...t){return _0e(VD.SVG,i,e,...t)};function GQe(i,...e){i?nl(...e):Js(...e)}function nl(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function Js(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function Roe(i){const e=window.devicePixelRatio*i;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function b0e(i){window.open(i,"_blank","noopener")}function XQe(i){const e=()=>{i(),t=Bc(e)};let t=Bc(e);return zt(()=>t.dispose())}u0e.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function Sv(i){return i?`url('${h0e.uriToBrowserUri(i).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Moe(i){return`'${i.replace(/'/g,"%27")}'`}function I0(i,e){if(i!==void 0){const t=i.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=I0(n[1].trim(),e)),`var(${n[0]}, ${e})`}return i}return e}function YQe(i,e=!1){const t=document.createElement("a");return c0e("afterSanitizeAttributes",n=>{for(const o of["href","src"])if(n.hasAttribute(o)){const r=n.getAttribute(o);if(o==="href"&&r.startsWith("#"))continue;if(t.href=r,!i.includes(t.protocol.replace(/:$/,""))){if(e&&o==="src"&&t.href.startsWith("data:"))continue;n.removeAttribute(o)}}}),zt(()=>{d0e("afterSanitizeAttributes")})}const ZQe=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"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type","start"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class Mg extends le{constructor(){super(),this._subscriptions=new Be,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ke(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Pi(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(ke(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(ke(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ke(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ke(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(ke(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 Mg.instance||(Mg.instance=new Mg),Mg.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class QQe extends _e{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(ke(this.element,et.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(ke(this.element,et.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)===null||n===void 0||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(ke(this.element,et.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(ke(this.element,et.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(ke(this.element,et.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const JQe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Or(i,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const o=JQe.exec(i);if(!o||!o.groups)throw new Error("Bad use of h");const r=o.groups.tag||"div",s=document.createElement(r);o.groups.id&&(s.id=o.groups.id);const a=[];if(o.groups.class)for(const c of o.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&&(s.className=a.join(" "));const l={};if(o.groups.name&&(l[o.groups.name]=s),n)for(const c of n)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.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))s.style.setProperty(Aoe(u),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=d:s.setAttribute(Aoe(c),d.toString());return l.root=s,l}function Aoe(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class t5{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 n=t.kbExpr;this.precondition&&(n?n=Me.and(n,this.precondition):n=this.precondition);const o={id:this.id,weight:t.weight,args:t.args,when:n,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Va.registerKeybindingRule(o)}}Rn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Hr.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 CS extends t5{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n,o){return this._implementations.push({priority:e,name:t,implementation:n,when:o}),this._implementations.sort((r,s)=>s.priority-r.priority),{dispose:()=>{for(let r=0;r{if(!!a.get(Ut).contextMatchesRules(n!=null?n:void 0))return o(a,s,t)})}runCommand(e,t){return Ir.runEditorCommand(e,t,this.precondition,(n,o,r)=>this.runEditorCommand(n,o,r))}}class ft extends Ir{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function n(o){return o.menuId||(o.menuId=Z.EditorContext),o.title||(o.title=e.label),o.when=Me.and(e.precondition,o.when),o}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(ft.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(tc).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class y0e extends ft{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((n,o)=>o[0]-n[0]),{dispose:()=>{for(let n=0;n{var s,a;const l=r.get(Ut),c=r.get(nc);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s: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(r,o,...t)})}}function Nf(i,e){Rn.registerCommand(i,function(t,...n){const o=t.get($t),[r,s]=n;fi(Rt.isUri(r)),fi(ae.isIPosition(s));const a=t.get(Yi).getModel(r);if(a){const l=ae.lift(s);return o.invokeFunction(e,a,l,...n.slice(2))}return t.get(za).createModelReference(r).then(l=>new Promise((c,d)=>{try{const u=o.invokeFunction(e,l.object.textEditorModel,ae.lift(s),n.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function Ye(i){return Lc.INSTANCE.registerEditorCommand(i),i}function ze(i){const e=new i;return Lc.INSTANCE.registerEditorAction(e),e}function w0e(i){return Lc.INSTANCE.registerEditorAction(i),i}function eJe(i){Lc.INSTANCE.registerEditorAction(i)}function Un(i,e,t){Lc.INSTANCE.registerEditorContribution(i,e,t)}var by;(function(i){function e(s){return Lc.INSTANCE.getEditorCommand(s)}i.getEditorCommand=e;function t(){return Lc.INSTANCE.getEditorActions()}i.getEditorActions=t;function n(){return Lc.INSTANCE.getEditorContributions()}i.getEditorContributions=n;function o(s){return Lc.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}i.getSomeEditorContributions=o;function r(){return Lc.INSTANCE.getDiffEditorContributions()}i.getDiffEditorContributions=r})(by||(by={}));const tJe={EditorCommonContributions:"editor.contributions"};class Lc{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,n){this.editorContributions.push({id:e,ctor:t,instantiation:n})}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}}Lc.INSTANCE=new Lc;no.add(tJe.EditorCommonContributions,Lc.INSTANCE);function zI(i){return i.register(),i}const S0e=zI(new CS({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:Z.MenubarEditMenu,group:"1_do",title:C({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:Z.CommandPalette,group:"",title:C("undo","Undo"),order:1}]}));zI(new C0e(S0e,{id:"default:undo",precondition:void 0}));const x0e=zI(new CS({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:Z.MenubarEditMenu,group:"1_do",title:C({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:Z.CommandPalette,group:"",title:C("redo","Redo"),order:1}]}));zI(new C0e(x0e,{id:"default:redo",precondition:void 0}));const nJe=zI(new CS({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:Z.CommandPalette,group:"",title:C("selectAll","Select All"),order:1}]})),L0e=Symbol("MicrotaskDelay");var vc=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},bL=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};function ZV(i){return!!i&&typeof i.then=="function"}function sr(i){const e=new Ro,t=i(e.token),n=new Promise((o,r)=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),r(new Yv)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),o(a)},a=>{s.dispose(),e.dispose(),r(a)})});return new class{cancel(){e.cancel()}then(o,r){return n.then(o,r)}catch(o){return this.then(void 0,o)}finally(o){return n.finally(o)}}}function n5(i,e,t){return new Promise((n,o)=>{const r=e.onCancellationRequested(()=>{r.dispose(),n(t)});i.then(n,o).finally(()=>r.dispose())})}class iJe{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 n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(),new Promise((t,n)=>{this.activePromise.then(o=>{this.activePromise=null,t(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.isDisposed=!0}}const oJe=(i,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},i);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},rJe=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Wd{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((o,r)=>{this.doResolve=o,this.doReject=r}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const o=this.task;return this.task=null,o()}}));const n=()=>{var o;this.deferred=null,(o=this.doResolve)===null||o===void 0||o.call(this,null)};return this.deferred=t===L0e?rJe(n):oJe(t,n),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 Yv),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class E0e{constructor(e){this.delayer=new Wd(e),this.throttler=new iJe}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function xv(i,e){return e?new Promise((t,n)=>{const o=setTimeout(()=>{r.dispose(),t()},i),r=e.onCancellationRequested(()=>{clearTimeout(o),r.dispose(),n(new Yv)})}):sr(t=>xv(i,t))}function Lv(i,e=0,t){const n=setTimeout(()=>{i(),t&&o.dispose()},e),o=zt(()=>{clearTimeout(n),t==null||t.deleteAndLeak(o)});return t==null||t.add(o),o}function D0e(i,e=n=>!!n,t=null){let n=0;const o=i.length,r=()=>{if(n>=o)return Promise.resolve(t);const s=i[n++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):r())};return r()}class zd{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 UI{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 bi{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 Ag;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?Ag=i=>{__e(()=>{if(e)return;const t=Date.now()+15;i(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:Ag=(i,e)=>{const t=requestIdleCallback(i,typeof e=="number"?{timeout:e}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(t))}}}})();class oM{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=Ag(()=>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 i5{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 Yv)}}var QV;(function(i){function e(n){return vc(this,void 0,void 0,function*(){let o;const r=yield Promise.all(n.map(s=>s.then(a=>a,a=>{o||(o=a)})));if(typeof o!="undefined")throw o;return r})}i.settled=e;function t(n){return new Promise((o,r)=>vc(this,void 0,void 0,function*(){try{yield n(o,r)}catch(s){r(s)}}))}i.withAsyncBody=t})(QV||(QV={}));class Wo{static fromArray(e){return new Wo(t=>{t.emitMany(e)})}static fromPromise(e){return new Wo(t=>vc(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new Wo(t=>vc(this,void 0,void 0,function*(){yield Promise.all(e.map(n=>vc(this,void 0,void 0,function*(){return t.emitOne(yield n)})))}))}static merge(e){return new Wo(t=>vc(this,void 0,void 0,function*(){yield Promise.all(e.map(n=>{var o,r,s;return vc(this,void 0,void 0,function*(){var a,l,c,d;try{for(o=!0,r=bL(n);s=yield r.next(),a=s.done,!a;o=!0){d=s.value,o=!1;const u=d;t.emitOne(u)}}catch(u){l={error:u}}finally{try{!o&&!a&&(c=r.return)&&(yield c.call(r))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new le,queueMicrotask(()=>vc(this,void 0,void 0,function*(){const t={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{yield Promise.resolve(e(t)),this.resolve()}catch(n){this.reject(n)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>vc(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(evc(this,void 0,void 0,function*(){var o,r,s,a;try{for(var l=!0,c=bL(e),d;d=yield c.next(),o=d.done,!o;l=!0){a=d.value,l=!1;const u=a;n.emitOne(t(u))}}catch(u){r={error:u}}finally{try{!l&&!o&&(s=c.return)&&(yield s.call(c))}finally{if(r)throw r.error}}}))}map(e){return Wo.map(this,e)}static filter(e,t){return new Wo(n=>vc(this,void 0,void 0,function*(){var o,r,s,a;try{for(var l=!0,c=bL(e),d;d=yield c.next(),o=d.done,!o;l=!0){a=d.value,l=!1;const u=a;t(u)&&n.emitOne(u)}}catch(u){r={error:u}}finally{try{!l&&!o&&(s=c.return)&&(yield s.call(c))}finally{if(r)throw r.error}}}))}filter(e){return Wo.filter(this,e)}static coalesce(e){return Wo.filter(e,t=>!!t)}coalesce(){return Wo.coalesce(this)}static toPromise(e){var t,n,o,r,s,a,l;return vc(this,void 0,void 0,function*(){const c=[];try{for(t=!0,n=bL(e);o=yield n.next(),r=o.done,!r;t=!0){l=o.value,t=!1;const d=l;c.push(d)}}catch(d){s={error:d}}finally{try{!t&&!r&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return c})}toPromise(){return Wo.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())}}Wo.EMPTY=Wo.fromArray([]);class sJe extends Wo{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function aJe(i){const e=new Ro,t=i(e.token);return new sJe(e,n=>vc(this,void 0,void 0,function*(){var o,r,s,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),n.reject(new Yv)});try{try{for(var c=!0,d=bL(t),u;u=yield d.next(),o=u.done,!o;c=!0){a=u.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;n.emitOne(h)}}catch(h){r={error:h}}finally{try{!c&&!o&&(s=d.return)&&(yield s.call(d))}finally{if(r)throw r.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),n.reject(h)}}))}const lJe="$initialize";let Poe=!1;function JV(i){!Xv||(Poe||(Poe=!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(i.message))}class cJe{constructor(e,t,n,o){this.vsWorker=e,this.req=t,this.method=n,this.args=o,this.type=0}}class Ooe{constructor(e,t,n,o){this.vsWorker=e,this.seq=t,this.res=n,this.err=o,this.type=1}}class dJe{constructor(e,t,n,o){this.vsWorker=e,this.req=t,this.eventName=n,this.arg=o,this.type=2}}class uJe{constructor(e,t,n){this.vsWorker=e,this.req=t,this.event=n,this.type=3}}class hJe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class fJe{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 n=String(++this._lastSentReq);return new Promise((o,r)=>{this._pendingReplies[n]={resolve:o,reject:r},this._send(new cJe(this._workerId,n,e,t))})}listen(e,t){let n=null;const o=new le({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,o),this._send(new dJe(this._workerId,n,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new hJe(this._workerId,n)),n=null}});return o.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 n=e.err;e.err.$isError&&(n=new Error,n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack),t.reject(n);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(o=>{this._send(new Ooe(this._workerId,t,o,void 0))},o=>{o.detail instanceof Error&&(o.detail=doe(o.detail)),this._send(new Ooe(this._workerId,t,void 0,doe(o)))})}_handleSubscribeEventMessage(e){const t=e.req,n=this._handler.handleEvent(e.eventName,e.arg)(o=>{this._send(new uJe(this._workerId,t,o))});this._pendingEvents.set(t,n)}_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 n=0;n{this._protocol.handleMessage(d)},d=>{o==null||o(d)})),this._protocol=new fJe({sendMessage:(d,u)=>{this._worker.postMessage(d,u)},handleMessage:(d,u)=>{if(typeof n[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(n[d].apply(n,u))}catch(h){return Promise.reject(h)}},handleEvent:(d,u)=>{if(I0e(d)){const h=n[d].call(n,u);if(typeof h!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return h}if(k0e(d)){const h=n[d];if(typeof h!="function")throw new Error(`Missing event ${d} on main thread host.`);return h}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let r=null;const s=globalThis.require;typeof s!="undefined"&&typeof s.getConfig=="function"?r=s.getConfig():typeof globalThis.requirejs!="undefined"&&(r=globalThis.requirejs.s.contexts._.config);const a=Oq(n);this._onModuleLoaded=this._protocol.sendMessage(lJe,[this._worker.getId(),JSON.parse(JSON.stringify(r)),t,a]);const l=(d,u)=>this._request(d,u),c=(d,u)=>this._protocol.listen(d,u);this._lazyProxy=new Promise((d,u)=>{o=u,this._onModuleLoaded.then(h=>{d(pJe(h,l,c))},h=>{u(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((n,o)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(n,o)},o)})}_onError(e,t){console.error(e),console.info(t)}}function k0e(i){return i[0]==="o"&&i[1]==="n"&&kh(i.charCodeAt(2))}function I0e(i){return/^onDynamic/.test(i)&&kh(i.charCodeAt(9))}function pJe(i,e,t){const n=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},o=s=>function(a){return t(s,a)},r={};for(const s of i){if(I0e(s)){r[s]=o(s);continue}if(k0e(s)){r[s]=t(s,void 0);continue}r[s]=n(s)}return r}function vp(i,e){var t;const n=globalThis.MonacoEnvironment;if(n!=null&&n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(i,e)}catch(o){en(o);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(i,e)}catch(o){en(o);return}}const Foe=vp("defaultWorkerFactory",{createScriptURL:i=>i});function mJe(i){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",i);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",i);return new Worker(Foe?Foe.createScriptURL(t):t,{name:i})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function vJe(i){return typeof i.then=="function"}class _Je{constructor(e,t,n,o,r){this.id=t,this.label=n;const s=mJe(n);vJe(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){o(l.data)},a.onmessageerror=r,typeof a.addEventListener=="function"&&a.addEventListener("error",r)})}getId(){return this.id}postMessage(e,t){var n;(n=this.worker)===null||n===void 0||n.then(o=>{try{o.postMessage(e,t)}catch(r){en(r),en(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:r}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class o5{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,n){const o=++o5.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new _Je(e,o,this._label||"anonymous"+o,t,r=>{JV(r),this._webWorkerFailedBeforeError=r,n(r)})}}o5.LAST_WORKER_ID=0;var Ho;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(Ho||(Ho={}));class U6{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,n=e.notIn.length;t0&&i.getLanguageId(s-1)===o;)s--;return new CJe(i,o,s,r+1,i.getStartOffset(s),i.getEndOffset(r))}class CJe{constructor(e,t,n,o,r,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=o,this.firstCharOffset=r,this._lastCharOffset=s}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 Ch(i){return(i&3)!==0}class bw{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new U6(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new U6({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new U6({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:bw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:bw.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}}bw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> +Received: '{1}'.`,e,Mh.getLexeme(t)),r=t.offset,s=Mh.getLexeme(t);return this._parsingErrors.push({message:o,offset:r,lexeme:s,additionalInfo:n}),d0._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}}d0._parseError=new Error;class Me{static false(){return ua.INSTANCE}static true(){return Wa.INSTANCE}static has(e){return Wb.create(e)}static equals(e,t){return _S.create(e,t)}static notEquals(e,t){return q4.create(e,t)}static regex(e,t){return OD.create(e,t)}static in(e,t){return j4.create(e,t)}static notIn(e,t){return K4.create(e,t)}static not(e){return Vb.create(e)}static and(...e){return u0.create(e,null,!0)}static or(...e){return Lg.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}Me._parser=new d0({regexParsingWithErrorRecovery:!1});function XZe(i,e){const t=i?i.substituteConstants():void 0,n=e?e.substituteConstants():void 0;return!t&&!n?!0:!t||!n?!1:t.equals(n)}function dE(i,e){return i.cmp(e)}class ua{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 Wa.INSTANCE}}ua.INSTANCE=new ua;class Wa{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 ua.INSTANCE}}Wa.INSTANCE=new Wa;class Wb{static create(e,t=null){const n=Es.get(e);return typeof n=="boolean"?n?Wa.INSTANCE:ua.INSTANCE:new Wb(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:e0e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Es.get(this.key);return typeof e=="boolean"?e?Wa.INSTANCE:ua.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Vb.create(this.key,this)),this.negated}}class _S{static create(e,t,n=null){if(typeof t=="boolean")return t?Wb.create(e,n):Vb.create(e,n);const o=Es.get(e);return typeof o=="boolean"?t===(o?"true":"false")?Wa.INSTANCE:ua.INSTANCE:new _S(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Hb(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=Es.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Wa.INSTANCE:ua.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=q4.create(this.key,this.value,this)),this.negated}}class j4{static create(e,t){return new j4(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:Hb(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),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n=="string"&&typeof t=="object"&&t!==null?VZe.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=K4.create(this.key,this.valueKey)),this.negated}}class K4{static create(e,t){return new K4(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=j4.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class q4{static create(e,t,n=null){if(typeof t=="boolean")return t?Vb.create(e,n):Wb.create(e,n);const o=Es.get(e);return typeof o=="boolean"?t===(o?"true":"false")?ua.INSTANCE:Wa.INSTANCE:new q4(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Hb(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=Es.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ua.INSTANCE:Wa.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_S.create(this.key,this.value,this)),this.negated}}class Vb{static create(e,t=null){const n=Es.get(e);return typeof n=="boolean"?n?ua.INSTANCE:Wa.INSTANCE:new Vb(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:e0e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Es.get(this.key);return typeof e=="boolean"?e?ua.INSTANCE:Wa.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Wb.create(this.key,this)),this.negated}}function G4(i,e){if(typeof i=="string"){const t=parseFloat(i);isNaN(t)||(i=t)}return typeof i=="string"||typeof i=="number"?e(i):ua.INSTANCE}class X4{static create(e,t,n=null){return G4(t,o=>new X4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Hb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Q4.create(this.key,this.value,this)),this.negated}}class Y4{static create(e,t,n=null){return G4(t,o=>new Y4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Hb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Z4.create(this.key,this.value,this)),this.negated}}class Z4{static create(e,t,n=null){return G4(t,o=>new Z4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Hb(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 Q4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Hb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=X4.create(this.key,this.value,this)),this.negated}}class OD{static create(e,t){return new OD(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:"",n=e.regexp?e.regexp.source:"";return tn?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=oG.create(this)),this.negated}}class oG{static create(e){return new oG(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function J_e(i){let e=null;for(let t=0,n=i.length;te.expr.length)return 1;for(let t=0,n=this.expr.length;t1;){const s=o[o.length-1];if(s.type!==9)break;o.pop();const a=o.pop(),l=o.length===0,c=Lg.create(s.expr.map(d=>u0.create([d,a],null,n)),null,l);c&&(o.push(c),o.sort(dE))}if(o.length===1)return o[0];if(n){for(let s=0;se.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=Lg.create(e,this,!0)}return this.negated}}class Lg{static create(e,t,n){return Lg._normalizeArr(e,t,n)}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,n=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(),n=e.shift(),o=[];for(const r of yoe(t))for(const s of yoe(n))o.push(u0.create([r,s],null,!1));e.unshift(Lg.create(o,null,!1))}this.negated=Lg.create(e,this,!0)}return this.negated}}class lt extends Wb{static all(){return lt._info.values()}constructor(e,t,n){super(e,null),this._defaultValue=t,typeof n=="object"?lt._info.push(Object.assign(Object.assign({},n),{key:e})):n!==!0&<._info.push({key:e,description:n,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 _S.create(this.key,e)}}lt._info=[];const Ut=yn("contextKeyService");function e0e(i,e){return ie?1:0}function Hb(i,e,t,n){return it?1:en?1:0}function qV(i,e){if(i.type===0||e.type===1)return!0;if(i.type===9)return e.type===9?Coe(i.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(qV(i,t))return!0;return!1}if(i.type===6){if(e.type===6)return Coe(e.expr,i.expr);for(const t of i.expr)if(qV(t,e))return!0;return!1}return i.equals(e)}function Coe(i,e){let t=0,n=0;for(;t>>0,n=(i&4294901760)>>>16;return n!==0?new A6([r2(t,e),r2(n,e)]):new A6([r2(t,e)])}else{const t=[];for(let n=0;n{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(eQe)),this._cachedMergedKeybindings.slice(0)}}const Va=new rG,JZe={EditorModes:"platform.keybindingsRegistry"};no.add(JZe.EditorModes,Va);function eQe(i,e){if(i.weight1!==e.weight1)return i.weight1-e.weight1;if(i.command&&e.command){if(i.commande.command)return 1}return i.weight2-e.weight2}var tQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},woe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},nQe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);ot===e}}Eg._all=new Map;const Hr=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new OYe({merge:Eg.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(i){return this._commands.set(i.id,i),this._onDidChangeMenu.fire(Eg.for(Z.CommandPalette)),zt(()=>{this._commands.delete(i.id)&&this._onDidChangeMenu.fire(Eg.for(Z.CommandPalette))})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((e,t)=>i.set(t,e)),i}appendMenuItem(i,e){let t=this._menuItems.get(i);t||(t=new oa,this._menuItems.set(i,t));const n=t.push(e);return this._onDidChangeMenu.fire(Eg.for(i)),zt(()=>{n(),this._onDidChangeMenu.fire(Eg.for(i))})}appendMenuItems(i){const e=new Be;for(const{id:t,item:n}of i)e.add(this.appendMenuItem(t,n));return e}getMenuItems(i){let e;return this._menuItems.has(i)?e=[...this._menuItems.get(i)]:e=[],i===Z.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(i){const e=new Set;for(const t of i)NC(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,n)=>{e.has(n)||i.push({command:t})})}};class BD extends _w{constructor(e,t,n){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,n,"submenu"),this.item=e,this.hideActions=t}}let Fd=nM=class{static label(e,t){return(t==null?void 0: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,n,o,r,s){var a,l;this.hideActions=o,this._commandService=s,this.id=e.id,this.label=nM.label(e,n),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||r.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const d=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(d.condition),this.checked&&d.tooltip&&(this.tooltip=typeof d.tooltip=="string"?d.tooltip:d.tooltip.value),this.checked&&Mt.isThemeIcon(d.icon)&&(c=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}c||(c=Mt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new nM(t,void 0,n,o,r,s):void 0,this._options=n,this.class=c&&Mt.asClassName(c)}run(...e){var t,n;let o=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(o=[...o,this._options.arg]),!((n=this._options)===null||n===void 0)&&n.shouldForwardArgs&&(o=[...o,...e]),this._commandService.executeCommand(this.id,...o)}};Fd=nM=tQe([woe(4,Ut),woe(5,_o)],Fd);class ec{constructor(e){this.desc=e}}function $i(i){const e=new Be,t=new i,n=t.desc,{f1:o,menu:r,keybinding:s,description:a}=n,l=nQe(n,["f1","menu","keybinding","description"]);if(e.add(Rn.registerCommand({id:l.id,handler:(c,...d)=>t.run(c,...d),description:a})),Array.isArray(r))for(const c of r)e.add(Hr.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else r&&e.add(Hr.appendMenuItem(r.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:r.precondition===null?void 0:l.precondition})},r)));if(o&&(e.add(Hr.appendMenuItem(Z.CommandPalette,{command:l,when:l.precondition})),e.add(Hr.addCommand(l))),Array.isArray(s))for(const c of s)e.add(Va.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?Me.and(l.precondition,c.when):c.when})));else s&&e.add(Va.registerKeybindingRule(Object.assign(Object.assign({},s),{id:l.id,when:l.precondition?Me.and(l.precondition,s.when):s.when})));return e}const tc=yn("telemetryService"),nc=yn("logService");var ns;(function(i){i[i.Off=0]="Off",i[i.Trace=1]="Trace",i[i.Debug=2]="Debug",i[i.Info=3]="Info",i[i.Warning=4]="Warning",i[i.Error=5]="Error"})(ns||(ns={}));const n0e=ns.Info;class i0e extends _e{constructor(){super(...arguments),this.level=n0e,this._onDidChangeLogLevel=this._register(new le),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!==ns.Off&&this.level<=e}}class oQe extends i0e{constructor(e=n0e,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(ns.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(ns.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(ns.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(ns.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(ns.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class rQe extends i0e{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 n of this.loggers)n.trace(e,...t)}debug(e,...t){for(const n of this.loggers)n.debug(e,...t)}info(e,...t){for(const n of this.loggers)n.info(e,...t)}warn(e,...t){for(const n of this.loggers)n.warn(e,...t)}error(e,...t){for(const n of this.loggers)n.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function sQe(i){switch(i){case ns.Trace:return"trace";case ns.Debug:return"debug";case ns.Info:return"info";case ns.Warning:return"warn";case ns.Error:return"error";case ns.Off:return"off"}}new lt("logLevel",sQe(ns.Info));const sG={clipboard:{writeText:Fu||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Fu||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>Fu||NZe()?0:navigator.keyboard||cp?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function aQe(i){if(i.charCode){const t=String.fromCharCode(i.charCode).toUpperCase();return xg.fromString(t)}const e=i.keyCode;if(e===3)return 7;if(Fc)switch(e){case 59:return 85;case 60:if(xs)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Nn)return 57;break}else if(D0){if(Nn&&e===93)return 57;if(!Nn&&e===92)return 57}return T_e[e]||0}const lQe=Nn?256:2048,cQe=512,dQe=1024,uQe=Nn?2048:256;class Pi{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=aQe(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|=lQe),this.altKey&&(t|=cQe),this.shiftKey&&(t|=dQe),this.metaKey&&(t|=uQe),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new dp(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let Soe=!1,Tx=null;function hQe(i){if(!i.parent||i.parent===i)return null;try{const e=i.location,t=i.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return Soe=!0,null}catch{return Soe=!0,null}return i.parent}class fQe{static getSameOriginWindowChain(){if(!Tx){Tx=[];let e=window,t;do t=hQe(e),t?Tx.push({window:e,iframeElement:e.frameElement||null}):Tx.push({window:e,iframeElement:null}),e=t;while(e)}return Tx.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,o=0;const r=this.getSameOriginWindowChain();for(const s of r){if(n+=s.window.scrollY,o+=s.window.scrollX,s.window===t||!s.iframeElement)break;const a=s.iframeElement.getBoundingClientRect();n+=a.top,o+=a.left}return{top:n,left:o}}}class kc{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=fQe.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class tb{constructor(e,t=0,n=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t,e){const o=e,r=e;if(typeof o.wheelDeltaY!="undefined")this.deltaY=o.wheelDeltaY/120;else if(typeof r.VERTICAL_AXIS!="undefined"&&r.axis===r.VERTICAL_AXIS)this.deltaY=-r.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?Fc&&!Nn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX!="undefined")cp&&ls?this.deltaX=-(o.wheelDeltaX/120):this.deltaX=o.wheelDeltaX/120;else if(typeof r.HORIZONTAL_AXIS!="undefined"&&r.axis===r.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?Fc&&!Nn?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:o0e,setPrototypeOf:xoe,isFrozen:gQe,getPrototypeOf:pQe,getOwnPropertyDescriptor:mQe}=Object;let{freeze:hl,seal:qu,create:vQe}=Object,{apply:XV,construct:YV}=typeof Reflect!="undefined"&&Reflect;XV||(XV=function(e,t,n){return e.apply(t,n)});hl||(hl=function(e){return e});qu||(qu=function(e){return e});YV||(YV=function(e,t){return new e(...t)});const _Qe=Bd(Array.prototype.forEach),Loe=Bd(Array.prototype.pop),Nx=Bd(Array.prototype.push),iM=Bd(String.prototype.toLowerCase),O6=Bd(String.prototype.toString),bQe=Bd(String.prototype.match),iu=Bd(String.prototype.replace),CQe=Bd(String.prototype.indexOf),yQe=Bd(String.prototype.trim),pc=Bd(RegExp.prototype.test),Rx=wQe(TypeError);function Bd(i){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o/gm),DQe=qu(/\${[\w\W]*}/gm),kQe=qu(/^data-[\-\w.\u00B7-\uFFFF]/),IQe=qu(/^aria-[\-\w]+$/),r0e=qu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),TQe=qu(/^(?:\w+script|data):/i),NQe=qu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),s0e=qu(/^html$/i);var Toe=Object.freeze({__proto__:null,MUSTACHE_EXPR:LQe,ERB_EXPR:EQe,TMPLIT_EXPR:DQe,DATA_ATTR:kQe,ARIA_ATTR:IQe,IS_ALLOWED_URI:r0e,IS_SCRIPT_OR_DATA:TQe,ATTR_WHITESPACE:NQe,DOCTYPE_NAME:s0e});const RQe=()=>typeof window=="undefined"?null:window,MQe=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function a0e(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:RQe();const e=Ze=>a0e(Ze);if(e.version="3.0.5",e.removed=[],!i||!i.document||i.document.nodeType!==9)return e.isSupported=!1,e;const t=i.document,n=t.currentScript;let{document:o}=i;const{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:f}=i,g=l.prototype,p=s2(g,"cloneNode"),v=s2(g,"nextSibling"),m=s2(g,"childNodes"),_=s2(g,"parentNode");if(typeof s=="function"){const Ze=o.createElement("template");Ze.content&&Ze.content.ownerDocument&&(o=Ze.content.ownerDocument)}let y,w="";const{implementation:L,createNodeIterator:D,createDocumentFragment:E,getElementsByTagName:I}=o,{importNode:k}=t;let R={};e.isSupported=typeof o0e=="function"&&typeof _=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:P,TMPLIT_EXPR:N,DATA_ATTR:M,ARIA_ATTR:H,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:F}=Toe;let{IS_ALLOWED_URI:$}=Toe,z=null;const K=hi({},[...Eoe,...F6,...B6,...W6,...Doe]);let j=null;const G=hi({},[...koe,...V6,...Ioe,...a2]);let X=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}})),ue=null,fe=null,pe=!0,be=!0,Se=!1,Fe=!0,De=!1,ce=!1,Pe=!1,Oe=!1,xe=!1,Ee=!1,tt=!1,nt=!0,Qe=!1;const Ge="user-content-";let re=!0,ie=!1,se={},U=null;const Y=hi({},["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 oe=null;const te=hi({},["audio","video","img","source","image","track"]);let ye=null;const Le=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Te="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",je="http://www.w3.org/1999/xhtml";let mt=je,Dt=!1,At=null;const Je=hi({},[Te,We,je],O6);let Lt;const Ot=["application/xhtml+xml","text/html"],Vn="text/html";let Et,tn=null;const di=o.createElement("form"),cn=function(de){return de instanceof RegExp||de instanceof Function},Gn=function(de){if(!(tn&&tn===de)){if((!de||typeof de!="object")&&(de={}),de=V1(de),Lt=Ot.indexOf(de.PARSER_MEDIA_TYPE)===-1?Lt=Vn:Lt=de.PARSER_MEDIA_TYPE,Et=Lt==="application/xhtml+xml"?O6:iM,z="ALLOWED_TAGS"in de?hi({},de.ALLOWED_TAGS,Et):K,j="ALLOWED_ATTR"in de?hi({},de.ALLOWED_ATTR,Et):G,At="ALLOWED_NAMESPACES"in de?hi({},de.ALLOWED_NAMESPACES,O6):Je,ye="ADD_URI_SAFE_ATTR"in de?hi(V1(Le),de.ADD_URI_SAFE_ATTR,Et):Le,oe="ADD_DATA_URI_TAGS"in de?hi(V1(te),de.ADD_DATA_URI_TAGS,Et):te,U="FORBID_CONTENTS"in de?hi({},de.FORBID_CONTENTS,Et):Y,ue="FORBID_TAGS"in de?hi({},de.FORBID_TAGS,Et):{},fe="FORBID_ATTR"in de?hi({},de.FORBID_ATTR,Et):{},se="USE_PROFILES"in de?de.USE_PROFILES:!1,pe=de.ALLOW_ARIA_ATTR!==!1,be=de.ALLOW_DATA_ATTR!==!1,Se=de.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=de.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=de.SAFE_FOR_TEMPLATES||!1,ce=de.WHOLE_DOCUMENT||!1,xe=de.RETURN_DOM||!1,Ee=de.RETURN_DOM_FRAGMENT||!1,tt=de.RETURN_TRUSTED_TYPE||!1,Oe=de.FORCE_BODY||!1,nt=de.SANITIZE_DOM!==!1,Qe=de.SANITIZE_NAMED_PROPS||!1,re=de.KEEP_CONTENT!==!1,ie=de.IN_PLACE||!1,$=de.ALLOWED_URI_REGEXP||r0e,mt=de.NAMESPACE||je,X=de.CUSTOM_ELEMENT_HANDLING||{},de.CUSTOM_ELEMENT_HANDLING&&cn(de.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=de.CUSTOM_ELEMENT_HANDLING.tagNameCheck),de.CUSTOM_ELEMENT_HANDLING&&cn(de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),de.CUSTOM_ELEMENT_HANDLING&&typeof de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(be=!1),Ee&&(xe=!0),se&&(z=hi({},[...Doe]),j=[],se.html===!0&&(hi(z,Eoe),hi(j,koe)),se.svg===!0&&(hi(z,F6),hi(j,V6),hi(j,a2)),se.svgFilters===!0&&(hi(z,B6),hi(j,V6),hi(j,a2)),se.mathMl===!0&&(hi(z,W6),hi(j,Ioe),hi(j,a2))),de.ADD_TAGS&&(z===K&&(z=V1(z)),hi(z,de.ADD_TAGS,Et)),de.ADD_ATTR&&(j===G&&(j=V1(j)),hi(j,de.ADD_ATTR,Et)),de.ADD_URI_SAFE_ATTR&&hi(ye,de.ADD_URI_SAFE_ATTR,Et),de.FORBID_CONTENTS&&(U===Y&&(U=V1(U)),hi(U,de.FORBID_CONTENTS,Et)),re&&(z["#text"]=!0),ce&&hi(z,["html","head","body"]),z.table&&(hi(z,["tbody"]),delete ue.tbody),de.TRUSTED_TYPES_POLICY){if(typeof de.TRUSTED_TYPES_POLICY.createHTML!="function")throw Rx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof de.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Rx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=de.TRUSTED_TYPES_POLICY,w=y.createHTML("")}else y===void 0&&(y=MQe(f,n)),y!==null&&typeof w=="string"&&(w=y.createHTML(""));hl&&hl(de),tn=de}},bn=hi({},["mi","mo","mn","ms","mtext"]),Pt=hi({},["foreignobject","desc","title","annotation-xml"]),qt=hi({},["title","style","font","a","script"]),Nt=hi({},F6);hi(Nt,B6),hi(Nt,SQe);const jt=hi({},W6);hi(jt,xQe);const Gt=function(de){let Ve=_(de);(!Ve||!Ve.tagName)&&(Ve={namespaceURI:mt,tagName:"template"});const ot=iM(de.tagName),Sn=iM(Ve.tagName);return At[de.namespaceURI]?de.namespaceURI===We?Ve.namespaceURI===je?ot==="svg":Ve.namespaceURI===Te?ot==="svg"&&(Sn==="annotation-xml"||bn[Sn]):Boolean(Nt[ot]):de.namespaceURI===Te?Ve.namespaceURI===je?ot==="math":Ve.namespaceURI===We?ot==="math"&&Pt[Sn]:Boolean(jt[ot]):de.namespaceURI===je?Ve.namespaceURI===We&&!Pt[Sn]||Ve.namespaceURI===Te&&!bn[Sn]?!1:!jt[ot]&&(qt[ot]||!Nt[ot]):!!(Lt==="application/xhtml+xml"&&At[de.namespaceURI]):!1},It=function(de){Nx(e.removed,{element:de});try{de.parentNode.removeChild(de)}catch{de.remove()}},Ft=function(de,Ve){try{Nx(e.removed,{attribute:Ve.getAttributeNode(de),from:Ve})}catch{Nx(e.removed,{attribute:null,from:Ve})}if(Ve.removeAttribute(de),de==="is"&&!j[de])if(xe||Ee)try{It(Ve)}catch{}else try{Ve.setAttribute(de,"")}catch{}},Ct=function(de){let Ve,ot;if(Oe)de=""+de;else{const Ci=bQe(de,/^[\r\n\t ]+/);ot=Ci&&Ci[0]}Lt==="application/xhtml+xml"&&mt===je&&(de=''+de+"");const Sn=y?y.createHTML(de):de;if(mt===je)try{Ve=new h().parseFromString(Sn,Lt)}catch{}if(!Ve||!Ve.documentElement){Ve=L.createDocument(mt,"template",null);try{Ve.documentElement.innerHTML=Dt?w:Sn}catch{}}const $n=Ve.body||Ve.documentElement;return de&&ot&&$n.insertBefore(o.createTextNode(ot),$n.childNodes[0]||null),mt===je?I.call(Ve,ce?"html":"body")[0]:ce?Ve.documentElement:$n},Zt=function(de){return D.call(de.ownerDocument||de,de,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},wn=function(de){return de instanceof u&&(typeof de.nodeName!="string"||typeof de.textContent!="string"||typeof de.removeChild!="function"||!(de.attributes instanceof d)||typeof de.removeAttribute!="function"||typeof de.setAttribute!="function"||typeof de.namespaceURI!="string"||typeof de.insertBefore!="function"||typeof de.hasChildNodes!="function")},Dn=function(de){return typeof a=="object"?de instanceof a:de&&typeof de=="object"&&typeof de.nodeType=="number"&&typeof de.nodeName=="string"},Xn=function(de,Ve,ot){!R[de]||_Qe(R[de],Sn=>{Sn.call(e,Ve,ot,tn)})},jn=function(de){let Ve;if(Xn("beforeSanitizeElements",de,null),wn(de))return It(de),!0;const ot=Et(de.nodeName);if(Xn("uponSanitizeElement",de,{tagName:ot,allowedTags:z}),de.hasChildNodes()&&!Dn(de.firstElementChild)&&(!Dn(de.content)||!Dn(de.content.firstElementChild))&&pc(/<[/\w]/g,de.innerHTML)&&pc(/<[/\w]/g,de.textContent))return It(de),!0;if(!z[ot]||ue[ot]){if(!ue[ot]&&an(ot)&&(X.tagNameCheck instanceof RegExp&&pc(X.tagNameCheck,ot)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ot)))return!1;if(re&&!U[ot]){const Sn=_(de)||de.parentNode,$n=m(de)||de.childNodes;if($n&&Sn){const Ci=$n.length;for(let An=Ci-1;An>=0;--An)Sn.insertBefore(p($n[An],!0),v(de))}}return It(de),!0}return de instanceof l&&!Gt(de)||(ot==="noscript"||ot==="noembed"||ot==="noframes")&&pc(/<\/no(script|embed|frames)/i,de.innerHTML)?(It(de),!0):(De&&de.nodeType===3&&(Ve=de.textContent,Ve=iu(Ve,A," "),Ve=iu(Ve,P," "),Ve=iu(Ve,N," "),de.textContent!==Ve&&(Nx(e.removed,{element:de.cloneNode()}),de.textContent=Ve)),Xn("afterSanitizeElements",de,null),!1)},Zi=function(de,Ve,ot){if(nt&&(Ve==="id"||Ve==="name")&&(ot in o||ot in di))return!1;if(!(be&&!fe[Ve]&&pc(M,Ve))){if(!(pe&&pc(H,Ve))){if(!j[Ve]||fe[Ve]){if(!(an(de)&&(X.tagNameCheck instanceof RegExp&&pc(X.tagNameCheck,de)||X.tagNameCheck instanceof Function&&X.tagNameCheck(de))&&(X.attributeNameCheck instanceof RegExp&&pc(X.attributeNameCheck,Ve)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(Ve))||Ve==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&pc(X.tagNameCheck,ot)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ot))))return!1}else if(!ye[Ve]){if(!pc($,iu(ot,F,""))){if(!((Ve==="src"||Ve==="xlink:href"||Ve==="href")&&de!=="script"&&CQe(ot,"data:")===0&&oe[de])){if(!(Se&&!pc(B,iu(ot,F,"")))){if(ot)return!1}}}}}}return!0},an=function(de){return de.indexOf("-")>0},Xt=function(de){let Ve,ot,Sn,$n;Xn("beforeSanitizeAttributes",de,null);const{attributes:Ci}=de;if(!Ci)return;const An={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for($n=Ci.length;$n--;){Ve=Ci[$n];const{name:lo,namespaceURI:Qo}=Ve;if(ot=lo==="value"?Ve.value:yQe(Ve.value),Sn=Et(lo),An.attrName=Sn,An.attrValue=ot,An.keepAttr=!0,An.forceKeepAttr=void 0,Xn("uponSanitizeAttribute",de,An),ot=An.attrValue,An.forceKeepAttr||(Ft(lo,de),!An.keepAttr))continue;if(!Fe&&pc(/\/>/i,ot)){Ft(lo,de);continue}De&&(ot=iu(ot,A," "),ot=iu(ot,P," "),ot=iu(ot,N," "));const zo=Et(de.nodeName);if(!!Zi(zo,Sn,ot)){if(Qe&&(Sn==="id"||Sn==="name")&&(Ft(lo,de),ot=Ge+ot),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Qo)switch(f.getAttributeType(zo,Sn)){case"TrustedHTML":{ot=y.createHTML(ot);break}case"TrustedScriptURL":{ot=y.createScriptURL(ot);break}}try{Qo?de.setAttributeNS(Qo,lo,ot):de.setAttribute(lo,ot),Loe(e.removed)}catch{}}}Xn("afterSanitizeAttributes",de,null)},oi=function Ze(de){let Ve;const ot=Zt(de);for(Xn("beforeSanitizeShadowDOM",de,null);Ve=ot.nextNode();)Xn("uponSanitizeShadowNode",Ve,null),!jn(Ve)&&(Ve.content instanceof r&&Ze(Ve.content),Xt(Ve));Xn("afterSanitizeShadowDOM",de,null)};return e.sanitize=function(Ze){let de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ve,ot,Sn,$n;if(Dt=!Ze,Dt&&(Ze=""),typeof Ze!="string"&&!Dn(Ze))if(typeof Ze.toString=="function"){if(Ze=Ze.toString(),typeof Ze!="string")throw Rx("dirty is not a string, aborting")}else throw Rx("toString is not a function");if(!e.isSupported)return Ze;if(Pe||Gn(de),e.removed=[],typeof Ze=="string"&&(ie=!1),ie){if(Ze.nodeName){const lo=Et(Ze.nodeName);if(!z[lo]||ue[lo])throw Rx("root node is forbidden and cannot be sanitized in-place")}}else if(Ze instanceof a)Ve=Ct(""),ot=Ve.ownerDocument.importNode(Ze,!0),ot.nodeType===1&&ot.nodeName==="BODY"||ot.nodeName==="HTML"?Ve=ot:Ve.appendChild(ot);else{if(!xe&&!De&&!ce&&Ze.indexOf("<")===-1)return y&&tt?y.createHTML(Ze):Ze;if(Ve=Ct(Ze),!Ve)return xe?null:tt?w:""}Ve&&Oe&&It(Ve.firstChild);const Ci=Zt(ie?Ze:Ve);for(;Sn=Ci.nextNode();)jn(Sn)||(Sn.content instanceof r&&oi(Sn.content),Xt(Sn));if(ie)return Ze;if(xe){if(Ee)for($n=E.call(Ve.ownerDocument);Ve.firstChild;)$n.appendChild(Ve.firstChild);else $n=Ve;return(j.shadowroot||j.shadowrootmode)&&($n=k.call(t,$n,!0)),$n}let An=ce?Ve.outerHTML:Ve.innerHTML;return ce&&z["!doctype"]&&Ve.ownerDocument&&Ve.ownerDocument.doctype&&Ve.ownerDocument.doctype.name&&pc(s0e,Ve.ownerDocument.doctype.name)&&(An=" +`+An),De&&(An=iu(An,A," "),An=iu(An,P," "),An=iu(An,N," ")),y&&tt?y.createHTML(An):An},e.setConfig=function(Ze){Gn(Ze),Pe=!0},e.clearConfig=function(){tn=null,Pe=!1},e.isValidAttribute=function(Ze,de,Ve){tn||Gn({});const ot=Et(Ze),Sn=Et(de);return Zi(ot,Sn,Ve)},e.addHook=function(Ze,de){typeof de=="function"&&(R[Ze]=R[Ze]||[],Nx(R[Ze],de))},e.removeHook=function(Ze){if(R[Ze])return Loe(R[Ze])},e.removeHooks=function(Ze){R[Ze]&&(R[Ze]=[])},e.removeAllHooks=function(){R={}},e}var Tf=a0e();Tf.version;Tf.isSupported;const l0e=Tf.sanitize;Tf.setConfig;Tf.clearConfig;Tf.isValidAttribute;const c0e=Tf.addHook,d0e=Tf.removeHook;Tf.removeHooks;Tf.removeAllHooks;var hn;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatSesssion="vscode-chat-editor",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm"})(hn||(hn={}));const AQe="tkn";class PQe{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${hn.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return en(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const o=this._ports[t],r=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof r=="string"&&(s+=`&${AQe}=${encodeURIComponent(r)}`),Rt.from({scheme:Xv?this._preferredWebSchema:hn.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:s})}}const u0e=new PQe;class WD{uriToBrowserUri(e){return e.scheme===hn.vscodeRemote?u0e.rewrite(e):e.scheme===hn.file&&(Fu||IXe&&Id.origin===`${hn.vscodeFileResource}://${WD.FALLBACK_AUTHORITY}`)?e.with({scheme:hn.vscodeFileResource,authority:e.authority||WD.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}WD.FALLBACK_AUTHORITY="vscode-app";const h0e=new WD;var Noe;(function(i){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"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(r){let s;typeof r=="string"?s=new URL(r).searchParams:r instanceof URL?s=r.searchParams:Rt.isUri(r)&&(s=new URL(r.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(!!a)return e.get(a)}i.getHeadersFromQuery=n;function o(r,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";r instanceof URLSearchParams?r.set(t,l):r[t]=l}i.addSearchParam=o})(Noe||(Noe={}));const{registerWindow:RNt,getWindows:OQe,onDidCreateWindow:MNt}=function(){const i=[],e=new le;return{onDidCreateWindow:e.event,registerWindow(t){i.push(t);const n=new Be;return n.add(zt(()=>{const o=i.indexOf(t);o!==-1&&i.splice(o,1)})),e.fire({window:t,disposableStore:n}),n},getWindows(){return i}}}();function Ur(i){for(;i.firstChild;)i.firstChild.remove()}function aG(i){var e;return(e=i==null?void 0:i.isConnected)!==null&&e!==void 0?e:!1}class FQe{constructor(e,t,n,o){this._node=e,this._type=t,this._handler=n,this._options=o||!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 ke(i,e,t,n){return new FQe(i,e,t,n)}function f0e(i){return function(e){return i(new kc(e))}}function BQe(i){return function(e){return i(new Pi(e))}}const No=function(e,t,n,o){let r=n;return t==="click"||t==="mousedown"?r=f0e(n):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=BQe(n)),ke(e,t,r,o)},WQe=function(e,t,n){const o=f0e(t);return VQe(e,o,n)};function VQe(i,e,t){return ke(i,Ku&&sG.pointerEvents?et.POINTER_DOWN:et.MOUSE_DOWN,e,t)}let GA,Bc;class H6{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){en(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let i=[],e=null,t=!1,n=!1;const o=()=>{for(t=!1,e=i,i=[],n=!0;e.length>0;)e.sort(H6.sort),e.shift().execute();n=!1};Bc=(r,s=0)=>{const a=new H6(r,s);return i.push(a),t||(t=!0,requestAnimationFrame(o)),a},GA=(r,s)=>{if(n){const a=new H6(r,s);return e.push(a),a}else return Bc(r,s)}})();function e5(i){return i.ownerDocument.defaultView.getComputedStyle(i,null)}function bS(i){var e;const t=i.ownerDocument,n=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(i!==t.body)return new Kn(i.clientWidth,i.clientHeight);if(Ku&&(n==null?void 0:n.visualViewport))return new Kn(n.visualViewport.width,n.visualViewport.height);if((n==null?void 0:n.innerWidth)&&n.innerHeight)return new Kn(n.innerWidth,n.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new Kn(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new Kn(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class wo{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,n){const o=e5(e),r=o?o.getPropertyValue(t):"0";return wo.convertToPixels(e,r)}static getBorderLeftWidth(e){return wo.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return wo.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return wo.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return wo.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return wo.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return wo.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return wo.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return wo.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return wo.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return wo.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return wo.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return wo.getDimension(e,"margin-bottom","marginBottom")}}class Kn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Kn(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Kn?e:new Kn(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Kn.None=new Kn(0,0);function g0e(i){let e=i.offsetParent,t=i.offsetTop,n=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){t-=i.scrollTop;const o=p0e(i)?null:e5(i);o&&(n-=o.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(n+=wo.getBorderLeftWidth(i),t+=wo.getBorderTopWidth(i),t+=i.offsetTop,n+=i.offsetLeft,e=i.offsetParent)}return{left:n,top:t}}function HQe(i,e,t){typeof e=="number"&&(i.style.width=`${e}px`),typeof t=="number"&&(i.style.height=`${t}px`)}function Yo(i){var e,t,n,o;const r=i.getBoundingClientRect();return{left:r.left+((t=(e=i.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:r.top+((o=(n=i.ownerDocument.defaultView)===null||n===void 0?void 0:n.scrollY)!==null&&o!==void 0?o:0),width:r.width,height:r.height}}function $Qe(i){let e=i,t=1;do{const n=e5(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Ea(i){const e=wo.getMarginLeft(i)+wo.getMarginRight(i);return i.offsetWidth+e}function $6(i){const e=wo.getBorderLeftWidth(i)+wo.getBorderRightWidth(i),t=wo.getPaddingLeft(i)+wo.getPaddingRight(i);return i.offsetWidth-e-t}function zQe(i){const e=wo.getBorderTopWidth(i)+wo.getBorderBottomWidth(i),t=wo.getPaddingTop(i)+wo.getPaddingBottom(i);return i.offsetHeight-e-t}function h0(i){const e=wo.getMarginTop(i)+wo.getMarginBottom(i);return i.offsetHeight+e}function rs(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function UQe(i,e,t){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(t){if(typeof t=="string"){if(i.classList.contains(t))return null}else if(i===t)return null}i=i.parentNode}return null}function z6(i,e,t){return!!UQe(i,e,t)}function p0e(i){return i&&!!i.host&&!!i.mode}function XA(i){return!!nb(i)}function nb(i){for(var e;i.parentNode;){if(i===((e=i.ownerDocument)===null||e===void 0?void 0:e.body))return null;i=i.parentNode}return p0e(i)?i:null}function Nd(){let i=t5().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function t5(){var i;return(i=[document,...OQe().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&i!==void 0?i:document}function Wc(i=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),i.appendChild(t),t}let U6=null;function m0e(){return U6||(U6=Wc()),U6}function jQe(i){var e,t;return!((e=i==null?void 0:i.sheet)===null||e===void 0)&&e.rules?i.sheet.rules:!((t=i==null?void 0:i.sheet)===null||t===void 0)&&t.cssRules?i.sheet.cssRules:[]}function ZV(i,e,t=m0e()){!t||!e||t.sheet.insertRule(i+"{"+e+"}",0)}function Roe(i,e=m0e()){if(!e)return;const t=jQe(e),n=[];for(let o=0;o=0;o--)e.sheet.deleteRule(n[o])}function lG(i){return typeof HTMLElement=="object"?i instanceof HTMLElement:i&&typeof i=="object"&&i.nodeType===1&&typeof i.nodeName=="string"}const et={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:D0?"webkitAnimationStart":"animationstart",ANIMATION_END:D0?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:D0?"webkitAnimationIteration":"animationiteration"};function KQe(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const un={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function qQe(i){const e=[];for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)e[t]=i.scrollTop,i=i.parentNode;return e}function GQe(i,e){for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)i.scrollTop!==e[t]&&(i.scrollTop=e[t]),i=i.parentNode}class YA extends _e{static hasFocusWithin(e){if(lG(e)){const t=nb(e),n=t?t.activeElement:e.ownerDocument.activeElement;return rs(n,e)}else return rs(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event;let t=YA.hasFocusWithin(e),n=!1;const o=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(n=!0,window.setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{YA.hasFocusWithin(e)!==t&&(t?r():o())},this._register(ke(e,et.FOCUS,o,!0)),this._register(ke(e,et.BLUR,r,!0)),e instanceof HTMLElement&&(this._register(ke(e,et.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ke(e,et.FOCUS_OUT,()=>this._refreshStateHandler())))}}function pf(i){return new YA(i)}function Ae(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function v0e(i,e){return i.insertBefore(e,i.firstChild),e}function jr(i,...e){i.innerText="",Ae(i,...e)}const XQe=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var VD;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(VD||(VD={}));function _0e(i,e,t,...n){const o=XQe.exec(e);if(!o)throw new Error("Bad use of emmet");const r=o[1]||"div";let s;return i!==VD.HTML?s=document.createElementNS(i,r):s=document.createElement(r),o[3]&&(s.id=o[3]),o[4]&&(s.className=o[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l!="undefined"&&(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...n),s}function He(i,e,...t){return _0e(VD.HTML,i,e,...t)}He.SVG=function(i,e,...t){return _0e(VD.SVG,i,e,...t)};function YQe(i,...e){i?nl(...e):Js(...e)}function nl(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function Js(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function Moe(i){const e=window.devicePixelRatio*i;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function b0e(i){window.open(i,"_blank","noopener")}function ZQe(i){const e=()=>{i(),t=Bc(e)};let t=Bc(e);return zt(()=>t.dispose())}u0e.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function Sv(i){return i?`url('${h0e.uriToBrowserUri(i).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Aoe(i){return`'${i.replace(/'/g,"%27")}'`}function I0(i,e){if(i!==void 0){const t=i.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=I0(n[1].trim(),e)),`var(${n[0]}, ${e})`}return i}return e}function QQe(i,e=!1){const t=document.createElement("a");return c0e("afterSanitizeAttributes",n=>{for(const o of["href","src"])if(n.hasAttribute(o)){const r=n.getAttribute(o);if(o==="href"&&r.startsWith("#"))continue;if(t.href=r,!i.includes(t.protocol.replace(/:$/,""))){if(e&&o==="src"&&t.href.startsWith("data:"))continue;n.removeAttribute(o)}}}),zt(()=>{d0e("afterSanitizeAttributes")})}const JQe=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"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type","start"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class Mg extends le{constructor(){super(),this._subscriptions=new Be,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ke(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Pi(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(ke(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(ke(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ke(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ke(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(ke(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 Mg.instance||(Mg.instance=new Mg),Mg.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class eJe extends _e{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(ke(this.element,et.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(ke(this.element,et.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)===null||n===void 0||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(ke(this.element,et.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(ke(this.element,et.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(ke(this.element,et.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const tJe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Or(i,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const o=tJe.exec(i);if(!o||!o.groups)throw new Error("Bad use of h");const r=o.groups.tag||"div",s=document.createElement(r);o.groups.id&&(s.id=o.groups.id);const a=[];if(o.groups.class)for(const c of o.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&&(s.className=a.join(" "));const l={};if(o.groups.name&&(l[o.groups.name]=s),n)for(const c of n)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.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))s.style.setProperty(Poe(u),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=d:s.setAttribute(Poe(c),d.toString());return l.root=s,l}function Poe(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class n5{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 n=t.kbExpr;this.precondition&&(n?n=Me.and(n,this.precondition):n=this.precondition);const o={id:this.id,weight:t.weight,args:t.args,when:n,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Va.registerKeybindingRule(o)}}Rn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Hr.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 CS extends n5{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n,o){return this._implementations.push({priority:e,name:t,implementation:n,when:o}),this._implementations.sort((r,s)=>s.priority-r.priority),{dispose:()=>{for(let r=0;r{if(!!a.get(Ut).contextMatchesRules(n!=null?n:void 0))return o(a,s,t)})}runCommand(e,t){return Ir.runEditorCommand(e,t,this.precondition,(n,o,r)=>this.runEditorCommand(n,o,r))}}class ft extends Ir{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function n(o){return o.menuId||(o.menuId=Z.EditorContext),o.title||(o.title=e.label),o.when=Me.and(e.precondition,o.when),o}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(ft.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(tc).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class y0e extends ft{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((n,o)=>o[0]-n[0]),{dispose:()=>{for(let n=0;n{var s,a;const l=r.get(Ut),c=r.get(nc);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s: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(r,o,...t)})}}function Nf(i,e){Rn.registerCommand(i,function(t,...n){const o=t.get($t),[r,s]=n;fi(Rt.isUri(r)),fi(ae.isIPosition(s));const a=t.get(Yi).getModel(r);if(a){const l=ae.lift(s);return o.invokeFunction(e,a,l,...n.slice(2))}return t.get(za).createModelReference(r).then(l=>new Promise((c,d)=>{try{const u=o.invokeFunction(e,l.object.textEditorModel,ae.lift(s),n.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function Ye(i){return Lc.INSTANCE.registerEditorCommand(i),i}function ze(i){const e=new i;return Lc.INSTANCE.registerEditorAction(e),e}function w0e(i){return Lc.INSTANCE.registerEditorAction(i),i}function nJe(i){Lc.INSTANCE.registerEditorAction(i)}function Un(i,e,t){Lc.INSTANCE.registerEditorContribution(i,e,t)}var by;(function(i){function e(s){return Lc.INSTANCE.getEditorCommand(s)}i.getEditorCommand=e;function t(){return Lc.INSTANCE.getEditorActions()}i.getEditorActions=t;function n(){return Lc.INSTANCE.getEditorContributions()}i.getEditorContributions=n;function o(s){return Lc.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}i.getSomeEditorContributions=o;function r(){return Lc.INSTANCE.getDiffEditorContributions()}i.getDiffEditorContributions=r})(by||(by={}));const iJe={EditorCommonContributions:"editor.contributions"};class Lc{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,n){this.editorContributions.push({id:e,ctor:t,instantiation:n})}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}}Lc.INSTANCE=new Lc;no.add(iJe.EditorCommonContributions,Lc.INSTANCE);function zI(i){return i.register(),i}const S0e=zI(new CS({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:Z.MenubarEditMenu,group:"1_do",title:C({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:Z.CommandPalette,group:"",title:C("undo","Undo"),order:1}]}));zI(new C0e(S0e,{id:"default:undo",precondition:void 0}));const x0e=zI(new CS({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:Z.MenubarEditMenu,group:"1_do",title:C({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:Z.CommandPalette,group:"",title:C("redo","Redo"),order:1}]}));zI(new C0e(x0e,{id:"default:redo",precondition:void 0}));const oJe=zI(new CS({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:Z.CommandPalette,group:"",title:C("selectAll","Select All"),order:1}]})),L0e=Symbol("MicrotaskDelay");var vc=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},bL=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};function QV(i){return!!i&&typeof i.then=="function"}function sr(i){const e=new Ro,t=i(e.token),n=new Promise((o,r)=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),r(new Yv)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),o(a)},a=>{s.dispose(),e.dispose(),r(a)})});return new class{cancel(){e.cancel()}then(o,r){return n.then(o,r)}catch(o){return this.then(void 0,o)}finally(o){return n.finally(o)}}}function i5(i,e,t){return new Promise((n,o)=>{const r=e.onCancellationRequested(()=>{r.dispose(),n(t)});i.then(n,o).finally(()=>r.dispose())})}class rJe{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 n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(),new Promise((t,n)=>{this.activePromise.then(o=>{this.activePromise=null,t(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.isDisposed=!0}}const sJe=(i,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},i);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},aJe=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Wd{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((o,r)=>{this.doResolve=o,this.doReject=r}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const o=this.task;return this.task=null,o()}}));const n=()=>{var o;this.deferred=null,(o=this.doResolve)===null||o===void 0||o.call(this,null)};return this.deferred=t===L0e?aJe(n):sJe(t,n),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 Yv),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class E0e{constructor(e){this.delayer=new Wd(e),this.throttler=new rJe}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function xv(i,e){return e?new Promise((t,n)=>{const o=setTimeout(()=>{r.dispose(),t()},i),r=e.onCancellationRequested(()=>{clearTimeout(o),r.dispose(),n(new Yv)})}):sr(t=>xv(i,t))}function Lv(i,e=0,t){const n=setTimeout(()=>{i(),t&&o.dispose()},e),o=zt(()=>{clearTimeout(n),t==null||t.deleteAndLeak(o)});return t==null||t.add(o),o}function D0e(i,e=n=>!!n,t=null){let n=0;const o=i.length,r=()=>{if(n>=o)return Promise.resolve(t);const s=i[n++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):r())};return r()}class zd{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 UI{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 bi{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 Ag;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?Ag=i=>{__e(()=>{if(e)return;const t=Date.now()+15;i(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:Ag=(i,e)=>{const t=requestIdleCallback(i,typeof e=="number"?{timeout:e}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(t))}}}})();class oM{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=Ag(()=>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 o5{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 Yv)}}var JV;(function(i){function e(n){return vc(this,void 0,void 0,function*(){let o;const r=yield Promise.all(n.map(s=>s.then(a=>a,a=>{o||(o=a)})));if(typeof o!="undefined")throw o;return r})}i.settled=e;function t(n){return new Promise((o,r)=>vc(this,void 0,void 0,function*(){try{yield n(o,r)}catch(s){r(s)}}))}i.withAsyncBody=t})(JV||(JV={}));class Wo{static fromArray(e){return new Wo(t=>{t.emitMany(e)})}static fromPromise(e){return new Wo(t=>vc(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new Wo(t=>vc(this,void 0,void 0,function*(){yield Promise.all(e.map(n=>vc(this,void 0,void 0,function*(){return t.emitOne(yield n)})))}))}static merge(e){return new Wo(t=>vc(this,void 0,void 0,function*(){yield Promise.all(e.map(n=>{var o,r,s;return vc(this,void 0,void 0,function*(){var a,l,c,d;try{for(o=!0,r=bL(n);s=yield r.next(),a=s.done,!a;o=!0){d=s.value,o=!1;const u=d;t.emitOne(u)}}catch(u){l={error:u}}finally{try{!o&&!a&&(c=r.return)&&(yield c.call(r))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new le,queueMicrotask(()=>vc(this,void 0,void 0,function*(){const t={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{yield Promise.resolve(e(t)),this.resolve()}catch(n){this.reject(n)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>vc(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(evc(this,void 0,void 0,function*(){var o,r,s,a;try{for(var l=!0,c=bL(e),d;d=yield c.next(),o=d.done,!o;l=!0){a=d.value,l=!1;const u=a;n.emitOne(t(u))}}catch(u){r={error:u}}finally{try{!l&&!o&&(s=c.return)&&(yield s.call(c))}finally{if(r)throw r.error}}}))}map(e){return Wo.map(this,e)}static filter(e,t){return new Wo(n=>vc(this,void 0,void 0,function*(){var o,r,s,a;try{for(var l=!0,c=bL(e),d;d=yield c.next(),o=d.done,!o;l=!0){a=d.value,l=!1;const u=a;t(u)&&n.emitOne(u)}}catch(u){r={error:u}}finally{try{!l&&!o&&(s=c.return)&&(yield s.call(c))}finally{if(r)throw r.error}}}))}filter(e){return Wo.filter(this,e)}static coalesce(e){return Wo.filter(e,t=>!!t)}coalesce(){return Wo.coalesce(this)}static toPromise(e){var t,n,o,r,s,a,l;return vc(this,void 0,void 0,function*(){const c=[];try{for(t=!0,n=bL(e);o=yield n.next(),r=o.done,!r;t=!0){l=o.value,t=!1;const d=l;c.push(d)}}catch(d){s={error:d}}finally{try{!t&&!r&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return c})}toPromise(){return Wo.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())}}Wo.EMPTY=Wo.fromArray([]);class lJe extends Wo{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function cJe(i){const e=new Ro,t=i(e.token);return new lJe(e,n=>vc(this,void 0,void 0,function*(){var o,r,s,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),n.reject(new Yv)});try{try{for(var c=!0,d=bL(t),u;u=yield d.next(),o=u.done,!o;c=!0){a=u.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;n.emitOne(h)}}catch(h){r={error:h}}finally{try{!c&&!o&&(s=d.return)&&(yield s.call(d))}finally{if(r)throw r.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),n.reject(h)}}))}const dJe="$initialize";let Ooe=!1;function eH(i){!Xv||(Ooe||(Ooe=!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(i.message))}class uJe{constructor(e,t,n,o){this.vsWorker=e,this.req=t,this.method=n,this.args=o,this.type=0}}class Foe{constructor(e,t,n,o){this.vsWorker=e,this.seq=t,this.res=n,this.err=o,this.type=1}}class hJe{constructor(e,t,n,o){this.vsWorker=e,this.req=t,this.eventName=n,this.arg=o,this.type=2}}class fJe{constructor(e,t,n){this.vsWorker=e,this.req=t,this.event=n,this.type=3}}class gJe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class pJe{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 n=String(++this._lastSentReq);return new Promise((o,r)=>{this._pendingReplies[n]={resolve:o,reject:r},this._send(new uJe(this._workerId,n,e,t))})}listen(e,t){let n=null;const o=new le({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,o),this._send(new hJe(this._workerId,n,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new gJe(this._workerId,n)),n=null}});return o.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 n=e.err;e.err.$isError&&(n=new Error,n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack),t.reject(n);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(o=>{this._send(new Foe(this._workerId,t,o,void 0))},o=>{o.detail instanceof Error&&(o.detail=uoe(o.detail)),this._send(new Foe(this._workerId,t,void 0,uoe(o)))})}_handleSubscribeEventMessage(e){const t=e.req,n=this._handler.handleEvent(e.eventName,e.arg)(o=>{this._send(new fJe(this._workerId,t,o))});this._pendingEvents.set(t,n)}_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 n=0;n{this._protocol.handleMessage(d)},d=>{o==null||o(d)})),this._protocol=new pJe({sendMessage:(d,u)=>{this._worker.postMessage(d,u)},handleMessage:(d,u)=>{if(typeof n[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(n[d].apply(n,u))}catch(h){return Promise.reject(h)}},handleEvent:(d,u)=>{if(I0e(d)){const h=n[d].call(n,u);if(typeof h!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return h}if(k0e(d)){const h=n[d];if(typeof h!="function")throw new Error(`Missing event ${d} on main thread host.`);return h}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let r=null;const s=globalThis.require;typeof s!="undefined"&&typeof s.getConfig=="function"?r=s.getConfig():typeof globalThis.requirejs!="undefined"&&(r=globalThis.requirejs.s.contexts._.config);const a=Fq(n);this._onModuleLoaded=this._protocol.sendMessage(dJe,[this._worker.getId(),JSON.parse(JSON.stringify(r)),t,a]);const l=(d,u)=>this._request(d,u),c=(d,u)=>this._protocol.listen(d,u);this._lazyProxy=new Promise((d,u)=>{o=u,this._onModuleLoaded.then(h=>{d(vJe(h,l,c))},h=>{u(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((n,o)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(n,o)},o)})}_onError(e,t){console.error(e),console.info(t)}}function k0e(i){return i[0]==="o"&&i[1]==="n"&&kh(i.charCodeAt(2))}function I0e(i){return/^onDynamic/.test(i)&&kh(i.charCodeAt(9))}function vJe(i,e,t){const n=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},o=s=>function(a){return t(s,a)},r={};for(const s of i){if(I0e(s)){r[s]=o(s);continue}if(k0e(s)){r[s]=t(s,void 0);continue}r[s]=n(s)}return r}function _p(i,e){var t;const n=globalThis.MonacoEnvironment;if(n!=null&&n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(i,e)}catch(o){en(o);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(i,e)}catch(o){en(o);return}}const Boe=_p("defaultWorkerFactory",{createScriptURL:i=>i});function _Je(i){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",i);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",i);return new Worker(Boe?Boe.createScriptURL(t):t,{name:i})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function bJe(i){return typeof i.then=="function"}class CJe{constructor(e,t,n,o,r){this.id=t,this.label=n;const s=_Je(n);bJe(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){o(l.data)},a.onmessageerror=r,typeof a.addEventListener=="function"&&a.addEventListener("error",r)})}getId(){return this.id}postMessage(e,t){var n;(n=this.worker)===null||n===void 0||n.then(o=>{try{o.postMessage(e,t)}catch(r){en(r),en(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:r}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class r5{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,n){const o=++r5.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new CJe(e,o,this._label||"anonymous"+o,t,r=>{eH(r),this._webWorkerFailedBeforeError=r,n(r)})}}r5.LAST_WORKER_ID=0;var Ho;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(Ho||(Ho={}));class j6{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,n=e.notIn.length;t0&&i.getLanguageId(s-1)===o;)s--;return new wJe(i,o,s,r+1,i.getStartOffset(s),i.getEndOffset(r))}class wJe{constructor(e,t,n,o,r,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=o,this.firstCharOffset=r,this._lastCharOffset=s}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 Ch(i){return(i&3)!==0}class bw{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new j6(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new j6({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new j6({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:bw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:bw.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}}bw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `;bw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> - `;const Boe=typeof Buffer!="undefined";new ah(()=>new Uint8Array(256));let j6;class s5{static wrap(e){return Boe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new s5(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Boe?this.buffer.toString():(j6||(j6=new TextDecoder),j6.decode(this.buffer))}}function yJe(i,e){return i[e+0]<<0>>>0|i[e+1]<<8>>>0}function wJe(i,e,t){i[t+0]=e&255,e=e>>>8,i[t+1]=e&255}function uu(i,e){return i[e]*Math.pow(2,24)+i[e+1]*Math.pow(2,16)+i[e+2]*Math.pow(2,8)+i[e+3]}function hu(i,e,t){i[t+3]=e,e=e>>>8,i[t+2]=e,e=e>>>8,i[t+1]=e,e=e>>>8,i[t]=e}function Woe(i,e){return i[e]}function Voe(i,e,t){i[t]=e}let K6;function T0e(){return K6||(K6=new TextDecoder("UTF-16LE")),K6}let q6;function SJe(){return q6||(q6=new TextDecoder("UTF-16BE")),q6}let G6;function N0e(){return G6||(G6=b_e()?T0e():SJe()),G6}function xJe(i,e,t){const n=new Uint16Array(i.buffer,e,t);return t>0&&(n[0]===65279||n[0]===65534)?LJe(i,e,t):T0e().decode(n)}function LJe(i,e,t){const n=[];let o=0;for(let r=0;r=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let n=0;n[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s{const[l,c]=s,[d,u]=a;return l===d||l===u||c===d||c===u},o=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let d=0;d0&&r.push({open:a,close:l})}return r}class DJe{constructor(e,t){this._richEditBracketsBrand=void 0;const n=EJe(t);this.brackets=n.map((o,r)=>new ZA(e,r,o.open,o.close,kJe(o.open,o.close,n,r),IJe(o.open,o.close,n,r))),this.forwardRegex=TJe(this.brackets),this.reversedRegex=NJe(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const o of this.brackets){for(const r of o.open)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,r.length);for(const r of o.close)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,r.length)}}}function R0e(i,e,t,n){for(let o=0,r=e.length;o=0&&n.push(a);for(const a of s.close)a.indexOf(i)>=0&&n.push(a)}}function M0e(i,e){return i.length-e.length}function a5(i){if(i.length<=1)return i;const e=[],t=new Set;for(const n of i)t.has(n)||(e.push(n),t.add(n));return e}function kJe(i,e,t,n){let o=[];o=o.concat(i),o=o.concat(e);for(let r=0,s=o.length;r=0;s--)o[r++]=n.charCodeAt(s);return N0e().decode(o)}let e=null,t=null;return function(o){return e!==o&&(e=o,t=i(e)),t}}();class hd{static _findPrevBracketInText(e,t,n,o){const r=n.match(e);if(!r)return null;const s=n.length-(r.index||0),a=r[0].length,l=o+s;return new V(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,n,o,r){const a=lG(n).substring(n.length-r,n.length-o);return this._findPrevBracketInText(e,t,a,o)}static findNextBracketInText(e,t,n,o){const r=n.match(e);if(!r)return null;const s=r.index||0,a=r[0].length;if(a===0)return null;const l=o+s;return new V(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,n,o,r){const s=n.substring(o,r);return this.findNextBracketInText(e,t,s,o)}}class MJe{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const n of t.close){const o=n.charAt(n.length-1);e.push(o)}return bv(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const o=t.findTokenIndexAtOffset(n-1);if(Ch(t.getStandardTokenType(o)))return null;const r=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,n-1)+e,a=hd.findPrevBracketInRange(r,1,s,0,s.length);if(!a)return null;const l=s.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 l2(i){return i.global&&(i.lastIndex=0),!0}class AJe{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&l2(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&l2(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&l2(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&l2(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 RC{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const n=RC._createOpenBracketRegExp(t[0]),o=RC._createCloseBracketRegExp(t[1]);n&&o&&this._brackets.push({open:t[0],openRegExp:n,close:t[1],closeRegExp:o})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,n,o){if(e>=3)for(let r=0,s=this._regExpRules.length;rc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&n.length>0&&o.length>0)for(let r=0,s=this._brackets.length;r=2&&n.length>0){for(let r=0,s=this._brackets.length;r0&&i.charAt(i.length-1)==="#"?i.substring(0,i.length-1):i}class BJe{constructor(){this._onDidChangeSchema=new le,this.schemasById={}}registerSchema(e,t){this.schemasById[FJe(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const WJe=new BJe;no.add(c5.JSONContribution,WJe);const ch={Configuration:"base.contributions.configuration"},Ax="vscode://schemas/settings/resourceLanguage",zoe=no.as(c5.JSONContribution);class VJe{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new le,this._onDidUpdateConfiguration=new le,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:C("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={},zoe.registerSchema(Ax,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=new Set;this.doRegisterConfigurations(e,t,n),zoe.registerSchema(Ax,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var n;const o=[];for(const{overrides:r,source:s}of e)for(const a in r)if(t.add(a),Ev.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(n=l==null?void 0:l.valuesSources)!==null&&n!==void 0?n:new Map;if(s)for(const f of Object.keys(r[a]))c.set(f,s);const d=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),r[a]);this.configurationDefaultsOverrides.set(a,{source:s,value:d,valuesSources:c});const u=OJe(a),h={type:"object",default:d,description:C("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:Ax,defaultDefaultValue:d,source:la(s)?void 0:s,defaultValueSource:s};o.push(...QA(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:r[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(o)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(o=>{this.validateAndRegisterProperties(o,t,o.extensionInfo,o.restrictedProperties,void 0,n),this.configurationContributors.push(o),this.registerJSONConfiguration(o)})}validateAndRegisterProperties(e,t=!0,n,o,r=3,s){var a;r=Al(e.scope)?r:e.scope;const l=e.properties;if(l)for(const d in l){const u=l[d];if(t&&zJe(d,u)){delete l[d];continue}if(u.source=n,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),Ev.test(d)?u.scope=void 0:(u.scope=Al(u.scope)?r:u.scope,u.restricted=Al(u.restricted)?!!(o!=null&&o.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),s.add(d)}const c=e.allOf;if(c)for(const d of c)this.validateAndRegisterProperties(d,t,n,o,r,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=n=>{const o=n.properties;if(o)for(const s in o)this.updateSchema(s,o[s]);const r=n.allOf;r==null||r.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,n={type:"object",description:C("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:C("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:Ax};this.updatePropertyDefaultValue(t,n)}}registerOverridePropertyPatternKey(){C("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),C("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const n=this.configurationDefaultsOverrides.get(e);let o=n==null?void 0:n.value,r=n==null?void 0:n.source;il(o)&&(o=t.defaultDefaultValue,r=void 0),il(o)&&(o=$Je(t.type)),t.default=o,t.defaultValueSource=r}}const F0e="\\[([^\\]]+)\\]",Uoe=new RegExp(F0e,"g"),HJe=`^(${F0e})+$`,Ev=new RegExp(HJe);function QA(i){const e=[];if(Ev.test(i)){let t=Uoe.exec(i);for(;t!=null&&t.length;){const n=t[1].trim();n&&e.push(n),t=Uoe.exec(i)}}return bv(e)}function $Je(i){switch(Array.isArray(i)?i[0]:i){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const rM=new VJe;no.add(ch.Configuration,rM);function zJe(i,e){var t,n,o,r;return i.trim()?Ev.test(i)?C("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",i):rM.getConfigurationProperties()[i]!==void 0?C("config.property.duplicate","Cannot register '{0}'. This property is already registered.",i):((t=e.policy)===null||t===void 0?void 0:t.name)&&rM.getPolicyConfigurations().get((n=e.policy)===null||n===void 0?void 0:n.name)!==void 0?C("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",i,(o=e.policy)===null||o===void 0?void 0:o.name,rM.getPolicyConfigurations().get((r=e.policy)===null||r===void 0?void 0:r.name)):null:C("config.property.empty","Cannot register an empty property")}const UJe={ModesRegistry:"editor.modesRegistry"};class jJe{constructor(){this._onDidChangeLanguages=new le,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t{const l=new Set;return{info:new GJe(this,a,l),closing:l}}),r=new goe(a=>{const l=new Set,c=new Set;return{info:new XJe(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of n){const c=o.get(a),d=r.get(l);c.closing.add(d.info),d.opening.add(c.info)}const s=t.colorizedBracketPairs?joe(t.colorizedBracketPairs):n.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=o.get(a),d=r.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...r.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 joe(i){return i.filter(([e,t])=>e!==""&&t!=="")}class B0e{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class GJe extends B0e{constructor(e,t,n){super(e,t),this.openedBrackets=n,this.isOpeningBracket=!0}}class XJe extends B0e{constructor(e,t,n,o){super(e,t),this.openingBrackets=n,this.openingColorizedBrackets=o,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 YJe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Koe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class X6{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Ti=yn("languageConfigurationService");let tH=class extends _e{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new eet),this.onDidChangeEmitter=this._register(new le),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const n=new Set(Object.values(nH));this._register(this.configurationService.onDidChangeConfiguration(o=>{const r=o.change.keys.some(a=>n.has(a)),s=o.change.overrides.filter(([a,l])=>l.some(c=>n.has(c))).map(([a])=>a);if(r)this.configurations.clear(),this.onDidChangeEmitter.fire(new X6(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new X6(a)))})),this._register(this._registry.onDidChange(o=>{this.configurations.delete(o.languageId),this.onDidChangeEmitter.fire(new X6(o.languageId))}))}register(e,t,n){return this._registry.register(e,t,n)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=ZJe(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};tH=YJe([Koe(0,En),Koe(1,Ki)],tH);function ZJe(i,e,t,n){let o=e.getLanguageConfiguration(i);if(!o){if(!n.isRegisteredLanguageId(i))return new yy(i,{});o=new yy(i,{})}const r=QJe(o.languageId,t),s=V0e([o.underlyingConfig,r]);return new yy(o.languageId,s)}const nH={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function QJe(i,e){const t=e.getValue(nH.brackets,{overrideIdentifier:i}),n=e.getValue(nH.colorizedBracketPairs,{overrideIdentifier:i});return{brackets:qoe(t),colorizedBracketPairs:qoe(n)}}function qoe(i){if(!!Array.isArray(i))return i.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function W0e(i,e,t){const n=i.getLineContent(e);let o=Si(n);return o.length>t-1&&(o=o.substring(0,t-1)),o}function Cy(i,e,t){i.tokenization.forceTokenization(e);const n=i.tokenization.getLineTokens(e),o=typeof t=="undefined"?i.getLineMaxColumn(e)-1:t-1;return r5(n,o)}class JJe{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const n=new Goe(e,t,++this._order);return this._entries.push(n),this._resolved=null,zt(()=>{for(let o=0;oe.configuration)))}}function V0e(i){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 i)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 Goe{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class Xoe{constructor(e){this.languageId=e}}class eet extends _e{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._register(this.register(Gl,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,n=0){let o=this._entries.get(e);o||(o=new JJe(e),this._entries.set(e,o));const r=o.register(t,n);return this._onDidChange.fire(new Xoe(e)),zt(()=>{r.dispose(),this._onDidChange.fire(new Xoe(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class yy{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 RC(this.underlyingConfig):null,this.comments=yy._handleComments(this.underlyingConfig),this.characterPair=new bw(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Wq,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new AJe(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new qJe(e,this.underlyingConfig)}getWordDefinition(){return w_e(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new DJe(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new MJe(this.brackets)),this._electricCharacter}onEnter(e,t,n,o){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,o):null}getAutoClosingPairs(){return new bJe(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 n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){const[o,r]=t.blockComment;n.blockCommentStartToken=o,n.blockCommentEndToken=r}return n}}Mn(Ti,tH,1);class qp{constructor(e,t,n,o){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=o}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function H0e(i){return d5(i,0)}function d5(i,e){switch(typeof i){case"object":return i===null?Pg(349,e):Array.isArray(i)?net(i,e):iet(i,e);case"string":return cG(i,e);case"boolean":return tet(i,e);case"number":return Pg(i,e);case"undefined":return Pg(937,e);default:return Pg(617,e)}}function Pg(i,e){return(e<<5)-e+i|0}function tet(i,e){return Pg(i?433:863,e)}function cG(i,e){e=Pg(149417,e);for(let t=0,n=i.length;td5(n,t),e)}function iet(i,e){return e=Pg(181387,e),Object.keys(i).sort().reduce((t,n)=>(t=cG(n,t),d5(i[n],t)),e)}function Y6(i,e,t=32){const n=t-e,o=~((1<>>n)>>>0}function Yoe(i,e=0,t=i.byteLength,n=0){for(let o=0;ot.toString(16).padStart(2,"0")).join(""):oet((i>>>0).toString(16),e/4)}class u5{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 n=this._buff;let o=this._buffLen,r=this._leftoverHighSurrogate,s,a;for(r!==0?(s=r,a=-1,r=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(gr(s))if(a+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&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()),Px(this._h0)+Px(this._h1)+Px(this._h2)+Px(this._h3)+Px(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Yoe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Yoe(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=u5._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,Y6(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let n=this._h0,o=this._h1,r=this._h2,s=this._h3,a=this._h4,l,c,d;for(let u=0;u<80;u++)u<20?(l=o&r|~o&s,c=1518500249):u<40?(l=o^r^s,c=1859775393):u<60?(l=o&r|o&s|r&s,c=2400959708):(l=o^r^s,c=3395469782),d=Y6(n,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=s,s=r,r=Y6(o,30),o=n,n=d;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}u5._bigBlock32=new DataView(new ArrayBuffer(320));class Zoe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,o=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new qp(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 Ah{constructor(e,t,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=e,this._modifiedSequence=t;const[o,r,s]=Ah._getElements(e),[a,l,c]=Ah._getElements(t);this._hasStrings=s&&c,this._originalStringElements=o,this._originalElementsOrHash=r,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(Ah._isStringArray(t)){const n=new Int32Array(t.length);for(let o=0,r=t.length;o=e&&o>=n&&this.ElementsAreEqual(t,o);)t--,o--;if(e>t||n>o){let u;return n<=o?(H1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new qp(e,0,n,o-n+1)]):e<=t?(H1.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),u=[new qp(e,t-e+1,n,0)]):(H1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),H1.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,n,o,s,a,r),c=s[0],d=a[0];if(l!==null)return l;if(!r[0]){const u=this.ComputeDiffRecursive(e,c,n,d,r);let h=[];return r[0]?h=[new qp(c+1,t-(c+1)+1,d+1,o-(d+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,d+1,o,r),this.ConcatenateChanges(u,h)}return[new qp(e,t-e+1,n,o-n+1)]}WALKTRACE(e,t,n,o,r,s,a,l,c,d,u,h,f,g,p,v,m,_){let y=null,w=null,L=new Qoe,D=t,E=n,I=f[0]-v[0]-o,k=-1073741824,R=this.m_forwardHistory.length-1;do{const A=I+e;A===D||A=0&&(c=this.m_forwardHistory[R],e=c[0],D=1,E=c.length-1)}while(--R>=-1);if(y=L.getReverseChanges(),_[0]){let A=f[0]+1,P=v[0]+1;if(y!==null&&y.length>0){const N=y[y.length-1];A=Math.max(A,N.getOriginalEnd()),P=Math.max(P,N.getModifiedEnd())}w=[new qp(A,h-A+1,P,p-P+1)]}else{L=new Qoe,D=s,E=a,I=f[0]-v[0]-l,k=1073741824,R=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=I+r;A===D||A=d[A+1]?(u=d[A+1]-1,g=u-I-l,u>k&&L.MarkNextChange(),k=u+1,L.AddOriginalElement(u+1,g+1),I=A+1-r):(u=d[A-1],g=u-I-l,u>k&&L.MarkNextChange(),k=u,L.AddModifiedElement(u+1,g+1),I=A-1-r),R>=0&&(d=this.m_reverseHistory[R],r=d[0],D=1,E=d.length-1)}while(--R>=-1);w=L.getChanges()}return this.ConcatenateChanges(y,w)}ComputeRecursionPoint(e,t,n,o,r,s,a){let l=0,c=0,d=0,u=0,h=0,f=0;e--,n--,r[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(o-n),p=g+1,v=new Int32Array(p),m=new Int32Array(p),_=o-n,y=t-e,w=e-n,L=t-o,E=(y-_)%2===0;v[_]=e,m[y]=t,a[0]=!1;for(let I=1;I<=g/2+1;I++){let k=0,R=0;d=this.ClipDiagonalBound(_-I,I,_,p),u=this.ClipDiagonalBound(_+I,I,_,p);for(let P=d;P<=u;P+=2){P===d||Pk+R&&(k=l,R=c),!E&&Math.abs(P-y)<=I-1&&l>=m[P])return r[0]=l,s[0]=c,N<=m[P]&&1447>0&&I<=1447+1?this.WALKTRACE(_,d,u,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a):null}const A=(k-e+(R-n)-I)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(k,A))return a[0]=!0,r[0]=k,s[0]=R,A>0&&1447>0&&I<=1447+1?this.WALKTRACE(_,d,u,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a):(e++,n++,[new qp(e,t-e+1,n,o-n+1)]);h=this.ClipDiagonalBound(y-I,I,y,p),f=this.ClipDiagonalBound(y+I,I,y,p);for(let P=h;P<=f;P+=2){P===h||P=m[P+1]?l=m[P+1]-1:l=m[P-1],c=l-(P-y)-L;const N=l;for(;l>e&&c>n&&this.ElementsAreEqual(l,c);)l--,c--;if(m[P]=l,E&&Math.abs(P-_)<=I&&l<=v[P])return r[0]=l,s[0]=c,N>=v[P]&&1447>0&&I<=1447+1?this.WALKTRACE(_,d,u,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a):null}if(I<=1447){let P=new Int32Array(u-d+2);P[0]=_-d+1,$1.Copy2(v,d,P,1,u-d+1),this.m_forwardHistory.push(P),P=new Int32Array(f-h+2),P[0]=y-h+1,$1.Copy2(m,h,P,1,f-h+1),this.m_reverseHistory.push(P)}}return this.WALKTRACE(_,d,u,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a)}PrettifyChanges(e){for(let t=0;t0,a=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let o=0,r=0;if(t>0){const u=e[t-1];o=u.originalStart+u.originalLength,r=u.modifiedStart+u.modifiedLength}const s=n.originalLength>0,a=n.modifiedLength>0;let l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let u=1;;u++){const h=n.originalStart-u,f=n.modifiedStart-u;if(hc&&(c=p,l=u)}n.originalStart-=l,n.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,n=e.length;t0&&f>l&&(l=f,c=u,d=h)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,n){let o=0;for(let r=0;r=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 n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))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 n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,o){const r=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(n,o)?1:0;return r+s}ConcatenateChanges(e,t){const n=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const o=new Array(e.length+t.length-1);return $1.Copy(e,0,o,0,e.length-1),o[e.length-1]=n[0],$1.Copy(t,1,o,e.length,t.length-1),o}else{const o=new Array(e.length+t.length);return $1.Copy(e,0,o,0,e.length),$1.Copy(t,0,o,e.length,t.length),o}}ChangesOverlap(e,t,n){if(H1.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),H1.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 o=e.originalStart;let r=e.originalLength;const s=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(r=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new qp(o,r,s,a),!0}else return n[0]=null,!1}ClipDiagonalBound(e,t,n,o){if(e>=0&&e255?255:i|0}function z1(i){return i<0?0:i>4294967295?4294967295:i|0}class set{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=z1(e);const n=this.values,o=this.prefixSum,r=t.length;return r===0?!1:(this.values=new Uint32Array(n.length+r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+r),this.values.set(t,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=z1(e),t=z1(t),this.values[e]===t?!1:(this.values[e]=t,e-1=n.length)return!1;const r=n.length-e;return t>=r&&(t=r),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.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=z1(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 n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,o=0,r=0,s=0;for(;t<=n;)if(o=t+(n-t)/2|0,r=this.prefixSum[o],s=r-this.values[o],e=r)t=o+1;else break;return new $0e(o,e-s)}}class aet{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],n=t>0?this._prefixSum[t-1]:0;return new $0e(t,e-n)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=W4(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]=o+n;for(let r=0;r=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}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 eP{constructor(){this._actual=new wS(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class det{constructor(e,t,n){const o=new Uint8Array(e*t);for(let r=0,s=e*t;rt&&(t=l),a>n&&(n=a),c>n&&(n=c)}t++,n++;const o=new det(n,t,0);for(let r=0,s=e.length;r=this._maxCharCode?0:this._states.get(e,t)}}let Z6=null;function het(){return Z6===null&&(Z6=new uet([[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]])),Z6}let Ox=null;function fet(){if(Ox===null){Ox=new wS(0);const i=` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026`;for(let t=0;to);if(o>0){const a=t.charCodeAt(o-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:n,startColumn:o+1,endLineNumber:n,endColumn:s+2},url:t.substring(o,s+1)}}static computeLinks(e,t=het()){const n=fet(),o=[];for(let r=1,s=e.getLineCount();r<=s;r++){const a=e.getLineContent(r),l=a.length;let c=0,d=0,u=0,h=1,f=!1,g=!1,p=!1,v=!1;for(;c=0?(o+=n?1:-1,o<0?o=e.length-1:o%=e.length,e[o]):null}}iH.INSTANCE=new iH;class pet extends wS{constructor(e){super(0);for(let t=0,n=e.length;t(e.hasOwnProperty(t)||(e[t]=i(t)),e[t])}const Vc=met(i=>new pet(i));var Yl;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(Yl||(Yl={}));var wy;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(wy||(wy={}));var ll;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(ll||(ll={}));var Nu;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(Nu||(Nu={}));class sM{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=Boolean(e.insertSpaces),this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=Boolean(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&&ql(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 HD{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function vet(i){return i&&typeof i.read=="function"}class Q6{constructor(e,t,n,o,r,s){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=o,this.isAutoWhitespaceEdit=r,this._isTracked=s}}class _et{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class bet{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}}function Cet(i){return!i.isTooLargeForSyncing()&&!i.isForSimpleWidget}const yet=999;class A_{constructor(e,t,n,o){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=o}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=wet(this.searchString):e=this.searchString.indexOf(` -`)>=0;let t=null;try{t=U_e(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new _et(t,this.wordSeparators?Vc(this.wordSeparators):null,n?this.searchString:null)}}function wet(i){if(!i||i.length===0)return!1;for(let e=0,t=i.length;e=t)break;const o=i.charCodeAt(e);if(o===110||o===114||o===87)return!0}}return!1}function H_(i,e,t){if(!t)return new HD(i,null);const n=[];for(let o=0,r=e.length;o>0);t[r]>=e?o=r-1:t[r+1]>=e?(n=r,o=r):n=r+1}return n+1}}class c2{static findMatches(e,t,n,o,r){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,n,new MC(s.wordSeparators,s.regex),o,r):this._doFindMatchesLineByLine(e,n,s,o,r):[]}static _getMultilineMatchRange(e,t,n,o,r,s){let a,l=0;o?(l=o.findLineFeedCountBeforeOffset(r),a=t+r+l):a=t+r;let c;if(o){const f=o.findLineFeedCountBeforeOffset(r+s.length)-l;c=a+s.length+f}else c=a+s.length;const d=e.getPositionAt(a),u=e.getPositionAt(c);return new V(d.lineNumber,d.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,n,o,r){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r -`?new Joe(a):null,c=[];let d=0,u;for(n.reset(0);u=n.next(a);)if(c[d++]=H_(this._getMultilineMatchRange(e,s,a,l,u.index,u[0]),u,o),d>=r)return c;return c}static _doFindMatchesLineByLine(e,t,n,o,r){const s=[];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(n,c,t.startLineNumber,t.startColumn-1,a,s,o,r),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(n,l,t.startLineNumber,t.startColumn-1,a,s,o,r);for(let c=t.startLineNumber+1;c=l))return r;return r}const d=new MC(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(s[r++]=H_(new V(n,u.index+1+o,n,u.index+1+u[0].length+o),u,a),r>=l))return r;while(u);return r}static findNextMatch(e,t,n,o){const r=t.parseSearchRequest();if(!r)return null;const s=new MC(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindNextMatchMultiline(e,n,s,o):this._doFindNextMatchLineByLine(e,n,s,o)}static _doFindNextMatchMultiline(e,t,n,o){const r=new ae(t.lineNumber,1),s=e.getOffsetAt(r),a=e.getLineCount(),l=e.getValueInRange(new V(r.lineNumber,r.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r -`?new Joe(l):null;n.reset(t.column-1);const d=n.next(l);return d?H_(this._getMultilineMatchRange(e,s,l,c,d.index,d[0]),d,o):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new ae(1,1),n,o):null}static _doFindNextMatchLineByLine(e,t,n,o){const r=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(n,a,s,t.column,o);if(l)return l;for(let c=1;c<=r;c++){const d=(s+c-1)%r,u=e.getLineContent(d+1),h=this._findFirstMatchInLine(n,u,d+1,1,o);if(h)return h}return null}static _findFirstMatchInLine(e,t,n,o,r){e.reset(o-1);const s=e.next(t);return s?H_(new V(n,s.index+1,n,s.index+1+s[0].length),s,r):null}static findPreviousMatch(e,t,n,o){const r=t.parseSearchRequest();if(!r)return null;const s=new MC(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindPreviousMatchMultiline(e,n,s,o):this._doFindPreviousMatchLineByLine(e,n,s,o)}static _doFindPreviousMatchMultiline(e,t,n,o){const r=this._doFindMatchesMultiline(e,new V(1,1,t.lineNumber,t.column),n,o,10*yet);if(r.length>0)return r[r.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new ae(s,e.getLineMaxColumn(s)),n,o):null}static _doFindPreviousMatchLineByLine(e,t,n,o){const r=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(n,a,s,o);if(l)return l;for(let c=1;c<=r;c++){const d=(r+s-c-1)%r,u=e.getLineContent(d+1),h=this._findLastMatchInLine(n,u,d+1,o);if(h)return h}return null}static _findLastMatchInLine(e,t,n,o){let r=null,s;for(e.reset(0);s=e.next(t);)r=H_(new V(n,s.index+1,n,s.index+1+s[0].length),s,o);return r}}function xet(i,e,t,n,o){if(n===0)return!0;const r=e.charCodeAt(n-1);if(i.get(r)!==0||r===13||r===10)return!0;if(o>0){const s=e.charCodeAt(n);if(i.get(s)!==0)return!0}return!1}function Let(i,e,t,n,o){if(n+o===t)return!0;const r=e.charCodeAt(n+o);if(i.get(r)!==0||r===13||r===10)return!0;if(o>0){const s=e.charCodeAt(n+o-1);if(i.get(s)!==0)return!0}return!1}function dG(i,e,t,n,o){return xet(i,e,t,n,o)&&Let(i,e,t,n,o)}class MC{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 n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;const o=n.index,r=n[0].length;if(o===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){KA(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=o,this._prevMatchLength=r,!this._wordSeparators||dG(this._wordSeparators,e,t,o,r))return n}while(n);return null}}class uG{static computeUnicodeHighlights(e,t,n){const o=n?n.startLineNumber:1,r=n?n.endLineNumber:e.getLineCount(),s=new ere(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${Eet(Array.from(a))}`,"g");const c=new MC(null,l),d=[];let u=!1,h,f=0,g=0,p=0;e:for(let v=o,m=r;v<=m;v++){const _=e.getLineContent(v),y=_.length;c.reset(0);do if(h=c.next(_),h){let w=h.index,L=h.index+h[0].length;if(w>0){const k=_.charCodeAt(w-1);gr(k)&&w--}if(L+1=k){u=!0;break e}d.push(new V(v,w+1,v,L+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const n=new ere(t);switch(n.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const r=e.codePointAt(0),s=n.ambiguousCharacters.getPrimaryConfusable(r),a=eb.getLocales().filter(l=>!eb.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(r));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function Eet(i,e){return`[${Xl(i.map(n=>String.fromCodePoint(n)).join(""))}]`}class ere{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=eb.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of cf.codePoints)tre(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 n=e.codePointAt(0);if(this.allowedCodePoints.has(n))return 0;if(this.options.nonBasicASCII)return 1;let o=!1,r=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=$I(s);o=o||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!cf.isInvisibleCharacter(a)&&(r=!0)}return!o&&r?0:this.options.invisibleCharacters&&!tre(e)&&cf.isInvisibleCharacter(n)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(n)?3:0}}function tre(i){return i===" "||i===` -`||i===" "}class aM{constructor(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n}}class z0e{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Cn{static addRange(e,t){let n=0;for(;nt))return new Cn(e,t)}static ofLength(e){return new Cn(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Vo(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Cn(this.start+e,this.endExclusive+e)}deltaStart(e){return new Cn(this.start+e,this.endExclusive)}deltaEnd(e){return new Cn(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function nP(i,e,t){const n=Det(i,e);if(n!==-1)return i[n]}function Det(i,e,t=i.length-1){for(let n=t;n>=0;n--){const o=i[n];if(e(o))return n}return-1}function $D(i,e){const t=zD(i,e);return t===-1?void 0:i[t]}function zD(i,e,t=0,n=i.length){let o=t,r=n;for(;o0&&(t=o)}return t}function Iet(i,e){if(i.length===0)return;let t=i[0];for(let n=1;n=0&&(t=o)}return t}function Tet(i,e){return U0e(i,(t,n)=>-e(t,n))}function Net(i,e){if(i.length===0)return-1;let t=0;for(let n=1;n0&&(t=n)}return t}function Ret(i,e){for(const t of i){const n=e(t);if(n!==void 0)return n}}class ln{static fromRange(e){return new ln(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new Ph(e[0].slice());for(let n=1;nt)throw new Vo(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=zD(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){const o=this._normalizedRanges[t];this._normalizedRanges[t]=o.join(e)}else{const o=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,o)}}contains(e){const t=$D(this._normalizedRanges,n=>n.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 n=0,o=0,r=null;for(;n=s.startLineNumber?r=new ln(r.startLineNumber,Math.max(r.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(r),r=s)}return r!==null&&t.push(r),new Ph(t)}subtractFrom(e){const t=UD(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),n=zD(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)return new Ph([e]);const o=[];let r=e.startLineNumber;for(let s=t;sr&&o.push(new ln(r,a.startLineNumber)),r=a.endLineNumberExclusive}return re.toString()).join(", ")}getIntersection(e){const t=[];let n=0,o=0;for(;nt.delta(e)))}}class mf{static inverse(e,t,n){const o=[];let r=1,s=1;for(const l of e){const c=new Hc(new ln(r,l.original.startLineNumber),new ln(s,l.modified.startLineNumber),void 0);c.modified.isEmpty||o.push(c),r=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new Hc(new ln(r,t+1),new ln(s,n+1),void 0);return a.modified.isEmpty||o.push(a),o}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new mf(this.modified,this.original)}join(e){return new mf(this.original.join(e.original),this.modified.join(e.modified))}}class Hc extends mf{constructor(e,t,n){super(e,t),this.innerChanges=n}flip(){var e;return new Hc(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class Dv{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Dv(this.modifiedRange,this.originalRange)}}const Met=3;class Aet{computeDiff(e,t,n){var o;const s=new Fet(e,t,{maxComputationTime:n.maxComputationTimeMs,shouldIgnoreTrimWhitespace:n.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let d;c.originalEndLineNumber===0?d=new ln(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new ln(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new ln(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new ln(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new Hc(d,u,(o=c.charChanges)===null||o===void 0?void 0:o.map(f=>new Dv(new V(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new V(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new Hc(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 FD(()=>t0e(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class Sy{constructor(e,t,n,o,r,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=n,this.originalEndColumn=o,this.modifiedStartLineNumber=r,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,n){const o=t.getStartLineNumber(e.originalStart),r=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=n.getStartLineNumber(e.modifiedStart),c=n.getStartColumn(e.modifiedStart),d=n.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=n.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new Sy(o,r,s,a,l,c,d,u)}}function Oet(i){if(i.length<=1)return i;const e=[i[0]];let t=e[0];for(let n=1,o=i.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&r()){const f=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=o.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=j0e(f,g,r,!0).changes;a&&(p=Oet(p)),h=[];for(let v=0,m=p.length;v1&&p>1;){const v=h.charCodeAt(g-2),m=f.charCodeAt(p-2);if(v!==m)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(o,r+1,1,g,s+1,1,p)}{let g=rH(h,1),p=rH(f,1);const v=h.length+1,m=f.length+1;for(;g!0;const e=Date.now();return()=>Date.now()-e{n.push(Fr.fromOffsetPairs(o?o.getEndExclusives():Kh.zero,r?r.getStarts():new Kh(t,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+t)))}),n}static fromOffsetPairs(e,t){return new Fr(new Cn(e.offset1,t.offset1),new Cn(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Fr(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Fr(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Fr(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Fr(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Fr(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!t||!n))return new Fr(t,n)}getStarts(){return new Kh(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Kh(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Kh{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Kh.zero=new Kh(0,0);Kh.max=new Kh(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class jD{isValid(){return!0}}jD.instance=new jD;class Bet{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Vo("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&s.get(g-1,p-1)===3&&(_+=a.get(g-1,p-1)),_+=o?o(g,p):1):_=-1;const y=Math.max(v,m,_);if(y===_){const w=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,w+1),s.set(g,p,3)}else y===v?(a.set(g,p,0),s.set(g,p,1)):y===m&&(a.set(g,p,0),s.set(g,p,2));r.set(g,p,y)}const l=[];let c=e.length,d=t.length;function u(g,p){(g+1!==c||p+1!==d)&&l.push(new Fr(new Cn(g+1,c),new Cn(p+1,d))),c=g,d=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(u(h,f),h--,f--):s.get(h,f)===1?h--:f--;return u(-1,-1),l.reverse(),new qg(l,!1)}}class K0e{compute(e,t,n=jD.instance){if(e.length===0||t.length===0)return qg.trivial(e,t);const o=e,r=t;function s(p,v){for(;po.length||w>r.length)continue;const L=s(y,w);l.set(d,L);const D=y===m?c.get(d+1):c.get(d-1);if(c.set(d,L!==y?new ore(D,y,w,L-y):D),l.get(d)===o.length&&l.get(d)-d===r.length)break e}}let u=c.get(d);const h=[];let f=o.length,g=r.length;for(;;){const p=u?u.x+u.length:0,v=u?u.y+u.length:0;if((p!==f||v!==g)&&h.push(new Fr(new Cn(p,f),new Cn(v,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new qg(h,!1)}}class ore{constructor(e,t,n,o){this.prev=e,this.x=t,this.y=n,this.length=o}}class Vet{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 n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=t}}}class Het{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 rre,sre;class $et{constructor(e,t){this.uri=e,this.value=t}}function zet(i){return Array.isArray(i)}class _s{constructor(e,t){if(this[rre]="ResourceMap",e instanceof _s)this.map=new Map(e.map),this.toKey=t!=null?t:_s.defaultToKey;else if(zet(e)){this.map=new Map,this.toKey=t!=null?t:_s.defaultToKey;for(const[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e!=null?e:_s.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new $et(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!="undefined"&&(e=e.bind(t));for(const[n,o]of this.map)e(o.value,o.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]}*[(rre=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}_s.defaultToKey=i=>i.toString();class Uet{constructor(){this[sre]="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 n=this._map.get(e);if(!!n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let o=this._map.get(e);if(o)o.value=t,n!==0&&this.touch(o,n);else{switch(o={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),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 n=this._state;let o=this._head;for(;o;){if(t?e.bind(t)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:n.key,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}values(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:n.value,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}entries(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:[n.key,n.value],done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}[(sre=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,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,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.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 n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),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 n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class Qv extends Uet{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 jet{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,n]of e)this.set(t,n)}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 fG{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){const n=this.map.get(e);!n||(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){const n=this.map.get(e);!n||n.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class iP{constructor(e,t,n){this.lines=e,this.considerWhitespaceChanges=n,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let o=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Cn(t.start-1,t.endExclusive),o=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let r=this.lineRange.start;rString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=lre(e>0?this.elements[e-1]:-1),n=lre(en<=e);return new ae(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return V.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!e9(this.elements[e]))return;let t=e;for(;t>0&&e9(this.elements[t-1]);)t--;let n=e;for(;ns<=e.start))!==null&&t!==void 0?t:0,r=(n=ket(this.firstCharOffsetByLine,s=>e.endExclusive<=s))!==null&&n!==void 0?n:this.elements.length;return new Cn(o,r)}}function e9(i){return i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57}const Ket={[0]:0,[1]:0,[2]:0,[3]:10,[4]:2,[5]:3,[6]:10,[7]:10};function are(i){return Ket[i]}function lre(i){return i===10?7:i===13?6:sH(i)?5:i>=97&&i<=122?0:i>=65&&i<=90?1:i>=48&&i<=57?2:i===-1?3:4}function qet(i,e,t,n,o,r){let{moves:s,excludedChanges:a}=Get(i,e,t,r);if(!r.isValid())return[];const l=i.filter(d=>!a.has(d)),c=Xet(l,n,o,e,t,r);return qW(s,c),s=Yet(s),s=s.filter(d=>d.original.toOffsetRange().slice(e).map(h=>h.trim()).join(` -`).length>=10),s=Zet(i,s),s}function Get(i,e,t,n){const o=[],r=i.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new yw(l.original,e,l)),s=new Set(i.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new yw(l.modified,t,l))),a=new Set;for(const l of r){let c=-1,d;for(const u of s){const h=l.computeSimilarity(u);h>c&&(c=h,d=u)}if(c>.9&&d&&(s.delete(d),o.push(new mf(l.range,d.range)),a.add(l.source),a.add(d.source)),!n.isValid())return{moves:o,excludedChanges:a}}return{moves:o,excludedChanges:a}}function Xet(i,e,t,n,o,r){const s=[],a=new fG;for(const h of i)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,jg));for(const h of i){let f=[];for(let g=h.modified.startLineNumber;g{for(const w of f)if(w.originalLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){w.originalLineRange=new ln(w.originalLineRange.startLineNumber,_.endLineNumberExclusive),w.modifiedLineRange=new ln(w.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),m.push(w);return}const y={modifiedLineRange:v,originalLineRange:_};l.push(y),m.push(y)}),f=m}if(!r.isValid())return[]}l.sort(h_e(Rc(h=>h.modifiedLineRange.length,jg)));const c=new Ph,d=new Ph;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),v=g.getIntersection(p);for(const m of v.ranges){if(m.length<3)continue;const _=m,y=m.delta(-f);s.push(new mf(y,_)),c.addRange(_),d.addRange(y)}}s.sort(Rc(h=>h.original.startLineNumber,jg));const u=new jI(i);for(let h=0;hD.original.startLineNumber<=f.original.startLineNumber),p=$D(i,D=>D.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),m=u.findLastMonotonous(D=>D.original.startLineNumberD.modified.startLineNumbern.length||E>o.length||c.contains(E)||d.contains(D)||!cre(n[D-1],o[E-1],r))break}w>0&&(d.addRange(new ln(f.original.startLineNumber-w,f.original.startLineNumber)),c.addRange(new ln(f.modified.startLineNumber-w,f.modified.startLineNumber)));let L;for(L=0;Ln.length||E>o.length||c.contains(E)||d.contains(D)||!cre(n[D-1],o[E-1],r))break}L>0&&(d.addRange(new ln(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+L)),c.addRange(new ln(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+L))),(w>0||L>0)&&(s[h]=new mf(new ln(f.original.startLineNumber-w,f.original.endLineNumberExclusive+L),new ln(f.modified.startLineNumber-w,f.modified.endLineNumberExclusive+L)))}return s}function cre(i,e,t){if(i.trim()===e.trim())return!0;if(i.length>300&&e.length>300)return!1;const o=new K0e().compute(new iP([i],new Cn(0,1),!1),new iP([e],new Cn(0,1),!1),t);let r=0;const s=Fr.invert(o.diffs,i.length);for(const d of s)d.seq1Range.forEach(u=>{sH(i.charCodeAt(u))||r++});function a(d){let u=0;for(let h=0;he.length?i:e);return r/l>.6&&l>10}function Yet(i){if(i.length===0)return i;i.sort(Rc(t=>t.original.startLineNumber,jg));const e=[i[0]];for(let t=1;t=0&&s>=0&&r+s<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}function Zet(i,e){const t=new jI(i);return e=e.filter(n=>{const o=t.findLastMonotonous(a=>a.original.endLineNumberExclusivea.modified.endLineNumberExclusive0&&(a=a.delta(c))}o.push(a)}return n.length>0&&o.push(n[n.length-1]),o}function Jet(i,e,t){if(!i.getBoundaryScore||!e.getBoundaryScore)return t;for(let n=0;n0?t[n-1]:void 0,r=t[n],s=n+1=n.start&&i.seq2Range.start-s>=o.start&&t.isStronglyEqual(i.seq2Range.start-s,i.seq2Range.endExclusive-s)&&s<100;)s++;s--;let a=0;for(;i.seq1Range.start+ac&&(c=g,l=d)}return i.delta(l)}function ett(i,e,t){const n=[];for(const o of t){const r=n[n.length-1];if(!r){n.push(o);continue}o.seq1Range.start-r.seq1Range.endExclusive<=2||o.seq2Range.start-r.seq2Range.endExclusive<=2?n[n.length-1]=new Fr(r.seq1Range.join(o.seq1Range),r.seq2Range.join(o.seq2Range)):n.push(o)}return n}function ttt(i,e,t){const n=[];let o;function r(){if(!o)return;const a=o.s1Range.length-o.deleted;o.s2Range.length-o.added,Math.max(o.deleted,o.added)+(o.count-1)>a&&n.push(new Fr(o.s1Range,o.s2Range)),o=void 0}for(const a of t){let l=function(f,g){var p,v,m,_;if(!o||!o.s1Range.containsRange(f)||!o.s2Range.containsRange(g))if(o&&!(o.s1Range.endExclusive0||e.length>0;){const n=i[0],o=e[0];let r;n&&(!o||n.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=r.seq1Range.start?t[t.length-1]=t[t.length-1].join(r):t.push(r)}return t}function itt(i,e,t){let n=t;if(n.length===0)return n;let o=0,r;do{r=!1;const s=[n[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=n[a],c=s[s.length-1];d(c,l)?(r=!0,s[s.length-1]=s[s.length-1].join(l)):s.push(l)}n=s}while(o++<10&&r);return n}function ott(i,e,t){let n=t;if(n.length===0)return n;let o=0,r;do{r=!1;const a=[n[0]];for(let l=1;l5||p.length>500)return!1;const m=i.getText(p).trim();if(m.length>20||m.split(/\r\n|\r|\n/).length>1)return!1;const _=i.countLinesIn(f.seq1Range),y=f.seq1Range.length,w=e.countLinesIn(f.seq2Range),L=f.seq2Range.length,D=i.countLinesIn(g.seq1Range),E=g.seq1Range.length,I=e.countLinesIn(g.seq2Range),k=g.seq2Range.length,R=2*40+50;function A(P){return Math.min(P,R)}return Math.pow(Math.pow(A(_*40+y),1.5)+Math.pow(A(w*40+L),1.5),1.5)+Math.pow(Math.pow(A(D*40+E),1.5)+Math.pow(A(I*40+k),1.5),1.5)>Math.pow(Math.pow(R,1.5),1.5)*1.3};const c=n[l],d=a[a.length-1];u(d,c)?(r=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}n=a}while(o++<10&&r);const s=[];return hXe(n,(a,l,c)=>{let d=l;function u(m){return m.length>0&&m.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=i.extendToFullLines(l.seq1Range),f=i.getText(new Cn(h.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=i.getText(new Cn(l.seq1Range.endExclusive,h.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const p=Fr.fromOffsetPairs(a?a.getEndExclusives():Kh.zero,c?c.getStarts():Kh.max),v=d.intersect(p);s.push(v)}),s}class ure{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:hre(this.lines[e-1]),n=e===this.lines.length?0:hre(this.lines[e]);return 1e3-(t+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function hre(i){let e=0;for(;eL===D))return new aM([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new aM([new Hc(new ln(1,e.length+1),new ln(1,t.length+1),[new Dv(new V(1,1,e.length,e[0].length+1),new V(1,1,t.length,t[0].length+1))])],[],!1);const o=n.maxComputationTimeMs===0?jD.instance:new Bet(n.maxComputationTimeMs),r=!n.ignoreTrimWhitespace,s=new Map;function a(L){let D=s.get(L);return D===void 0&&(D=s.size,s.set(L,D)),D}const l=e.map(L=>a(L.trim())),c=t.map(L=>a(L.trim())),d=new ure(l,e),u=new ure(c,t),h=(()=>d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,o,(L,D)=>e[L]===t[D]?t[D].length===0?.1:1+Math.log(1+t[D].length):.99):this.myersDiffingAlgorithm.compute(d,u))();let f=h.diffs,g=h.hitTimeout;f=aH(d,u,f),f=itt(d,u,f);const p=[],v=L=>{if(!!r)for(let D=0;DL.seq1Range.start-m===L.seq2Range.start-_);const D=L.seq1Range.start-m;v(D),m=L.seq1Range.endExclusive,_=L.seq2Range.endExclusive;const E=this.refineDiff(e,t,L,o,r);E.hitTimeout&&(g=!0);for(const I of E.mappings)p.push(I)}v(e.length-m);const y=fre(p,e,t);let w=[];return n.computeMoves&&(w=this.computeMoves(y,e,t,l,c,o,r)),FD(()=>{function L(E,I){if(E.lineNumber<1||E.lineNumber>I.length)return!1;const k=I[E.lineNumber-1];return!(E.column<1||E.column>k.length+1)}function D(E,I){return!(E.startLineNumber<1||E.startLineNumber>I.length+1||E.endLineNumberExclusive<1||E.endLineNumberExclusive>I.length+1)}for(const E of y){if(!E.innerChanges)return!1;for(const I of E.innerChanges)if(!(L(I.modifiedRange.getStartPosition(),t)&&L(I.modifiedRange.getEndPosition(),t)&&L(I.originalRange.getStartPosition(),e)&&L(I.originalRange.getEndPosition(),e)))return!1;if(!D(E.modified,t)||!D(E.original,e))return!1}return!0}),new aM(y,w,g)}computeMoves(e,t,n,o,r,s,a){return qet(e,t,n,o,r,s).map(d=>{const u=this.refineDiff(t,n,new Fr(d.original.toOffsetRange(),d.modified.toOffsetRange()),s,a),h=fre(u.mappings,t,n,!0);return new z0e(d,h)})}refineDiff(e,t,n,o,r){const s=new iP(e,n.seq1Range,r),a=new iP(t,n.seq2Range,r),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,o):this.myersDiffingAlgorithm.compute(s,a,o);let c=l.diffs;return c=aH(s,a,c),c=ttt(s,a,c),c=ett(s,a,c),c=ott(s,a,c),{mappings:c.map(u=>new Dv(s.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function fre(i,e,t,n=!1){const o=[];for(const r of a_e(i.map(s=>rtt(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=r[0],a=r[r.length-1];o.push(new Hc(s.original.join(a.original),s.modified.join(a.modified),r.map(l=>l.innerChanges[0])))}return FD(()=>!n&&o.length>0&&o[0].original.startLineNumber!==o[0].modified.startLineNumber?!1:t0e(o,(r,s)=>s.original.startLineNumber-r.original.endLineNumberExclusive===s.modified.startLineNumber-r.modified.endLineNumberExclusive&&r.original.endLineNumberExclusive=t[i.modifiedRange.startLineNumber-1].length&&i.originalRange.startColumn-1>=e[i.originalRange.startLineNumber-1].length&&i.originalRange.startLineNumber<=i.originalRange.endLineNumber+o&&i.modifiedRange.startLineNumber<=i.modifiedRange.endLineNumber+o&&(n=1);const r=new ln(i.originalRange.startLineNumber+n,i.originalRange.endLineNumber+1+o),s=new ln(i.modifiedRange.startLineNumber+n,i.modifiedRange.endLineNumber+1+o);return new Hc(r,s,[i])}const gre={getLegacy:()=>new Aet,getDefault:()=>new q0e};function Gm(i,e){const t=Math.pow(10,e);return Math.round(i*t)/t}class Tn{constructor(e,t,n,o=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,n))|0,this.a=Gm(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class md{constructor(e,t,n,o){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Gm(Math.max(Math.min(1,t),0),3),this.l=Gm(Math.max(Math.min(1,n),0),3),this.a=Gm(Math.max(Math.min(1,o),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,n=e.g/255,o=e.b/255,r=e.a,s=Math.max(t,n,o),a=Math.min(t,n,o);let l=0,c=0;const d=(a+s)/2,u=s-a;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),s){case t:l=(n-o)/u+(n1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(e){const t=e.h/360,{s:n,l:o,a:r}=e;let s,a,l;if(n===0)s=a=l=o;else{const c=o<.5?o*(1+n):o+n-o*n,d=2*o-c;s=md._hue2rgb(d,c,t+1/3),a=md._hue2rgb(d,c,t),l=md._hue2rgb(d,c,t-1/3)}return new Tn(Math.round(s*255),Math.round(a*255),Math.round(l*255),r)}}class qh{constructor(e,t,n,o){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Gm(Math.max(Math.min(1,t),0),3),this.v=Gm(Math.max(Math.min(1,n),0),3),this.a=Gm(Math.max(Math.min(1,o),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,n=e.g/255,o=e.b/255,r=Math.max(t,n,o),s=Math.min(t,n,o),a=r-s,l=r===0?0:a/r;let c;return a===0?c=0:r===t?c=((n-o)/a%6+6)%6:r===n?c=(o-t)/a+2:c=(t-n)/a+4,new qh(Math.round(c*60),l,r,e.a)}static toRGBA(e){const{h:t,s:n,v:o,a:r}=e,s=o*n,a=s*(1-Math.abs(t/60%2-1)),l=o-s;let[c,d,u]=[0,0,0];return t<60?(c=s,d=a):t<120?(c=a,d=s):t<180?(d=s,u=a):t<240?(d=a,u=s):t<300?(c=a,u=s):t<=360&&(c=s,u=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new Tn(c,d,u,r)}}class ve{static fromHex(e){return ve.Format.CSS.parseHex(e)||ve.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:md.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:qh.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Tn)this.rgba=e;else if(e instanceof md)this._hsla=e,this.rgba=md.toRGBA(e);else if(e instanceof qh)this._hsva=e,this.rgba=qh.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Tn.equals(this.rgba,e.rgba)&&md.equals(this.hsla,e.hsla)&&qh.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=ve._relativeLuminanceForComponent(this.rgba.r),t=ve._relativeLuminanceForComponent(this.rgba.g),n=ve._relativeLuminanceForComponent(this.rgba.b),o=.2126*e+.7152*t+.0722*n;return Gm(o,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(),n=e.getRelativeLuminance();return t>n}isDarkerThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t0)for(const o of n){const r=o.filter(c=>c!==void 0),s=r[1],a=r[2];if(!a)continue;let l;if(s==="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=pre(Fx(i,o),Bx(a,c),!1)}else if(s==="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=pre(Fx(i,o),Bx(a,c),!0)}else if(s==="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=mre(Fx(i,o),Bx(a,c),!1)}else if(s==="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=mre(Fx(i,o),Bx(a,c),!0)}else s==="#"&&(l=stt(Fx(i,o),s+a));l&&e.push(l)}return e}function ltt(i){return!i||typeof i.getValue!="function"||typeof i.positionAt!="function"?[]:att(i)}var Vp=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class ctt extends cet{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let n=0;nthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,o=!0;else{const r=this._lines[t-1].length+1;n<1?(n=1,o=!0):n>r&&(n=r,o=!0)}return o?{lineNumber:t,column:n}:e}}class Xm{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 ctt(Rt.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,n){return Vp(this,void 0,void 0,function*(){const o=this._getModel(e);return o?uG.computeUnicodeHighlights(o,t,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,n,o){return Vp(this,void 0,void 0,function*(){const r=this._getModel(e),s=this._getModel(t);return!r||!s?null:Xm.computeDiff(r,s,n,o)})}static computeDiff(e,t,n,o){const r=o==="advanced"?gre.getDefault():gre.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=r.computeDiff(s,a,n),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 n=e.getLineCount(),o=t.getLineCount();if(n!==o)return!1;for(let r=1;r<=n;r++){const s=e.getLineContent(r),a=t.getLineContent(r);if(s!==a)return!1}return!0}computeMoreMinimalEdits(e,t,n){return Vp(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return t;const r=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return V.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;lXm._diffLimit){r.push({range:l,text:c});continue}const h=ret(u,c,n),f=o.offsetAt(V.lift(l).getStartPosition());for(const g of h){const p=o.positionAt(f+g.originalStart),v=o.positionAt(f+g.originalStart+g.originalLength),m={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:v.lineNumber,endColumn:v.column}};o.getValueInRange(m.range)!==m.text&&r.push(m)}}return typeof s=="number"&&r.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r})}computeLinks(e){return Vp(this,void 0,void 0,function*(){const t=this._getModel(e);return t?get(t):null})}computeDefaultDocumentColors(e){return Vp(this,void 0,void 0,function*(){const t=this._getModel(e);return t?ltt(t):null})}textualSuggest(e,t,n,o){return Vp(this,void 0,void 0,function*(){const r=new Ls,s=new RegExp(n,o),a=new Set;e:for(const l of e){const c=this._getModel(l);if(!!c){for(const d of c.words(s))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>Xm._suggestionsLimit))break e}}return{words:Array.from(a),duration:r.elapsed()}})}computeWordRanges(e,t,n,o){return Vp(this,void 0,void 0,function*(){const r=this._getModel(e);if(!r)return Object.create(null);const s=new RegExp(n,o),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(Oq(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(n){return Promise.reject(n)}}}Xm._diffLimit=1e5;Xm._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=H_e());const pG=yn("textResourceConfigurationService"),X0e=yn("textResourcePropertiesService"),pt=yn("ILanguageFeaturesService");var dtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Wx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},oP=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const vre=60*1e3,_re=5*60*1e3;function $_(i,e){const t=i.getModel(e);return!(!t||t.isTooLargeForSyncing())}let lH=class extends _e{constructor(e,t,n,o,r){super(),this._modelService=e,this._workerManager=this._register(new htt(this._modelService,o)),this._logService=n,this._register(r.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>$_(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(r.completionProvider.register("*",new utt(this._workerManager,t,this._modelService,o)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return $_(this._modelService,e)}computedUnicodeHighlights(e,t,n){return this._workerManager.withWorker().then(o=>o.computedUnicodeHighlights(e,t,n))}computeDiff(e,t,n,o){return oP(this,void 0,void 0,function*(){const r=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,n,o));if(!r)return null;return{identical:r.identical,quitEarly:r.quitEarly,changes:a(r.changes),moves:r.moves.map(l=>new z0e(new mf(new ln(l[0],l[1]),new ln(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new Hc(new ln(c[0],c[1]),new ln(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(u=>new Dv(new V(u[0],u[1],u[2],u[3]),new V(u[4],u[5],u[6],u[7]))))})}})}computeMoreMinimalEdits(e,t,n=!1){if(ws(t)){if(!$_(this._modelService,e))return Promise.resolve(t);const o=Ls.create(),r=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,n));return r.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),o.elapsed())),Promise.race([r,xv(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return $_(this._modelService,e)}navigateValueSet(e,t,n){return this._workerManager.withWorker().then(o=>o.navigateValueSet(e,t,n))}canComputeWordRanges(e){return $_(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(n=>n.computeWordRanges(e,t))}};lH=dtt([Wx(0,Yi),Wx(1,pG),Wx(2,nc),Wx(3,Ti),Wx(4,pt)],lH);class utt{constructor(e,t,n,o){this.languageConfigurationService=o,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}provideCompletionItems(e,t){return oP(this,void 0,void 0,function*(){const n=this._configurationService.getValue(e.uri,t,"editor");if(!n.wordBasedSuggestions)return;const o=[];if(n.wordBasedSuggestionsMode==="currentDocument")$_(this._modelService,e.uri)&&o.push(e.uri);else for(const u of this._modelService.getModels())!$_(this._modelService,u.uri)||(u===e?o.unshift(u.uri):(n.wordBasedSuggestionsMode==="allDocuments"||u.getLanguageId()===e.getLanguageId())&&o.push(u.uri));if(o.length===0)return;const r=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new V(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):V.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),d=yield(yield this._workerManager.withWorker()).textualSuggest(o,s==null?void 0:s.word,r);if(!!d)return{duration:d.duration,suggestions:d.words.map(u=>({kind:18,label:u,insertText:u,range:{insert:l,replace:a}}))}})}}class htt extends _e{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new UI).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(_re/2)),this._register(this._modelService.onModelRemoved(o=>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>_re&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new mG(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class ftt extends _e{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){const o=new UI;o.cancelAndSet(()=>this._checkStopModelSync(),Math.round(vre/2)),this._register(o)}}dispose(){for(const e in this._syncedModels)si(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const n of e){const o=n.toString();this._syncedModels[o]||this._beginModelSync(n,t),this._syncedModels[o]&&(this._syncedModelsLastUsedTime[o]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const n in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[n]>vre&&t.push(n);for(const n of t)this._stopModelSync(n)}_beginModelSync(e,t){const n=this._modelService.getModel(e);if(!n||!t&&n.isTooLargeForSyncing())return;const o=e.toString();this._proxy.acceptNewModel({url:n.uri.toString(),lines:n.getLinesContent(),EOL:n.getEOL(),versionId:n.getVersionId()});const r=new Be;r.add(n.onDidChangeContent(s=>{this._proxy.acceptModelChanged(o.toString(),s)})),r.add(n.onWillDispose(()=>{this._stopModelSync(o)})),r.add(zt(()=>{this._proxy.acceptRemovedModel(o)})),this._syncedModels[o]=r}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],si(t)}}class bre{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class t9{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class mG extends _e{constructor(e,t,n,o){super(),this.languageConfigurationService=o,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new o5(n),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new gJe(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new t9(this)))}catch(e){JV(e),this._worker=new bre(new Xm(new t9(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(JV(e),this._worker=new bre(new Xm(new t9(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new ftt(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return oP(this,void 0,void 0,function*(){return this._disposed?Promise.reject(LYe()):this._getProxy().then(n=>(this._getOrCreateModelManager(n).ensureSyncedResources(e,t),n))})}computedUnicodeHighlights(e,t,n){return this._withSyncedResources([e]).then(o=>o.computeUnicodeHighlights(e.toString(),t,n))}computeDiff(e,t,n,o){return this._withSyncedResources([e,t],!0).then(r=>r.computeDiff(e.toString(),t.toString(),n,o))}computeMoreMinimalEdits(e,t,n){return this._withSyncedResources([e]).then(o=>o.computeMoreMinimalEdits(e.toString(),t,n))}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,n){return oP(this,void 0,void 0,function*(){const o=yield this._withSyncedResources(e),r=n.source,s=n.flags;return o.textualSuggest(e.map(a=>a.toString()),t,r,s)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(n=>{const o=this._modelService.getModel(e);if(!o)return Promise.resolve(null);const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),s=r.source,a=r.flags;return n.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,n){return this._withSyncedResources([e]).then(o=>{const r=this._modelService.getModel(e);if(!r)return null;const s=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return o.navigateValueSet(e.toString(),t,n,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function gtt(i,e,t){return new ptt(i,e,t)}class ptt extends mG{constructor(e,t,n){super(e,n.keepIdleModels||!1,n.label,t),this._foreignModuleId=n.moduleId,this._foreignModuleCreateData=n.createData||null,this._foreignModuleHost=n.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(n){return Promise.reject(n)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?Oq(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(n=>{this._foreignModuleCreateData=null;const o=(a,l)=>e.fmr(a,l),r=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of n)s[a]=r(a,o);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const KI={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},ww=new class{clone(){return this}equals(i){return this===i}};function vG(i,e){return new qq([new ND(0,"",i)],e)}function h5(i,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(i<<0|0<<8|0<<11|1<<15|2<<24)>>>0,new $4(t,e===null?ww:e)}class is{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){const t=this.getForeground(e);let n="mtk"+t;const o=this.getFontStyle(e);return o&1&&(n+=" mtki"),o&2&&(n+=" mtkb"),o&4&&(n+=" mtku"),o&8&&(n+=" mtks"),n}static getInlineStyleFromMetadata(e,t){const n=this.getForeground(e),o=this.getFontStyle(e);let r=`color: ${t[n]};`;o&1&&(r+="font-style: italic;"),o&2&&(r+="font-weight: bold;");let s="";return o&4&&(s+=" underline"),o&8&&(s+=" line-through"),s&&(r+=`text-decoration:${s};`),r}static getPresentationFromMetadata(e){const t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:Boolean(n&1),bold:Boolean(n&2),underline:Boolean(n&4),strikethrough:Boolean(n&8)}}}class pr{static createEmpty(e,t){const n=pr.defaultTokenMetadata,o=new Uint32Array(2);return o[0]=e.length,o[1]=n,new pr(o,e,t)}constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=n}equals(e){return e instanceof pr?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,n){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const o=t<<1,r=o+(n<<1);for(let s=o;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],n=is.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return is.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return is.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return is.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[(e<<1)+1];return is.getInlineStyleFromMetadata(n,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return is.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return pr.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,n){return new _G(this,e,t,n)}static convertToEndOffset(e,t){const o=(e.length>>>1)-1;for(let r=0;r>>1)-1;for(;nt&&(o=r)}return n}withInserted(e){if(e.length===0)return this;let t=0,n=0,o="";const r=new Array;let s=0;for(;;){const a=ts){o+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];r.push(o.length,c),s=l.offset}o+=l.text,r.push(o.length,l.tokenMetadata),n++}else break}return new pr(new Uint32Array(r),o,this._languageIdCodec)}}pr.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class _G{constructor(e,t,n,o){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=o,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let r=this._firstTokenIndex,s=e.getCount();r=n);r++)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 _G?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 rl{constructor(e,t,n,o){this.startColumn=e,this.endColumn=t,this.className=n,this.type=o,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 n=e.length,o=t.length;if(n!==o)return!1;for(let r=0;r=r||(a[l++]=new rl(Math.max(1,c.startColumn-o+1),Math.min(s+1,c.endColumn-o+1),c.className,c.type));return a}static filter(e,t,n,o){if(e.length===0)return[];const r=[];let s=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:n,h=d.endLineNumber===t?d.endColumn:o;r[s++]=new rl(u,h,c.inlineClassName,c.type)}return r}static _typeCompare(e,t){const n=[2,0,1,3];return n[e]-n[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 n=rl._typeCompare(e.type,t.type);return n!==0?n:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(o,0,e),this.classNames.splice(o,0,t),this.metadata.splice(o,0,n);break}this.count++}}class mtt{static normalize(e,t){if(t.length===0)return[];const n=[],o=new rP;let r=0;for(let s=0,a=t.length;s1){const p=e.charCodeAt(c-2);gr(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);gr(p)&&d--}const f=c-1,g=d-2;r=o.consumeLowerThan(f,r,n),o.count===0&&(r=f),o.insert(g,u,h)}return o.consumeLowerThan(1073741824,r,n),n}}class Lr{constructor(e,t,n,o){this.endIndex=e,this.type=t,this.metadata=n,this.containsRTL=o,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class Y0e{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Jv{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f,g,p,v,m,_,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=o,this.isBasicASCII=r,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(rl.compare),this.tabSize=d,this.startVisibleColumn=u,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=v==="all"?4:v==="boundary"?1:v==="selection"?2:v==="trailing"?3:0,this.renderControlCharacters=m,this.fontLigatures=_,this.selectionsOnLine=y&&y.sort((D,E)=>D.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,n,o){const r=(t<<16|n<<0)>>>0;this._data[e-1]=r,this._horizontalOffset[e-1]=o}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),n=Th.getPartIndex(t),o=Th.getCharIndex(t);return new Z0e(n,o)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,n){if(this.length===0)return 0;const o=(e<<16|n<<0)>>>0;let r=0,s=this.length-1;for(;r+1>>1,v=this._data[p];if(v===o)return p;v>o?s=p:r=p}if(r===s)return r;const a=this._data[r],l=this._data[s];if(a===o)return r;if(l===o)return s;const c=Th.getPartIndex(a),d=Th.getCharIndex(a),u=Th.getPartIndex(l);let h;c!==u?h=t:h=Th.getCharIndex(l);const f=n-d,g=h-n;return f<=g?r:s}}class cH{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}}function qI(i,e){if(i.lineContent.length===0){if(i.lineDecorations.length>0){e.appendString("");let t=0,n=0,o=0;for(const s of i.lineDecorations)(s.type===1||s.type===2)&&(e.appendString(''),s.type===1&&(o|=1,t++),s.type===2&&(o|=2,n++));e.appendString("");const r=new Th(1,t+n);return r.setColumnInfo(1,t,0,0),new cH(r,!1,o)}return e.appendString(""),new cH(new Th(0,0),!1,0)}return Ltt(btt(i),e)}class vtt{constructor(e,t,n,o){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=o}}function f5(i){const e=new yS(1e4),t=qI(i,e);return new vtt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class _tt{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f,g,p,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=o,this.isOverflowing=r,this.overflowingCharCount=s,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=v}}function btt(i){const e=i.lineContent;let t,n,o;i.stopRenderingLineAfter!==-1&&i.stopRenderingLineAfter0){for(let a=0,l=i.lineDecorations.length;a0&&(r[s++]=new Lr(n,"",0,!1));let a=n;for(let l=0,c=t.getCount();l=o){const f=e?pw(i.substring(a,o)):!1;r[s++]=new Lr(o,u,0,f);break}const h=e?pw(i.substring(a,d)):!1;r[s++]=new Lr(d,u,0,h),a=d}return r}function ytt(i,e,t){let n=0;const o=[];let r=0;if(t)for(let s=0,a=e.length;s=50&&(o[r++]=new Lr(f+1,d,u,h),g=f+1,f=-1);g!==c&&(o[r++]=new Lr(c,d,u,h))}else o[r++]=l;n=c}else for(let s=0,a=e.length;s50){const u=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(d/50);for(let p=1;p=8234&&i<=8238||i>=8294&&i<=8297||i>=8206&&i<=8207||i===1564}function wtt(i,e){const t=[];let n=new Lr(0,"",0,!1),o=0;for(const r of e){const s=r.endIndex;for(;on.endIndex&&(n=new Lr(o,r.type,r.metadata,r.containsRTL),t.push(n)),n=new Lr(o+1,"mtkcontrol",r.metadata,!1),t.push(n))}o>n.endIndex&&(n=new Lr(s,r.type,r.metadata,r.containsRTL),t.push(n))}return t}function Stt(i,e,t,n){const o=i.continuesWithWrappedLine,r=i.fauxIndentLength,s=i.tabSize,a=i.startVisibleColumn,l=i.useMonospaceOptimizations,c=i.selectionsOnLine,d=i.renderWhitespace===1,u=i.renderWhitespace===3,h=i.renderSpaceWidth!==i.spaceWidth,f=[];let g=0,p=0,v=n[p].type,m=n[p].containsRTL,_=n[p].endIndex;const y=n.length;let w=!1,L=Ws(e),D;L===-1?(w=!0,L=t,D=t):D=Wu(e);let E=!1,I=0,k=c&&c[I],R=a%s;for(let P=r;P=k.endOffset&&(I++,k=c&&c[I]);let M;if(PD)M=!0;else if(N===9)M=!0;else if(N===32)if(d)if(E)M=!0;else{const H=P+1P),M&&u&&(M=w||P>D),M&&m&&P>=L&&P<=D&&(M=!1),E){if(!M||!l&&R>=s){if(h){const H=g>0?f[g-1].endIndex:r;for(let B=H+1;B<=P;B++)f[g++]=new Lr(B,"mtkw",1,!1)}else f[g++]=new Lr(P,"mtkw",1,!1);R=R%s}}else(P===_||M&&P>r)&&(f[g++]=new Lr(P,v,0,m),R=R%s);for(N===9?R=s:wv(N)?R+=2:R++,E=M;P===_&&(p++,p0?e.charCodeAt(t-1):0,N=t>1?e.charCodeAt(t-2):0;P===32&&N!==32&&N!==9||(A=!0)}else A=!0;if(A)if(h){const P=g>0?f[g-1].endIndex:r;for(let N=P+1;N<=t;N++)f[g++]=new Lr(N,"mtkw",1,!1)}else f[g++]=new Lr(t,"mtkw",1,!1);else f[g++]=new Lr(t,v,0,m);return f}function xtt(i,e,t,n){n.sort(rl.compare);const o=mtt.normalize(i,n),r=o.length;let s=0;const a=[];let l=0,c=0;for(let u=0,h=t.length;uc&&(c=_.startOffset,a[l++]=new Lr(c,p,v,m)),_.endOffset+1<=g)c=_.endOffset+1,a[l++]=new Lr(c,p+" "+_.className,v|_.metadata,m),s++;else{c=g,a[l++]=new Lr(c,p+" "+_.className,v|_.metadata,m);break}}g>c&&(c=g,a[l++]=new Lr(c,p,v,m))}const d=t[t.length-1].endIndex;if(s'):e.appendString("");for(let k=0,R=c.length;k=d&&(K+=G)}}for(B&&(e.appendString(' style="width:'),e.appendString(String(g*$)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let G=2;G<=j;G++)e.appendCharCode(160)}else K=2,j=1,e.appendCharCode(p),e.appendCharCode(8204);D+=K,E+=j,w>=d&&(L+=j)}}else for(e.appendASCIICharCode(62);w=d&&(L+=K)}F?I++:I=0,w>=s&&!y&&A.isPseudoAfter()&&(y=!0,_.setColumnInfo(w+1,k,D,E)),e.appendString("")}return y||_.setColumnInfo(s+1,c.length-1,D,E),a&&(e.appendString(''),e.appendString(C("showMore","Show more ({0})",Dtt(l))),e.appendString("")),e.appendString(""),new cH(_,f,o)}function Ett(i){return i.toString(16).toUpperCase().padStart(4,"0")}function Dtt(i){return i<1024?C("overflow.chars","{0} chars",i):i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`}class yre{constructor(e,t,n,o){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=o|0}}class ktt{constructor(e,t){this.tabSize=e,this.data=t}}class bG{constructor(e,t,n,o,r,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=o,this.startVisibleColumn=r,this.tokens=s,this.inlineDecorations=a}}class Zl{constructor(e,t,n,o,r,s,a,l,c,d){this.minColumn=e,this.maxColumn=t,this.content=n,this.continuesWithWrappedLine=o,this.isBasicASCII=Zl.isBasicASCII(n,s),this.containsRTL=Zl.containsRTL(n,this.isBasicASCII,r),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?$I(e):!0}static containsRTL(e,t,n){return!t&&n?pw(e):!1}}class hE{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}}class Itt{constructor(e,t,n,o){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=o}toInlineDecoration(e){return new hE(new V(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class J0e{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class KD{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}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&&Lo(e.data,t.data)}static equalsArr(e,t){return Lo(e,t,KD.equals)}}function Ttt(i){return Array.isArray(i)}function Ntt(i){return!Ttt(i)}function ebe(i){return typeof i=="string"}function wre(i){return!ebe(i)}function uC(i){return!i}function Ym(i,e){return i.ignoreCase&&e?e.toLowerCase():e}function Sre(i){return i.replace(/[&<>'"_]/g,"-")}function Rtt(i,e){console.log(`${i.languageId}: ${e}`)}function Bi(i,e){return new Error(`${i.languageId}: ${e}`)}function lm(i,e,t,n,o){const r=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(r,function(a,l,c,d,u,h,f,g,p){return uC(c)?uC(d)?!uC(u)&&u0;){const n=i.tokenizer[t];if(n)return n;const o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return null}function Mtt(i,e){let t=e;for(;t&&t.length>0;){if(i.stateNames[t])return!0;const o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return!1}var Att=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ptt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dH;const tbe=5;class qD{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 xy(e,t);let n=xy.getStackElementId(e);n.length>0&&(n+="|"),n+=t;let o=this._entries[n];return o||(o=new xy(e,t),this._entries[n]=o,o)}}qD._INSTANCE=new qD(tbe);class xy{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 xy._equals(this,e)}push(e){return qD.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return qD.create(this.parent,e)}}class AC{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 AC(this.languageId,this.state)}}class cm{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 fE(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new fE(e,t);const n=xy.getStackElementId(e);let o=this._entries[n];return o||(o=new fE(e,null),this._entries[n]=o,o)}}cm._INSTANCE=new cm(tbe);class fE{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:cm.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof fE)||!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 Ott{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 ND(e,t,this._languageId)))}nestedLanguageTokenize(e,t,n,o){const r=n.languageId,s=n.state,a=oo.get(r);if(!a)return this.enterLanguage(r),this.emit(o,""),s;const l=a.tokenize(e,t,s);if(o!==0)for(const c of l.tokens)this._tokens.push(new ND(c.offset+o,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 qq(this._tokens,e)}}class sP{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 n=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))}static _merge(e,t,n){const o=e!==null?e.length:0,r=t.length,s=n!==null?n.length:0;if(o===0&&r===0&&s===0)return new Uint32Array(0);if(o===0&&r===0)return n;if(r===0&&s===0)return e;const a=new Uint32Array(o+r+s);e!==null&&a.set(e);for(let l=0;l{if(s)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 n=oo.get(t);if(n){if(n instanceof dH){const o=n.getLoadStatus();o.loaded===!1&&e.push(o.promise)}continue}oo.isResolved(t)||e.push(oo.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=qD.create(null,this._lexer.start);return cm.create(e,null)}tokenize(e,t,n){if(e.length>=this._maxTokenizationLineLength)return vG(this._languageId,n);const o=new Ott,r=this._tokenize(e,t,n,o);return o.finalize(r)}tokenizeEncoded(e,t,n){if(e.length>=this._maxTokenizationLineLength)return h5(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),n);const o=new sP(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),r=this._tokenize(e,t,n,o);return o.finalize(r)}_tokenize(e,t,n,o){return n.embeddedLanguageData?this._nestedTokenize(e,t,n,0,o):this._myTokenize(e,t,n,0,o)}_findLeavingNestedLanguageOffset(e,t){let n=this._lexer.tokenizer[t.stack.state];if(!n&&(n=d2(this._lexer,t.stack.state),!n))throw Bi(this._lexer,"tokenizer state is not defined: "+t.stack.state);let o=-1,r=!1;for(const s of n){if(!wre(s.action)||s.action.nextEmbedded!=="@pop")continue;r=!0;let a=s.regex;const l=s.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&&s.matchOnlyAtLineStart||(o===-1||c0&&r.nestedLanguageTokenize(a,!1,n.embeddedLanguageData,o);const l=e.substring(s);return this._myTokenize(l,t,n,o+s,r)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,n,o,r){r.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+` -`:e,l=a.length;let c=n.embeddedLanguageData,d=n.stack,u=0,h=null,f=!0;for(;f||u=l)break;f=!1;let k=this._lexer.tokenizer[m];if(!k&&(k=d2(this._lexer,m),!k))throw Bi(this._lexer,"tokenizer state is not defined: "+m);const R=a.substr(u);for(const A of k)if((u===0||!A.matchOnlyAtLineStart)&&(_=R.match(A.regex),_)){y=_[0],w=A.action;break}}if(_||(_=[""],y=""),w||(u=this._lexer.maxStack)throw Bi(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(m)}else if(w.next==="@pop"){if(d.depth<=1)throw Bi(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(L));d=d.pop()}else if(w.next==="@popall")d=d.popall();else{let k=lm(this._lexer,w.next,y,_,m);if(k[0]==="@"&&(k=k.substr(1)),d2(this._lexer,k))d=d.push(k);else throw Bi(this._lexer,"trying to set a next state '"+k+"' that is undefined in rule: "+this._safeRuleName(L))}}w.log&&typeof w.log=="string"&&Rtt(this._lexer,this._lexer.languageId+": "+lm(this._lexer,w.log,y,_,m))}if(E===null)throw Bi(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(L));const I=k=>{const R=this._languageService.getLanguageIdByLanguageName(k)||this._languageService.getLanguageIdByMimeType(k)||k,A=this._getNestedEmbeddedLanguageData(R);if(u0)throw Bi(this._lexer,"groups cannot be nested: "+this._safeRuleName(L));if(_.length!==E.length+1)throw Bi(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(L));let k=0;for(let R=1;R<_.length;R++)k+=_[R].length;if(k!==y.length)throw Bi(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(L));h={rule:L,matches:_,groups:[]};for(let R=0;Ri});class CG{static colorizeElement(e,t,n,o){o=o||{};const r=o.theme||"vs",s=o.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(r);const l=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+r;const c=d=>{var u;const h=(u=n9==null?void 0:n9.createHTML(d))!==null&&u!==void 0?u:d;n.innerHTML=h};return this.colorize(t,l||"",a,o).then(c,d=>console.error(d))}static colorize(e,t,n,o){return Btt(this,void 0,void 0,function*(){const r=e.languageIdCodec;let s=4;o&&typeof o.tabSize=="number"&&(s=o.tabSize),eG(t)&&(t=t.substr(1));const a=gf(t);if(!e.isRegisteredLanguageId(n))return xre(a,s,r);const l=yield oo.getOrCreate(n);return l?Wtt(a,s,l,r):xre(a,s,r)})}static colorizeLine(e,t,n,o,r=4){const s=Zl.isBasicASCII(e,t),a=Zl.containsRTL(e,s,n);return f5(new Jv(!1,!0,e,!1,s,a,0,o,[],r,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,n=4){const o=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(o,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,n)}}function Wtt(i,e,t,n){return new Promise((o,r)=>{const s=()=>{const a=Vtt(i,e,t,n);if(t instanceof GD){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,r);return}}o(a)};s()})}function xre(i,e,t){let n=[];const r=new Uint32Array(2);r[0]=0,r[1]=33587200;for(let s=0,a=i.length;s")}return n.join("")}function Vtt(i,e,t,n){let o=[],r=t.getInitialState();for(let s=0,a=i.length;s"),r=c.endState}return o.join("")}const Lre=2e4;let z_,lM,uH,cM,hH;function Htt(i){z_=document.createElement("div"),z_.className="monaco-aria-container";const e=()=>{const n=document.createElement("div");return n.className="monaco-alert",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),z_.appendChild(n),n};lM=e(),uH=e();const t=()=>{const n=document.createElement("div");return n.className="monaco-status",n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),z_.appendChild(n),n};cM=t(),hH=t(),i.appendChild(z_)}function Cs(i){!z_||(lM.textContent!==i?(Ur(uH),aP(lM,i)):(Ur(lM),aP(uH,i)))}function kv(i){!z_||(cM.textContent!==i?(Ur(hH),aP(cM,i)):(Ur(cM),aP(hH,i)))}function aP(i,e){Ur(i),e.length>Lre&&(e=e.substr(0,Lre)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}const yG=yn("markerDecorationsService");var $tt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ztt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let XD=class{constructor(e,t){}dispose(){}};XD.ID="editor.contrib.markerDecorations";XD=$tt([ztt(1,yG)],XD);Un(XD.ID,XD,0);class nbe extends _e{constructor(e,t){super(),this._onDidChange=this._register(new le),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 n=!1,o=!1;const r=()=>{if(n&&!o)try{n=!1,o=!0,t()}finally{requestAnimationFrame(()=>{o=!1,r()})}};this._resizeObserver=new ResizeObserver(s=>{e=s&&s[0]&&s[0].contentRect?s[0].contentRect:null,n=!0,r()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,o=0;t?(n=t.width,o=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,o=this._referenceDomElement.clientHeight),n=Math.max(5,n),o=Math.max(5,o),(this._width!==n||this._height!==o)&&(this._width=n,this._height=o,e&&this._onDidChange.fire())}}class Zm{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Zm._read(e,this.key),n=r=>Zm._read(e,r),o=(r,s)=>Zm._write(e,r,s);this.migrate(t,n,o)}static _read(e,t){if(typeof e=="undefined")return;const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return this._read(e[o],t.substring(n+1))}return e[t]}static _write(e,t,n){const o=t.indexOf(".");if(o>=0){const r=t.substring(0,o);e[r]=e[r]||{},this._write(e[r],t.substring(o+1),n);return}e[t]=n}}Zm.items=[];function e_(i,e){Zm.items.push(new Zm(i,e))}function Kc(i,e){e_(i,(t,n,o)=>{if(typeof t!="undefined"){for(const[r,s]of e)if(t===r){o(i,s);return}}})}function Utt(i){Zm.items.forEach(e=>e.apply(i))}Kc("wordWrap",[[!0,"on"],[!1,"off"]]);Kc("lineNumbers",[[!0,"on"],[!1,"off"]]);Kc("cursorBlinking",[["visible","solid"]]);Kc("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Kc("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Kc("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Kc("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Kc("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Kc("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Kc("autoIndent",[[!1,"advanced"],[!0,"full"]]);Kc("matchBrackets",[[!0,"always"],[!1,"never"]]);Kc("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Kc("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);e_("autoClosingBrackets",(i,e,t)=>{i===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")=="undefined"&&t("autoClosingQuotes","never"),typeof e("autoSurround")=="undefined"&&t("autoSurround","never"))});e_("renderIndentGuides",(i,e,t)=>{typeof i!="undefined"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")=="undefined"&&t("guides.indentation",!!i))});e_("highlightActiveIndentGuide",(i,e,t)=>{typeof i!="undefined"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")=="undefined"&&t("guides.highlightActiveIndentation",!!i))});const jtt={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"};e_("suggest.filteredTypes",(i,e,t)=>{if(i&&typeof i=="object"){for(const n of Object.entries(jtt))i[n[0]]===!1&&typeof e(`suggest.${n[1]}`)=="undefined"&&t(`suggest.${n[1]}`,!1);t("suggest.filteredTypes",void 0)}});e_("quickSuggestions",(i,e,t)=>{if(typeof i=="boolean"){const n=i?"on":"off";t("quickSuggestions",{comments:n,strings:n,other:n})}});e_("experimental.stickyScroll.enabled",(i,e,t)=>{typeof i=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")=="undefined"&&t("stickyScroll.enabled",i))});e_("experimental.stickyScroll.maxLineCount",(i,e,t)=>{typeof i=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")=="undefined"&&t("stickyScroll.maxLineCount",i))});class Ktt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new le,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Sw=new Ktt,_p=yn("accessibilityService"),GI=new lt("accessibilityModeEnabled",!1);var qtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Gtt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let fH=class extends _e{constructor(e,t,n,o){super(),this._accessibilityService=o,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new le),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new L_e,this.isSimpleWidget=e,this._containerObserver=this._register(new nbe(n,t.dimension)),this._rawOptions=Ere(t),this._validatedOptions=dm.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(xc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Sw.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(UV.onDidChange(()=>this._recomputeOptions())),this._register(PD.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=dm.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=k0.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),o={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Sw.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return dm.computeOptions(this._validatedOptions,o)}_readEnvConfiguration(){return{extraEditorClassName:Ytt(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:D0||Fc,pixelRatio:PD.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return UV.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=Ere(e);!dm.applyUpdate(this._rawOptions,t)||(this._validatedOptions=dm.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=Xtt(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())}};fH=qtt([Gtt(3,_p)],fH);function Xtt(i){let e=0;for(;i;)i=Math.floor(i/10),e++;return e||1}function Ytt(){let i="";return!lp&&!Z_e&&(i+="no-user-select "),lp&&(i+="no-minimap-shadow ",i+="enable-user-select "),Nn&&(i+="mac "),i}class Ztt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Qtt{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 dm{static validateOptions(e){const t=new Ztt;for(const n of IC){const o=n.name==="_never_"?void 0:e[n.name];t._write(n.id,n.validate(o))}return t}static computeOptions(e,t){const n=new Qtt;for(const o of IC)n._write(o.id,o.compute(t,n,e._read(o.id)));return n}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)?Lo(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!dm._deepEquals(e[n],t[n]))return!1;return!0}static checkEquals(e,t){const n=[];let o=!1;for(const r of IC){const s=!dm._deepEquals(e._read(r.id),t._read(r.id));n[r.id]=s,s&&(o=!0)}return o?new x_e(n):null}static applyUpdate(e,t){let n=!1;for(const o of IC)if(t.hasOwnProperty(o.name)){const r=o.applyUpdate(e[o.name],t[o.name]);e[o.name]=r.newValue,n=n||r.didChange}return n}}function Ere(i){const e=gg(i);return Utt(e),e}function Mo(i,e,t){let n=null,o=null;if(typeof t.value=="function"?(n="value",o=t.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(n="get",o=t.get),!o)throw new Error("not supported");const r=`$memoize$${e}`;t[n]=function(...s){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,s)}),this[r]}}var Jtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Di;(function(i){i.Tap="-monaco-gesturetap",i.Change="-monaco-gesturechange",i.Start="-monaco-gesturestart",i.End="-monaco-gesturesend",i.Contextmenu="-monaco-gesturecontextmenu"})(Di||(Di={}));class Ei extends _e{constructor(){super(),this.dispatched=!1,this.targets=new oa,this.ignoreTargets=new oa,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ke(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(ke(document,"touchend",e=>this.onTouchEnd(e))),this._register(ke(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Ei.isTouchDevice())return _e.None;Ei.INSTANCE||(Ei.INSTANCE=new Ei);const t=Ei.INSTANCE.targets.push(e);return zt(t)}static ignoreTarget(e){if(!Ei.isTouchDevice())return _e.None;Ei.INSTANCE||(Ei.INSTANCE=new Ei);const t=Ei.INSTANCE.ignoreTargets.push(e);return zt(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 n=0,o=e.targetTouches.length;n=Ei.HOLD_DELAY&&Math.abs(a.initialPageX-gc(a.rollingPageX))<30&&Math.abs(a.initialPageY-gc(a.rollingPageY))<30){const c=this.newGestureEvent(Di.Contextmenu,a.initialTarget);c.pageX=gc(a.rollingPageX),c.pageY=gc(a.rollingPageY),this.dispatchEvent(c)}else if(n===1){const c=gc(a.rollingPageX),d=gc(a.rollingPageY),u=gc(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(Di.End,a.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(e){if(e.type===Di.Tap){const t=new Date().getTime();let n=0;t-this._lastSetTapCountTime>Ei.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=t,e.tapCount=n}else(e.type===Di.Change||e.type===Di.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,n,o,r,s,a,l){this.handle=Bc(()=>{const c=Date.now(),d=c-t;let u=0,h=0,f=!0;n+=Ei.SCROLL_FRICTION*d,s+=Ei.SCROLL_FRICTION*d,n>0&&(f=!1,u=o*n*d),s>0&&(f=!1,h=a*s*d);const g=this.newGestureEvent(Di.Change);g.translationX=u,g.translationY=h,e.forEach(p=>p.dispatchEvent(g)),f||this.inertia(e,c,n,o,r+u,s,a,l+h)})}onTouchMove(e){const t=Date.now();for(let n=0,o=e.changedTouches.length;n3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(r.pageX),s.rollingPageY.push(r.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Ei.SCROLL_FRICTION=-.005;Ei.HOLD_DELAY=700;Ei.CLEAR_TAP_COUNT_TIME=400;Jtt([Mo],Ei,"isTouchDevice",null);class SS{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 n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,o,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=o,this._onStopCallback=r;let s=e;try{e.setPointerCapture(t),this._hooks.add(zt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=window}this._hooks.add(ke(s,et.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ke(s,et.POINTER_UP,a=>this.stopMonitoring(!0)))}}function wG(i){return`--vscode-${i.replace(/\./g,"-")}`}function ct(i){return`var(${wG(i)})`}function ent(i,e){return`var(${wG(i)}, ${e})`}const ibe={ColorContribution:"base.contributions.colors"};class tnt{constructor(){this._onDidChangeSchema=new le,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,o=!1,r){const s={id:e,description:n,defaults:t,needsTransparency:o,deprecationMessage:r};this.colorsById[e]=s;const a={type:"string",description:n,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const n=this.colorsById[e];if(n&&n.defaults){const o=n.defaults[t.type];return su(o,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,n)=>{const o=t.indexOf(".")===-1?0:1,r=n.indexOf(".")===-1?0:1;return o!==r?o-r:t.localeCompare(n)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const g5=new tnt;no.add(ibe.ColorContribution,g5);function J(i,e,t,n,o){return g5.registerColor(i,e,t,n,o)}const Ke=J("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},C("foreground","Overall foreground color. This color is only used if not overridden by a component."));J("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},C("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const nnt=J("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},C("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));J("descriptionForeground",{light:"#717171",dark:St(Ke,.7),hcDark:St(Ke,.7),hcLight:St(Ke,.7)},C("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Sm=J("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},C("iconForeground","The default color for icons in the workbench.")),Hl=J("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},C("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Ln=J("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},C("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Wi=J("contrastActiveBorder",{light:null,dark:null,hcDark:Hl,hcLight:Hl},C("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));J("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},C("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."));J("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:ve.black,hcLight:"#292929"},C("textSeparatorForeground","Color for text separators."));const int=J("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},C("textLinkForeground","Foreground color for links in text."));J("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},C("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));J("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},C("textPreformatForeground","Foreground color for preformatted text segments."));J("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},C("textBlockQuoteBackground","Background color for block quotes in text."));J("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:ve.white,hcLight:"#292929"},C("textBlockQuoteBorder","Border color for block quotes in text."));J("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:ve.black,hcLight:"#F2F2F2"},C("textCodeBlockBackground","Background color for code blocks in text."));const Gh=J("widget.shadow",{dark:St(ve.black,.36),light:St(ve.black,.16),hcDark:null,hcLight:null},C("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),SG=J("widget.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("widgetBorder","Border color of widgets such as find/replace inside the editor.")),obe=J("input.background",{dark:"#3C3C3C",light:ve.white,hcDark:ve.black,hcLight:ve.white},C("inputBoxBackground","Input box background.")),rbe=J("input.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("inputBoxForeground","Input box foreground.")),sbe=J("input.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("inputBoxBorder","Input box border.")),xG=J("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Ln,hcLight:Ln},C("inputBoxActiveOptionBorder","Border color of activated options in input fields."));J("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},C("inputOption.hoverBackground","Background color of activated options in input fields."));const f0=J("inputOption.activeBackground",{dark:St(Hl,.4),light:St(Hl,.2),hcDark:ve.transparent,hcLight:ve.transparent},C("inputOption.activeBackground","Background hover color of options in input fields.")),LG=J("inputOption.activeForeground",{dark:ve.white,light:ve.black,hcDark:Ke,hcLight:Ke},C("inputOption.activeForeground","Foreground color of activated options in input fields."));J("input.placeholderForeground",{light:St(Ke,.5),dark:St(Ke,.5),hcDark:St(Ke,.7),hcLight:St(Ke,.7)},C("inputPlaceholderForeground","Input box foreground color for placeholder text."));const ont=J("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:ve.black,hcLight:ve.white},C("inputValidationInfoBackground","Input validation background color for information severity.")),rnt=J("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationInfoForeground","Input validation foreground color for information severity.")),snt=J("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Ln,hcLight:Ln},C("inputValidationInfoBorder","Input validation border color for information severity.")),ant=J("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:ve.black,hcLight:ve.white},C("inputValidationWarningBackground","Input validation background color for warning severity.")),lnt=J("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationWarningForeground","Input validation foreground color for warning severity.")),cnt=J("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Ln,hcLight:Ln},C("inputValidationWarningBorder","Input validation border color for warning severity.")),dnt=J("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:ve.black,hcLight:ve.white},C("inputValidationErrorBackground","Input validation background color for error severity.")),unt=J("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationErrorForeground","Input validation foreground color for error severity.")),hnt=J("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},C("inputValidationErrorBorder","Input validation border color for error severity.")),Xh=J("dropdown.background",{dark:"#3C3C3C",light:ve.white,hcDark:ve.black,hcLight:ve.white},C("dropdownBackground","Dropdown background.")),fnt=J("dropdown.listBackground",{dark:null,light:null,hcDark:ve.black,hcLight:ve.white},C("dropdownListBackground","Dropdown list background.")),Og=J("dropdown.foreground",{dark:"#F0F0F0",light:Ke,hcDark:ve.white,hcLight:Ke},C("dropdownForeground","Dropdown foreground.")),PC=J("dropdown.border",{dark:Xh,light:"#CECECE",hcDark:Ln,hcLight:Ln},C("dropdownBorder","Dropdown border.")),CL=J("button.foreground",{dark:ve.white,light:ve.white,hcDark:ve.white,hcLight:ve.white},C("buttonForeground","Button foreground color.")),gnt=J("button.separator",{dark:St(CL,.4),light:St(CL,.4),hcDark:St(CL,.4),hcLight:St(CL,.4)},C("buttonSeparator","Button separator color.")),yL=J("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},C("buttonBackground","Button background color.")),pnt=J("button.hoverBackground",{dark:Vu(yL,.2),light:$b(yL,.2),hcDark:yL,hcLight:yL},C("buttonHoverBackground","Button background color when hovering.")),mnt=J("button.border",{dark:Ln,light:Ln,hcDark:Ln,hcLight:Ln},C("buttonBorder","Button border color.")),vnt=J("button.secondaryForeground",{dark:ve.white,light:ve.white,hcDark:ve.white,hcLight:Ke},C("buttonSecondaryForeground","Secondary button foreground color.")),gH=J("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:ve.white},C("buttonSecondaryBackground","Secondary button background color.")),_nt=J("button.secondaryHoverBackground",{dark:Vu(gH,.2),light:$b(gH,.2),hcDark:null,hcLight:null},C("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),dM=J("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:ve.black,hcLight:"#0F4A85"},C("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),bnt=J("badge.foreground",{dark:ve.white,light:"#333",hcDark:ve.white,hcLight:ve.white},C("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Cnt=J("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},C("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),wL=J("scrollbarSlider.background",{dark:ve.fromHex("#797979").transparent(.4),light:ve.fromHex("#646464").transparent(.4),hcDark:St(Ln,.6),hcLight:St(Ln,.4)},C("scrollbarSliderBackground","Scrollbar slider background color.")),SL=J("scrollbarSlider.hoverBackground",{dark:ve.fromHex("#646464").transparent(.7),light:ve.fromHex("#646464").transparent(.7),hcDark:St(Ln,.8),hcLight:St(Ln,.8)},C("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),xL=J("scrollbarSlider.activeBackground",{dark:ve.fromHex("#BFBFBF").transparent(.4),light:ve.fromHex("#000000").transparent(.6),hcDark:Ln,hcLight:Ln},C("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),ynt=J("progressBar.background",{dark:ve.fromHex("#0E70C0"),light:ve.fromHex("#0E70C0"),hcDark:Ln,hcLight:Ln},C("progressBarBackground","Background color of the progress bar that can show for long running operations."));J("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},C("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 Yh=J("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},C("editorError.foreground","Foreground color of error squigglies in the editor.")),wnt=J("editorError.border",{dark:null,light:null,hcDark:ve.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},C("errorBorder","If set, color of double underlines for errors in the editor."));J("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},C("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 $l=J("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},C("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),YD=J("editorWarning.border",{dark:null,light:null,hcDark:ve.fromHex("#FFCC00").transparent(.8),hcLight:ve.fromHex("#FFCC00").transparent(.8)},C("warningBorder","If set, color of double underlines for warnings in the editor."));J("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},C("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 Ma=J("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},C("editorInfo.foreground","Foreground color of info squigglies in the editor.")),ZD=J("editorInfo.border",{dark:null,light:null,hcDark:ve.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},C("infoBorder","If set, color of double underlines for infos in the editor.")),Snt=J("editorHint.foreground",{dark:ve.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},C("editorHint.foreground","Foreground color of hint squigglies in the editor."));J("editorHint.border",{dark:null,light:null,hcDark:ve.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},C("hintBorder","If set, color of double underlines for hints in the editor."));J("sash.hoverBorder",{dark:Hl,light:Hl,hcDark:Hl,hcLight:Hl},C("sashActiveBorder","Border color of active sashes."));const mr=J("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:ve.black,hcLight:ve.white},C("editorBackground","Editor background color.")),Sd=J("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:ve.white,hcLight:Ke},C("editorForeground","Editor default foreground color."));J("editorStickyScroll.background",{light:mr,dark:mr,hcDark:mr,hcLight:mr},C("editorStickyScrollBackground","Sticky scroll background color for the editor"));J("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const po=J("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:ve.white},C("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Zh=J("editorWidget.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Qh=J("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Ln,hcLight:Ln},C("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.")),xnt=J("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},C("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.")),Dre=J("quickInput.background",{dark:po,light:po,hcDark:po,hcLight:po},C("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Lnt=J("quickInput.foreground",{dark:Zh,light:Zh,hcDark:Zh,hcLight:Zh},C("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Ent=J("quickInputTitle.background",{dark:new ve(new Tn(255,255,255,.105)),light:new ve(new Tn(0,0,0,.06)),hcDark:"#000000",hcLight:ve.white},C("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),abe=J("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:ve.white,hcLight:"#0F4A85"},C("pickerGroupForeground","Quick picker color for grouping labels.")),Dnt=J("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:ve.white,hcLight:"#0F4A85"},C("pickerGroupBorder","Quick picker color for grouping borders.")),knt=J("keybindingLabel.background",{dark:new ve(new Tn(128,128,128,.17)),light:new ve(new Tn(221,221,221,.4)),hcDark:ve.transparent,hcLight:ve.transparent},C("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Int=J("keybindingLabel.foreground",{dark:ve.fromHex("#CCCCCC"),light:ve.fromHex("#555555"),hcDark:ve.white,hcLight:Ke},C("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Tnt=J("keybindingLabel.border",{dark:new ve(new Tn(51,51,51,.6)),light:new ve(new Tn(204,204,204,.4)),hcDark:new ve(new Tn(111,195,223)),hcLight:Ln},C("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Nnt=J("keybindingLabel.bottomBorder",{dark:new ve(new Tn(68,68,68,.6)),light:new ve(new Tn(187,187,187,.4)),hcDark:new ve(new Tn(111,195,223)),hcLight:Ke},C("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),xm=J("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},C("editorSelectionBackground","Color of the editor selection.")),Rnt=J("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:ve.white},C("editorSelectionForeground","Color of the selected text for high contrast.")),lbe=J("editor.inactiveSelectionBackground",{light:St(xm,.5),dark:St(xm,.5),hcDark:St(xm,.7),hcLight:St(xm,.5)},C("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),EG=J("editor.selectionHighlightBackground",{light:Are(xm,mr,.3,.6),dark:Are(xm,mr,.3,.6),hcDark:null,hcLight:null},C("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);J("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const Mnt=J("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},C("editorFindMatch","Color of the current search match.")),Jh=J("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},C("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Ant=J("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},C("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Pnt=J("editor.findMatchBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("editorFindMatchBorder","Border color of the current search match.")),Lm=J("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("findMatchHighlightBorder","Border color of the other search matches.")),Ont=J("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:St(Wi,.4),hcLight:St(Wi,.4)},C("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);J("searchEditor.findMatchBackground",{light:St(Jh,.66),dark:St(Jh,.66),hcDark:Jh,hcLight:Jh},C("searchEditor.queryMatch","Color of the Search Editor query matches."));J("searchEditor.findMatchBorder",{light:St(Lm,.66),dark:St(Lm,.66),hcDark:Lm,hcLight:Lm},C("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));J("search.resultsInfoForeground",{light:Ke,dark:St(Ke,.65),hcDark:Ke,hcLight:Ke},C("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));J("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},C("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 lP=J("editorHoverWidget.background",{light:po,dark:po,hcDark:po,hcLight:po},C("hoverBackground","Background color of the editor hover."));J("editorHoverWidget.foreground",{light:Zh,dark:Zh,hcDark:Zh,hcLight:Zh},C("hoverForeground","Foreground color of the editor hover."));const Fnt=J("editorHoverWidget.border",{light:Qh,dark:Qh,hcDark:Qh,hcLight:Qh},C("hoverBorder","Border color of the editor hover."));J("editorHoverWidget.statusBarBackground",{dark:Vu(lP,.2),light:$b(lP,.05),hcDark:po,hcLight:po},C("statusBarBackground","Background color of the editor hover status bar."));const Bnt=J("editorLink.activeForeground",{dark:"#4E94CE",light:ve.blue,hcDark:ve.cyan,hcLight:"#292929"},C("activeLinkForeground","Color of active links.")),Fg=J("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:ve.white,hcLight:ve.black},C("editorInlayHintForeground","Foreground color of inline hints")),Bg=J("editorInlayHint.background",{dark:St(dM,.1),light:St(dM,.1),hcDark:St(ve.white,.1),hcLight:St(dM,.1)},C("editorInlayHintBackground","Background color of inline hints")),Wnt=J("editorInlayHint.typeForeground",{dark:Fg,light:Fg,hcDark:Fg,hcLight:Fg},C("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Vnt=J("editorInlayHint.typeBackground",{dark:Bg,light:Bg,hcDark:Bg,hcLight:Bg},C("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Hnt=J("editorInlayHint.parameterForeground",{dark:Fg,light:Fg,hcDark:Fg,hcLight:Fg},C("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),$nt=J("editorInlayHint.parameterBackground",{dark:Bg,light:Bg,hcDark:Bg,hcLight:Bg},C("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));J("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},C("editorLightBulbForeground","The color used for the lightbulb actions icon."));J("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const pH=new ve(new Tn(155,185,85,.2)),mH=new ve(new Tn(255,0,0,.2)),znt=J("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},C("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Unt=J("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},C("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditor.insertedLineBackground",{dark:pH,light:pH,hcDark:null,hcLight:null},C("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditor.removedLineBackground",{dark:mH,light:mH,hcDark:null,hcLight:null},C("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));J("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const jnt=J("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Knt=J("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));J("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},C("diffEditorInsertedOutline","Outline color for the text that got inserted."));J("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},C("diffEditorRemovedOutline","Outline color for text that got removed."));J("diffEditor.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("diffEditorBorder","Border color between the two text editors."));J("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},C("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));J("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},C("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));J("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},C("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));J("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},C("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const qnt=J("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),Gnt=J("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),Xnt=J("list.focusOutline",{dark:Hl,light:Hl,hcDark:Wi,hcLight:Wi},C("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.")),Ynt=J("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),Wg=J("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("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.")),ef=J("list.activeSelectionForeground",{dark:ve.white,light:ve.white,hcDark:null,hcLight:null},C("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.")),LL=J("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),Znt=J("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("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.")),Qnt=J("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),Jnt=J("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),eit=J("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),tit=J("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),cbe=J("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:ve.white.transparent(.1),hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("listHoverBackground","List/Tree background when hovering over items using the mouse.")),dbe=J("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),nit=J("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},C("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),xd=J("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Hl,hcLight:Hl},C("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),u2=J("list.focusHighlightForeground",{dark:xd,light:Rit(Wg,xd,"#BBE7FF"),hcDark:xd,hcLight:xd},C("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));J("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},C("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));J("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},C("listErrorForeground","Foreground color of list items containing errors."));J("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},C("listWarningForeground","Foreground color of list items containing warnings."));const iit=J("listFilterWidget.background",{light:$b(po,0),dark:Vu(po,0),hcDark:po,hcLight:po},C("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),oit=J("listFilterWidget.outline",{dark:ve.transparent,light:ve.transparent,hcDark:"#f38518",hcLight:"#007ACC"},C("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),rit=J("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},C("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),sit=J("listFilterWidget.shadow",{dark:Gh,light:Gh,hcDark:Gh,hcLight:Gh},C("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));J("list.filterMatchBackground",{dark:Jh,light:Jh,hcDark:null,hcLight:null},C("listFilterMatchHighlight","Background color of the filtered match."));J("list.filterMatchBorder",{dark:Lm,light:Lm,hcDark:Ln,hcLight:Wi},C("listFilterMatchHighlightBorder","Border color of the filtered match."));const EL=J("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},C("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),ait=J("tree.inactiveIndentGuidesStroke",{dark:St(EL,.4),light:St(EL,.4),hcDark:St(EL,.4),hcLight:St(EL,.4)},C("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),lit=J("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},C("tableColumnsBorder","Table border color between columns.")),cit=J("tree.tableOddRowsBackground",{dark:St(Ke,.04),light:St(Ke,.04),hcDark:null,hcLight:null},C("tableOddRowsBackgroundColor","Background color for odd table rows."));J("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},C("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const dit=J("checkbox.background",{dark:Xh,light:Xh,hcDark:Xh,hcLight:Xh},C("checkbox.background","Background color of checkbox widget."));J("checkbox.selectBackground",{dark:po,light:po,hcDark:po,hcLight:po},C("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const uit=J("checkbox.foreground",{dark:Og,light:Og,hcDark:Og,hcLight:Og},C("checkbox.foreground","Foreground color of checkbox widget.")),hit=J("checkbox.border",{dark:PC,light:PC,hcDark:PC,hcLight:PC},C("checkbox.border","Border color of checkbox widget."));J("checkbox.selectBorder",{dark:Sm,light:Sm,hcDark:Sm,hcLight:Sm},C("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const kre=J("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,C("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),g0=J("quickInputList.focusForeground",{dark:ef,light:ef,hcDark:ef,hcLight:ef},C("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),OC=J("quickInputList.focusIconForeground",{dark:LL,light:LL,hcDark:LL,hcLight:LL},C("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),p0=J("quickInputList.focusBackground",{dark:QD(kre,Wg),light:QD(kre,Wg),hcDark:null,hcLight:null},C("quickInput.listFocusBackground","Quick picker background color for the focused item.")),fit=J("menu.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("menuBorder","Border color of menus.")),git=J("menu.foreground",{dark:Og,light:Og,hcDark:Og,hcLight:Og},C("menuForeground","Foreground color of menu items.")),pit=J("menu.background",{dark:Xh,light:Xh,hcDark:Xh,hcLight:Xh},C("menuBackground","Background color of menu items.")),mit=J("menu.selectionForeground",{dark:ef,light:ef,hcDark:ef,hcLight:ef},C("menuSelectionForeground","Foreground color of the selected menu item in menus.")),vit=J("menu.selectionBackground",{dark:Wg,light:Wg,hcDark:Wg,hcLight:Wg},C("menuSelectionBackground","Background color of the selected menu item in menus.")),_it=J("menu.selectionBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("menuSelectionBorder","Border color of the selected menu item in menus.")),bit=J("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Ln,hcLight:Ln},C("menuSeparatorBackground","Color of a separator menu item in menus.")),vH=J("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},C("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));J("toolbar.hoverOutline",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));J("toolbar.activeBackground",{dark:Vu(vH,.1),light:$b(vH,.1),hcDark:null,hcLight:null},C("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));J("editor.snippetTabstopHighlightBackground",{dark:new ve(new Tn(124,124,124,.3)),light:new ve(new Tn(10,50,100,.2)),hcDark:new ve(new Tn(124,124,124,.3)),hcLight:new ve(new Tn(10,50,100,.2))},C("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));J("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},C("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));J("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));J("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new ve(new Tn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},C("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const Cit=J("breadcrumb.foreground",{light:St(Ke,.8),dark:St(Ke,.8),hcDark:St(Ke,.8),hcLight:St(Ke,.8)},C("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),yit=J("breadcrumb.background",{light:mr,dark:mr,hcDark:mr,hcLight:mr},C("breadcrumbsBackground","Background color of breadcrumb items.")),Ire=J("breadcrumb.focusForeground",{light:$b(Ke,.2),dark:Vu(Ke,.1),hcDark:Vu(Ke,.1),hcLight:Vu(Ke,.1)},C("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),wit=J("breadcrumb.activeSelectionForeground",{light:$b(Ke,.2),dark:Vu(Ke,.1),hcDark:Vu(Ke,.1),hcLight:Vu(Ke,.1)},C("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));J("breadcrumbPicker.background",{light:po,dark:po,hcDark:po,hcLight:po},C("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const ube=.5,Tre=ve.fromHex("#40C8AE").transparent(ube),Nre=ve.fromHex("#40A6FF").transparent(ube),Rre=ve.fromHex("#606060").transparent(.4),Ld=.4,xw=1,FC=J("merge.currentHeaderBackground",{dark:Tre,light:Tre,hcDark:null,hcLight:null},C("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.currentContentBackground",{dark:St(FC,Ld),light:St(FC,Ld),hcDark:St(FC,Ld),hcLight:St(FC,Ld)},C("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const BC=J("merge.incomingHeaderBackground",{dark:Nre,light:Nre,hcDark:null,hcLight:null},C("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.incomingContentBackground",{dark:St(BC,Ld),light:St(BC,Ld),hcDark:St(BC,Ld),hcLight:St(BC,Ld)},C("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const WC=J("merge.commonHeaderBackground",{dark:Rre,light:Rre,hcDark:null,hcLight:null},C("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.commonContentBackground",{dark:St(WC,Ld),light:St(WC,Ld),hcDark:St(WC,Ld),hcLight:St(WC,Ld)},C("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Lw=J("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},C("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));J("editorOverviewRuler.currentContentForeground",{dark:St(FC,xw),light:St(FC,xw),hcDark:Lw,hcLight:Lw},C("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));J("editorOverviewRuler.incomingContentForeground",{dark:St(BC,xw),light:St(BC,xw),hcDark:Lw,hcLight:Lw},C("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));J("editorOverviewRuler.commonContentForeground",{dark:St(WC,xw),light:St(WC,xw),hcDark:Lw,hcLight:Lw},C("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const DG=J("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},C("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),DL=J("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},C("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),VC=J("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},C("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),p5=J("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},C("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),Mre=J("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},C("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Sit=J("minimap.infoHighlight",{dark:Ma,light:Ma,hcDark:ZD,hcLight:ZD},C("minimapInfo","Minimap marker color for infos.")),xit=J("minimap.warningHighlight",{dark:$l,light:$l,hcDark:YD,hcLight:YD},C("overviewRuleWarning","Minimap marker color for warnings.")),Lit=J("minimap.errorHighlight",{dark:new ve(new Tn(255,18,18,.7)),light:new ve(new Tn(255,18,18,.7)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:"#B5200D"},C("minimapError","Minimap marker color for errors.")),Eit=J("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},C("minimapBackground","Minimap background color.")),Dit=J("minimap.foregroundOpacity",{dark:ve.fromHex("#000f"),light:ve.fromHex("#000f"),hcDark:ve.fromHex("#000f"),hcLight:ve.fromHex("#000f")},C("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));J("minimapSlider.background",{light:St(wL,.5),dark:St(wL,.5),hcDark:St(wL,.5),hcLight:St(wL,.5)},C("minimapSliderBackground","Minimap slider background color."));J("minimapSlider.hoverBackground",{light:St(SL,.5),dark:St(SL,.5),hcDark:St(SL,.5),hcLight:St(SL,.5)},C("minimapSliderHoverBackground","Minimap slider background color when hovering."));J("minimapSlider.activeBackground",{light:St(xL,.5),dark:St(xL,.5),hcDark:St(xL,.5),hcLight:St(xL,.5)},C("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const kit=J("problemsErrorIcon.foreground",{dark:Yh,light:Yh,hcDark:Yh,hcLight:Yh},C("problemsErrorIconForeground","The color used for the problems error icon.")),Iit=J("problemsWarningIcon.foreground",{dark:$l,light:$l,hcDark:$l,hcLight:$l},C("problemsWarningIconForeground","The color used for the problems warning icon.")),Tit=J("problemsInfoIcon.foreground",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},C("problemsInfoIconForeground","The color used for the problems info icon."));J("charts.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("chartsForeground","The foreground color used in charts."));J("charts.lines",{dark:St(Ke,.5),light:St(Ke,.5),hcDark:St(Ke,.5),hcLight:St(Ke,.5)},C("chartsLines","The color used for horizontal lines in charts."));J("charts.red",{dark:Yh,light:Yh,hcDark:Yh,hcLight:Yh},C("chartsRed","The red color used in chart visualizations."));J("charts.blue",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},C("chartsBlue","The blue color used in chart visualizations."));J("charts.yellow",{dark:$l,light:$l,hcDark:$l,hcLight:$l},C("chartsYellow","The yellow color used in chart visualizations."));J("charts.orange",{dark:VC,light:VC,hcDark:VC,hcLight:VC},C("chartsOrange","The orange color used in chart visualizations."));J("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},C("chartsGreen","The green color used in chart visualizations."));J("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("chartsPurple","The purple color used in chart visualizations."));function Nit(i,e){var t,n,o,r;switch(i.op){case 0:return(t=su(i.value,e))===null||t===void 0?void 0:t.darken(i.factor);case 1:return(n=su(i.value,e))===null||n===void 0?void 0:n.lighten(i.factor);case 2:return(o=su(i.value,e))===null||o===void 0?void 0:o.transparent(i.factor);case 3:{const s=su(i.background,e);return s?(r=su(i.value,e))===null||r===void 0?void 0:r.makeOpaque(s):su(i.value,e)}case 4:for(const s of i.values){const a=su(s,e);if(a)return a}return;case 6:return su(e.defines(i.if)?i.then:i.else,e);case 5:{const s=su(i.value,e);if(!s)return;const a=su(i.background,e);return a?s.isDarkerThan(a)?ve.getLighterColor(s,a,i.factor).transparent(i.transparency):ve.getDarkerColor(s,a,i.factor).transparent(i.transparency):s.transparent(i.factor*i.transparency)}default:throw Q4()}}function $b(i,e){return{op:0,value:i,factor:e}}function Vu(i,e){return{op:1,value:i,factor:e}}function St(i,e){return{op:2,value:i,factor:e}}function QD(...i){return{op:4,values:i}}function Rit(i,e,t){return{op:6,if:i,then:e,else:t}}function Are(i,e,t,n){return{op:5,value:i,background:e,factor:t,transparency:n}}function su(i,e){if(i!==null){if(typeof i=="string")return i[0]==="#"?ve.fromHex(i):e.getColor(i);if(i instanceof ve)return i;if(typeof i=="object")return Nit(i,e)}}const hbe="vscode://schemas/workbench-colors",fbe=no.as(c5.JSONContribution);fbe.registerSchema(hbe,g5.getColorSchema());const Pre=new bi(()=>fbe.notifySchemaChanged(hbe),200);g5.onDidChangeSchema(()=>{Pre.isScheduled()||Pre.schedule()});class m5{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new gbe(this.x-window.scrollX,this.y-window.scrollY)}}class gbe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new m5(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class Mit{constructor(e,t,n,o){this.x=e,this.y=t,this.width=n,this.height=o,this._editorPagePositionBrand=void 0}}class Ait{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function kG(i){const e=Yo(i);return new Mit(e.left,e.top,e.width,e.height)}function IG(i,e,t){const n=e.width/i.offsetWidth,o=e.height/i.offsetHeight,r=(t.x-e.x)/n,s=(t.y-e.y)/o;return new Ait(r,s)}class Iv extends kc{constructor(e,t,n){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new m5(this.posx,this.posy),this.editorPos=kG(n),this.relativePos=IG(n,this.editorPos,this.pos)}}class Pit{constructor(e){this._editorViewDomNode=e}_create(e){return new Iv(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ke(e,"contextmenu",n=>{t(this._create(n))})}onMouseUp(e,t){return ke(e,"mouseup",n=>{t(this._create(n))})}onMouseDown(e,t){return ke(e,et.MOUSE_DOWN,n=>{t(this._create(n))})}onPointerDown(e,t){return ke(e,et.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onMouseLeave(e,t){return ke(e,et.MOUSE_LEAVE,n=>{t(this._create(n))})}onMouseMove(e,t){return ke(e,"mousemove",n=>t(this._create(n)))}}class Oit{constructor(e){this._editorViewDomNode=e}_create(e){return new Iv(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ke(e,"pointerup",n=>{t(this._create(n))})}onPointerDown(e,t){return ke(e,et.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onPointerLeave(e,t){return ke(e,et.POINTER_LEAVE,n=>{t(this._create(n))})}onPointerMove(e,t){return ke(e,"pointermove",n=>t(this._create(n)))}}class Fit extends _e{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new SS),this._keydownListener=null}startMonitoring(e,t,n,o,r){this._keydownListener=No(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,n,s=>{o(new Iv(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),r(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class XI{constructor(e){this._editor=e,this._instanceId=++XI._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new bi(()=>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 n=this._rules.get(t);if(!n){const o=this._counter++;n=new Bit(t,`dyn-rule-${this._instanceId}-${o}`,XA(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}XI._idPool=0;class Bit{constructor(e,t,n,o){this.key=e,this.className=t,this.properties=o,this._referenceCount=0,this._styleElement=Wc(n),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(const o in t){const r=t[o];let s;typeof r=="object"?s=ct(r.id):s=r,n+=` - ${Wit(o)}: ${s};`}return n+=` -}`,n}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Wit(i){return i.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class YI extends _e{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 n=0,o=e.length;n=a.left?o.width=Math.max(o.width,a.left+a.width-o.left):(t[n++]=o,o=a)}return t[n++]=o,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||e.length===0)return null;const o=[];for(let r=0,s=e.length;rl)return null;if(t=Math.min(l,Math.max(0,t)),o=Math.min(l,Math.max(0,o)),t===o&&n===r&&n===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==o&&o>0&&r===0&&(o--,r=1073741824);let c=e.children[t].firstChild,d=e.children[o].firstChild;if((!c||!d)&&(!c&&n===0&&t>0&&(c=e.children[t-1].firstChild,n=1073741824),!d&&r===0&&o>0&&(d=e.children[o-1].firstChild,r=1073741824)),!c||!d)return null;n=Math.min(c.textContent.length,Math.max(0,n)),r=Math.min(d.textContent.length,Math.max(0,r));const u=this._readClientRects(c,n,d,r,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,s.clientRectDeltaLeft,s.clientRectScale)}}var Ic;(function(i){i.DARK="dark",i.LIGHT="light",i.HIGH_CONTRAST_DARK="hcDark",i.HIGH_CONTRAST_LIGHT="hcLight"})(Ic||(Ic={}));function Hu(i){return i===Ic.HIGH_CONTRAST_DARK||i===Ic.HIGH_CONTRAST_LIGHT}function Ew(i){return i===Ic.DARK||i===Ic.HIGH_CONTRAST_DARK}const Uit=function(){return Fu?!0:!(xs||Fc||lp)}();let Ly=!0;class Fre{constructor(e,t){this.themeType=t;const n=e.options,o=n.get(50);n.get(38)==="off"?this.renderWhitespace=n.get(98):this.renderWhitespace="none",this.renderControlCharacters=n.get(93),this.spaceWidth=o.spaceWidth,this.middotWidth=o.middotWidth,this.wsmiddotWidth=o.wsmiddotWidth,this.useMonospaceOptimizations=o.isMonospace&&!n.get(33),this.canUseHalfwidthRightwardsArrow=o.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(66),this.stopRenderingLineAfter=n.get(116),this.fontLigatures=n.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 Oh{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=ti(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 Hu(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,n,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),s=this._options,a=rl.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(Hu(s.themeType)||this._options.renderWhitespace==="selection"){const h=n.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:r.minColumn,p=f.endLineNumber===e?f.endColumn:r.maxColumn;g');const d=qI(c,o);o.appendString("");let u=null;return Ly&&Uit&&r.isBasicASCII&&s.useMonospaceOptimizations&&d.containsForeignElements===0&&(u=new h2(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping)),u||(u=mbe(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 h2:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof h2?this._renderedViewLine.monospaceAssumptionsAreValid():Ly}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof h2&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,o){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));const r=this._renderedViewLine.input.stopRenderingLineAfter;if(r!==-1&&t>r+1&&n>r+1)return new Ore(!0,[new T0(this.getWidth(o),0)]);r!==-1&&t>r+1&&(t=r+1),r!==-1&&n>r+1&&(n=r+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,n,o);return s&&s.length>0?new Ore(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Oh.CLASS_NAME="view-line";class h2{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;const o=Math.floor(t.lineContent.length/300);if(o>0){this._keyColumnPixelOffsetCache=new Float32Array(o);for(let r=0;r=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Ly=!1)}return Ly}toSlowRenderedLine(){return mbe(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,o){const r=this._getColumnPixelOffset(e,t,o),s=this._getColumnPixelOffset(e,n,o);return[new T0(r,s-r)]}_getColumnPixelOffset(e,t,n){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const o=Math.floor((t-1)/300)-1,r=(o+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[o],s===-1&&(s=this._actualReadPixelOffset(e,r,n),this._keyColumnPixelOffsetCache[o]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(r),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;const o=this._characterMapping.getDomPosition(t),r=uM.readHorizontalRanges(this._getReadingTarget(this.domNode),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);return!r||r.length===0?-1:r[0].left}getColumnOfNodeOffset(e,t){return TG(this._characterMapping,e,t)}}class pbe{constructor(e,t,n,o,r){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=r,this._cachedWidth=-1,this._pixelOffsetCache=null,!o||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-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,n,o){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const r=this._readPixelOffset(this.domNode,e,t,o);if(r===-1)return null;const s=this._readPixelOffset(this.domNode,e,n,o);return s===-1?null:[new T0(r,s-r)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,o)}_readVisibleRangesForRange(e,t,n,o,r){if(n===o){const s=this._readPixelOffset(e,t,n,r);return s===-1?null:[new T0(s,0)]}else return this._readRawVisibleRangesForRange(e,n,o,r)}_readPixelOffset(e,t,n,o){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(o);const r=this._getReadingTarget(e);return r.firstChild?(o.markDidDomLayout(),r.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const r=this._pixelOffsetCache[n];if(r!==-1)return r;const s=this._actualReadPixelOffset(e,t,n,o);return this._pixelOffsetCache[n]=s,s}return this._actualReadPixelOffset(e,t,n,o)}_actualReadPixelOffset(e,t,n,o){if(this._characterMapping.length===0){const l=uM.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,o);return!l||l.length===0?-1:l[0].left}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(o);const r=this._characterMapping.getDomPosition(n),s=uM.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,r.partIndex,r.charIndex,o);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(n),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,n,o){if(t===1&&n===this._characterMapping.length)return[new T0(0,this.getWidth(o))];const r=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(n);return uM.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,s.partIndex,s.charIndex,o)}getColumnOfNodeOffset(e,t){return TG(this._characterMapping,e,t)}}class jit extends pbe{_readVisibleRangesForRange(e,t,n,o,r){const s=super._readVisibleRangesForRange(e,t,n,o,r);if(!s||s.length===0||n===o||n===1&&o===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,o,r);if(a!==-1){const l=s[s.length-1];l.left=t){const u=t-s;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 Dw{constructor(e,t,n){this.viewModel=e.viewModel;const o=e.configuration.options;this.layoutInfo=o.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=o.get(66),this.stickyTabStops=o.get(115),this.typicalHalfwidthCharacterWidth=o.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Dw.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){const o=n.verticalOffset+n.height/2,r=e.viewModel.getLineCount();let s=null,a,l=null;return n.afterLineNumber!==r&&(l=new ae(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(s=new ae(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),l===null?a=s:s===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Yr._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class NG extends Xit{constructor(e,t,n,o,r){super(e,t,n,o),this._ctx=e,r?(this.target=r,this.targetPath=vf.collect(r,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} - target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=r&&r<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){const o=t.isInContentArea?8:5;return t.fulfillViewZone(o,n.position,n)}return null}static _hitTestTextArea(e,t){return Ll.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 n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),o=n.range.getStartPosition();let r=Math.abs(t.relativePos.x);const s={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:r};return r-=e.layoutInfo.glyphMarginLeft,r<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,o,n.range,s):(r-=e.layoutInfo.glyphMarginWidth,r<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,o,n.range,s):(r-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,o,n.range,s)))}return null}static _hitTestViewLines(e,t,n){if(!Ll.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new ae(1,1),Bre);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const r=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(r);return t.fulfillContentEmpty(new ae(r,s),Bre)}if(n){if(Ll.isStrictChildOfViewLines(t.targetPath)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(r)===0){const a=e.getLineWidth(r),l=i9(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new ae(r,1),l)}const s=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>=s){const a=i9(t.mouseContentHorizontalOffset-s),l=new ae(r,e.viewModel.getLineMaxColumn(r));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const o=Yr._doHitTest(e,t);return o.type===1?Yr.createMouseTargetFromHitTestPosition(e,t,o.spanNode,o.position,o.injectedText):this._createMouseTarget(e,t.withTarget(o.hitTarget),!0)}static _hitTestMinimap(e,t){if(Ll.isChildOfMinimap(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,o))}return null}static _hitTestScrollbarSlider(e,t){if(Ll.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(o);return t.fulfillScrollbar(new ae(o,r))}}return null}static _hitTestScrollbar(e,t){if(Ll.isChildOfScrollableElement(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,o))}return null}getMouseColumn(e){const t=this._context.configuration.options,n=t.get(143),o=this._context.viewLayout.getCurrentScrollLeft()+e.x-n.contentLeft;return Yr._getMouseColumn(o,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,o,r){const s=o.lineNumber,a=o.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const m=i9(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(o,m)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(o);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(o,null,{mightBeForeignElement:!!r,injectedText:r});const u=[];if(u.push({offset:c.left,column:a}),a>1){const m=e.visibleRangeForPosition(s,a-1);m&&u.push({offset:m.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(am.offset-_.offset);const f=t.pos.toClientCoordinates(),g=n.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let v=null;for(let m=1;mr)){const a=Math.floor((o+r)/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 m5(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 n=nb(e.viewDomNode);let o;if(n?typeof n.caretRangeFromPoint=="undefined"?o=Yit(n,t.clientX,t.clientY):o=n.caretRangeFromPoint(t.clientX,t.clientY):o=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!o||!o.startContainer)return new Gp;const r=o.startContainer;if(r.nodeType===r.TEXT_NODE){const s=r.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Oh.CLASS_NAME?U_.createFromDOMInfo(e,s,o.startOffset):new Gp(r.parentNode)}else if(r.nodeType===r.ELEMENT_NODE){const s=r.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Oh.CLASS_NAME?U_.createFromDOMInfo(e,r,r.textContent.length):new Gp(r)}return new Gp}static _doHitTestWithCaretPositionFromPoint(e,t){const n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){const o=n.offsetNode.parentNode,r=o?o.parentNode:null,s=r?r.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===Oh.CLASS_NAME?U_.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new Gp(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){const o=n.offsetNode.parentNode,r=o&&o.nodeType===o.ELEMENT_NODE?o.className:null,s=o?o.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(r===Oh.CLASS_NAME){const l=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(l)return U_.createFromDOMInfo(e,l,0)}else if(a===Oh.CLASS_NAME)return U_.createFromDOMInfo(e,n.offsetNode,0)}return new Gp(n.offsetNode)}static _snapToSoftTabBoundary(e,t){const n=t.getLineContent(e.lineNumber),{tabSize:o}=t.model.getOptions(),r=JD.atomicPosition(n,e.column-1,o,2);return r!==-1?new ae(e.lineNumber,r+1):e}static _doHitTest(e,t){let n=new Gp;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),n.type===1){const o=e.viewModel.getInjectedTextAt(n.position),r=e.viewModel.normalizePosition(n.position,2);(o||!r.equals(n.position))&&(n=new vbe(r,n.spanNode,o))}return n}}function Yit(i,e,t){const n=document.createRange();let o=i.elementFromPoint(e,t);if(o!==null){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const r=o.getBoundingClientRect(),s=window.getComputedStyle(o,null).getPropertyValue("font-style"),a=window.getComputedStyle(o,null).getPropertyValue("font-variant"),l=window.getComputedStyle(o,null).getPropertyValue("font-weight"),c=window.getComputedStyle(o,null).getPropertyValue("font-size"),d=window.getComputedStyle(o,null).getPropertyValue("line-height"),u=window.getComputedStyle(o,null).getPropertyValue("font-family"),h=`${s} ${a} ${l} ${c}/${d} ${u}`,f=o.innerText;let g=r.left,p=0,v;if(e>r.left+r.width)p=f.length;else{const m=m0.getInstance();for(let _=0;_t(new kc(n))))}onmousedown(e,t){this._register(ke(e,et.MOUSE_DOWN,n=>t(new kc(n))))}onmouseover(e,t){this._register(ke(e,et.MOUSE_OVER,n=>t(new kc(n))))}onmouseleave(e,t){this._register(ke(e,et.MOUSE_LEAVE,n=>t(new kc(n))))}onkeydown(e,t){this._register(ke(e,et.KEY_DOWN,n=>t(new Pi(n))))}onkeyup(e,t){this._register(ke(e,et.KEY_UP,n=>t(new Pi(n))))}oninput(e,t){this._register(ke(e,et.INPUT,t))}onblur(e,t){this._register(ke(e,et.BLUR,t))}onfocus(e,t){this._register(ke(e,et.FOCUS,t))}ignoreGesture(e){return Ei.ignoreTarget(e)}}const kw=11;class Zit extends Ud{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!="undefined"&&(this.bgDomNode.style.top="0px"),typeof e.left!="undefined"&&(this.bgDomNode.style.left="0px"),typeof e.bottom!="undefined"&&(this.bgDomNode.style.bottom="0px"),typeof e.right!="undefined"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Mt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=kw+"px",this.domNode.style.height=kw+"px",typeof e.top!="undefined"&&(this.domNode.style.top=e.top+"px"),typeof e.left!="undefined"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom!="undefined"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right!="undefined"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new SS),this._register(No(this.bgDomNode,et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(No(this.domNode,et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new UI),this._pointerdownScheduleRepeatTimer=this._register(new zd)}_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,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Qit extends _e{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new zd)}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 Jit=140;class _be extends Ud{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 Qit(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new SS),this._shouldRender=!0,this.domNode=ti(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(ke(this.domNode.domNode,et.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Zit(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,o){this.slider=ti(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof o=="number"&&this.slider.setHeight(o),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ke(this.slider.domNode,et.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.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,n=t+this._scrollbarState.getSliderPosition(),o=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);n<=r&&r<=o?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{const r=Yo(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}const o=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(o):this._scrollbarState.getDesiredScrollPositionFromOffset(o)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{const s=this._sliderOrthogonalPointerPosition(r),a=Math.abs(s-n);if(ls&&a>Jit){this._setDesiredScrollPositionNow(o.getScrollPosition());return}const c=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(o.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 eot=20;class Iw{constructor(e,t,n,o,r,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=o,this._scrollSize=r,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Iw(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,n,o,r){const s=Math.max(0,n-e),a=Math.max(0,s-2*t),l=o>0&&o>n;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(eot,Math.floor(n*a/o))),d=(a-c)/(o-n),u=r*d;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){const e=Iw._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 n=this._scrollPosition;return tthis._host.onMouseWheel(new tb(null,1,0))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new tb(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 not extends _be{constructor(e,t,n){const o=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Iw(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,o.height,o.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-kw)/2,a=(t.verticalScrollbarSize-kw)/2;this._createArrow({className:"scra",icon:Xe.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new tb(null,0,1))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new tb(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 cP{constructor(e,t,n,o,r,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,n=n|0,o=o|0,r=r|0,s=s|0,a=a|0),this.rawScrollLeft=o,this.rawScrollTop=a,t<0&&(t=0),o+t>n&&(o=n-t),o<0&&(o=0),r<0&&(r=0),a+r>s&&(a=s-r),a<0&&(a=0),this.width=t,this.scrollWidth=n,this.scrollLeft=o,this.height=r,this.scrollHeight=s,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 cP(this._forceIntegerValues,typeof e.width!="undefined"?e.width:this.width,typeof e.scrollWidth!="undefined"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height!="undefined"?e.height:this.height,typeof e.scrollHeight!="undefined"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new cP(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft!="undefined"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop!="undefined"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const n=this.width!==e.width,o=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,s=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:n,scrollWidthChanged:o,scrollLeftChanged:r,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class ZI extends _e{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new cP(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 n;const o=this._state.withScrollDimensions(e,t);this._setState(o,Boolean(this._smoothScrolling)),(n=this._smoothScrolling)===null||n===void 0||n.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=="undefined"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop=="undefined"?this._smoothScrolling.to.scrollTop:e.scrollTop};const n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let o;t?o=new ek(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):o=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=o}else{const n=this._state.withScrollPosition(e);this._smoothScrolling=ek.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{!this._smoothScrolling||(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return Boolean(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 n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}}class Wre{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}}function o9(i,e){const t=e-i;return function(n){return i+t*rot(n)}}function iot(i,e,t){return function(n){return n2.5*n){let r,s;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}}dP.INSTANCE=new dP;class RG extends Ud{get options(){return this._options}constructor(e,t,n){super(),this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new le),e.style.overflow="hidden",this._options=lot(t),this._scrollable=n,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const o={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new not(this._scrollable,this._options,o)),this._horizontalScrollbar=this._register(new tot(this._scrollable,this._options,o)),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=ti(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ti(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ti(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,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new zd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=si(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,Nn&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel!="undefined"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity!="undefined"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity!="undefined"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis!="undefined"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal!="undefined"&&(this._options.horizontal=e.horizontal),typeof e.vertical!="undefined"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize!="undefined"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize!="undefined"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage!="undefined"&&(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 tb(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=si(this._mouseWheelToDispose),e)){const n=o=>{this._onMouseWheel(new tb(o))};this._mouseWheelToDispose.push(ke(this._listenOnDomNode,et.MOUSE_WHEEL,n,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const n=dP.INSTANCE;n.acceptStandardWheelEvent(e);let o=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!Nn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let d={};if(s){const u=Vre*s,h=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,h)}if(a){const u=Vre*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&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),o=!0)}let r=o;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(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,n=e.scrollLeft>0,o=n?" left":"",r=t?" top":"",s=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${o}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${r}${o}`)}}_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(),sot)}}class bbe extends RG{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new ZI({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Bc(o)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class MG extends RG{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class QI extends RG{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new ZI({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Bc(o)});super(e,t,n),this._register(n),this._element=e,this._register(this.onScroll(o=>{o.scrollTopChanged&&(this._element.scrollTop=o.scrollTop),o.scrollLeftChanged&&(this._element.scrollLeft=o.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 lot(i){const e={lazyRender:typeof i.lazyRender!="undefined"?i.lazyRender:!1,className:typeof i.className!="undefined"?i.className:"",useShadows:typeof i.useShadows!="undefined"?i.useShadows:!0,handleMouseWheel:typeof i.handleMouseWheel!="undefined"?i.handleMouseWheel:!0,flipAxes:typeof i.flipAxes!="undefined"?i.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof i.consumeMouseWheelIfScrollbarIsNeeded!="undefined"?i.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof i.alwaysConsumeMouseWheel!="undefined"?i.alwaysConsumeMouseWheel:!1,scrollYToX:typeof i.scrollYToX!="undefined"?i.scrollYToX:!1,mouseWheelScrollSensitivity:typeof i.mouseWheelScrollSensitivity!="undefined"?i.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof i.fastScrollSensitivity!="undefined"?i.fastScrollSensitivity:5,scrollPredominantAxis:typeof i.scrollPredominantAxis!="undefined"?i.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof i.mouseWheelSmoothScroll!="undefined"?i.mouseWheelSmoothScroll:!0,arrowSize:typeof i.arrowSize!="undefined"?i.arrowSize:11,listenOnDomNode:typeof i.listenOnDomNode!="undefined"?i.listenOnDomNode:null,horizontal:typeof i.horizontal!="undefined"?i.horizontal:1,horizontalScrollbarSize:typeof i.horizontalScrollbarSize!="undefined"?i.horizontalScrollbarSize:10,horizontalSliderSize:typeof i.horizontalSliderSize!="undefined"?i.horizontalSliderSize:0,horizontalHasArrows:typeof i.horizontalHasArrows!="undefined"?i.horizontalHasArrows:!1,vertical:typeof i.vertical!="undefined"?i.vertical:1,verticalScrollbarSize:typeof i.verticalScrollbarSize!="undefined"?i.verticalScrollbarSize:10,verticalHasArrows:typeof i.verticalHasArrows!="undefined"?i.verticalHasArrows:!1,verticalSliderSize:typeof i.verticalSliderSize!="undefined"?i.verticalSliderSize:0,scrollByPage:typeof i.scrollByPage!="undefined"?i.scrollByPage:!1};return e.horizontalSliderSize=typeof i.horizontalSliderSize!="undefined"?i.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof i.verticalSliderSize!="undefined"?i.verticalSliderSize:e.verticalScrollbarSize,Nn&&(e.className+=" mac"),e}class AG extends YI{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new Yr(this._context,n),this._mouseDownOperation=this._register(new cot(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const o=new Pit(this.viewHelper.viewDomNode);this._register(o.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(o.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ke(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Iv(a,!1,this.viewHelper.viewDomNode))}))})),this._register(o.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(o.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let r=0;this._register(o.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{r=a})),this._register(ke(this.viewHelper.viewDomNode,et.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(o.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,r))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=dP.INSTANCE;let t=0,n=xc.getZoomLevel(),o=!1,r=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new tb(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=xc.getZoomLevel(),u=c.deltaY>0?1:-1;xc.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(n=xc.getZoomLevel(),o=a(l),r=0),t=Date.now(),r+=c.deltaY,o&&(xc.setZoomLevel(n+r/5),c.preventDefault(),c.stopPropagation())};this._register(ke(this.viewHelper.viewDomNode,et.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return Nn?(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 o=new gbe(e,t).toPageCoordinates(),r=kG(this.viewHelper.viewDomNode);if(o.yr.y+r.height||o.xr.x+r.width)return null;const s=IG(this.viewHelper.viewDomNode,r,o);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),r,o,s,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){const o=nb(this.viewHelper.viewDomNode);o&&(n=o.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n: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&&(o||s&&a))u(),this._mouseDownOperation.start(n.type,e,t);else if(r)e.preventDefault();else if(l){const h=n.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(u(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}}class cot extends _e{constructor(e,t,n,o,r,s){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=o,this._createMouseTarget=r,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new Fit(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new dot(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new _5,this._currentSelection=new gt(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,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const o=this._findMousePosition(t,!0);if(!o||!o.position)return;this._mouseState.trySetCount(t.detail,o.position),t.detail=this._mouseState.count;const r=this._context.configuration.options;if(!r.get(90)&&r.get(35)&&!r.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&o.type===6&&o.position&&this._currentSelection.containsPosition(o.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);s&&s 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(o,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),()=>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,n=this._context.viewModel,o=this._context.viewLayout,r=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=o.getCurrentScrollTop()+e.relativePos.y,c=Dw.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return Fs.createOutsideEditor(r,u,"below",a)}const d=o.getLineNumberAtVerticalOffset(l);return Fs.createOutsideEditor(r,new ae(d,n.getLineMaxColumn(d)),"below",a)}const s=o.getLineNumberAtVerticalOffset(o.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return Fs.createOutsideEditor(r,new ae(s,n.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const n=this._getPositionOutsideEditor(e);if(n)return n;const o=this._createMouseTarget(e,t);if(!o.position)return null;if(o.type===8||o.type===5){const s=this._helpPositionJumpOverViewZone(o.detail);if(s)return Fs.createViewZone(o.type,o.element,o.mouseColumn,s,o.detail)}return o}_helpPositionJumpOverViewZone(e){const t=new ae(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,o=e.positionAfter;return n&&o?n.isBefore(t)?n:o:null}_dispatchMouse(e,t,n){!e.position||this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,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 dot extends _e{constructor(e,t,n,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=o,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new uot(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class uot extends _e{constructor(e,t,n,o,r,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=o,this._position=r,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Bc(()=>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,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),n=this._tick(),o=t*(n/1e3)*e,r=this._position.outsidePosition==="above"?-o:o;this._context.viewModel.viewLayout.deltaScrollNow(0,r),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=kG(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(143).horizontalScrollbarHeight,u=new m5(this._mouseEvent.pos.x,c.y+c.height-d-.1),h=IG(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=Fs.createOutsideEditor(this._position.mouseColumn,new ae(a,1),"above",this._position.outsideDistance):l=Fs.createOutsideEditor(this._position.mouseColumn,new ae(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Bc(()=>this._execute())}}class _5{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 n=new Date().getTime();n-this._lastSetMouseDownCountTime>_5.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=n,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)}}_5.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class xn{get event(){return this.emitter.event}constructor(e,t,n){const o=r=>this.emitter.fire(r);this.emitter=new le({onWillAddFirstListener:()=>e.addEventListener(t,o,n),onDidRemoveLastListener:()=>e.removeEventListener(t,o,n)})}dispose(){this.emitter.dispose()}}var Em;(function(i){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),n=Object.assign({},e),o=Object.assign({},e);let r=0;const s={keydown:0,input:0,render:0};function a(){m(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}i.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,v()}i.onBeforeInput=c;function d(){s.input===0&&c(),queueMicrotask(u)}i.onInput=d;function u(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){m()}i.onKeyUp=h;function f(){m()}i.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(p),v())}i.onRenderStart=g;function p(){s.render===1&&(performance.mark("render/end"),s.render=2)}function v(){setTimeout(m)}function m(){s.keydown===2&&s.input===2&&s.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"),_("keydown",e),_("input",t),_("render",n),_("inputlatency",o),r++,y())}function _(E,I){const k=performance.getEntriesByName(E)[0].duration;I.total+=k,I.min=Math.min(I.min,k),I.max=Math.max(I.max,k)}function y(){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"),s.keydown=0,s.input=0,s.render=0}function w(){if(r===0)return;const E={keydown:L(e),input:L(t),render:L(n),total:L(o),sampleCount:r};return D(e),D(t),D(n),D(o),r=0,E}i.getAndClearMeasurements=w;function L(E){return{average:E.total/r,max:E.max,min:E.min}}function D(E){E.total=0,E.min=Number.MAX_VALUE,E.max=0}})(Em||(Em={}));class Pr{constructor(e,t,n,o,r){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=o,this.newlineCountBeforeSelection=r}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const n=e.getValue(),o=e.getSelectionStart(),r=e.getSelectionEnd();let s;if(t){const a=n.substring(0,o),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new Pr(n,o,r,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Pr(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,n,o,r,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((n=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&n!==void 0?n:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((r=(o=this.selection)===null||o===void 0?void 0:o.getEndPosition())!==null&&r!==void 0?r:null,h,1)}const d=this.value.substring(this.selectionStart,e);if(d.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.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,n){let o=0,r=-1;for(;(r=t.indexOf(` -`,r+1))!==-1;)o++;return[e,n*t.length,o]}static deduceInput(e,t,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const o=Math.min(Q0(e.value,t.value),e.selectionStart,t.selectionStart),r=Math.min(jA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(o,e.value.length-r);const s=t.value.substring(o,t.value.length-r),a=e.selectionStart-o,l=e.selectionEnd-o,c=t.selectionStart-o,d=t.selectionEnd-o;if(c===d){const h=e.selectionStart-o;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:s,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 n=Math.min(Q0(e.value,t.value),e.selectionEnd),o=Math.min(jA(e.value,t.value),e.value.length-e.selectionEnd),r=e.value.substring(n,e.value.length-o),s=t.value.substring(n,t.value.length-o);e.selectionStart-n;const a=e.selectionEnd-n;t.selectionStart-n;const l=t.selectionEnd-n;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:r.length-a,positionDelta:l-s.length}}}Pr.EMPTY=new Pr("",0,0,null,void 0);class HC{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const n=e*t,o=n+1,r=n+t;return new V(o,1,r+1,1)}static fromEditorSelection(e,t,n,o){const s=HC._getPageOfLine(t.startLineNumber,n),a=HC._getRangeForPage(s,n),l=HC._getPageOfLine(t.endLineNumber,n),c=HC._getRangeForPage(l,n);let d=a.intersectRanges(new V(1,1,t.startLineNumber,t.startColumn));if(o&&e.getValueLengthInRange(d,1)>500){const m=e.modifyPosition(d.getEndPosition(),-500);d=V.fromPositions(m,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new V(t.endLineNumber,t.endColumn,h,f));if(o&&e.getValueLengthInRange(g,1)>500){const m=e.modifyPosition(g.getStartPosition(),500);g=V.fromPositions(g.getStartPosition(),m)}const p=e.getValueInRange(g,1);let v;if(s===l||s+1===l)v=e.getValueInRange(t,1);else{const m=a.intersectRanges(t),_=c.intersectRanges(t);v=e.getValueInRange(m,1)+String.fromCharCode(8230)+e.getValueInRange(_,1)}return o&&v.length>2*500&&(v=v.substring(0,500)+String.fromCharCode(8230)+v.substring(v.length-500,v.length)),new Pr(u+v+p,u.length,u.length+v.length,t,d.endLineNumber-d.startLineNumber)}}var uP;(function(i){i.Tap="-monaco-textarea-synthetic-tap"})(uP||(uP={}));const _H={forceCopyWithSyntaxHighlighting:!1};class tk{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)}}tk.INSTANCE=new tk;class hot{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 fot extends _e{get textAreaState(){return this._textAreaState}constructor(e,t,n,o){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=o,this._onFocus=this._register(new le),this.onFocus=this._onFocus.event,this._onBlur=this._register(new le),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new le),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new le),this.onCut=this._onCut.event,this._onPaste=this._register(new le),this.onPaste=this._onPaste.event,this._onType=this._register(new le),this.onType=this._onType.event,this._onCompositionStart=this._register(new le),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new le),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new le),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new le),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new bi(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new bi(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=Pr.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let r=null;this._register(this._textArea.onKeyDown(s=>{const a=new Pi(s);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),r=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(s=>{const a=new Pi(s);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(s=>{const a=new hot;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&r&&r.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===s.data&&(r.code==="ArrowRight"||r.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:s.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:s.data});return}this._onCompositionStart.fire({data:s.data})})),this._register(this._textArea.onCompositionUpdate(s=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=Pr.readFromTextArea(this._textArea,this._textAreaState),d=Pr.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionUpdate.fire(s);return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Pr.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(s)})),this._register(this._textArea.onCompositionEnd(s=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=Pr.readFromTextArea(this._textArea,this._textAreaState),d=Pr.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Pr.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=Pr.readFromTextArea(this._textArea,this._textAreaState),l=Pr.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(gr(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(s=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(s),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(s=>{this._ensureClipboardGetsEditorSelection(s)})),this._register(this._textArea.onPaste(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),s.preventDefault(),!s.clipboardData)return;let[a,l]=bH.getTextData(s.clipboardData);!a||(l=l||tk.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const s=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!s&&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 ke(this._textArea.ownerDocument,"selectionchange",t=>{if(Em.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const n=Date.now(),o=n-e;if(e=n,o<5)return;const r=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),r<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)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 gt(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(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};tk.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` -`):t.text,n),e.preventDefault(),e.clipboardData&&bH.setTextData(e.clipboardData,t.text,t.html,n)}}const bH={getTextData(i){const e=i.getData(xo.text);let t=null;const n=i.getData("vscode-editor-data");if(typeof n=="string")try{t=JSON.parse(n),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&i.files.length>0?[Array.prototype.slice.call(i.files,0).map(r=>r.name).join(` -`),null]:[e,t]},setTextData(i,e,t,n){i.setData(xo.text,e),typeof t=="string"&&i.setData("text/html",t),i.setData("vscode-editor-data",JSON.stringify(n))}};class got extends _e{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new xn(this._actual,"keydown")).event,this.onKeyUp=this._register(new xn(this._actual,"keyup")).event,this.onCompositionStart=this._register(new xn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new xn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new xn(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new xn(this._actual,"beforeinput")).event,this.onInput=this._register(new xn(this._actual,"input")).event,this.onCut=this._register(new xn(this._actual,"cut")).event,this.onCopy=this._register(new xn(this._actual,"copy")).event,this.onPaste=this._register(new xn(this._actual,"paste")).event,this.onFocus=this._register(new xn(this._actual,"focus")).event,this.onBlur=this._register(new xn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new le),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Em.onKeyDown())),this._register(this.onBeforeInput(()=>Em.onBeforeInput())),this._register(this.onInput(()=>Em.onInput())),this._register(this.onKeyUp(()=>Em.onKeyUp())),this._register(ke(this._actual,uP.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=nb(this._actual);return e?e.activeElement===this._actual:sG(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 n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.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,n){const o=this._actual;let r=null;const s=nb(o);s?r=s.activeElement:r=o.ownerDocument.activeElement;const a=r===o,l=o.selectionStart,c=o.selectionEnd;if(a&&l===t&&c===n){Fc&&window.parent!==window&&o.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),o.setSelectionRange(t,n),Fc&&window.parent!==window&&o.focus();return}try{const d=jQe(o);this.setIgnoreSelectionChangeTime("setSelectionRange"),o.focus(),o.setSelectionRange(t,n),KQe(o,d)}catch{}}}class pot extends AG{constructor(e,t,n){super(e,t,n),this._register(Ei.addTarget(this.viewHelper.linesContentDomNode)),this._register(ke(this.viewHelper.linesContentDomNode,Di.Tap,r=>this.onTap(r))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Change,r=>this.onChange(r))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Contextmenu,r=>this._onContextMenu(new Iv(r,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ke(this.viewHelper.linesContentDomNode,"pointerdown",r=>{const s=r.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const o=new Oit(this.viewHelper.viewDomNode);this._register(o.onPointerMove(this.viewHelper.viewDomNode,r=>this._onMouseMove(r))),this._register(o.onPointerUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(o.onPointerLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(o.onPointerDown(this.viewHelper.viewDomNode,(r,s)=>this._onMouseDown(r,s)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Iv(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 mot extends AG{constructor(e,t,n){super(e,t,n),this._register(Ei.addTarget(this.viewHelper.linesContentDomNode)),this._register(ke(this.viewHelper.linesContentDomNode,Di.Tap,o=>this.onTap(o))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Change,o=>this.onChange(o))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Contextmenu,o=>this._onContextMenu(new Iv(o,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Iv(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const n=document.createEvent("CustomEvent");n.initEvent(uP.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(n),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class vot extends _e{constructor(e,t,n){super(),Ku&&rG.pointerEvents?this.handler=this._register(new pot(e,t,n)):window.TouchEvent?this.handler=this._register(new mot(e,t,n)):this.handler=this._register(new AG(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class zb extends YI{}const vr=yn("themeService");function ro(i){return{id:i}}function CH(i){switch(i){case Ic.DARK:return"vs-dark";case Ic.HIGH_CONTRAST_DARK:return"hc-black";case Ic.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const Cbe={ThemingContribution:"base.contributions.theming"};class _ot{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new le}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),zt(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const ybe=new _ot;no.add(Cbe.ThemingContribution,ybe);function jd(i){return ybe.onColorThemeChange(i)}class bot extends _e{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 wbe=J("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("lineHighlight","Background color for the highlight of line at the cursor position.")),Hre=J("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Ln},C("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));J("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},C("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);J("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);J("editor.symbolHighlightBackground",{dark:Jh,light:Jh,hcDark:null,hcLight:null},C("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);J("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const Sbe=J("editorCursor.foreground",{dark:"#AEAFAD",light:ve.black,hcDark:ve.white,hcLight:"#0F4A85"},C("caret","Color of the editor cursor.")),Cot=J("editorCursor.background",null,C("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Vg=J("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},C("editorWhitespaces","Color of whitespace characters in the editor.")),yot=J("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:ve.white,hcLight:"#292929"},C("editorLineNumbers","Color of editor line numbers.")),f2=J("editorIndentGuide.background",{dark:Vg,light:Vg,hcDark:Vg,hcLight:Vg},C("editorIndentGuides","Color of the editor indentation guides."),!1,C("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),g2=J("editorIndentGuide.activeBackground",{dark:Vg,light:Vg,hcDark:Vg,hcLight:Vg},C("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,C("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),JI=J("editorIndentGuide.background1",{dark:f2,light:f2,hcDark:f2,hcLight:f2},C("editorIndentGuides1","Color of the editor indentation guides (1).")),wot=J("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides2","Color of the editor indentation guides (2).")),Sot=J("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides3","Color of the editor indentation guides (3).")),xot=J("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides4","Color of the editor indentation guides (4).")),Lot=J("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides5","Color of the editor indentation guides (5).")),Eot=J("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides6","Color of the editor indentation guides (6).")),eT=J("editorIndentGuide.activeBackground1",{dark:g2,light:g2,hcDark:g2,hcLight:g2},C("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Dot=J("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),kot=J("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Iot=J("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),Tot=J("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Not=J("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),p2=J("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Wi,hcLight:Wi},C("editorActiveLineNumber","Color of editor active line number"),!1,C("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));J("editorLineNumber.activeForeground",{dark:p2,light:p2,hcDark:p2,hcLight:p2},C("editorActiveLineNumber","Color of editor active line number"));const Rot=J("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));J("editorRuler.foreground",{dark:"#5A5A5A",light:ve.lightgrey,hcDark:ve.white,hcLight:"#292929"},C("editorRuler","Color of the editor rulers."));J("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},C("editorCodeLensForeground","Foreground color of editor CodeLens"));J("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},C("editorBracketMatchBackground","Background color behind matching brackets"));J("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Ln,hcLight:Ln},C("editorBracketMatchBorder","Color for matching brackets boxes"));const Mot=J("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},C("editorOverviewRulerBorder","Color of the overview ruler border.")),Aot=J("editorOverviewRuler.background",null,C("editorOverviewRulerBackground","Background color of the editor overview ruler."));J("editorGutter.background",{dark:mr,light:mr,hcDark:mr,hcLight:mr},C("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));J("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:ve.fromHex("#fff").transparent(.8),hcLight:Ln},C("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Pot=J("editorUnnecessaryCode.opacity",{dark:ve.fromHex("#000a"),light:ve.fromHex("#0007"),hcDark:null,hcLight:null},C("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.`));J("editorGhostText.border",{dark:null,light:null,hcDark:ve.fromHex("#fff").transparent(.8),hcLight:ve.fromHex("#292929").transparent(.8)},C("editorGhostTextBorder","Border color of ghost text in the editor."));J("editorGhostText.foreground",{dark:ve.fromHex("#ffffff56"),light:ve.fromHex("#0007"),hcDark:null,hcLight:null},C("editorGhostTextForeground","Foreground color of the ghost text in the editor."));J("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorGhostTextBackground","Background color of the ghost text in the editor."));const m2=new ve(new Tn(0,122,204,.6)),xbe=J("editorOverviewRuler.rangeHighlightForeground",{dark:m2,light:m2,hcDark:m2,hcLight:m2},C("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Oot=J("editorOverviewRuler.errorForeground",{dark:new ve(new Tn(255,18,18,.7)),light:new ve(new Tn(255,18,18,.7)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:"#B5200D"},C("overviewRuleError","Overview ruler marker color for errors.")),Fot=J("editorOverviewRuler.warningForeground",{dark:$l,light:$l,hcDark:YD,hcLight:YD},C("overviewRuleWarning","Overview ruler marker color for warnings.")),Bot=J("editorOverviewRuler.infoForeground",{dark:Ma,light:Ma,hcDark:ZD,hcLight:ZD},C("overviewRuleInfo","Overview ruler marker color for infos.")),Lbe=J("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},C("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Ebe=J("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},C("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Dbe=J("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},C("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),kbe=J("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Ibe=J("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Tbe=J("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Wot=J("editorBracketHighlight.unexpectedBracket.foreground",{dark:new ve(new Tn(255,18,18,.8)),light:new ve(new Tn(255,18,18,.8)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:""},C("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Vot=J("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Hot=J("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),$ot=J("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),zot=J("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Uot=J("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),jot=J("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Kot=J("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),qot=J("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Got=J("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Xot=J("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Yot=J("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Zot=J("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));J("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},C("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));J("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},C("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));jd((i,e)=>{const t=i.getColor(mr),n=i.getColor(wbe),o=n&&!n.isTransparent()?n:t;o&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)});class tT extends zb{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ae(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 n=e.get(143);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.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 n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}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 ae(e,1));if(t.column!==1)return"";const n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){const o=Math.abs(this._lastCursorModelPosition.lineNumber-n);return o===0?''+n+"":String(o)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10===0?String(n):"":String(n)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=xs?this._lineHeight%2===0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=this._context.viewModel.getLineCount(),s=[];for(let a=n;a<=o;a++){const l=a-n,c=this._getLineRenderLineNumber(a);if(!c){s[l]="";continue}let d="";if(a===r&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){s[l]="";continue}this._renderFinalNewline==="dimmed"&&(d=" dimmed-line-number")}a===this._activeLineNumber&&(d=" active-line-number"),s[l]=`
${c}
`}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}tT.CLASS_NAME="line-numbers";jd((i,e)=>{const t=i.getColor(yot),n=i.getColor(Rot);n?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class ib extends pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=ti(document.createElement("div")),this._domNode.setClassName(ib.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ti(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(ib.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.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 n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}}ib.CLASS_NAME="glyph-margin";ib.OUTER_CLASS_NAME="margin";const Ey="monaco-mouse-cursor-text";class Qot{constructor(){this._onDidChange=new le,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 gE=new Qot,xi=yn("keybindingService");var Jot=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ert=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class trt{constructor(e,t,n,o,r){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=o,this.distanceToModelLineEnd=r,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new ae(this.modelLineNumber,this.distanceToModelLineStart+1),n=new ae(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(n),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 r9=Fc;let yH=class extends pl{constructor(e,t,n,o){super(e),this._keybindingService=o,this._primaryCursorPosition=new ae(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,s=r.get(143);this._setAccessibilityOptions(r),this._contentLeft=s.contentLeft,this._contentWidth=s.contentWidth,this._contentHeight=s.height,this._fontInfo=r.get(50),this._lineHeight=r.get(66),this._emptySelectionClipboard=r.get(37),this._copyWithSyntaxHighlighting=r.get(25),this._visibleTextArea=null,this._selections=[new gt(1,1,1,1)],this._modelSelections=[new gt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ti(document.createElement("textarea")),vf.write(this.textArea,6),this.textArea.setClassName(`inputarea ${Ey}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",C("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ti(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,ls),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,m=null;if(_H.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&p.length<65536){const _=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);_&&(v=_.html,m=_.mode)}return{isFromEmptySelection:f,multicursorText:g,text:p,html:v,mode:m}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const u=this._selections[0];if(Nn&&u.isEmpty()){const f=u.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new Pr(g,g.length,g.length,V.fromPositions(f),0)}const h=500;if(Nn&&!u.isEmpty()&&l.getValueLengthInRange(u,0)0)return new Pr(f,g,g,V.fromPositions(h),0)}return Pr.EMPTY}return HC.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 got(this.textArea.domNode));this._textAreaInput=this._register(new fot(c,d,Vl,{isAndroid:moe,isChrome:tG,isFirefox:Fc,isSafari:lp})),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!="undefined"?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 m=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),_=m.lastIndexOf(` -`),y=m.substring(_+1),w=y.lastIndexOf(" "),L=y.length-w-1,D=f.getStartPosition(),E=Math.min(D.column-1,L),I=D.column-1-E,k=y.substring(0,y.length-E),{tabSize:R}=this._context.viewModel.model.getOptions(),A=nrt(this.textArea.domNode.ownerDocument,k,this._fontInfo,R);return{distanceToModelLineStart:I,widthOfHiddenTextBefore:A}})(),{distanceToModelLineEnd:v}=(()=>{const m=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),_=m.indexOf(` -`),y=_===-1?m:m.substring(0,_),w=y.indexOf(" "),L=w===-1?y.length:y.length-w-1,D=f.getEndPosition(),E=Math.min(this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column-E}})();this._context.viewModel.revealRange("keyboard",!0,V.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new trt(this._context,f.startLineNumber,g,p,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Ey} 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 ${Ey}`),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(gE.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',n=this._context.viewModel.getLineContent(e.lineNumber),o=Vc(t);let r=!0,s=e.column,a=!0,l=e.column,c=0;for(;c<50&&(r||a);){if(r&&s<=1&&(r=!1),r){const d=n.charCodeAt(s-2);o.get(d)!==0?r=!1:s--}if(a&&l>n.length&&(a=!1),a){const d=n.charCodeAt(l-1);o.get(d)!==0?a=!1:l++}c++}return[n.substring(s-1,l-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),n=Vc(this._context.configuration.options.get(129));let o=e.column,r=0;for(;o>1;){const s=t.charCodeAt(o-2);if(n.get(s)!==0||r>50)return t.substring(o-1,e.column-1);r++,o--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const n=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!gr(n.charCodeAt(0)))return n}return""}_getAriaLabel(e){var t,n,o;if(e.get(2)===1){const s=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(n=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||n===void 0?void 0:n.getAriaLabel(),l=(o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||o===void 0?void 0:o.getAriaLabel(),c=C("accessibilityModeOff","The editor is not accessible at this time.");return s?C("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,s):a?C("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?C("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===rh.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const o=e.get(143).wrappingColumn;if(o!==-1&&this._accessibilitySupport!==1){const r=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(o*r.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=r9?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._contentHeight=n.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:o}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${o*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;!gE.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new ae(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 o=this._visibleTextArea.visibleTextareaStart,r=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(s&&a&&o&&r&&r.left>=this._scrollLeft&&o.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+o.left-this._scrollLeft,h=r.left-o.left+1;if(uthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(s.lineNumber),g=f.tokens.findTokenIndexAtOffset(s.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),v=g===p,m=this._visibleTextArea.definePresentation(v?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:(oo.getColorMap()||[])[m.foreground],italic:m.italic,bold:m.bold,underline:m.underline,strikethrough:m.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 n=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(n<0||n>this._contentHeight){this._renderAtTopLeft();return}if(Nn){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const o=(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=o*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:r9?0:1,useCover:!1})}_newlinecount(e){let t=0,n=-1;do{if(n=e.indexOf(` -`,n+1),n===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:r9?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,n=this.textAreaCover;ss(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?ve.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),n.setTop(e.useCover?e.top:0),n.setLeft(e.useCover?e.left:0),n.setWidth(e.useCover?e.width:0),n.setHeight(e.useCover?e.height:0);const o=this._context.configuration.options;o.get(57)?n.setClassName("monaco-editor-background textAreaCover "+ib.OUTER_CLASS_NAME):o.get(67).renderType!==0?n.setClassName("monaco-editor-background textAreaCover "+tT.CLASS_NAME):n.setClassName("monaco-editor-background textAreaCover")}};yH=Jot([ert(3,xi)],yH);function nrt(i,e,t,n){if(e.length===0)return 0;const o=i.createElement("div");o.style.position="absolute",o.style.top="-50000px",o.style.width="50000px";const r=i.createElement("span");ss(r,t),r.style.whiteSpace="pre",r.style.tabSize=`${n*t.spaceWidth}px`,r.append(e),o.appendChild(r),i.body.appendChild(o);const s=r.offsetWidth;return i.body.removeChild(o),s}function irt(i,e,t){let n=0;for(let r=0;r!0,rrt=()=>!1,srt=i=>i===" "||i===" ";class U1{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,n,o){var r;this.languageConfigurationService=o,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=n.options,a=s.get(143),l=s.get(50);this.readOnly=s.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(127),this.wordSeparators=s.get(129),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(76),this.multiCursorPaste=s.get(78),this.multiCursorLimit=s.get(79),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),this.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=(r=d==null?void 0:d.blockCommentStartToken)!==null&&r!==void 0?r: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 n of t)this._electricChars[n]=!0}return this._electricChars}onElectricCharacter(e,t,n){const o=r5(t,n-1),r=this.languageConfigurationService.getLanguageConfiguration(o.languageId).electricCharacter;return r?r.onElectricCharacter(e,o,n-o.firstCharOffset):null}normalizeIndentation(e){return hP(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,n){switch(t){case"beforeWhitespace":return srt;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,n);case"always":return ort;case"never":return rrt}}_getLanguageDefinedShouldAutoClose(e,t){const n=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return o=>n.indexOf(o)!==-1}visibleColumnFromColumn(e,t){return or.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){const o=or.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),r=e.getLineMinColumn(t);if(os?s:o}}class kn{static fromModelState(e){return new art(e)}static fromViewState(e){return new lrt(e)}static fromModelSelection(e){const t=gt.liftSelection(e),n=new Br(V.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return kn.fromModelState(n)}static fromModelSelections(e){const t=[];for(let n=0,o=e.length;nr,c=o>s,d=os||mo||v0&&o--,j_.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,o)}static columnSelectRight(e,t,n){let o=0;const r=Math.min(n.fromViewLineNumber,n.toViewLineNumber),s=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let l=r;l<=s;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new ae(l,c));o=Math.max(o,d)}let a=n.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-j_e(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const n=t.lineNumber-1;return new ae(n,e.getLineMaxColumn(n))}else return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const o=e.getLineMinColumn(t.lineNumber),r=e.getLineContent(t.lineNumber),s=JD.atomicPosition(r,t.column-1,n,0);if(s!==-1&&s+1>=o)return new ae(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,n){const o=e.stickyTabStops?ii.leftPositionAtomicSoftTabs(t,n,e.tabSize):ii.leftPosition(t,n);return new s9(o.lineNumber,o.column,0)}static moveLeft(e,t,n,o,r){let s,a;if(n.hasSelection()&&!o)s=n.selection.startLineNumber,a=n.selection.startColumn;else{const l=n.position.delta(void 0,-(r-1)),c=t.normalizePosition(ii.clipPositionColumn(l,t),0),d=ii.left(e,t,c);s=d.lineNumber,a=d.column}return n.move(o,s,a,0)}static clipPositionColumn(e,t){return new ae(e.lineNumber,ii.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,n){return en?n:e}static rightPosition(e,t,n){return nd?(n=d,a?o=t.getLineMaxColumn(n):o=Math.min(t.getLineMaxColumn(n),o)):o=e.columnFromVisibleColumn(t,n,c),f?r=0:r=c-or.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize),l!==void 0){const g=new ae(n,o),p=t.normalizePosition(g,l);r=r+(o-p.column),n=p.lineNumber,o=p.column}return new s9(n,o,r)}static down(e,t,n,o,r,s,a){return this.vertical(e,t,n,o,r,n+s,a,4)}static moveDown(e,t,n,o,r){let s,a;n.hasSelection()&&!o?(s=n.selection.endLineNumber,a=n.selection.endColumn):(s=n.position.lineNumber,a=n.position.column);let l=0,c;do if(c=ii.down(e,t,s+l,a,n.leftoverVisibleColumns,r,!0),t.normalizePosition(new ae(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l1&&this._isBlankLine(t,r);)r--;for(;r>1&&!this._isBlankLine(t,r);)r--;return n.move(o,r,t.getLineMinColumn(r),0)}static moveToNextBlankLine(e,t,n,o){const r=t.getLineCount();let s=n.position.lineNumber;for(;s=h.length+1)return!1;const f=h.charAt(u.column-2),g=o.get(f);if(!g)return!1;if(Xp(f)){if(n==="never")return!1}else if(t==="never")return!1;const p=h.charAt(u.column-1);let v=!1;for(const m of g)m.open===f&&m.close===p&&(v=!0);if(!v)return!1;if(e==="auto"){let m=!1;for(let _=0,y=a.length;_1){const r=t.getLineContent(o.lineNumber),s=Ws(r),a=s===-1?r.length+1:s+1;if(o.column<=a){const l=n.visibleColumnFromColumn(t,o),c=or.prevIndentTabStop(l,n.indentSize),d=n.columnFromVisibleColumn(t,o.lineNumber,c);return new V(o.lineNumber,d,o.lineNumber,o.column)}}return V.fromPositions(ob.getPositionAfterDeleteLeft(o,t),o)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const n=wZe(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}else if(e.lineNumber>1){const n=e.lineNumber-1;return new ae(n,t.getLineMaxColumn(n))}else return e}static cut(e,t,n){const o=[];let r=null;n.sort((s,a)=>ae.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=n.length;s1&&(r==null?void 0:r.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 V(d,u,h,f);r=g,g.isEmpty()?o[s]=null:o[s]=new Qr(g,"")}else o[s]=null;else o[s]=new Qr(l,"")}return new Sa(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Qn{static _createWord(e,t,n,o,r){return{start:o,end:r,wordType:t,nextCharClass:n}}static _findPreviousWordOnLine(e,t,n){const o=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(o,e,n)}static _doFindPreviousWordOnLine(e,t,n){let o=0;for(let r=n.column-2;r>=0;r--){const s=e.charCodeAt(r),a=t.get(s);if(a===0){if(o===2)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1));o=1}else if(a===2){if(o===1)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1));o=2}else if(a===1&&o!==0)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1))}return o!==0?this._createWord(e,o,1,0,this._findEndOfWord(e,t,o,0)):null}static _findEndOfWord(e,t,n,o){const r=e.length;for(let s=o;s=0;r--){const s=e.charCodeAt(r),a=t.get(s);if(a===1||n===1&&a===2||n===2&&a===0)return r+1}return 0}static moveWordLeft(e,t,n,o){let r=n.lineNumber,s=n.column;s===1&&r>1&&(r=r-1,s=t.getLineMaxColumn(r));let a=Qn._findPreviousWordOnLine(e,t,new ae(r,s));if(o===0)return new ae(r,a?a.start+1:1);if(o===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1))),new ae(r,a?a.start+1:1);if(o===3){for(;a&&a.wordType===2;)a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1));return new ae(r,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1))),new ae(r,a?a.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===1)return n>1?new ae(n-1,e.getLineMaxColumn(n-1)):t;const r=e.getLineContent(n);for(let s=t.column-1;s>1;s--){const a=r.charCodeAt(s-2),l=r.charCodeAt(s-1);if(a===95&&l!==95)return new ae(n,s);if(a===45&&l!==45)return new ae(n,s);if((ym(a)||o2(a))&&kh(l))return new ae(n,s);if(kh(a)&&kh(l)&&s+1=l.start+1&&(l=Qn._findNextWordOnLine(e,t,new ae(r,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(r);return new ae(r,s)}static _moveWordPartRight(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===o)return n1?c=1:(l--,c=o.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=Qn._findPreviousWordOnLine(n,o,new ae(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=o.getLineMaxColumn(l))),new V(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;const o=new ae(n.positionLineNumber,n.positionColumn),r=this._deleteInsideWordWhitespace(t,o);return r||this._deleteInsideWordDetermineDeleteRange(e,t,o)}static _charAtIsWhitespace(e,t){const n=e.charCodeAt(t);return n===32||n===9}static _deleteInsideWordWhitespace(e,t){const n=e.getLineContent(t.lineNumber),o=n.length;if(o===0)return null;let r=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,r))return null;let s=Math.min(t.column-1,o-1);if(!this._charAtIsWhitespace(n,s))return null;for(;r>0&&this._charAtIsWhitespace(n,r-1);)r--;for(;s+11?new V(n.lineNumber-1,t.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumberu.start+1<=n.column&&n.column<=u.end+1,a=(u,h)=>(u=Math.min(u,n.column),h=Math.max(h,n.column),new V(n.lineNumber,u,n.lineNumber,h)),l=u=>{let h=u.start+1,f=u.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(o,h-2);)h--;return a(h,f)},c=Qn._findPreviousWordOnLine(e,t,n);if(c&&s(c))return l(c);const d=Qn._findNextWordOnLine(e,t,n);return d&&s(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,r+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),o=Qn._moveWordPartLeft(e,n);return new V(n.lineNumber,n.column,o.lineNumber,o.column)}static _findFirstNonWhitespaceChar(e,t){const n=e.length;for(let o=t;o=h.start+1&&(h=Qn._findNextWordOnLine(n,o,new ae(l,h.end+1))),h?c=h.start+1:cBoolean(e))}class Mr{static addCursorDown(e,t,n){const o=[];let r=0;for(let s=0,a=t.length;sc&&(d=c,u=e.model.getLineMaxColumn(d)),kn.fromModelState(new Br(new V(s.lineNumber,1,d,u),2,0,new ae(d,u),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,u=1;return d>c&&(d=c,u=e.getLineMaxColumn(d)),kn.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return kn.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,n,o){const r=e.model.validatePosition(o);return kn.fromModelState(Qn.word(e.cursorConfig,e.model,t.modelState,n,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new kn(t.modelState,t.viewState);const n=t.viewState.position.lineNumber,o=t.viewState.position.column;return kn.fromViewState(new Br(new V(n,o,n,o),0,0,new ae(n,o),0))}static moveTo(e,t,n,o,r){if(n){if(t.modelState.selectionStartKind===1)return this.word(e,t,n,o);if(t.modelState.selectionStartKind===2)return this.line(e,t,n,o,r)}const s=e.model.validatePosition(o),a=r?e.coordinatesConverter.validateViewPosition(new ae(r.lineNumber,r.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return kn.fromViewState(t.viewState.move(n,a.lineNumber,a.column,0))}static simpleMove(e,t,n,o,r,s){switch(n){case 0:return s===4?this._moveHalfLineLeft(e,t,o):this._moveLeft(e,t,o,r);case 1:return s===4?this._moveHalfLineRight(e,t,o):this._moveRight(e,t,o,r);case 2:return s===2?this._moveUpByViewLines(e,t,o,r):this._moveUpByModelLines(e,t,o,r);case 3:return s===2?this._moveDownByViewLines(e,t,o,r):this._moveDownByModelLines(e,t,o,r);case 4:return s===2?t.map(a=>kn.fromViewState(ii.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>kn.fromModelState(ii.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 5:return s===2?t.map(a=>kn.fromViewState(ii.moveToNextBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>kn.fromModelState(ii.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 6:return this._moveToViewMinColumn(e,t,o);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,o);case 8:return this._moveToViewCenterColumn(e,t,o);case 9:return this._moveToViewMaxColumn(e,t,o);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,o);default:return null}}static viewportMove(e,t,n,o,r){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(n){case 11:{const l=this._firstLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;cn.endLineNumber-1?s=n.endLineNumber-1:rkn.fromViewState(ii.moveLeft(e.cursorConfig,e,r.viewState,n,o)))}static _moveHalfLineLeft(e,t,n){const o=[];for(let r=0,s=t.length;rkn.fromViewState(ii.moveRight(e.cursorConfig,e,r.viewState,n,o)))}static _moveHalfLineRight(e,t,n){const o=[];for(let r=0,s=t.length;rnew Uint8Array(256));let K6;class a5{static wrap(e){return Woe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new a5(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Woe?this.buffer.toString():(K6||(K6=new TextDecoder),K6.decode(this.buffer))}}function SJe(i,e){return i[e+0]<<0>>>0|i[e+1]<<8>>>0}function xJe(i,e,t){i[t+0]=e&255,e=e>>>8,i[t+1]=e&255}function uu(i,e){return i[e]*Math.pow(2,24)+i[e+1]*Math.pow(2,16)+i[e+2]*Math.pow(2,8)+i[e+3]}function hu(i,e,t){i[t+3]=e,e=e>>>8,i[t+2]=e,e=e>>>8,i[t+1]=e,e=e>>>8,i[t]=e}function Voe(i,e){return i[e]}function Hoe(i,e,t){i[t]=e}let q6;function T0e(){return q6||(q6=new TextDecoder("UTF-16LE")),q6}let G6;function LJe(){return G6||(G6=new TextDecoder("UTF-16BE")),G6}let X6;function N0e(){return X6||(X6=b_e()?T0e():LJe()),X6}function EJe(i,e,t){const n=new Uint16Array(i.buffer,e,t);return t>0&&(n[0]===65279||n[0]===65534)?DJe(i,e,t):T0e().decode(n)}function DJe(i,e,t){const n=[];let o=0;for(let r=0;r=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let n=0;n[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s{const[l,c]=s,[d,u]=a;return l===d||l===u||c===d||c===u},o=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let d=0;d0&&r.push({open:a,close:l})}return r}class IJe{constructor(e,t){this._richEditBracketsBrand=void 0;const n=kJe(t);this.brackets=n.map((o,r)=>new ZA(e,r,o.open,o.close,TJe(o.open,o.close,n,r),NJe(o.open,o.close,n,r))),this.forwardRegex=RJe(this.brackets),this.reversedRegex=MJe(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const o of this.brackets){for(const r of o.open)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,r.length);for(const r of o.close)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,r.length)}}}function R0e(i,e,t,n){for(let o=0,r=e.length;o=0&&n.push(a);for(const a of s.close)a.indexOf(i)>=0&&n.push(a)}}function M0e(i,e){return i.length-e.length}function l5(i){if(i.length<=1)return i;const e=[],t=new Set;for(const n of i)t.has(n)||(e.push(n),t.add(n));return e}function TJe(i,e,t,n){let o=[];o=o.concat(i),o=o.concat(e);for(let r=0,s=o.length;r=0;s--)o[r++]=n.charCodeAt(s);return N0e().decode(o)}let e=null,t=null;return function(o){return e!==o&&(e=o,t=i(e)),t}}();class hd{static _findPrevBracketInText(e,t,n,o){const r=n.match(e);if(!r)return null;const s=n.length-(r.index||0),a=r[0].length,l=o+s;return new V(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,n,o,r){const a=cG(n).substring(n.length-r,n.length-o);return this._findPrevBracketInText(e,t,a,o)}static findNextBracketInText(e,t,n,o){const r=n.match(e);if(!r)return null;const s=r.index||0,a=r[0].length;if(a===0)return null;const l=o+s;return new V(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,n,o,r){const s=n.substring(o,r);return this.findNextBracketInText(e,t,s,o)}}class PJe{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const n of t.close){const o=n.charAt(n.length-1);e.push(o)}return bv(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const o=t.findTokenIndexAtOffset(n-1);if(Ch(t.getStandardTokenType(o)))return null;const r=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,n-1)+e,a=hd.findPrevBracketInRange(r,1,s,0,s.length);if(!a)return null;const l=s.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 l2(i){return i.global&&(i.lastIndex=0),!0}class OJe{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&l2(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&l2(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&l2(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&l2(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 RC{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const n=RC._createOpenBracketRegExp(t[0]),o=RC._createCloseBracketRegExp(t[1]);n&&o&&this._brackets.push({open:t[0],openRegExp:n,close:t[1],closeRegExp:o})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,n,o){if(e>=3)for(let r=0,s=this._regExpRules.length;rc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&n.length>0&&o.length>0)for(let r=0,s=this._brackets.length;r=2&&n.length>0){for(let r=0,s=this._brackets.length;r0&&i.charAt(i.length-1)==="#"?i.substring(0,i.length-1):i}class VJe{constructor(){this._onDidChangeSchema=new le,this.schemasById={}}registerSchema(e,t){this.schemasById[WJe(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const HJe=new VJe;no.add(d5.JSONContribution,HJe);const ch={Configuration:"base.contributions.configuration"},Ax="vscode://schemas/settings/resourceLanguage",Uoe=no.as(d5.JSONContribution);class $Je{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new le,this._onDidUpdateConfiguration=new le,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:C("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={},Uoe.registerSchema(Ax,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=new Set;this.doRegisterConfigurations(e,t,n),Uoe.registerSchema(Ax,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var n;const o=[];for(const{overrides:r,source:s}of e)for(const a in r)if(t.add(a),Ev.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(n=l==null?void 0:l.valuesSources)!==null&&n!==void 0?n:new Map;if(s)for(const f of Object.keys(r[a]))c.set(f,s);const d=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),r[a]);this.configurationDefaultsOverrides.set(a,{source:s,value:d,valuesSources:c});const u=BJe(a),h={type:"object",default:d,description:C("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:Ax,defaultDefaultValue:d,source:la(s)?void 0:s,defaultValueSource:s};o.push(...QA(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:r[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(o)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(o=>{this.validateAndRegisterProperties(o,t,o.extensionInfo,o.restrictedProperties,void 0,n),this.configurationContributors.push(o),this.registerJSONConfiguration(o)})}validateAndRegisterProperties(e,t=!0,n,o,r=3,s){var a;r=Al(e.scope)?r:e.scope;const l=e.properties;if(l)for(const d in l){const u=l[d];if(t&&jJe(d,u)){delete l[d];continue}if(u.source=n,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),Ev.test(d)?u.scope=void 0:(u.scope=Al(u.scope)?r:u.scope,u.restricted=Al(u.restricted)?!!(o!=null&&o.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),s.add(d)}const c=e.allOf;if(c)for(const d of c)this.validateAndRegisterProperties(d,t,n,o,r,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=n=>{const o=n.properties;if(o)for(const s in o)this.updateSchema(s,o[s]);const r=n.allOf;r==null||r.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,n={type:"object",description:C("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:C("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:Ax};this.updatePropertyDefaultValue(t,n)}}registerOverridePropertyPatternKey(){C("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),C("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const n=this.configurationDefaultsOverrides.get(e);let o=n==null?void 0:n.value,r=n==null?void 0:n.source;il(o)&&(o=t.defaultDefaultValue,r=void 0),il(o)&&(o=UJe(t.type)),t.default=o,t.defaultValueSource=r}}const F0e="\\[([^\\]]+)\\]",joe=new RegExp(F0e,"g"),zJe=`^(${F0e})+$`,Ev=new RegExp(zJe);function QA(i){const e=[];if(Ev.test(i)){let t=joe.exec(i);for(;t!=null&&t.length;){const n=t[1].trim();n&&e.push(n),t=joe.exec(i)}}return bv(e)}function UJe(i){switch(Array.isArray(i)?i[0]:i){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const rM=new $Je;no.add(ch.Configuration,rM);function jJe(i,e){var t,n,o,r;return i.trim()?Ev.test(i)?C("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",i):rM.getConfigurationProperties()[i]!==void 0?C("config.property.duplicate","Cannot register '{0}'. This property is already registered.",i):((t=e.policy)===null||t===void 0?void 0:t.name)&&rM.getPolicyConfigurations().get((n=e.policy)===null||n===void 0?void 0:n.name)!==void 0?C("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",i,(o=e.policy)===null||o===void 0?void 0:o.name,rM.getPolicyConfigurations().get((r=e.policy)===null||r===void 0?void 0:r.name)):null:C("config.property.empty","Cannot register an empty property")}const KJe={ModesRegistry:"editor.modesRegistry"};class qJe{constructor(){this._onDidChangeLanguages=new le,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t{const l=new Set;return{info:new YJe(this,a,l),closing:l}}),r=new poe(a=>{const l=new Set,c=new Set;return{info:new ZJe(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of n){const c=o.get(a),d=r.get(l);c.closing.add(d.info),d.opening.add(c.info)}const s=t.colorizedBracketPairs?Koe(t.colorizedBracketPairs):n.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=o.get(a),d=r.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...r.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 Koe(i){return i.filter(([e,t])=>e!==""&&t!=="")}class B0e{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class YJe extends B0e{constructor(e,t,n){super(e,t),this.openedBrackets=n,this.isOpeningBracket=!0}}class ZJe extends B0e{constructor(e,t,n,o){super(e,t),this.openingBrackets=n,this.openingColorizedBrackets=o,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 QJe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},qoe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Y6{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Ti=yn("languageConfigurationService");let nH=class extends _e{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new net),this.onDidChangeEmitter=this._register(new le),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const n=new Set(Object.values(iH));this._register(this.configurationService.onDidChangeConfiguration(o=>{const r=o.change.keys.some(a=>n.has(a)),s=o.change.overrides.filter(([a,l])=>l.some(c=>n.has(c))).map(([a])=>a);if(r)this.configurations.clear(),this.onDidChangeEmitter.fire(new Y6(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new Y6(a)))})),this._register(this._registry.onDidChange(o=>{this.configurations.delete(o.languageId),this.onDidChangeEmitter.fire(new Y6(o.languageId))}))}register(e,t,n){return this._registry.register(e,t,n)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=JJe(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};nH=QJe([qoe(0,En),qoe(1,Ki)],nH);function JJe(i,e,t,n){let o=e.getLanguageConfiguration(i);if(!o){if(!n.isRegisteredLanguageId(i))return new yy(i,{});o=new yy(i,{})}const r=eet(o.languageId,t),s=V0e([o.underlyingConfig,r]);return new yy(o.languageId,s)}const iH={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function eet(i,e){const t=e.getValue(iH.brackets,{overrideIdentifier:i}),n=e.getValue(iH.colorizedBracketPairs,{overrideIdentifier:i});return{brackets:Goe(t),colorizedBracketPairs:Goe(n)}}function Goe(i){if(!!Array.isArray(i))return i.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function W0e(i,e,t){const n=i.getLineContent(e);let o=Si(n);return o.length>t-1&&(o=o.substring(0,t-1)),o}function Cy(i,e,t){i.tokenization.forceTokenization(e);const n=i.tokenization.getLineTokens(e),o=typeof t=="undefined"?i.getLineMaxColumn(e)-1:t-1;return s5(n,o)}class tet{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const n=new Xoe(e,t,++this._order);return this._entries.push(n),this._resolved=null,zt(()=>{for(let o=0;oe.configuration)))}}function V0e(i){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 i)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 Xoe{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class Yoe{constructor(e){this.languageId=e}}class net extends _e{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._register(this.register(Gl,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,n=0){let o=this._entries.get(e);o||(o=new tet(e),this._entries.set(e,o));const r=o.register(t,n);return this._onDidChange.fire(new Yoe(e)),zt(()=>{r.dispose(),this._onDidChange.fire(new Yoe(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class yy{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 RC(this.underlyingConfig):null,this.comments=yy._handleComments(this.underlyingConfig),this.characterPair=new bw(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Vq,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new OJe(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new XJe(e,this.underlyingConfig)}getWordDefinition(){return w_e(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new IJe(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new PJe(this.brackets)),this._electricCharacter}onEnter(e,t,n,o){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,o):null}getAutoClosingPairs(){return new yJe(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 n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){const[o,r]=t.blockComment;n.blockCommentStartToken=o,n.blockCommentEndToken=r}return n}}Mn(Ti,nH,1);class Gp{constructor(e,t,n,o){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=o}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function H0e(i){return u5(i,0)}function u5(i,e){switch(typeof i){case"object":return i===null?Pg(349,e):Array.isArray(i)?oet(i,e):ret(i,e);case"string":return dG(i,e);case"boolean":return iet(i,e);case"number":return Pg(i,e);case"undefined":return Pg(937,e);default:return Pg(617,e)}}function Pg(i,e){return(e<<5)-e+i|0}function iet(i,e){return Pg(i?433:863,e)}function dG(i,e){e=Pg(149417,e);for(let t=0,n=i.length;tu5(n,t),e)}function ret(i,e){return e=Pg(181387,e),Object.keys(i).sort().reduce((t,n)=>(t=dG(n,t),u5(i[n],t)),e)}function Z6(i,e,t=32){const n=t-e,o=~((1<>>n)>>>0}function Zoe(i,e=0,t=i.byteLength,n=0){for(let o=0;ot.toString(16).padStart(2,"0")).join(""):set((i>>>0).toString(16),e/4)}class h5{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 n=this._buff;let o=this._buffLen,r=this._leftoverHighSurrogate,s,a;for(r!==0?(s=r,a=-1,r=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(gr(s))if(a+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&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()),Px(this._h0)+Px(this._h1)+Px(this._h2)+Px(this._h3)+Px(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Zoe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Zoe(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=h5._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,Z6(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let n=this._h0,o=this._h1,r=this._h2,s=this._h3,a=this._h4,l,c,d;for(let u=0;u<80;u++)u<20?(l=o&r|~o&s,c=1518500249):u<40?(l=o^r^s,c=1859775393):u<60?(l=o&r|o&s|r&s,c=2400959708):(l=o^r^s,c=3395469782),d=Z6(n,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=s,s=r,r=Z6(o,30),o=n,n=d;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}h5._bigBlock32=new DataView(new ArrayBuffer(320));class Qoe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,o=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new Gp(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 Ah{constructor(e,t,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=e,this._modifiedSequence=t;const[o,r,s]=Ah._getElements(e),[a,l,c]=Ah._getElements(t);this._hasStrings=s&&c,this._originalStringElements=o,this._originalElementsOrHash=r,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(Ah._isStringArray(t)){const n=new Int32Array(t.length);for(let o=0,r=t.length;o=e&&o>=n&&this.ElementsAreEqual(t,o);)t--,o--;if(e>t||n>o){let u;return n<=o?(H1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new Gp(e,0,n,o-n+1)]):e<=t?(H1.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),u=[new Gp(e,t-e+1,n,0)]):(H1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),H1.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,n,o,s,a,r),c=s[0],d=a[0];if(l!==null)return l;if(!r[0]){const u=this.ComputeDiffRecursive(e,c,n,d,r);let h=[];return r[0]?h=[new Gp(c+1,t-(c+1)+1,d+1,o-(d+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,d+1,o,r),this.ConcatenateChanges(u,h)}return[new Gp(e,t-e+1,n,o-n+1)]}WALKTRACE(e,t,n,o,r,s,a,l,c,d,u,h,f,g,p,v,m,_){let y=null,w=null,L=new Joe,D=t,E=n,I=f[0]-v[0]-o,k=-1073741824,R=this.m_forwardHistory.length-1;do{const A=I+e;A===D||A=0&&(c=this.m_forwardHistory[R],e=c[0],D=1,E=c.length-1)}while(--R>=-1);if(y=L.getReverseChanges(),_[0]){let A=f[0]+1,P=v[0]+1;if(y!==null&&y.length>0){const N=y[y.length-1];A=Math.max(A,N.getOriginalEnd()),P=Math.max(P,N.getModifiedEnd())}w=[new Gp(A,h-A+1,P,p-P+1)]}else{L=new Joe,D=s,E=a,I=f[0]-v[0]-l,k=1073741824,R=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=I+r;A===D||A=d[A+1]?(u=d[A+1]-1,g=u-I-l,u>k&&L.MarkNextChange(),k=u+1,L.AddOriginalElement(u+1,g+1),I=A+1-r):(u=d[A-1],g=u-I-l,u>k&&L.MarkNextChange(),k=u,L.AddModifiedElement(u+1,g+1),I=A-1-r),R>=0&&(d=this.m_reverseHistory[R],r=d[0],D=1,E=d.length-1)}while(--R>=-1);w=L.getChanges()}return this.ConcatenateChanges(y,w)}ComputeRecursionPoint(e,t,n,o,r,s,a){let l=0,c=0,d=0,u=0,h=0,f=0;e--,n--,r[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(o-n),p=g+1,v=new Int32Array(p),m=new Int32Array(p),_=o-n,y=t-e,w=e-n,L=t-o,E=(y-_)%2===0;v[_]=e,m[y]=t,a[0]=!1;for(let I=1;I<=g/2+1;I++){let k=0,R=0;d=this.ClipDiagonalBound(_-I,I,_,p),u=this.ClipDiagonalBound(_+I,I,_,p);for(let P=d;P<=u;P+=2){P===d||Pk+R&&(k=l,R=c),!E&&Math.abs(P-y)<=I-1&&l>=m[P])return r[0]=l,s[0]=c,N<=m[P]&&1447>0&&I<=1447+1?this.WALKTRACE(_,d,u,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a):null}const A=(k-e+(R-n)-I)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(k,A))return a[0]=!0,r[0]=k,s[0]=R,A>0&&1447>0&&I<=1447+1?this.WALKTRACE(_,d,u,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a):(e++,n++,[new Gp(e,t-e+1,n,o-n+1)]);h=this.ClipDiagonalBound(y-I,I,y,p),f=this.ClipDiagonalBound(y+I,I,y,p);for(let P=h;P<=f;P+=2){P===h||P=m[P+1]?l=m[P+1]-1:l=m[P-1],c=l-(P-y)-L;const N=l;for(;l>e&&c>n&&this.ElementsAreEqual(l,c);)l--,c--;if(m[P]=l,E&&Math.abs(P-_)<=I&&l<=v[P])return r[0]=l,s[0]=c,N>=v[P]&&1447>0&&I<=1447+1?this.WALKTRACE(_,d,u,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a):null}if(I<=1447){let P=new Int32Array(u-d+2);P[0]=_-d+1,$1.Copy2(v,d,P,1,u-d+1),this.m_forwardHistory.push(P),P=new Int32Array(f-h+2),P[0]=y-h+1,$1.Copy2(m,h,P,1,f-h+1),this.m_reverseHistory.push(P)}}return this.WALKTRACE(_,d,u,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a)}PrettifyChanges(e){for(let t=0;t0,a=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let o=0,r=0;if(t>0){const u=e[t-1];o=u.originalStart+u.originalLength,r=u.modifiedStart+u.modifiedLength}const s=n.originalLength>0,a=n.modifiedLength>0;let l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let u=1;;u++){const h=n.originalStart-u,f=n.modifiedStart-u;if(hc&&(c=p,l=u)}n.originalStart-=l,n.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,n=e.length;t0&&f>l&&(l=f,c=u,d=h)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,n){let o=0;for(let r=0;r=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 n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))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 n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,o){const r=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(n,o)?1:0;return r+s}ConcatenateChanges(e,t){const n=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const o=new Array(e.length+t.length-1);return $1.Copy(e,0,o,0,e.length-1),o[e.length-1]=n[0],$1.Copy(t,1,o,e.length,t.length-1),o}else{const o=new Array(e.length+t.length);return $1.Copy(e,0,o,0,e.length),$1.Copy(t,0,o,e.length,t.length),o}}ChangesOverlap(e,t,n){if(H1.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),H1.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 o=e.originalStart;let r=e.originalLength;const s=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(r=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new Gp(o,r,s,a),!0}else return n[0]=null,!1}ClipDiagonalBound(e,t,n,o){if(e>=0&&e255?255:i|0}function z1(i){return i<0?0:i>4294967295?4294967295:i|0}class cet{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=z1(e);const n=this.values,o=this.prefixSum,r=t.length;return r===0?!1:(this.values=new Uint32Array(n.length+r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+r),this.values.set(t,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=z1(e),t=z1(t),this.values[e]===t?!1:(this.values[e]=t,e-1=n.length)return!1;const r=n.length-e;return t>=r&&(t=r),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.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=z1(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 n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,o=0,r=0,s=0;for(;t<=n;)if(o=t+(n-t)/2|0,r=this.prefixSum[o],s=r-this.values[o],e=r)t=o+1;else break;return new $0e(o,e-s)}}class det{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],n=t>0?this._prefixSum[t-1]:0;return new $0e(t,e-n)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=V4(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]=o+n;for(let r=0;r=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}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 eP{constructor(){this._actual=new wS(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class het{constructor(e,t,n){const o=new Uint8Array(e*t);for(let r=0,s=e*t;rt&&(t=l),a>n&&(n=a),c>n&&(n=c)}t++,n++;const o=new het(n,t,0);for(let r=0,s=e.length;r=this._maxCharCode?0:this._states.get(e,t)}}let Q6=null;function get(){return Q6===null&&(Q6=new fet([[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]])),Q6}let Ox=null;function pet(){if(Ox===null){Ox=new wS(0);const i=` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026`;for(let t=0;to);if(o>0){const a=t.charCodeAt(o-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:n,startColumn:o+1,endLineNumber:n,endColumn:s+2},url:t.substring(o,s+1)}}static computeLinks(e,t=get()){const n=pet(),o=[];for(let r=1,s=e.getLineCount();r<=s;r++){const a=e.getLineContent(r),l=a.length;let c=0,d=0,u=0,h=1,f=!1,g=!1,p=!1,v=!1;for(;c=0?(o+=n?1:-1,o<0?o=e.length-1:o%=e.length,e[o]):null}}oH.INSTANCE=new oH;class vet extends wS{constructor(e){super(0);for(let t=0,n=e.length;t(e.hasOwnProperty(t)||(e[t]=i(t)),e[t])}const Vc=_et(i=>new vet(i));var Yl;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(Yl||(Yl={}));var wy;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(wy||(wy={}));var ll;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(ll||(ll={}));var Nu;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(Nu||(Nu={}));class sM{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=Boolean(e.insertSpaces),this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=Boolean(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&&ql(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 HD{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function bet(i){return i&&typeof i.read=="function"}class J6{constructor(e,t,n,o,r,s){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=o,this.isAutoWhitespaceEdit=r,this._isTracked=s}}class Cet{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class yet{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}}function wet(i){return!i.isTooLargeForSyncing()&&!i.isForSimpleWidget}const xet=999;class A_{constructor(e,t,n,o){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=o}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=Let(this.searchString):e=this.searchString.indexOf(` +`)>=0;let t=null;try{t=U_e(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new Cet(t,this.wordSeparators?Vc(this.wordSeparators):null,n?this.searchString:null)}}function Let(i){if(!i||i.length===0)return!1;for(let e=0,t=i.length;e=t)break;const o=i.charCodeAt(e);if(o===110||o===114||o===87)return!0}}return!1}function H_(i,e,t){if(!t)return new HD(i,null);const n=[];for(let o=0,r=e.length;o>0);t[r]>=e?o=r-1:t[r+1]>=e?(n=r,o=r):n=r+1}return n+1}}class c2{static findMatches(e,t,n,o,r){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,n,new MC(s.wordSeparators,s.regex),o,r):this._doFindMatchesLineByLine(e,n,s,o,r):[]}static _getMultilineMatchRange(e,t,n,o,r,s){let a,l=0;o?(l=o.findLineFeedCountBeforeOffset(r),a=t+r+l):a=t+r;let c;if(o){const f=o.findLineFeedCountBeforeOffset(r+s.length)-l;c=a+s.length+f}else c=a+s.length;const d=e.getPositionAt(a),u=e.getPositionAt(c);return new V(d.lineNumber,d.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,n,o,r){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new ere(a):null,c=[];let d=0,u;for(n.reset(0);u=n.next(a);)if(c[d++]=H_(this._getMultilineMatchRange(e,s,a,l,u.index,u[0]),u,o),d>=r)return c;return c}static _doFindMatchesLineByLine(e,t,n,o,r){const s=[];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(n,c,t.startLineNumber,t.startColumn-1,a,s,o,r),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(n,l,t.startLineNumber,t.startColumn-1,a,s,o,r);for(let c=t.startLineNumber+1;c=l))return r;return r}const d=new MC(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(s[r++]=H_(new V(n,u.index+1+o,n,u.index+1+u[0].length+o),u,a),r>=l))return r;while(u);return r}static findNextMatch(e,t,n,o){const r=t.parseSearchRequest();if(!r)return null;const s=new MC(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindNextMatchMultiline(e,n,s,o):this._doFindNextMatchLineByLine(e,n,s,o)}static _doFindNextMatchMultiline(e,t,n,o){const r=new ae(t.lineNumber,1),s=e.getOffsetAt(r),a=e.getLineCount(),l=e.getValueInRange(new V(r.lineNumber,r.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r +`?new ere(l):null;n.reset(t.column-1);const d=n.next(l);return d?H_(this._getMultilineMatchRange(e,s,l,c,d.index,d[0]),d,o):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new ae(1,1),n,o):null}static _doFindNextMatchLineByLine(e,t,n,o){const r=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(n,a,s,t.column,o);if(l)return l;for(let c=1;c<=r;c++){const d=(s+c-1)%r,u=e.getLineContent(d+1),h=this._findFirstMatchInLine(n,u,d+1,1,o);if(h)return h}return null}static _findFirstMatchInLine(e,t,n,o,r){e.reset(o-1);const s=e.next(t);return s?H_(new V(n,s.index+1,n,s.index+1+s[0].length),s,r):null}static findPreviousMatch(e,t,n,o){const r=t.parseSearchRequest();if(!r)return null;const s=new MC(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindPreviousMatchMultiline(e,n,s,o):this._doFindPreviousMatchLineByLine(e,n,s,o)}static _doFindPreviousMatchMultiline(e,t,n,o){const r=this._doFindMatchesMultiline(e,new V(1,1,t.lineNumber,t.column),n,o,10*xet);if(r.length>0)return r[r.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new ae(s,e.getLineMaxColumn(s)),n,o):null}static _doFindPreviousMatchLineByLine(e,t,n,o){const r=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(n,a,s,o);if(l)return l;for(let c=1;c<=r;c++){const d=(r+s-c-1)%r,u=e.getLineContent(d+1),h=this._findLastMatchInLine(n,u,d+1,o);if(h)return h}return null}static _findLastMatchInLine(e,t,n,o){let r=null,s;for(e.reset(0);s=e.next(t);)r=H_(new V(n,s.index+1,n,s.index+1+s[0].length),s,o);return r}}function Eet(i,e,t,n,o){if(n===0)return!0;const r=e.charCodeAt(n-1);if(i.get(r)!==0||r===13||r===10)return!0;if(o>0){const s=e.charCodeAt(n);if(i.get(s)!==0)return!0}return!1}function Det(i,e,t,n,o){if(n+o===t)return!0;const r=e.charCodeAt(n+o);if(i.get(r)!==0||r===13||r===10)return!0;if(o>0){const s=e.charCodeAt(n+o-1);if(i.get(s)!==0)return!0}return!1}function uG(i,e,t,n,o){return Eet(i,e,t,n,o)&&Det(i,e,t,n,o)}class MC{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 n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;const o=n.index,r=n[0].length;if(o===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){KA(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=o,this._prevMatchLength=r,!this._wordSeparators||uG(this._wordSeparators,e,t,o,r))return n}while(n);return null}}class hG{static computeUnicodeHighlights(e,t,n){const o=n?n.startLineNumber:1,r=n?n.endLineNumber:e.getLineCount(),s=new tre(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${ket(Array.from(a))}`,"g");const c=new MC(null,l),d=[];let u=!1,h,f=0,g=0,p=0;e:for(let v=o,m=r;v<=m;v++){const _=e.getLineContent(v),y=_.length;c.reset(0);do if(h=c.next(_),h){let w=h.index,L=h.index+h[0].length;if(w>0){const k=_.charCodeAt(w-1);gr(k)&&w--}if(L+1=k){u=!0;break e}d.push(new V(v,w+1,v,L+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const n=new tre(t);switch(n.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const r=e.codePointAt(0),s=n.ambiguousCharacters.getPrimaryConfusable(r),a=eb.getLocales().filter(l=>!eb.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(r));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function ket(i,e){return`[${Xl(i.map(n=>String.fromCodePoint(n)).join(""))}]`}class tre{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=eb.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of cf.codePoints)nre(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 n=e.codePointAt(0);if(this.allowedCodePoints.has(n))return 0;if(this.options.nonBasicASCII)return 1;let o=!1,r=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=$I(s);o=o||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!cf.isInvisibleCharacter(a)&&(r=!0)}return!o&&r?0:this.options.invisibleCharacters&&!nre(e)&&cf.isInvisibleCharacter(n)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(n)?3:0}}function nre(i){return i===" "||i===` +`||i===" "}class aM{constructor(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n}}class z0e{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Cn{static addRange(e,t){let n=0;for(;nt))return new Cn(e,t)}static ofLength(e){return new Cn(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Vo(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Cn(this.start+e,this.endExclusive+e)}deltaStart(e){return new Cn(this.start+e,this.endExclusive)}deltaEnd(e){return new Cn(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function nP(i,e,t){const n=Iet(i,e);if(n!==-1)return i[n]}function Iet(i,e,t=i.length-1){for(let n=t;n>=0;n--){const o=i[n];if(e(o))return n}return-1}function $D(i,e){const t=zD(i,e);return t===-1?void 0:i[t]}function zD(i,e,t=0,n=i.length){let o=t,r=n;for(;o0&&(t=o)}return t}function Net(i,e){if(i.length===0)return;let t=i[0];for(let n=1;n=0&&(t=o)}return t}function Ret(i,e){return U0e(i,(t,n)=>-e(t,n))}function Met(i,e){if(i.length===0)return-1;let t=0;for(let n=1;n0&&(t=n)}return t}function Aet(i,e){for(const t of i){const n=e(t);if(n!==void 0)return n}}class ln{static fromRange(e){return new ln(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new Ph(e[0].slice());for(let n=1;nt)throw new Vo(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=zD(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){const o=this._normalizedRanges[t];this._normalizedRanges[t]=o.join(e)}else{const o=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,o)}}contains(e){const t=$D(this._normalizedRanges,n=>n.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 n=0,o=0,r=null;for(;n=s.startLineNumber?r=new ln(r.startLineNumber,Math.max(r.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(r),r=s)}return r!==null&&t.push(r),new Ph(t)}subtractFrom(e){const t=UD(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),n=zD(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)return new Ph([e]);const o=[];let r=e.startLineNumber;for(let s=t;sr&&o.push(new ln(r,a.startLineNumber)),r=a.endLineNumberExclusive}return re.toString()).join(", ")}getIntersection(e){const t=[];let n=0,o=0;for(;nt.delta(e)))}}class mf{static inverse(e,t,n){const o=[];let r=1,s=1;for(const l of e){const c=new Hc(new ln(r,l.original.startLineNumber),new ln(s,l.modified.startLineNumber),void 0);c.modified.isEmpty||o.push(c),r=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new Hc(new ln(r,t+1),new ln(s,n+1),void 0);return a.modified.isEmpty||o.push(a),o}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new mf(this.modified,this.original)}join(e){return new mf(this.original.join(e.original),this.modified.join(e.modified))}}class Hc extends mf{constructor(e,t,n){super(e,t),this.innerChanges=n}flip(){var e;return new Hc(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class Dv{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Dv(this.modifiedRange,this.originalRange)}}const Pet=3;class Oet{computeDiff(e,t,n){var o;const s=new Wet(e,t,{maxComputationTime:n.maxComputationTimeMs,shouldIgnoreTrimWhitespace:n.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let d;c.originalEndLineNumber===0?d=new ln(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new ln(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new ln(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new ln(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new Hc(d,u,(o=c.charChanges)===null||o===void 0?void 0:o.map(f=>new Dv(new V(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new V(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new Hc(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 FD(()=>t0e(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class Sy{constructor(e,t,n,o,r,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=n,this.originalEndColumn=o,this.modifiedStartLineNumber=r,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,n){const o=t.getStartLineNumber(e.originalStart),r=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=n.getStartLineNumber(e.modifiedStart),c=n.getStartColumn(e.modifiedStart),d=n.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=n.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new Sy(o,r,s,a,l,c,d,u)}}function Bet(i){if(i.length<=1)return i;const e=[i[0]];let t=e[0];for(let n=1,o=i.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&r()){const f=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=o.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=j0e(f,g,r,!0).changes;a&&(p=Bet(p)),h=[];for(let v=0,m=p.length;v1&&p>1;){const v=h.charCodeAt(g-2),m=f.charCodeAt(p-2);if(v!==m)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(o,r+1,1,g,s+1,1,p)}{let g=sH(h,1),p=sH(f,1);const v=h.length+1,m=f.length+1;for(;g!0;const e=Date.now();return()=>Date.now()-e{n.push(Fr.fromOffsetPairs(o?o.getEndExclusives():Kh.zero,r?r.getStarts():new Kh(t,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+t)))}),n}static fromOffsetPairs(e,t){return new Fr(new Cn(e.offset1,t.offset1),new Cn(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Fr(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Fr(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Fr(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Fr(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Fr(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!t||!n))return new Fr(t,n)}getStarts(){return new Kh(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Kh(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Kh{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Kh.zero=new Kh(0,0);Kh.max=new Kh(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class jD{isValid(){return!0}}jD.instance=new jD;class Vet{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Vo("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&s.get(g-1,p-1)===3&&(_+=a.get(g-1,p-1)),_+=o?o(g,p):1):_=-1;const y=Math.max(v,m,_);if(y===_){const w=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,w+1),s.set(g,p,3)}else y===v?(a.set(g,p,0),s.set(g,p,1)):y===m&&(a.set(g,p,0),s.set(g,p,2));r.set(g,p,y)}const l=[];let c=e.length,d=t.length;function u(g,p){(g+1!==c||p+1!==d)&&l.push(new Fr(new Cn(g+1,c),new Cn(p+1,d))),c=g,d=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(u(h,f),h--,f--):s.get(h,f)===1?h--:f--;return u(-1,-1),l.reverse(),new qg(l,!1)}}class K0e{compute(e,t,n=jD.instance){if(e.length===0||t.length===0)return qg.trivial(e,t);const o=e,r=t;function s(p,v){for(;po.length||w>r.length)continue;const L=s(y,w);l.set(d,L);const D=y===m?c.get(d+1):c.get(d-1);if(c.set(d,L!==y?new rre(D,y,w,L-y):D),l.get(d)===o.length&&l.get(d)-d===r.length)break e}}let u=c.get(d);const h=[];let f=o.length,g=r.length;for(;;){const p=u?u.x+u.length:0,v=u?u.y+u.length:0;if((p!==f||v!==g)&&h.push(new Fr(new Cn(p,f),new Cn(v,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new qg(h,!1)}}class rre{constructor(e,t,n,o){this.prev=e,this.x=t,this.y=n,this.length=o}}class $et{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 n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=t}}}class zet{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 sre,are;class Uet{constructor(e,t){this.uri=e,this.value=t}}function jet(i){return Array.isArray(i)}class _s{constructor(e,t){if(this[sre]="ResourceMap",e instanceof _s)this.map=new Map(e.map),this.toKey=t!=null?t:_s.defaultToKey;else if(jet(e)){this.map=new Map,this.toKey=t!=null?t:_s.defaultToKey;for(const[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e!=null?e:_s.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Uet(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!="undefined"&&(e=e.bind(t));for(const[n,o]of this.map)e(o.value,o.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]}*[(sre=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}_s.defaultToKey=i=>i.toString();class Ket{constructor(){this[are]="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 n=this._map.get(e);if(!!n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let o=this._map.get(e);if(o)o.value=t,n!==0&&this.touch(o,n);else{switch(o={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),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 n=this._state;let o=this._head;for(;o;){if(t?e.bind(t)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:n.key,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}values(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:n.value,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}entries(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:[n.key,n.value],done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}[(are=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,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,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.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 n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),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 n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class Qv extends Ket{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 qet{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,n]of e)this.set(t,n)}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 gG{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){const n=this.map.get(e);!n||(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){const n=this.map.get(e);!n||n.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class iP{constructor(e,t,n){this.lines=e,this.considerWhitespaceChanges=n,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let o=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Cn(t.start-1,t.endExclusive),o=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let r=this.lineRange.start;rString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=cre(e>0?this.elements[e-1]:-1),n=cre(en<=e);return new ae(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return V.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!t9(this.elements[e]))return;let t=e;for(;t>0&&t9(this.elements[t-1]);)t--;let n=e;for(;ns<=e.start))!==null&&t!==void 0?t:0,r=(n=Tet(this.firstCharOffsetByLine,s=>e.endExclusive<=s))!==null&&n!==void 0?n:this.elements.length;return new Cn(o,r)}}function t9(i){return i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57}const Get={[0]:0,[1]:0,[2]:0,[3]:10,[4]:2,[5]:3,[6]:10,[7]:10};function lre(i){return Get[i]}function cre(i){return i===10?7:i===13?6:aH(i)?5:i>=97&&i<=122?0:i>=65&&i<=90?1:i>=48&&i<=57?2:i===-1?3:4}function Xet(i,e,t,n,o,r){let{moves:s,excludedChanges:a}=Yet(i,e,t,r);if(!r.isValid())return[];const l=i.filter(d=>!a.has(d)),c=Zet(l,n,o,e,t,r);return GW(s,c),s=Qet(s),s=s.filter(d=>d.original.toOffsetRange().slice(e).map(h=>h.trim()).join(` +`).length>=10),s=Jet(i,s),s}function Yet(i,e,t,n){const o=[],r=i.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new yw(l.original,e,l)),s=new Set(i.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new yw(l.modified,t,l))),a=new Set;for(const l of r){let c=-1,d;for(const u of s){const h=l.computeSimilarity(u);h>c&&(c=h,d=u)}if(c>.9&&d&&(s.delete(d),o.push(new mf(l.range,d.range)),a.add(l.source),a.add(d.source)),!n.isValid())return{moves:o,excludedChanges:a}}return{moves:o,excludedChanges:a}}function Zet(i,e,t,n,o,r){const s=[],a=new gG;for(const h of i)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,jg));for(const h of i){let f=[];for(let g=h.modified.startLineNumber;g{for(const w of f)if(w.originalLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){w.originalLineRange=new ln(w.originalLineRange.startLineNumber,_.endLineNumberExclusive),w.modifiedLineRange=new ln(w.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),m.push(w);return}const y={modifiedLineRange:v,originalLineRange:_};l.push(y),m.push(y)}),f=m}if(!r.isValid())return[]}l.sort(h_e(Rc(h=>h.modifiedLineRange.length,jg)));const c=new Ph,d=new Ph;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),v=g.getIntersection(p);for(const m of v.ranges){if(m.length<3)continue;const _=m,y=m.delta(-f);s.push(new mf(y,_)),c.addRange(_),d.addRange(y)}}s.sort(Rc(h=>h.original.startLineNumber,jg));const u=new jI(i);for(let h=0;hD.original.startLineNumber<=f.original.startLineNumber),p=$D(i,D=>D.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),m=u.findLastMonotonous(D=>D.original.startLineNumberD.modified.startLineNumbern.length||E>o.length||c.contains(E)||d.contains(D)||!dre(n[D-1],o[E-1],r))break}w>0&&(d.addRange(new ln(f.original.startLineNumber-w,f.original.startLineNumber)),c.addRange(new ln(f.modified.startLineNumber-w,f.modified.startLineNumber)));let L;for(L=0;Ln.length||E>o.length||c.contains(E)||d.contains(D)||!dre(n[D-1],o[E-1],r))break}L>0&&(d.addRange(new ln(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+L)),c.addRange(new ln(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+L))),(w>0||L>0)&&(s[h]=new mf(new ln(f.original.startLineNumber-w,f.original.endLineNumberExclusive+L),new ln(f.modified.startLineNumber-w,f.modified.endLineNumberExclusive+L)))}return s}function dre(i,e,t){if(i.trim()===e.trim())return!0;if(i.length>300&&e.length>300)return!1;const o=new K0e().compute(new iP([i],new Cn(0,1),!1),new iP([e],new Cn(0,1),!1),t);let r=0;const s=Fr.invert(o.diffs,i.length);for(const d of s)d.seq1Range.forEach(u=>{aH(i.charCodeAt(u))||r++});function a(d){let u=0;for(let h=0;he.length?i:e);return r/l>.6&&l>10}function Qet(i){if(i.length===0)return i;i.sort(Rc(t=>t.original.startLineNumber,jg));const e=[i[0]];for(let t=1;t=0&&s>=0&&r+s<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}function Jet(i,e){const t=new jI(i);return e=e.filter(n=>{const o=t.findLastMonotonous(a=>a.original.endLineNumberExclusivea.modified.endLineNumberExclusive0&&(a=a.delta(c))}o.push(a)}return n.length>0&&o.push(n[n.length-1]),o}function ttt(i,e,t){if(!i.getBoundaryScore||!e.getBoundaryScore)return t;for(let n=0;n0?t[n-1]:void 0,r=t[n],s=n+1=n.start&&i.seq2Range.start-s>=o.start&&t.isStronglyEqual(i.seq2Range.start-s,i.seq2Range.endExclusive-s)&&s<100;)s++;s--;let a=0;for(;i.seq1Range.start+ac&&(c=g,l=d)}return i.delta(l)}function ntt(i,e,t){const n=[];for(const o of t){const r=n[n.length-1];if(!r){n.push(o);continue}o.seq1Range.start-r.seq1Range.endExclusive<=2||o.seq2Range.start-r.seq2Range.endExclusive<=2?n[n.length-1]=new Fr(r.seq1Range.join(o.seq1Range),r.seq2Range.join(o.seq2Range)):n.push(o)}return n}function itt(i,e,t){const n=[];let o;function r(){if(!o)return;const a=o.s1Range.length-o.deleted;o.s2Range.length-o.added,Math.max(o.deleted,o.added)+(o.count-1)>a&&n.push(new Fr(o.s1Range,o.s2Range)),o=void 0}for(const a of t){let l=function(f,g){var p,v,m,_;if(!o||!o.s1Range.containsRange(f)||!o.s2Range.containsRange(g))if(o&&!(o.s1Range.endExclusive0||e.length>0;){const n=i[0],o=e[0];let r;n&&(!o||n.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=r.seq1Range.start?t[t.length-1]=t[t.length-1].join(r):t.push(r)}return t}function rtt(i,e,t){let n=t;if(n.length===0)return n;let o=0,r;do{r=!1;const s=[n[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=n[a],c=s[s.length-1];d(c,l)?(r=!0,s[s.length-1]=s[s.length-1].join(l)):s.push(l)}n=s}while(o++<10&&r);return n}function stt(i,e,t){let n=t;if(n.length===0)return n;let o=0,r;do{r=!1;const a=[n[0]];for(let l=1;l5||p.length>500)return!1;const m=i.getText(p).trim();if(m.length>20||m.split(/\r\n|\r|\n/).length>1)return!1;const _=i.countLinesIn(f.seq1Range),y=f.seq1Range.length,w=e.countLinesIn(f.seq2Range),L=f.seq2Range.length,D=i.countLinesIn(g.seq1Range),E=g.seq1Range.length,I=e.countLinesIn(g.seq2Range),k=g.seq2Range.length,R=2*40+50;function A(P){return Math.min(P,R)}return Math.pow(Math.pow(A(_*40+y),1.5)+Math.pow(A(w*40+L),1.5),1.5)+Math.pow(Math.pow(A(D*40+E),1.5)+Math.pow(A(I*40+k),1.5),1.5)>Math.pow(Math.pow(R,1.5),1.5)*1.3};const c=n[l],d=a[a.length-1];u(d,c)?(r=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}n=a}while(o++<10&&r);const s=[];return gXe(n,(a,l,c)=>{let d=l;function u(m){return m.length>0&&m.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=i.extendToFullLines(l.seq1Range),f=i.getText(new Cn(h.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=i.getText(new Cn(l.seq1Range.endExclusive,h.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const p=Fr.fromOffsetPairs(a?a.getEndExclusives():Kh.zero,c?c.getStarts():Kh.max),v=d.intersect(p);s.push(v)}),s}class hre{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:fre(this.lines[e-1]),n=e===this.lines.length?0:fre(this.lines[e]);return 1e3-(t+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function fre(i){let e=0;for(;eL===D))return new aM([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new aM([new Hc(new ln(1,e.length+1),new ln(1,t.length+1),[new Dv(new V(1,1,e.length,e[0].length+1),new V(1,1,t.length,t[0].length+1))])],[],!1);const o=n.maxComputationTimeMs===0?jD.instance:new Vet(n.maxComputationTimeMs),r=!n.ignoreTrimWhitespace,s=new Map;function a(L){let D=s.get(L);return D===void 0&&(D=s.size,s.set(L,D)),D}const l=e.map(L=>a(L.trim())),c=t.map(L=>a(L.trim())),d=new hre(l,e),u=new hre(c,t),h=(()=>d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,o,(L,D)=>e[L]===t[D]?t[D].length===0?.1:1+Math.log(1+t[D].length):.99):this.myersDiffingAlgorithm.compute(d,u))();let f=h.diffs,g=h.hitTimeout;f=lH(d,u,f),f=rtt(d,u,f);const p=[],v=L=>{if(!!r)for(let D=0;DL.seq1Range.start-m===L.seq2Range.start-_);const D=L.seq1Range.start-m;v(D),m=L.seq1Range.endExclusive,_=L.seq2Range.endExclusive;const E=this.refineDiff(e,t,L,o,r);E.hitTimeout&&(g=!0);for(const I of E.mappings)p.push(I)}v(e.length-m);const y=gre(p,e,t);let w=[];return n.computeMoves&&(w=this.computeMoves(y,e,t,l,c,o,r)),FD(()=>{function L(E,I){if(E.lineNumber<1||E.lineNumber>I.length)return!1;const k=I[E.lineNumber-1];return!(E.column<1||E.column>k.length+1)}function D(E,I){return!(E.startLineNumber<1||E.startLineNumber>I.length+1||E.endLineNumberExclusive<1||E.endLineNumberExclusive>I.length+1)}for(const E of y){if(!E.innerChanges)return!1;for(const I of E.innerChanges)if(!(L(I.modifiedRange.getStartPosition(),t)&&L(I.modifiedRange.getEndPosition(),t)&&L(I.originalRange.getStartPosition(),e)&&L(I.originalRange.getEndPosition(),e)))return!1;if(!D(E.modified,t)||!D(E.original,e))return!1}return!0}),new aM(y,w,g)}computeMoves(e,t,n,o,r,s,a){return Xet(e,t,n,o,r,s).map(d=>{const u=this.refineDiff(t,n,new Fr(d.original.toOffsetRange(),d.modified.toOffsetRange()),s,a),h=gre(u.mappings,t,n,!0);return new z0e(d,h)})}refineDiff(e,t,n,o,r){const s=new iP(e,n.seq1Range,r),a=new iP(t,n.seq2Range,r),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,o):this.myersDiffingAlgorithm.compute(s,a,o);let c=l.diffs;return c=lH(s,a,c),c=itt(s,a,c),c=ntt(s,a,c),c=stt(s,a,c),{mappings:c.map(u=>new Dv(s.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function gre(i,e,t,n=!1){const o=[];for(const r of a_e(i.map(s=>att(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=r[0],a=r[r.length-1];o.push(new Hc(s.original.join(a.original),s.modified.join(a.modified),r.map(l=>l.innerChanges[0])))}return FD(()=>!n&&o.length>0&&o[0].original.startLineNumber!==o[0].modified.startLineNumber?!1:t0e(o,(r,s)=>s.original.startLineNumber-r.original.endLineNumberExclusive===s.modified.startLineNumber-r.modified.endLineNumberExclusive&&r.original.endLineNumberExclusive=t[i.modifiedRange.startLineNumber-1].length&&i.originalRange.startColumn-1>=e[i.originalRange.startLineNumber-1].length&&i.originalRange.startLineNumber<=i.originalRange.endLineNumber+o&&i.modifiedRange.startLineNumber<=i.modifiedRange.endLineNumber+o&&(n=1);const r=new ln(i.originalRange.startLineNumber+n,i.originalRange.endLineNumber+1+o),s=new ln(i.modifiedRange.startLineNumber+n,i.modifiedRange.endLineNumber+1+o);return new Hc(r,s,[i])}const pre={getLegacy:()=>new Oet,getDefault:()=>new q0e};function Xm(i,e){const t=Math.pow(10,e);return Math.round(i*t)/t}class Tn{constructor(e,t,n,o=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,n))|0,this.a=Xm(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class md{constructor(e,t,n,o){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Xm(Math.max(Math.min(1,t),0),3),this.l=Xm(Math.max(Math.min(1,n),0),3),this.a=Xm(Math.max(Math.min(1,o),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,n=e.g/255,o=e.b/255,r=e.a,s=Math.max(t,n,o),a=Math.min(t,n,o);let l=0,c=0;const d=(a+s)/2,u=s-a;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),s){case t:l=(n-o)/u+(n1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(e){const t=e.h/360,{s:n,l:o,a:r}=e;let s,a,l;if(n===0)s=a=l=o;else{const c=o<.5?o*(1+n):o+n-o*n,d=2*o-c;s=md._hue2rgb(d,c,t+1/3),a=md._hue2rgb(d,c,t),l=md._hue2rgb(d,c,t-1/3)}return new Tn(Math.round(s*255),Math.round(a*255),Math.round(l*255),r)}}class qh{constructor(e,t,n,o){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Xm(Math.max(Math.min(1,t),0),3),this.v=Xm(Math.max(Math.min(1,n),0),3),this.a=Xm(Math.max(Math.min(1,o),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,n=e.g/255,o=e.b/255,r=Math.max(t,n,o),s=Math.min(t,n,o),a=r-s,l=r===0?0:a/r;let c;return a===0?c=0:r===t?c=((n-o)/a%6+6)%6:r===n?c=(o-t)/a+2:c=(t-n)/a+4,new qh(Math.round(c*60),l,r,e.a)}static toRGBA(e){const{h:t,s:n,v:o,a:r}=e,s=o*n,a=s*(1-Math.abs(t/60%2-1)),l=o-s;let[c,d,u]=[0,0,0];return t<60?(c=s,d=a):t<120?(c=a,d=s):t<180?(d=s,u=a):t<240?(d=a,u=s):t<300?(c=a,u=s):t<=360&&(c=s,u=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new Tn(c,d,u,r)}}class ve{static fromHex(e){return ve.Format.CSS.parseHex(e)||ve.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:md.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:qh.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Tn)this.rgba=e;else if(e instanceof md)this._hsla=e,this.rgba=md.toRGBA(e);else if(e instanceof qh)this._hsva=e,this.rgba=qh.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Tn.equals(this.rgba,e.rgba)&&md.equals(this.hsla,e.hsla)&&qh.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=ve._relativeLuminanceForComponent(this.rgba.r),t=ve._relativeLuminanceForComponent(this.rgba.g),n=ve._relativeLuminanceForComponent(this.rgba.b),o=.2126*e+.7152*t+.0722*n;return Xm(o,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(),n=e.getRelativeLuminance();return t>n}isDarkerThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t0)for(const o of n){const r=o.filter(c=>c!==void 0),s=r[1],a=r[2];if(!a)continue;let l;if(s==="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=mre(Fx(i,o),Bx(a,c),!1)}else if(s==="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=mre(Fx(i,o),Bx(a,c),!0)}else if(s==="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=vre(Fx(i,o),Bx(a,c),!1)}else if(s==="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=vre(Fx(i,o),Bx(a,c),!0)}else s==="#"&&(l=ltt(Fx(i,o),s+a));l&&e.push(l)}return e}function dtt(i){return!i||typeof i.getValue!="function"||typeof i.positionAt!="function"?[]:ctt(i)}var Hp=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class utt extends uet{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let n=0;nthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,o=!0;else{const r=this._lines[t-1].length+1;n<1?(n=1,o=!0):n>r&&(n=r,o=!0)}return o?{lineNumber:t,column:n}:e}}class Ym{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 utt(Rt.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,n){return Hp(this,void 0,void 0,function*(){const o=this._getModel(e);return o?hG.computeUnicodeHighlights(o,t,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,n,o){return Hp(this,void 0,void 0,function*(){const r=this._getModel(e),s=this._getModel(t);return!r||!s?null:Ym.computeDiff(r,s,n,o)})}static computeDiff(e,t,n,o){const r=o==="advanced"?pre.getDefault():pre.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=r.computeDiff(s,a,n),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 n=e.getLineCount(),o=t.getLineCount();if(n!==o)return!1;for(let r=1;r<=n;r++){const s=e.getLineContent(r),a=t.getLineContent(r);if(s!==a)return!1}return!0}computeMoreMinimalEdits(e,t,n){return Hp(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return t;const r=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return V.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;lYm._diffLimit){r.push({range:l,text:c});continue}const h=aet(u,c,n),f=o.offsetAt(V.lift(l).getStartPosition());for(const g of h){const p=o.positionAt(f+g.originalStart),v=o.positionAt(f+g.originalStart+g.originalLength),m={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:v.lineNumber,endColumn:v.column}};o.getValueInRange(m.range)!==m.text&&r.push(m)}}return typeof s=="number"&&r.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r})}computeLinks(e){return Hp(this,void 0,void 0,function*(){const t=this._getModel(e);return t?met(t):null})}computeDefaultDocumentColors(e){return Hp(this,void 0,void 0,function*(){const t=this._getModel(e);return t?dtt(t):null})}textualSuggest(e,t,n,o){return Hp(this,void 0,void 0,function*(){const r=new Ls,s=new RegExp(n,o),a=new Set;e:for(const l of e){const c=this._getModel(l);if(!!c){for(const d of c.words(s))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>Ym._suggestionsLimit))break e}}return{words:Array.from(a),duration:r.elapsed()}})}computeWordRanges(e,t,n,o){return Hp(this,void 0,void 0,function*(){const r=this._getModel(e);if(!r)return Object.create(null);const s=new RegExp(n,o),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(Fq(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(n){return Promise.reject(n)}}}Ym._diffLimit=1e5;Ym._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=H_e());const mG=yn("textResourceConfigurationService"),X0e=yn("textResourcePropertiesService"),pt=yn("ILanguageFeaturesService");var htt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Wx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},oP=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const _re=60*1e3,bre=5*60*1e3;function $_(i,e){const t=i.getModel(e);return!(!t||t.isTooLargeForSyncing())}let cH=class extends _e{constructor(e,t,n,o,r){super(),this._modelService=e,this._workerManager=this._register(new gtt(this._modelService,o)),this._logService=n,this._register(r.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>$_(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(r.completionProvider.register("*",new ftt(this._workerManager,t,this._modelService,o)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return $_(this._modelService,e)}computedUnicodeHighlights(e,t,n){return this._workerManager.withWorker().then(o=>o.computedUnicodeHighlights(e,t,n))}computeDiff(e,t,n,o){return oP(this,void 0,void 0,function*(){const r=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,n,o));if(!r)return null;return{identical:r.identical,quitEarly:r.quitEarly,changes:a(r.changes),moves:r.moves.map(l=>new z0e(new mf(new ln(l[0],l[1]),new ln(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new Hc(new ln(c[0],c[1]),new ln(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(u=>new Dv(new V(u[0],u[1],u[2],u[3]),new V(u[4],u[5],u[6],u[7]))))})}})}computeMoreMinimalEdits(e,t,n=!1){if(ws(t)){if(!$_(this._modelService,e))return Promise.resolve(t);const o=Ls.create(),r=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,n));return r.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),o.elapsed())),Promise.race([r,xv(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return $_(this._modelService,e)}navigateValueSet(e,t,n){return this._workerManager.withWorker().then(o=>o.navigateValueSet(e,t,n))}canComputeWordRanges(e){return $_(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(n=>n.computeWordRanges(e,t))}};cH=htt([Wx(0,Yi),Wx(1,mG),Wx(2,nc),Wx(3,Ti),Wx(4,pt)],cH);class ftt{constructor(e,t,n,o){this.languageConfigurationService=o,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}provideCompletionItems(e,t){return oP(this,void 0,void 0,function*(){const n=this._configurationService.getValue(e.uri,t,"editor");if(!n.wordBasedSuggestions)return;const o=[];if(n.wordBasedSuggestionsMode==="currentDocument")$_(this._modelService,e.uri)&&o.push(e.uri);else for(const u of this._modelService.getModels())!$_(this._modelService,u.uri)||(u===e?o.unshift(u.uri):(n.wordBasedSuggestionsMode==="allDocuments"||u.getLanguageId()===e.getLanguageId())&&o.push(u.uri));if(o.length===0)return;const r=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new V(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):V.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),d=yield(yield this._workerManager.withWorker()).textualSuggest(o,s==null?void 0:s.word,r);if(!!d)return{duration:d.duration,suggestions:d.words.map(u=>({kind:18,label:u,insertText:u,range:{insert:l,replace:a}}))}})}}class gtt extends _e{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new UI).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(bre/2)),this._register(this._modelService.onModelRemoved(o=>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>bre&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new vG(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class ptt extends _e{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){const o=new UI;o.cancelAndSet(()=>this._checkStopModelSync(),Math.round(_re/2)),this._register(o)}}dispose(){for(const e in this._syncedModels)si(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const n of e){const o=n.toString();this._syncedModels[o]||this._beginModelSync(n,t),this._syncedModels[o]&&(this._syncedModelsLastUsedTime[o]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const n in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[n]>_re&&t.push(n);for(const n of t)this._stopModelSync(n)}_beginModelSync(e,t){const n=this._modelService.getModel(e);if(!n||!t&&n.isTooLargeForSyncing())return;const o=e.toString();this._proxy.acceptNewModel({url:n.uri.toString(),lines:n.getLinesContent(),EOL:n.getEOL(),versionId:n.getVersionId()});const r=new Be;r.add(n.onDidChangeContent(s=>{this._proxy.acceptModelChanged(o.toString(),s)})),r.add(n.onWillDispose(()=>{this._stopModelSync(o)})),r.add(zt(()=>{this._proxy.acceptRemovedModel(o)})),this._syncedModels[o]=r}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],si(t)}}class Cre{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class n9{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class vG extends _e{constructor(e,t,n,o){super(),this.languageConfigurationService=o,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new r5(n),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new mJe(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new n9(this)))}catch(e){eH(e),this._worker=new Cre(new Ym(new n9(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(eH(e),this._worker=new Cre(new Ym(new n9(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new ptt(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return oP(this,void 0,void 0,function*(){return this._disposed?Promise.reject(DYe()):this._getProxy().then(n=>(this._getOrCreateModelManager(n).ensureSyncedResources(e,t),n))})}computedUnicodeHighlights(e,t,n){return this._withSyncedResources([e]).then(o=>o.computeUnicodeHighlights(e.toString(),t,n))}computeDiff(e,t,n,o){return this._withSyncedResources([e,t],!0).then(r=>r.computeDiff(e.toString(),t.toString(),n,o))}computeMoreMinimalEdits(e,t,n){return this._withSyncedResources([e]).then(o=>o.computeMoreMinimalEdits(e.toString(),t,n))}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,n){return oP(this,void 0,void 0,function*(){const o=yield this._withSyncedResources(e),r=n.source,s=n.flags;return o.textualSuggest(e.map(a=>a.toString()),t,r,s)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(n=>{const o=this._modelService.getModel(e);if(!o)return Promise.resolve(null);const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),s=r.source,a=r.flags;return n.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,n){return this._withSyncedResources([e]).then(o=>{const r=this._modelService.getModel(e);if(!r)return null;const s=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return o.navigateValueSet(e.toString(),t,n,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function mtt(i,e,t){return new vtt(i,e,t)}class vtt extends vG{constructor(e,t,n){super(e,n.keepIdleModels||!1,n.label,t),this._foreignModuleId=n.moduleId,this._foreignModuleCreateData=n.createData||null,this._foreignModuleHost=n.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(n){return Promise.reject(n)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?Fq(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(n=>{this._foreignModuleCreateData=null;const o=(a,l)=>e.fmr(a,l),r=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of n)s[a]=r(a,o);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const KI={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},ww=new class{clone(){return this}equals(i){return this===i}};function _G(i,e){return new Gq([new ND(0,"",i)],e)}function f5(i,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(i<<0|0<<8|0<<11|1<<15|2<<24)>>>0,new z4(t,e===null?ww:e)}class is{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){const t=this.getForeground(e);let n="mtk"+t;const o=this.getFontStyle(e);return o&1&&(n+=" mtki"),o&2&&(n+=" mtkb"),o&4&&(n+=" mtku"),o&8&&(n+=" mtks"),n}static getInlineStyleFromMetadata(e,t){const n=this.getForeground(e),o=this.getFontStyle(e);let r=`color: ${t[n]};`;o&1&&(r+="font-style: italic;"),o&2&&(r+="font-weight: bold;");let s="";return o&4&&(s+=" underline"),o&8&&(s+=" line-through"),s&&(r+=`text-decoration:${s};`),r}static getPresentationFromMetadata(e){const t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:Boolean(n&1),bold:Boolean(n&2),underline:Boolean(n&4),strikethrough:Boolean(n&8)}}}class pr{static createEmpty(e,t){const n=pr.defaultTokenMetadata,o=new Uint32Array(2);return o[0]=e.length,o[1]=n,new pr(o,e,t)}constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=n}equals(e){return e instanceof pr?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,n){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const o=t<<1,r=o+(n<<1);for(let s=o;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],n=is.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return is.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return is.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return is.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[(e<<1)+1];return is.getInlineStyleFromMetadata(n,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return is.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return pr.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,n){return new bG(this,e,t,n)}static convertToEndOffset(e,t){const o=(e.length>>>1)-1;for(let r=0;r>>1)-1;for(;nt&&(o=r)}return n}withInserted(e){if(e.length===0)return this;let t=0,n=0,o="";const r=new Array;let s=0;for(;;){const a=ts){o+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];r.push(o.length,c),s=l.offset}o+=l.text,r.push(o.length,l.tokenMetadata),n++}else break}return new pr(new Uint32Array(r),o,this._languageIdCodec)}}pr.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class bG{constructor(e,t,n,o){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=o,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let r=this._firstTokenIndex,s=e.getCount();r=n);r++)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 bG?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 rl{constructor(e,t,n,o){this.startColumn=e,this.endColumn=t,this.className=n,this.type=o,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 n=e.length,o=t.length;if(n!==o)return!1;for(let r=0;r=r||(a[l++]=new rl(Math.max(1,c.startColumn-o+1),Math.min(s+1,c.endColumn-o+1),c.className,c.type));return a}static filter(e,t,n,o){if(e.length===0)return[];const r=[];let s=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:n,h=d.endLineNumber===t?d.endColumn:o;r[s++]=new rl(u,h,c.inlineClassName,c.type)}return r}static _typeCompare(e,t){const n=[2,0,1,3];return n[e]-n[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 n=rl._typeCompare(e.type,t.type);return n!==0?n:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(o,0,e),this.classNames.splice(o,0,t),this.metadata.splice(o,0,n);break}this.count++}}class _tt{static normalize(e,t){if(t.length===0)return[];const n=[],o=new rP;let r=0;for(let s=0,a=t.length;s1){const p=e.charCodeAt(c-2);gr(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);gr(p)&&d--}const f=c-1,g=d-2;r=o.consumeLowerThan(f,r,n),o.count===0&&(r=f),o.insert(g,u,h)}return o.consumeLowerThan(1073741824,r,n),n}}class Lr{constructor(e,t,n,o){this.endIndex=e,this.type=t,this.metadata=n,this.containsRTL=o,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class Y0e{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Jv{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f,g,p,v,m,_,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=o,this.isBasicASCII=r,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(rl.compare),this.tabSize=d,this.startVisibleColumn=u,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=v==="all"?4:v==="boundary"?1:v==="selection"?2:v==="trailing"?3:0,this.renderControlCharacters=m,this.fontLigatures=_,this.selectionsOnLine=y&&y.sort((D,E)=>D.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,n,o){const r=(t<<16|n<<0)>>>0;this._data[e-1]=r,this._horizontalOffset[e-1]=o}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),n=Th.getPartIndex(t),o=Th.getCharIndex(t);return new Z0e(n,o)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,n){if(this.length===0)return 0;const o=(e<<16|n<<0)>>>0;let r=0,s=this.length-1;for(;r+1>>1,v=this._data[p];if(v===o)return p;v>o?s=p:r=p}if(r===s)return r;const a=this._data[r],l=this._data[s];if(a===o)return r;if(l===o)return s;const c=Th.getPartIndex(a),d=Th.getCharIndex(a),u=Th.getPartIndex(l);let h;c!==u?h=t:h=Th.getCharIndex(l);const f=n-d,g=h-n;return f<=g?r:s}}class dH{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}}function qI(i,e){if(i.lineContent.length===0){if(i.lineDecorations.length>0){e.appendString("");let t=0,n=0,o=0;for(const s of i.lineDecorations)(s.type===1||s.type===2)&&(e.appendString(''),s.type===1&&(o|=1,t++),s.type===2&&(o|=2,n++));e.appendString("");const r=new Th(1,t+n);return r.setColumnInfo(1,t,0,0),new dH(r,!1,o)}return e.appendString(""),new dH(new Th(0,0),!1,0)}return Dtt(ytt(i),e)}class btt{constructor(e,t,n,o){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=o}}function g5(i){const e=new yS(1e4),t=qI(i,e);return new btt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Ctt{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f,g,p,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=o,this.isOverflowing=r,this.overflowingCharCount=s,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=v}}function ytt(i){const e=i.lineContent;let t,n,o;i.stopRenderingLineAfter!==-1&&i.stopRenderingLineAfter0){for(let a=0,l=i.lineDecorations.length;a0&&(r[s++]=new Lr(n,"",0,!1));let a=n;for(let l=0,c=t.getCount();l=o){const f=e?pw(i.substring(a,o)):!1;r[s++]=new Lr(o,u,0,f);break}const h=e?pw(i.substring(a,d)):!1;r[s++]=new Lr(d,u,0,h),a=d}return r}function Stt(i,e,t){let n=0;const o=[];let r=0;if(t)for(let s=0,a=e.length;s=50&&(o[r++]=new Lr(f+1,d,u,h),g=f+1,f=-1);g!==c&&(o[r++]=new Lr(c,d,u,h))}else o[r++]=l;n=c}else for(let s=0,a=e.length;s50){const u=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(d/50);for(let p=1;p=8234&&i<=8238||i>=8294&&i<=8297||i>=8206&&i<=8207||i===1564}function xtt(i,e){const t=[];let n=new Lr(0,"",0,!1),o=0;for(const r of e){const s=r.endIndex;for(;on.endIndex&&(n=new Lr(o,r.type,r.metadata,r.containsRTL),t.push(n)),n=new Lr(o+1,"mtkcontrol",r.metadata,!1),t.push(n))}o>n.endIndex&&(n=new Lr(s,r.type,r.metadata,r.containsRTL),t.push(n))}return t}function Ltt(i,e,t,n){const o=i.continuesWithWrappedLine,r=i.fauxIndentLength,s=i.tabSize,a=i.startVisibleColumn,l=i.useMonospaceOptimizations,c=i.selectionsOnLine,d=i.renderWhitespace===1,u=i.renderWhitespace===3,h=i.renderSpaceWidth!==i.spaceWidth,f=[];let g=0,p=0,v=n[p].type,m=n[p].containsRTL,_=n[p].endIndex;const y=n.length;let w=!1,L=Ws(e),D;L===-1?(w=!0,L=t,D=t):D=Wu(e);let E=!1,I=0,k=c&&c[I],R=a%s;for(let P=r;P=k.endOffset&&(I++,k=c&&c[I]);let M;if(PD)M=!0;else if(N===9)M=!0;else if(N===32)if(d)if(E)M=!0;else{const H=P+1P),M&&u&&(M=w||P>D),M&&m&&P>=L&&P<=D&&(M=!1),E){if(!M||!l&&R>=s){if(h){const H=g>0?f[g-1].endIndex:r;for(let B=H+1;B<=P;B++)f[g++]=new Lr(B,"mtkw",1,!1)}else f[g++]=new Lr(P,"mtkw",1,!1);R=R%s}}else(P===_||M&&P>r)&&(f[g++]=new Lr(P,v,0,m),R=R%s);for(N===9?R=s:wv(N)?R+=2:R++,E=M;P===_&&(p++,p0?e.charCodeAt(t-1):0,N=t>1?e.charCodeAt(t-2):0;P===32&&N!==32&&N!==9||(A=!0)}else A=!0;if(A)if(h){const P=g>0?f[g-1].endIndex:r;for(let N=P+1;N<=t;N++)f[g++]=new Lr(N,"mtkw",1,!1)}else f[g++]=new Lr(t,"mtkw",1,!1);else f[g++]=new Lr(t,v,0,m);return f}function Ett(i,e,t,n){n.sort(rl.compare);const o=_tt.normalize(i,n),r=o.length;let s=0;const a=[];let l=0,c=0;for(let u=0,h=t.length;uc&&(c=_.startOffset,a[l++]=new Lr(c,p,v,m)),_.endOffset+1<=g)c=_.endOffset+1,a[l++]=new Lr(c,p+" "+_.className,v|_.metadata,m),s++;else{c=g,a[l++]=new Lr(c,p+" "+_.className,v|_.metadata,m);break}}g>c&&(c=g,a[l++]=new Lr(c,p,v,m))}const d=t[t.length-1].endIndex;if(s'):e.appendString("");for(let k=0,R=c.length;k=d&&(K+=G)}}for(B&&(e.appendString(' style="width:'),e.appendString(String(g*$)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let G=2;G<=j;G++)e.appendCharCode(160)}else K=2,j=1,e.appendCharCode(p),e.appendCharCode(8204);D+=K,E+=j,w>=d&&(L+=j)}}else for(e.appendASCIICharCode(62);w=d&&(L+=K)}F?I++:I=0,w>=s&&!y&&A.isPseudoAfter()&&(y=!0,_.setColumnInfo(w+1,k,D,E)),e.appendString("")}return y||_.setColumnInfo(s+1,c.length-1,D,E),a&&(e.appendString(''),e.appendString(C("showMore","Show more ({0})",Itt(l))),e.appendString("")),e.appendString(""),new dH(_,f,o)}function ktt(i){return i.toString(16).toUpperCase().padStart(4,"0")}function Itt(i){return i<1024?C("overflow.chars","{0} chars",i):i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`}class wre{constructor(e,t,n,o){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=o|0}}class Ttt{constructor(e,t){this.tabSize=e,this.data=t}}class CG{constructor(e,t,n,o,r,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=o,this.startVisibleColumn=r,this.tokens=s,this.inlineDecorations=a}}class Zl{constructor(e,t,n,o,r,s,a,l,c,d){this.minColumn=e,this.maxColumn=t,this.content=n,this.continuesWithWrappedLine=o,this.isBasicASCII=Zl.isBasicASCII(n,s),this.containsRTL=Zl.containsRTL(n,this.isBasicASCII,r),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?$I(e):!0}static containsRTL(e,t,n){return!t&&n?pw(e):!1}}class hE{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}}class Ntt{constructor(e,t,n,o){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=o}toInlineDecoration(e){return new hE(new V(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class J0e{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class KD{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}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&&Lo(e.data,t.data)}static equalsArr(e,t){return Lo(e,t,KD.equals)}}function Rtt(i){return Array.isArray(i)}function Mtt(i){return!Rtt(i)}function ebe(i){return typeof i=="string"}function Sre(i){return!ebe(i)}function uC(i){return!i}function Zm(i,e){return i.ignoreCase&&e?e.toLowerCase():e}function xre(i){return i.replace(/[&<>'"_]/g,"-")}function Att(i,e){console.log(`${i.languageId}: ${e}`)}function Bi(i,e){return new Error(`${i.languageId}: ${e}`)}function cm(i,e,t,n,o){const r=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(r,function(a,l,c,d,u,h,f,g,p){return uC(c)?uC(d)?!uC(u)&&u0;){const n=i.tokenizer[t];if(n)return n;const o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return null}function Ptt(i,e){let t=e;for(;t&&t.length>0;){if(i.stateNames[t])return!0;const o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return!1}var Ott=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ftt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},uH;const tbe=5;class qD{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 xy(e,t);let n=xy.getStackElementId(e);n.length>0&&(n+="|"),n+=t;let o=this._entries[n];return o||(o=new xy(e,t),this._entries[n]=o,o)}}qD._INSTANCE=new qD(tbe);class xy{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 xy._equals(this,e)}push(e){return qD.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return qD.create(this.parent,e)}}class AC{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 AC(this.languageId,this.state)}}class dm{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 fE(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new fE(e,t);const n=xy.getStackElementId(e);let o=this._entries[n];return o||(o=new fE(e,null),this._entries[n]=o,o)}}dm._INSTANCE=new dm(tbe);class fE{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:dm.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof fE)||!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 Btt{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 ND(e,t,this._languageId)))}nestedLanguageTokenize(e,t,n,o){const r=n.languageId,s=n.state,a=oo.get(r);if(!a)return this.enterLanguage(r),this.emit(o,""),s;const l=a.tokenize(e,t,s);if(o!==0)for(const c of l.tokens)this._tokens.push(new ND(c.offset+o,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 Gq(this._tokens,e)}}class sP{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 n=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))}static _merge(e,t,n){const o=e!==null?e.length:0,r=t.length,s=n!==null?n.length:0;if(o===0&&r===0&&s===0)return new Uint32Array(0);if(o===0&&r===0)return n;if(r===0&&s===0)return e;const a=new Uint32Array(o+r+s);e!==null&&a.set(e);for(let l=0;l{if(s)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 n=oo.get(t);if(n){if(n instanceof uH){const o=n.getLoadStatus();o.loaded===!1&&e.push(o.promise)}continue}oo.isResolved(t)||e.push(oo.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=qD.create(null,this._lexer.start);return dm.create(e,null)}tokenize(e,t,n){if(e.length>=this._maxTokenizationLineLength)return _G(this._languageId,n);const o=new Btt,r=this._tokenize(e,t,n,o);return o.finalize(r)}tokenizeEncoded(e,t,n){if(e.length>=this._maxTokenizationLineLength)return f5(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),n);const o=new sP(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),r=this._tokenize(e,t,n,o);return o.finalize(r)}_tokenize(e,t,n,o){return n.embeddedLanguageData?this._nestedTokenize(e,t,n,0,o):this._myTokenize(e,t,n,0,o)}_findLeavingNestedLanguageOffset(e,t){let n=this._lexer.tokenizer[t.stack.state];if(!n&&(n=d2(this._lexer,t.stack.state),!n))throw Bi(this._lexer,"tokenizer state is not defined: "+t.stack.state);let o=-1,r=!1;for(const s of n){if(!Sre(s.action)||s.action.nextEmbedded!=="@pop")continue;r=!0;let a=s.regex;const l=s.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&&s.matchOnlyAtLineStart||(o===-1||c0&&r.nestedLanguageTokenize(a,!1,n.embeddedLanguageData,o);const l=e.substring(s);return this._myTokenize(l,t,n,o+s,r)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,n,o,r){r.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+` +`:e,l=a.length;let c=n.embeddedLanguageData,d=n.stack,u=0,h=null,f=!0;for(;f||u=l)break;f=!1;let k=this._lexer.tokenizer[m];if(!k&&(k=d2(this._lexer,m),!k))throw Bi(this._lexer,"tokenizer state is not defined: "+m);const R=a.substr(u);for(const A of k)if((u===0||!A.matchOnlyAtLineStart)&&(_=R.match(A.regex),_)){y=_[0],w=A.action;break}}if(_||(_=[""],y=""),w||(u=this._lexer.maxStack)throw Bi(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(m)}else if(w.next==="@pop"){if(d.depth<=1)throw Bi(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(L));d=d.pop()}else if(w.next==="@popall")d=d.popall();else{let k=cm(this._lexer,w.next,y,_,m);if(k[0]==="@"&&(k=k.substr(1)),d2(this._lexer,k))d=d.push(k);else throw Bi(this._lexer,"trying to set a next state '"+k+"' that is undefined in rule: "+this._safeRuleName(L))}}w.log&&typeof w.log=="string"&&Att(this._lexer,this._lexer.languageId+": "+cm(this._lexer,w.log,y,_,m))}if(E===null)throw Bi(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(L));const I=k=>{const R=this._languageService.getLanguageIdByLanguageName(k)||this._languageService.getLanguageIdByMimeType(k)||k,A=this._getNestedEmbeddedLanguageData(R);if(u0)throw Bi(this._lexer,"groups cannot be nested: "+this._safeRuleName(L));if(_.length!==E.length+1)throw Bi(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(L));let k=0;for(let R=1;R<_.length;R++)k+=_[R].length;if(k!==y.length)throw Bi(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(L));h={rule:L,matches:_,groups:[]};for(let R=0;Ri});class yG{static colorizeElement(e,t,n,o){o=o||{};const r=o.theme||"vs",s=o.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(r);const l=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+r;const c=d=>{var u;const h=(u=i9==null?void 0:i9.createHTML(d))!==null&&u!==void 0?u:d;n.innerHTML=h};return this.colorize(t,l||"",a,o).then(c,d=>console.error(d))}static colorize(e,t,n,o){return Vtt(this,void 0,void 0,function*(){const r=e.languageIdCodec;let s=4;o&&typeof o.tabSize=="number"&&(s=o.tabSize),tG(t)&&(t=t.substr(1));const a=gf(t);if(!e.isRegisteredLanguageId(n))return Lre(a,s,r);const l=yield oo.getOrCreate(n);return l?Htt(a,s,l,r):Lre(a,s,r)})}static colorizeLine(e,t,n,o,r=4){const s=Zl.isBasicASCII(e,t),a=Zl.containsRTL(e,s,n);return g5(new Jv(!1,!0,e,!1,s,a,0,o,[],r,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,n=4){const o=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(o,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,n)}}function Htt(i,e,t,n){return new Promise((o,r)=>{const s=()=>{const a=$tt(i,e,t,n);if(t instanceof GD){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,r);return}}o(a)};s()})}function Lre(i,e,t){let n=[];const r=new Uint32Array(2);r[0]=0,r[1]=33587200;for(let s=0,a=i.length;s")}return n.join("")}function $tt(i,e,t,n){let o=[],r=t.getInitialState();for(let s=0,a=i.length;s"),r=c.endState}return o.join("")}const Ere=2e4;let z_,lM,hH,cM,fH;function ztt(i){z_=document.createElement("div"),z_.className="monaco-aria-container";const e=()=>{const n=document.createElement("div");return n.className="monaco-alert",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),z_.appendChild(n),n};lM=e(),hH=e();const t=()=>{const n=document.createElement("div");return n.className="monaco-status",n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),z_.appendChild(n),n};cM=t(),fH=t(),i.appendChild(z_)}function Cs(i){!z_||(lM.textContent!==i?(Ur(hH),aP(lM,i)):(Ur(lM),aP(hH,i)))}function kv(i){!z_||(cM.textContent!==i?(Ur(fH),aP(cM,i)):(Ur(cM),aP(fH,i)))}function aP(i,e){Ur(i),e.length>Ere&&(e=e.substr(0,Ere)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}const wG=yn("markerDecorationsService");var Utt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jtt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let XD=class{constructor(e,t){}dispose(){}};XD.ID="editor.contrib.markerDecorations";XD=Utt([jtt(1,wG)],XD);Un(XD.ID,XD,0);class nbe extends _e{constructor(e,t){super(),this._onDidChange=this._register(new le),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 n=!1,o=!1;const r=()=>{if(n&&!o)try{n=!1,o=!0,t()}finally{requestAnimationFrame(()=>{o=!1,r()})}};this._resizeObserver=new ResizeObserver(s=>{e=s&&s[0]&&s[0].contentRect?s[0].contentRect:null,n=!0,r()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,o=0;t?(n=t.width,o=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,o=this._referenceDomElement.clientHeight),n=Math.max(5,n),o=Math.max(5,o),(this._width!==n||this._height!==o)&&(this._width=n,this._height=o,e&&this._onDidChange.fire())}}class Qm{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Qm._read(e,this.key),n=r=>Qm._read(e,r),o=(r,s)=>Qm._write(e,r,s);this.migrate(t,n,o)}static _read(e,t){if(typeof e=="undefined")return;const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return this._read(e[o],t.substring(n+1))}return e[t]}static _write(e,t,n){const o=t.indexOf(".");if(o>=0){const r=t.substring(0,o);e[r]=e[r]||{},this._write(e[r],t.substring(o+1),n);return}e[t]=n}}Qm.items=[];function e_(i,e){Qm.items.push(new Qm(i,e))}function Kc(i,e){e_(i,(t,n,o)=>{if(typeof t!="undefined"){for(const[r,s]of e)if(t===r){o(i,s);return}}})}function Ktt(i){Qm.items.forEach(e=>e.apply(i))}Kc("wordWrap",[[!0,"on"],[!1,"off"]]);Kc("lineNumbers",[[!0,"on"],[!1,"off"]]);Kc("cursorBlinking",[["visible","solid"]]);Kc("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Kc("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Kc("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Kc("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Kc("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Kc("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Kc("autoIndent",[[!1,"advanced"],[!0,"full"]]);Kc("matchBrackets",[[!0,"always"],[!1,"never"]]);Kc("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Kc("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);e_("autoClosingBrackets",(i,e,t)=>{i===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")=="undefined"&&t("autoClosingQuotes","never"),typeof e("autoSurround")=="undefined"&&t("autoSurround","never"))});e_("renderIndentGuides",(i,e,t)=>{typeof i!="undefined"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")=="undefined"&&t("guides.indentation",!!i))});e_("highlightActiveIndentGuide",(i,e,t)=>{typeof i!="undefined"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")=="undefined"&&t("guides.highlightActiveIndentation",!!i))});const qtt={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"};e_("suggest.filteredTypes",(i,e,t)=>{if(i&&typeof i=="object"){for(const n of Object.entries(qtt))i[n[0]]===!1&&typeof e(`suggest.${n[1]}`)=="undefined"&&t(`suggest.${n[1]}`,!1);t("suggest.filteredTypes",void 0)}});e_("quickSuggestions",(i,e,t)=>{if(typeof i=="boolean"){const n=i?"on":"off";t("quickSuggestions",{comments:n,strings:n,other:n})}});e_("experimental.stickyScroll.enabled",(i,e,t)=>{typeof i=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")=="undefined"&&t("stickyScroll.enabled",i))});e_("experimental.stickyScroll.maxLineCount",(i,e,t)=>{typeof i=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")=="undefined"&&t("stickyScroll.maxLineCount",i))});class Gtt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new le,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Sw=new Gtt,bp=yn("accessibilityService"),GI=new lt("accessibilityModeEnabled",!1);var Xtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ytt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let gH=class extends _e{constructor(e,t,n,o){super(),this._accessibilityService=o,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new le),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new L_e,this.isSimpleWidget=e,this._containerObserver=this._register(new nbe(n,t.dimension)),this._rawOptions=Dre(t),this._validatedOptions=um.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(xc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Sw.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(jV.onDidChange(()=>this._recomputeOptions())),this._register(PD.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=um.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=k0.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),o={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Sw.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return um.computeOptions(this._validatedOptions,o)}_readEnvConfiguration(){return{extraEditorClassName:Qtt(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:D0||Fc,pixelRatio:PD.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return jV.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=Dre(e);!um.applyUpdate(this._rawOptions,t)||(this._validatedOptions=um.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=Ztt(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())}};gH=Xtt([Ytt(3,bp)],gH);function Ztt(i){let e=0;for(;i;)i=Math.floor(i/10),e++;return e||1}function Qtt(){let i="";return!cp&&!Z_e&&(i+="no-user-select "),cp&&(i+="no-minimap-shadow ",i+="enable-user-select "),Nn&&(i+="mac "),i}class Jtt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class ent{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 um{static validateOptions(e){const t=new Jtt;for(const n of IC){const o=n.name==="_never_"?void 0:e[n.name];t._write(n.id,n.validate(o))}return t}static computeOptions(e,t){const n=new ent;for(const o of IC)n._write(o.id,o.compute(t,n,e._read(o.id)));return n}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)?Lo(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!um._deepEquals(e[n],t[n]))return!1;return!0}static checkEquals(e,t){const n=[];let o=!1;for(const r of IC){const s=!um._deepEquals(e._read(r.id),t._read(r.id));n[r.id]=s,s&&(o=!0)}return o?new x_e(n):null}static applyUpdate(e,t){let n=!1;for(const o of IC)if(t.hasOwnProperty(o.name)){const r=o.applyUpdate(e[o.name],t[o.name]);e[o.name]=r.newValue,n=n||r.didChange}return n}}function Dre(i){const e=gg(i);return Ktt(e),e}function Mo(i,e,t){let n=null,o=null;if(typeof t.value=="function"?(n="value",o=t.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(n="get",o=t.get),!o)throw new Error("not supported");const r=`$memoize$${e}`;t[n]=function(...s){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,s)}),this[r]}}var tnt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Di;(function(i){i.Tap="-monaco-gesturetap",i.Change="-monaco-gesturechange",i.Start="-monaco-gesturestart",i.End="-monaco-gesturesend",i.Contextmenu="-monaco-gesturecontextmenu"})(Di||(Di={}));class Ei extends _e{constructor(){super(),this.dispatched=!1,this.targets=new oa,this.ignoreTargets=new oa,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ke(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(ke(document,"touchend",e=>this.onTouchEnd(e))),this._register(ke(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Ei.isTouchDevice())return _e.None;Ei.INSTANCE||(Ei.INSTANCE=new Ei);const t=Ei.INSTANCE.targets.push(e);return zt(t)}static ignoreTarget(e){if(!Ei.isTouchDevice())return _e.None;Ei.INSTANCE||(Ei.INSTANCE=new Ei);const t=Ei.INSTANCE.ignoreTargets.push(e);return zt(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 n=0,o=e.targetTouches.length;n=Ei.HOLD_DELAY&&Math.abs(a.initialPageX-gc(a.rollingPageX))<30&&Math.abs(a.initialPageY-gc(a.rollingPageY))<30){const c=this.newGestureEvent(Di.Contextmenu,a.initialTarget);c.pageX=gc(a.rollingPageX),c.pageY=gc(a.rollingPageY),this.dispatchEvent(c)}else if(n===1){const c=gc(a.rollingPageX),d=gc(a.rollingPageY),u=gc(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(Di.End,a.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(e){if(e.type===Di.Tap){const t=new Date().getTime();let n=0;t-this._lastSetTapCountTime>Ei.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=t,e.tapCount=n}else(e.type===Di.Change||e.type===Di.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,n,o,r,s,a,l){this.handle=Bc(()=>{const c=Date.now(),d=c-t;let u=0,h=0,f=!0;n+=Ei.SCROLL_FRICTION*d,s+=Ei.SCROLL_FRICTION*d,n>0&&(f=!1,u=o*n*d),s>0&&(f=!1,h=a*s*d);const g=this.newGestureEvent(Di.Change);g.translationX=u,g.translationY=h,e.forEach(p=>p.dispatchEvent(g)),f||this.inertia(e,c,n,o,r+u,s,a,l+h)})}onTouchMove(e){const t=Date.now();for(let n=0,o=e.changedTouches.length;n3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(r.pageX),s.rollingPageY.push(r.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Ei.SCROLL_FRICTION=-.005;Ei.HOLD_DELAY=700;Ei.CLEAR_TAP_COUNT_TIME=400;tnt([Mo],Ei,"isTouchDevice",null);class SS{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 n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,o,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=o,this._onStopCallback=r;let s=e;try{e.setPointerCapture(t),this._hooks.add(zt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=window}this._hooks.add(ke(s,et.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ke(s,et.POINTER_UP,a=>this.stopMonitoring(!0)))}}function SG(i){return`--vscode-${i.replace(/\./g,"-")}`}function ct(i){return`var(${SG(i)})`}function nnt(i,e){return`var(${SG(i)}, ${e})`}const ibe={ColorContribution:"base.contributions.colors"};class int{constructor(){this._onDidChangeSchema=new le,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,o=!1,r){const s={id:e,description:n,defaults:t,needsTransparency:o,deprecationMessage:r};this.colorsById[e]=s;const a={type:"string",description:n,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const n=this.colorsById[e];if(n&&n.defaults){const o=n.defaults[t.type];return su(o,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,n)=>{const o=t.indexOf(".")===-1?0:1,r=n.indexOf(".")===-1?0:1;return o!==r?o-r:t.localeCompare(n)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const p5=new int;no.add(ibe.ColorContribution,p5);function J(i,e,t,n,o){return p5.registerColor(i,e,t,n,o)}const Ke=J("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},C("foreground","Overall foreground color. This color is only used if not overridden by a component."));J("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},C("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const ont=J("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},C("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));J("descriptionForeground",{light:"#717171",dark:St(Ke,.7),hcDark:St(Ke,.7),hcLight:St(Ke,.7)},C("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const xm=J("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},C("iconForeground","The default color for icons in the workbench.")),Hl=J("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},C("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Ln=J("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},C("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Wi=J("contrastActiveBorder",{light:null,dark:null,hcDark:Hl,hcLight:Hl},C("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));J("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},C("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."));J("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:ve.black,hcLight:"#292929"},C("textSeparatorForeground","Color for text separators."));const rnt=J("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},C("textLinkForeground","Foreground color for links in text."));J("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},C("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));J("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},C("textPreformatForeground","Foreground color for preformatted text segments."));J("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},C("textBlockQuoteBackground","Background color for block quotes in text."));J("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:ve.white,hcLight:"#292929"},C("textBlockQuoteBorder","Border color for block quotes in text."));J("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:ve.black,hcLight:"#F2F2F2"},C("textCodeBlockBackground","Background color for code blocks in text."));const Gh=J("widget.shadow",{dark:St(ve.black,.36),light:St(ve.black,.16),hcDark:null,hcLight:null},C("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),xG=J("widget.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("widgetBorder","Border color of widgets such as find/replace inside the editor.")),obe=J("input.background",{dark:"#3C3C3C",light:ve.white,hcDark:ve.black,hcLight:ve.white},C("inputBoxBackground","Input box background.")),rbe=J("input.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("inputBoxForeground","Input box foreground.")),sbe=J("input.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("inputBoxBorder","Input box border.")),LG=J("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Ln,hcLight:Ln},C("inputBoxActiveOptionBorder","Border color of activated options in input fields."));J("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},C("inputOption.hoverBackground","Background color of activated options in input fields."));const f0=J("inputOption.activeBackground",{dark:St(Hl,.4),light:St(Hl,.2),hcDark:ve.transparent,hcLight:ve.transparent},C("inputOption.activeBackground","Background hover color of options in input fields.")),EG=J("inputOption.activeForeground",{dark:ve.white,light:ve.black,hcDark:Ke,hcLight:Ke},C("inputOption.activeForeground","Foreground color of activated options in input fields."));J("input.placeholderForeground",{light:St(Ke,.5),dark:St(Ke,.5),hcDark:St(Ke,.7),hcLight:St(Ke,.7)},C("inputPlaceholderForeground","Input box foreground color for placeholder text."));const snt=J("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:ve.black,hcLight:ve.white},C("inputValidationInfoBackground","Input validation background color for information severity.")),ant=J("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationInfoForeground","Input validation foreground color for information severity.")),lnt=J("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Ln,hcLight:Ln},C("inputValidationInfoBorder","Input validation border color for information severity.")),cnt=J("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:ve.black,hcLight:ve.white},C("inputValidationWarningBackground","Input validation background color for warning severity.")),dnt=J("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationWarningForeground","Input validation foreground color for warning severity.")),unt=J("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Ln,hcLight:Ln},C("inputValidationWarningBorder","Input validation border color for warning severity.")),hnt=J("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:ve.black,hcLight:ve.white},C("inputValidationErrorBackground","Input validation background color for error severity.")),fnt=J("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationErrorForeground","Input validation foreground color for error severity.")),gnt=J("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},C("inputValidationErrorBorder","Input validation border color for error severity.")),Xh=J("dropdown.background",{dark:"#3C3C3C",light:ve.white,hcDark:ve.black,hcLight:ve.white},C("dropdownBackground","Dropdown background.")),pnt=J("dropdown.listBackground",{dark:null,light:null,hcDark:ve.black,hcLight:ve.white},C("dropdownListBackground","Dropdown list background.")),Og=J("dropdown.foreground",{dark:"#F0F0F0",light:Ke,hcDark:ve.white,hcLight:Ke},C("dropdownForeground","Dropdown foreground.")),PC=J("dropdown.border",{dark:Xh,light:"#CECECE",hcDark:Ln,hcLight:Ln},C("dropdownBorder","Dropdown border.")),CL=J("button.foreground",{dark:ve.white,light:ve.white,hcDark:ve.white,hcLight:ve.white},C("buttonForeground","Button foreground color.")),mnt=J("button.separator",{dark:St(CL,.4),light:St(CL,.4),hcDark:St(CL,.4),hcLight:St(CL,.4)},C("buttonSeparator","Button separator color.")),yL=J("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},C("buttonBackground","Button background color.")),vnt=J("button.hoverBackground",{dark:Vu(yL,.2),light:$b(yL,.2),hcDark:yL,hcLight:yL},C("buttonHoverBackground","Button background color when hovering.")),_nt=J("button.border",{dark:Ln,light:Ln,hcDark:Ln,hcLight:Ln},C("buttonBorder","Button border color.")),bnt=J("button.secondaryForeground",{dark:ve.white,light:ve.white,hcDark:ve.white,hcLight:Ke},C("buttonSecondaryForeground","Secondary button foreground color.")),pH=J("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:ve.white},C("buttonSecondaryBackground","Secondary button background color.")),Cnt=J("button.secondaryHoverBackground",{dark:Vu(pH,.2),light:$b(pH,.2),hcDark:null,hcLight:null},C("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),dM=J("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:ve.black,hcLight:"#0F4A85"},C("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),ynt=J("badge.foreground",{dark:ve.white,light:"#333",hcDark:ve.white,hcLight:ve.white},C("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),wnt=J("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},C("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),wL=J("scrollbarSlider.background",{dark:ve.fromHex("#797979").transparent(.4),light:ve.fromHex("#646464").transparent(.4),hcDark:St(Ln,.6),hcLight:St(Ln,.4)},C("scrollbarSliderBackground","Scrollbar slider background color.")),SL=J("scrollbarSlider.hoverBackground",{dark:ve.fromHex("#646464").transparent(.7),light:ve.fromHex("#646464").transparent(.7),hcDark:St(Ln,.8),hcLight:St(Ln,.8)},C("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),xL=J("scrollbarSlider.activeBackground",{dark:ve.fromHex("#BFBFBF").transparent(.4),light:ve.fromHex("#000000").transparent(.6),hcDark:Ln,hcLight:Ln},C("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),Snt=J("progressBar.background",{dark:ve.fromHex("#0E70C0"),light:ve.fromHex("#0E70C0"),hcDark:Ln,hcLight:Ln},C("progressBarBackground","Background color of the progress bar that can show for long running operations."));J("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},C("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 Yh=J("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},C("editorError.foreground","Foreground color of error squigglies in the editor.")),xnt=J("editorError.border",{dark:null,light:null,hcDark:ve.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},C("errorBorder","If set, color of double underlines for errors in the editor."));J("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},C("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 $l=J("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},C("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),YD=J("editorWarning.border",{dark:null,light:null,hcDark:ve.fromHex("#FFCC00").transparent(.8),hcLight:ve.fromHex("#FFCC00").transparent(.8)},C("warningBorder","If set, color of double underlines for warnings in the editor."));J("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},C("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 Ma=J("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},C("editorInfo.foreground","Foreground color of info squigglies in the editor.")),ZD=J("editorInfo.border",{dark:null,light:null,hcDark:ve.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},C("infoBorder","If set, color of double underlines for infos in the editor.")),Lnt=J("editorHint.foreground",{dark:ve.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},C("editorHint.foreground","Foreground color of hint squigglies in the editor."));J("editorHint.border",{dark:null,light:null,hcDark:ve.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},C("hintBorder","If set, color of double underlines for hints in the editor."));J("sash.hoverBorder",{dark:Hl,light:Hl,hcDark:Hl,hcLight:Hl},C("sashActiveBorder","Border color of active sashes."));const mr=J("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:ve.black,hcLight:ve.white},C("editorBackground","Editor background color.")),Sd=J("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:ve.white,hcLight:Ke},C("editorForeground","Editor default foreground color."));J("editorStickyScroll.background",{light:mr,dark:mr,hcDark:mr,hcLight:mr},C("editorStickyScrollBackground","Sticky scroll background color for the editor"));J("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const po=J("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:ve.white},C("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Zh=J("editorWidget.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Qh=J("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Ln,hcLight:Ln},C("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.")),Ent=J("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},C("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.")),kre=J("quickInput.background",{dark:po,light:po,hcDark:po,hcLight:po},C("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Dnt=J("quickInput.foreground",{dark:Zh,light:Zh,hcDark:Zh,hcLight:Zh},C("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),knt=J("quickInputTitle.background",{dark:new ve(new Tn(255,255,255,.105)),light:new ve(new Tn(0,0,0,.06)),hcDark:"#000000",hcLight:ve.white},C("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),abe=J("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:ve.white,hcLight:"#0F4A85"},C("pickerGroupForeground","Quick picker color for grouping labels.")),Int=J("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:ve.white,hcLight:"#0F4A85"},C("pickerGroupBorder","Quick picker color for grouping borders.")),Tnt=J("keybindingLabel.background",{dark:new ve(new Tn(128,128,128,.17)),light:new ve(new Tn(221,221,221,.4)),hcDark:ve.transparent,hcLight:ve.transparent},C("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Nnt=J("keybindingLabel.foreground",{dark:ve.fromHex("#CCCCCC"),light:ve.fromHex("#555555"),hcDark:ve.white,hcLight:Ke},C("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Rnt=J("keybindingLabel.border",{dark:new ve(new Tn(51,51,51,.6)),light:new ve(new Tn(204,204,204,.4)),hcDark:new ve(new Tn(111,195,223)),hcLight:Ln},C("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Mnt=J("keybindingLabel.bottomBorder",{dark:new ve(new Tn(68,68,68,.6)),light:new ve(new Tn(187,187,187,.4)),hcDark:new ve(new Tn(111,195,223)),hcLight:Ke},C("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Lm=J("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},C("editorSelectionBackground","Color of the editor selection.")),Ant=J("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:ve.white},C("editorSelectionForeground","Color of the selected text for high contrast.")),lbe=J("editor.inactiveSelectionBackground",{light:St(Lm,.5),dark:St(Lm,.5),hcDark:St(Lm,.7),hcLight:St(Lm,.5)},C("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),DG=J("editor.selectionHighlightBackground",{light:Pre(Lm,mr,.3,.6),dark:Pre(Lm,mr,.3,.6),hcDark:null,hcLight:null},C("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);J("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const Pnt=J("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},C("editorFindMatch","Color of the current search match.")),Jh=J("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},C("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Ont=J("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},C("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Fnt=J("editor.findMatchBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("editorFindMatchBorder","Border color of the current search match.")),Em=J("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("findMatchHighlightBorder","Border color of the other search matches.")),Bnt=J("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:St(Wi,.4),hcLight:St(Wi,.4)},C("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);J("searchEditor.findMatchBackground",{light:St(Jh,.66),dark:St(Jh,.66),hcDark:Jh,hcLight:Jh},C("searchEditor.queryMatch","Color of the Search Editor query matches."));J("searchEditor.findMatchBorder",{light:St(Em,.66),dark:St(Em,.66),hcDark:Em,hcLight:Em},C("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));J("search.resultsInfoForeground",{light:Ke,dark:St(Ke,.65),hcDark:Ke,hcLight:Ke},C("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));J("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},C("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 lP=J("editorHoverWidget.background",{light:po,dark:po,hcDark:po,hcLight:po},C("hoverBackground","Background color of the editor hover."));J("editorHoverWidget.foreground",{light:Zh,dark:Zh,hcDark:Zh,hcLight:Zh},C("hoverForeground","Foreground color of the editor hover."));const Wnt=J("editorHoverWidget.border",{light:Qh,dark:Qh,hcDark:Qh,hcLight:Qh},C("hoverBorder","Border color of the editor hover."));J("editorHoverWidget.statusBarBackground",{dark:Vu(lP,.2),light:$b(lP,.05),hcDark:po,hcLight:po},C("statusBarBackground","Background color of the editor hover status bar."));const Vnt=J("editorLink.activeForeground",{dark:"#4E94CE",light:ve.blue,hcDark:ve.cyan,hcLight:"#292929"},C("activeLinkForeground","Color of active links.")),Fg=J("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:ve.white,hcLight:ve.black},C("editorInlayHintForeground","Foreground color of inline hints")),Bg=J("editorInlayHint.background",{dark:St(dM,.1),light:St(dM,.1),hcDark:St(ve.white,.1),hcLight:St(dM,.1)},C("editorInlayHintBackground","Background color of inline hints")),Hnt=J("editorInlayHint.typeForeground",{dark:Fg,light:Fg,hcDark:Fg,hcLight:Fg},C("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),$nt=J("editorInlayHint.typeBackground",{dark:Bg,light:Bg,hcDark:Bg,hcLight:Bg},C("editorInlayHintBackgroundTypes","Background color of inline hints for types")),znt=J("editorInlayHint.parameterForeground",{dark:Fg,light:Fg,hcDark:Fg,hcLight:Fg},C("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Unt=J("editorInlayHint.parameterBackground",{dark:Bg,light:Bg,hcDark:Bg,hcLight:Bg},C("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));J("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},C("editorLightBulbForeground","The color used for the lightbulb actions icon."));J("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const mH=new ve(new Tn(155,185,85,.2)),vH=new ve(new Tn(255,0,0,.2)),jnt=J("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},C("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Knt=J("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},C("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditor.insertedLineBackground",{dark:mH,light:mH,hcDark:null,hcLight:null},C("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditor.removedLineBackground",{dark:vH,light:vH,hcDark:null,hcLight:null},C("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));J("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const qnt=J("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Gnt=J("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));J("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},C("diffEditorInsertedOutline","Outline color for the text that got inserted."));J("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},C("diffEditorRemovedOutline","Outline color for text that got removed."));J("diffEditor.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("diffEditorBorder","Border color between the two text editors."));J("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},C("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));J("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},C("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));J("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},C("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));J("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},C("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const Xnt=J("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),Ynt=J("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),Znt=J("list.focusOutline",{dark:Hl,light:Hl,hcDark:Wi,hcLight:Wi},C("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.")),Qnt=J("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),Wg=J("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("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.")),ef=J("list.activeSelectionForeground",{dark:ve.white,light:ve.white,hcDark:null,hcLight:null},C("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.")),LL=J("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),Jnt=J("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("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.")),eit=J("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),tit=J("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),nit=J("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),iit=J("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},C("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.")),cbe=J("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:ve.white.transparent(.1),hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("listHoverBackground","List/Tree background when hovering over items using the mouse.")),dbe=J("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),oit=J("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},C("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),xd=J("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Hl,hcLight:Hl},C("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),u2=J("list.focusHighlightForeground",{dark:xd,light:Ait(Wg,xd,"#BBE7FF"),hcDark:xd,hcLight:xd},C("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));J("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},C("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));J("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},C("listErrorForeground","Foreground color of list items containing errors."));J("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},C("listWarningForeground","Foreground color of list items containing warnings."));const rit=J("listFilterWidget.background",{light:$b(po,0),dark:Vu(po,0),hcDark:po,hcLight:po},C("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),sit=J("listFilterWidget.outline",{dark:ve.transparent,light:ve.transparent,hcDark:"#f38518",hcLight:"#007ACC"},C("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),ait=J("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},C("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),lit=J("listFilterWidget.shadow",{dark:Gh,light:Gh,hcDark:Gh,hcLight:Gh},C("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));J("list.filterMatchBackground",{dark:Jh,light:Jh,hcDark:null,hcLight:null},C("listFilterMatchHighlight","Background color of the filtered match."));J("list.filterMatchBorder",{dark:Em,light:Em,hcDark:Ln,hcLight:Wi},C("listFilterMatchHighlightBorder","Border color of the filtered match."));const EL=J("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},C("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),cit=J("tree.inactiveIndentGuidesStroke",{dark:St(EL,.4),light:St(EL,.4),hcDark:St(EL,.4),hcLight:St(EL,.4)},C("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),dit=J("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},C("tableColumnsBorder","Table border color between columns.")),uit=J("tree.tableOddRowsBackground",{dark:St(Ke,.04),light:St(Ke,.04),hcDark:null,hcLight:null},C("tableOddRowsBackgroundColor","Background color for odd table rows."));J("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},C("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const hit=J("checkbox.background",{dark:Xh,light:Xh,hcDark:Xh,hcLight:Xh},C("checkbox.background","Background color of checkbox widget."));J("checkbox.selectBackground",{dark:po,light:po,hcDark:po,hcLight:po},C("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const fit=J("checkbox.foreground",{dark:Og,light:Og,hcDark:Og,hcLight:Og},C("checkbox.foreground","Foreground color of checkbox widget.")),git=J("checkbox.border",{dark:PC,light:PC,hcDark:PC,hcLight:PC},C("checkbox.border","Border color of checkbox widget."));J("checkbox.selectBorder",{dark:xm,light:xm,hcDark:xm,hcLight:xm},C("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const Ire=J("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,C("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),g0=J("quickInputList.focusForeground",{dark:ef,light:ef,hcDark:ef,hcLight:ef},C("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),OC=J("quickInputList.focusIconForeground",{dark:LL,light:LL,hcDark:LL,hcLight:LL},C("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),p0=J("quickInputList.focusBackground",{dark:QD(Ire,Wg),light:QD(Ire,Wg),hcDark:null,hcLight:null},C("quickInput.listFocusBackground","Quick picker background color for the focused item.")),pit=J("menu.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("menuBorder","Border color of menus.")),mit=J("menu.foreground",{dark:Og,light:Og,hcDark:Og,hcLight:Og},C("menuForeground","Foreground color of menu items.")),vit=J("menu.background",{dark:Xh,light:Xh,hcDark:Xh,hcLight:Xh},C("menuBackground","Background color of menu items.")),_it=J("menu.selectionForeground",{dark:ef,light:ef,hcDark:ef,hcLight:ef},C("menuSelectionForeground","Foreground color of the selected menu item in menus.")),bit=J("menu.selectionBackground",{dark:Wg,light:Wg,hcDark:Wg,hcLight:Wg},C("menuSelectionBackground","Background color of the selected menu item in menus.")),Cit=J("menu.selectionBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("menuSelectionBorder","Border color of the selected menu item in menus.")),yit=J("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Ln,hcLight:Ln},C("menuSeparatorBackground","Color of a separator menu item in menus.")),_H=J("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},C("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));J("toolbar.hoverOutline",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));J("toolbar.activeBackground",{dark:Vu(_H,.1),light:$b(_H,.1),hcDark:null,hcLight:null},C("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));J("editor.snippetTabstopHighlightBackground",{dark:new ve(new Tn(124,124,124,.3)),light:new ve(new Tn(10,50,100,.2)),hcDark:new ve(new Tn(124,124,124,.3)),hcLight:new ve(new Tn(10,50,100,.2))},C("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));J("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},C("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));J("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));J("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new ve(new Tn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},C("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const wit=J("breadcrumb.foreground",{light:St(Ke,.8),dark:St(Ke,.8),hcDark:St(Ke,.8),hcLight:St(Ke,.8)},C("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Sit=J("breadcrumb.background",{light:mr,dark:mr,hcDark:mr,hcLight:mr},C("breadcrumbsBackground","Background color of breadcrumb items.")),Tre=J("breadcrumb.focusForeground",{light:$b(Ke,.2),dark:Vu(Ke,.1),hcDark:Vu(Ke,.1),hcLight:Vu(Ke,.1)},C("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),xit=J("breadcrumb.activeSelectionForeground",{light:$b(Ke,.2),dark:Vu(Ke,.1),hcDark:Vu(Ke,.1),hcLight:Vu(Ke,.1)},C("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));J("breadcrumbPicker.background",{light:po,dark:po,hcDark:po,hcLight:po},C("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const ube=.5,Nre=ve.fromHex("#40C8AE").transparent(ube),Rre=ve.fromHex("#40A6FF").transparent(ube),Mre=ve.fromHex("#606060").transparent(.4),Ld=.4,xw=1,FC=J("merge.currentHeaderBackground",{dark:Nre,light:Nre,hcDark:null,hcLight:null},C("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.currentContentBackground",{dark:St(FC,Ld),light:St(FC,Ld),hcDark:St(FC,Ld),hcLight:St(FC,Ld)},C("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const BC=J("merge.incomingHeaderBackground",{dark:Rre,light:Rre,hcDark:null,hcLight:null},C("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.incomingContentBackground",{dark:St(BC,Ld),light:St(BC,Ld),hcDark:St(BC,Ld),hcLight:St(BC,Ld)},C("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const WC=J("merge.commonHeaderBackground",{dark:Mre,light:Mre,hcDark:null,hcLight:null},C("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.commonContentBackground",{dark:St(WC,Ld),light:St(WC,Ld),hcDark:St(WC,Ld),hcLight:St(WC,Ld)},C("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Lw=J("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},C("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));J("editorOverviewRuler.currentContentForeground",{dark:St(FC,xw),light:St(FC,xw),hcDark:Lw,hcLight:Lw},C("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));J("editorOverviewRuler.incomingContentForeground",{dark:St(BC,xw),light:St(BC,xw),hcDark:Lw,hcLight:Lw},C("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));J("editorOverviewRuler.commonContentForeground",{dark:St(WC,xw),light:St(WC,xw),hcDark:Lw,hcLight:Lw},C("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const kG=J("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},C("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),DL=J("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},C("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),VC=J("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},C("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),m5=J("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},C("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),Are=J("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},C("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Lit=J("minimap.infoHighlight",{dark:Ma,light:Ma,hcDark:ZD,hcLight:ZD},C("minimapInfo","Minimap marker color for infos.")),Eit=J("minimap.warningHighlight",{dark:$l,light:$l,hcDark:YD,hcLight:YD},C("overviewRuleWarning","Minimap marker color for warnings.")),Dit=J("minimap.errorHighlight",{dark:new ve(new Tn(255,18,18,.7)),light:new ve(new Tn(255,18,18,.7)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:"#B5200D"},C("minimapError","Minimap marker color for errors.")),kit=J("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},C("minimapBackground","Minimap background color.")),Iit=J("minimap.foregroundOpacity",{dark:ve.fromHex("#000f"),light:ve.fromHex("#000f"),hcDark:ve.fromHex("#000f"),hcLight:ve.fromHex("#000f")},C("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));J("minimapSlider.background",{light:St(wL,.5),dark:St(wL,.5),hcDark:St(wL,.5),hcLight:St(wL,.5)},C("minimapSliderBackground","Minimap slider background color."));J("minimapSlider.hoverBackground",{light:St(SL,.5),dark:St(SL,.5),hcDark:St(SL,.5),hcLight:St(SL,.5)},C("minimapSliderHoverBackground","Minimap slider background color when hovering."));J("minimapSlider.activeBackground",{light:St(xL,.5),dark:St(xL,.5),hcDark:St(xL,.5),hcLight:St(xL,.5)},C("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const Tit=J("problemsErrorIcon.foreground",{dark:Yh,light:Yh,hcDark:Yh,hcLight:Yh},C("problemsErrorIconForeground","The color used for the problems error icon.")),Nit=J("problemsWarningIcon.foreground",{dark:$l,light:$l,hcDark:$l,hcLight:$l},C("problemsWarningIconForeground","The color used for the problems warning icon.")),Rit=J("problemsInfoIcon.foreground",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},C("problemsInfoIconForeground","The color used for the problems info icon."));J("charts.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("chartsForeground","The foreground color used in charts."));J("charts.lines",{dark:St(Ke,.5),light:St(Ke,.5),hcDark:St(Ke,.5),hcLight:St(Ke,.5)},C("chartsLines","The color used for horizontal lines in charts."));J("charts.red",{dark:Yh,light:Yh,hcDark:Yh,hcLight:Yh},C("chartsRed","The red color used in chart visualizations."));J("charts.blue",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},C("chartsBlue","The blue color used in chart visualizations."));J("charts.yellow",{dark:$l,light:$l,hcDark:$l,hcLight:$l},C("chartsYellow","The yellow color used in chart visualizations."));J("charts.orange",{dark:VC,light:VC,hcDark:VC,hcLight:VC},C("chartsOrange","The orange color used in chart visualizations."));J("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},C("chartsGreen","The green color used in chart visualizations."));J("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("chartsPurple","The purple color used in chart visualizations."));function Mit(i,e){var t,n,o,r;switch(i.op){case 0:return(t=su(i.value,e))===null||t===void 0?void 0:t.darken(i.factor);case 1:return(n=su(i.value,e))===null||n===void 0?void 0:n.lighten(i.factor);case 2:return(o=su(i.value,e))===null||o===void 0?void 0:o.transparent(i.factor);case 3:{const s=su(i.background,e);return s?(r=su(i.value,e))===null||r===void 0?void 0:r.makeOpaque(s):su(i.value,e)}case 4:for(const s of i.values){const a=su(s,e);if(a)return a}return;case 6:return su(e.defines(i.if)?i.then:i.else,e);case 5:{const s=su(i.value,e);if(!s)return;const a=su(i.background,e);return a?s.isDarkerThan(a)?ve.getLighterColor(s,a,i.factor).transparent(i.transparency):ve.getDarkerColor(s,a,i.factor).transparent(i.transparency):s.transparent(i.factor*i.transparency)}default:throw J4()}}function $b(i,e){return{op:0,value:i,factor:e}}function Vu(i,e){return{op:1,value:i,factor:e}}function St(i,e){return{op:2,value:i,factor:e}}function QD(...i){return{op:4,values:i}}function Ait(i,e,t){return{op:6,if:i,then:e,else:t}}function Pre(i,e,t,n){return{op:5,value:i,background:e,factor:t,transparency:n}}function su(i,e){if(i!==null){if(typeof i=="string")return i[0]==="#"?ve.fromHex(i):e.getColor(i);if(i instanceof ve)return i;if(typeof i=="object")return Mit(i,e)}}const hbe="vscode://schemas/workbench-colors",fbe=no.as(d5.JSONContribution);fbe.registerSchema(hbe,p5.getColorSchema());const Ore=new bi(()=>fbe.notifySchemaChanged(hbe),200);p5.onDidChangeSchema(()=>{Ore.isScheduled()||Ore.schedule()});class v5{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new gbe(this.x-window.scrollX,this.y-window.scrollY)}}class gbe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new v5(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class Pit{constructor(e,t,n,o){this.x=e,this.y=t,this.width=n,this.height=o,this._editorPagePositionBrand=void 0}}class Oit{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function IG(i){const e=Yo(i);return new Pit(e.left,e.top,e.width,e.height)}function TG(i,e,t){const n=e.width/i.offsetWidth,o=e.height/i.offsetHeight,r=(t.x-e.x)/n,s=(t.y-e.y)/o;return new Oit(r,s)}class Iv extends kc{constructor(e,t,n){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new v5(this.posx,this.posy),this.editorPos=IG(n),this.relativePos=TG(n,this.editorPos,this.pos)}}class Fit{constructor(e){this._editorViewDomNode=e}_create(e){return new Iv(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ke(e,"contextmenu",n=>{t(this._create(n))})}onMouseUp(e,t){return ke(e,"mouseup",n=>{t(this._create(n))})}onMouseDown(e,t){return ke(e,et.MOUSE_DOWN,n=>{t(this._create(n))})}onPointerDown(e,t){return ke(e,et.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onMouseLeave(e,t){return ke(e,et.MOUSE_LEAVE,n=>{t(this._create(n))})}onMouseMove(e,t){return ke(e,"mousemove",n=>t(this._create(n)))}}class Bit{constructor(e){this._editorViewDomNode=e}_create(e){return new Iv(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ke(e,"pointerup",n=>{t(this._create(n))})}onPointerDown(e,t){return ke(e,et.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onPointerLeave(e,t){return ke(e,et.POINTER_LEAVE,n=>{t(this._create(n))})}onPointerMove(e,t){return ke(e,"pointermove",n=>t(this._create(n)))}}class Wit extends _e{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new SS),this._keydownListener=null}startMonitoring(e,t,n,o,r){this._keydownListener=No(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,n,s=>{o(new Iv(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),r(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class XI{constructor(e){this._editor=e,this._instanceId=++XI._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new bi(()=>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 n=this._rules.get(t);if(!n){const o=this._counter++;n=new Vit(t,`dyn-rule-${this._instanceId}-${o}`,XA(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}XI._idPool=0;class Vit{constructor(e,t,n,o){this.key=e,this.className=t,this.properties=o,this._referenceCount=0,this._styleElement=Wc(n),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(const o in t){const r=t[o];let s;typeof r=="object"?s=ct(r.id):s=r,n+=` + ${Hit(o)}: ${s};`}return n+=` +}`,n}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Hit(i){return i.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class YI extends _e{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 n=0,o=e.length;n=a.left?o.width=Math.max(o.width,a.left+a.width-o.left):(t[n++]=o,o=a)}return t[n++]=o,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||e.length===0)return null;const o=[];for(let r=0,s=e.length;rl)return null;if(t=Math.min(l,Math.max(0,t)),o=Math.min(l,Math.max(0,o)),t===o&&n===r&&n===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==o&&o>0&&r===0&&(o--,r=1073741824);let c=e.children[t].firstChild,d=e.children[o].firstChild;if((!c||!d)&&(!c&&n===0&&t>0&&(c=e.children[t-1].firstChild,n=1073741824),!d&&r===0&&o>0&&(d=e.children[o-1].firstChild,r=1073741824)),!c||!d)return null;n=Math.min(c.textContent.length,Math.max(0,n)),r=Math.min(d.textContent.length,Math.max(0,r));const u=this._readClientRects(c,n,d,r,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,s.clientRectDeltaLeft,s.clientRectScale)}}var Ic;(function(i){i.DARK="dark",i.LIGHT="light",i.HIGH_CONTRAST_DARK="hcDark",i.HIGH_CONTRAST_LIGHT="hcLight"})(Ic||(Ic={}));function Hu(i){return i===Ic.HIGH_CONTRAST_DARK||i===Ic.HIGH_CONTRAST_LIGHT}function Ew(i){return i===Ic.DARK||i===Ic.HIGH_CONTRAST_DARK}const Kit=function(){return Fu?!0:!(xs||Fc||cp)}();let Ly=!0;class Bre{constructor(e,t){this.themeType=t;const n=e.options,o=n.get(50);n.get(38)==="off"?this.renderWhitespace=n.get(98):this.renderWhitespace="none",this.renderControlCharacters=n.get(93),this.spaceWidth=o.spaceWidth,this.middotWidth=o.middotWidth,this.wsmiddotWidth=o.wsmiddotWidth,this.useMonospaceOptimizations=o.isMonospace&&!n.get(33),this.canUseHalfwidthRightwardsArrow=o.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(66),this.stopRenderingLineAfter=n.get(116),this.fontLigatures=n.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 Oh{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=ti(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 Hu(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,n,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),s=this._options,a=rl.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(Hu(s.themeType)||this._options.renderWhitespace==="selection"){const h=n.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:r.minColumn,p=f.endLineNumber===e?f.endColumn:r.maxColumn;g');const d=qI(c,o);o.appendString("");let u=null;return Ly&&Kit&&r.isBasicASCII&&s.useMonospaceOptimizations&&d.containsForeignElements===0&&(u=new h2(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping)),u||(u=mbe(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 h2:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof h2?this._renderedViewLine.monospaceAssumptionsAreValid():Ly}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof h2&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,o){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));const r=this._renderedViewLine.input.stopRenderingLineAfter;if(r!==-1&&t>r+1&&n>r+1)return new Fre(!0,[new T0(this.getWidth(o),0)]);r!==-1&&t>r+1&&(t=r+1),r!==-1&&n>r+1&&(n=r+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,n,o);return s&&s.length>0?new Fre(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Oh.CLASS_NAME="view-line";class h2{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;const o=Math.floor(t.lineContent.length/300);if(o>0){this._keyColumnPixelOffsetCache=new Float32Array(o);for(let r=0;r=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Ly=!1)}return Ly}toSlowRenderedLine(){return mbe(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,o){const r=this._getColumnPixelOffset(e,t,o),s=this._getColumnPixelOffset(e,n,o);return[new T0(r,s-r)]}_getColumnPixelOffset(e,t,n){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const o=Math.floor((t-1)/300)-1,r=(o+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[o],s===-1&&(s=this._actualReadPixelOffset(e,r,n),this._keyColumnPixelOffsetCache[o]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(r),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;const o=this._characterMapping.getDomPosition(t),r=uM.readHorizontalRanges(this._getReadingTarget(this.domNode),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);return!r||r.length===0?-1:r[0].left}getColumnOfNodeOffset(e,t){return NG(this._characterMapping,e,t)}}class pbe{constructor(e,t,n,o,r){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=r,this._cachedWidth=-1,this._pixelOffsetCache=null,!o||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-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,n,o){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const r=this._readPixelOffset(this.domNode,e,t,o);if(r===-1)return null;const s=this._readPixelOffset(this.domNode,e,n,o);return s===-1?null:[new T0(r,s-r)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,o)}_readVisibleRangesForRange(e,t,n,o,r){if(n===o){const s=this._readPixelOffset(e,t,n,r);return s===-1?null:[new T0(s,0)]}else return this._readRawVisibleRangesForRange(e,n,o,r)}_readPixelOffset(e,t,n,o){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(o);const r=this._getReadingTarget(e);return r.firstChild?(o.markDidDomLayout(),r.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const r=this._pixelOffsetCache[n];if(r!==-1)return r;const s=this._actualReadPixelOffset(e,t,n,o);return this._pixelOffsetCache[n]=s,s}return this._actualReadPixelOffset(e,t,n,o)}_actualReadPixelOffset(e,t,n,o){if(this._characterMapping.length===0){const l=uM.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,o);return!l||l.length===0?-1:l[0].left}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(o);const r=this._characterMapping.getDomPosition(n),s=uM.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,r.partIndex,r.charIndex,o);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(n),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,n,o){if(t===1&&n===this._characterMapping.length)return[new T0(0,this.getWidth(o))];const r=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(n);return uM.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,s.partIndex,s.charIndex,o)}getColumnOfNodeOffset(e,t){return NG(this._characterMapping,e,t)}}class qit extends pbe{_readVisibleRangesForRange(e,t,n,o,r){const s=super._readVisibleRangesForRange(e,t,n,o,r);if(!s||s.length===0||n===o||n===1&&o===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,o,r);if(a!==-1){const l=s[s.length-1];l.left=t){const u=t-s;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 Dw{constructor(e,t,n){this.viewModel=e.viewModel;const o=e.configuration.options;this.layoutInfo=o.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=o.get(66),this.stickyTabStops=o.get(115),this.typicalHalfwidthCharacterWidth=o.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Dw.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){const o=n.verticalOffset+n.height/2,r=e.viewModel.getLineCount();let s=null,a,l=null;return n.afterLineNumber!==r&&(l=new ae(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(s=new ae(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),l===null?a=s:s===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Yr._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class RG extends Zit{constructor(e,t,n,o,r){super(e,t,n,o),this._ctx=e,r?(this.target=r,this.targetPath=vf.collect(r,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=r&&r<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){const o=t.isInContentArea?8:5;return t.fulfillViewZone(o,n.position,n)}return null}static _hitTestTextArea(e,t){return Ll.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 n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),o=n.range.getStartPosition();let r=Math.abs(t.relativePos.x);const s={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:r};return r-=e.layoutInfo.glyphMarginLeft,r<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,o,n.range,s):(r-=e.layoutInfo.glyphMarginWidth,r<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,o,n.range,s):(r-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,o,n.range,s)))}return null}static _hitTestViewLines(e,t,n){if(!Ll.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new ae(1,1),Wre);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const r=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(r);return t.fulfillContentEmpty(new ae(r,s),Wre)}if(n){if(Ll.isStrictChildOfViewLines(t.targetPath)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(r)===0){const a=e.getLineWidth(r),l=o9(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new ae(r,1),l)}const s=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>=s){const a=o9(t.mouseContentHorizontalOffset-s),l=new ae(r,e.viewModel.getLineMaxColumn(r));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const o=Yr._doHitTest(e,t);return o.type===1?Yr.createMouseTargetFromHitTestPosition(e,t,o.spanNode,o.position,o.injectedText):this._createMouseTarget(e,t.withTarget(o.hitTarget),!0)}static _hitTestMinimap(e,t){if(Ll.isChildOfMinimap(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,o))}return null}static _hitTestScrollbarSlider(e,t){if(Ll.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(o);return t.fulfillScrollbar(new ae(o,r))}}return null}static _hitTestScrollbar(e,t){if(Ll.isChildOfScrollableElement(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,o))}return null}getMouseColumn(e){const t=this._context.configuration.options,n=t.get(143),o=this._context.viewLayout.getCurrentScrollLeft()+e.x-n.contentLeft;return Yr._getMouseColumn(o,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,o,r){const s=o.lineNumber,a=o.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const m=o9(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(o,m)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(o);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(o,null,{mightBeForeignElement:!!r,injectedText:r});const u=[];if(u.push({offset:c.left,column:a}),a>1){const m=e.visibleRangeForPosition(s,a-1);m&&u.push({offset:m.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(am.offset-_.offset);const f=t.pos.toClientCoordinates(),g=n.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let v=null;for(let m=1;mr)){const a=Math.floor((o+r)/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 v5(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 n=nb(e.viewDomNode);let o;if(n?typeof n.caretRangeFromPoint=="undefined"?o=Qit(n,t.clientX,t.clientY):o=n.caretRangeFromPoint(t.clientX,t.clientY):o=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!o||!o.startContainer)return new Xp;const r=o.startContainer;if(r.nodeType===r.TEXT_NODE){const s=r.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Oh.CLASS_NAME?U_.createFromDOMInfo(e,s,o.startOffset):new Xp(r.parentNode)}else if(r.nodeType===r.ELEMENT_NODE){const s=r.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Oh.CLASS_NAME?U_.createFromDOMInfo(e,r,r.textContent.length):new Xp(r)}return new Xp}static _doHitTestWithCaretPositionFromPoint(e,t){const n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){const o=n.offsetNode.parentNode,r=o?o.parentNode:null,s=r?r.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===Oh.CLASS_NAME?U_.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new Xp(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){const o=n.offsetNode.parentNode,r=o&&o.nodeType===o.ELEMENT_NODE?o.className:null,s=o?o.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(r===Oh.CLASS_NAME){const l=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(l)return U_.createFromDOMInfo(e,l,0)}else if(a===Oh.CLASS_NAME)return U_.createFromDOMInfo(e,n.offsetNode,0)}return new Xp(n.offsetNode)}static _snapToSoftTabBoundary(e,t){const n=t.getLineContent(e.lineNumber),{tabSize:o}=t.model.getOptions(),r=JD.atomicPosition(n,e.column-1,o,2);return r!==-1?new ae(e.lineNumber,r+1):e}static _doHitTest(e,t){let n=new Xp;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),n.type===1){const o=e.viewModel.getInjectedTextAt(n.position),r=e.viewModel.normalizePosition(n.position,2);(o||!r.equals(n.position))&&(n=new vbe(r,n.spanNode,o))}return n}}function Qit(i,e,t){const n=document.createRange();let o=i.elementFromPoint(e,t);if(o!==null){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const r=o.getBoundingClientRect(),s=window.getComputedStyle(o,null).getPropertyValue("font-style"),a=window.getComputedStyle(o,null).getPropertyValue("font-variant"),l=window.getComputedStyle(o,null).getPropertyValue("font-weight"),c=window.getComputedStyle(o,null).getPropertyValue("font-size"),d=window.getComputedStyle(o,null).getPropertyValue("line-height"),u=window.getComputedStyle(o,null).getPropertyValue("font-family"),h=`${s} ${a} ${l} ${c}/${d} ${u}`,f=o.innerText;let g=r.left,p=0,v;if(e>r.left+r.width)p=f.length;else{const m=m0.getInstance();for(let _=0;_t(new kc(n))))}onmousedown(e,t){this._register(ke(e,et.MOUSE_DOWN,n=>t(new kc(n))))}onmouseover(e,t){this._register(ke(e,et.MOUSE_OVER,n=>t(new kc(n))))}onmouseleave(e,t){this._register(ke(e,et.MOUSE_LEAVE,n=>t(new kc(n))))}onkeydown(e,t){this._register(ke(e,et.KEY_DOWN,n=>t(new Pi(n))))}onkeyup(e,t){this._register(ke(e,et.KEY_UP,n=>t(new Pi(n))))}oninput(e,t){this._register(ke(e,et.INPUT,t))}onblur(e,t){this._register(ke(e,et.BLUR,t))}onfocus(e,t){this._register(ke(e,et.FOCUS,t))}ignoreGesture(e){return Ei.ignoreTarget(e)}}const kw=11;class Jit extends Ud{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!="undefined"&&(this.bgDomNode.style.top="0px"),typeof e.left!="undefined"&&(this.bgDomNode.style.left="0px"),typeof e.bottom!="undefined"&&(this.bgDomNode.style.bottom="0px"),typeof e.right!="undefined"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Mt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=kw+"px",this.domNode.style.height=kw+"px",typeof e.top!="undefined"&&(this.domNode.style.top=e.top+"px"),typeof e.left!="undefined"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom!="undefined"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right!="undefined"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new SS),this._register(No(this.bgDomNode,et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(No(this.domNode,et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new UI),this._pointerdownScheduleRepeatTimer=this._register(new zd)}_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,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class eot extends _e{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new zd)}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 tot=140;class _be extends Ud{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 eot(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new SS),this._shouldRender=!0,this.domNode=ti(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(ke(this.domNode.domNode,et.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Jit(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,o){this.slider=ti(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof o=="number"&&this.slider.setHeight(o),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ke(this.slider.domNode,et.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.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,n=t+this._scrollbarState.getSliderPosition(),o=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);n<=r&&r<=o?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{const r=Yo(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}const o=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(o):this._scrollbarState.getDesiredScrollPositionFromOffset(o)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{const s=this._sliderOrthogonalPointerPosition(r),a=Math.abs(s-n);if(ls&&a>tot){this._setDesiredScrollPositionNow(o.getScrollPosition());return}const c=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(o.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 not=20;class Iw{constructor(e,t,n,o,r,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=o,this._scrollSize=r,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Iw(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,n,o,r){const s=Math.max(0,n-e),a=Math.max(0,s-2*t),l=o>0&&o>n;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(not,Math.floor(n*a/o))),d=(a-c)/(o-n),u=r*d;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){const e=Iw._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 n=this._scrollPosition;return tthis._host.onMouseWheel(new tb(null,1,0))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new tb(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 oot extends _be{constructor(e,t,n){const o=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Iw(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,o.height,o.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-kw)/2,a=(t.verticalScrollbarSize-kw)/2;this._createArrow({className:"scra",icon:Xe.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new tb(null,0,1))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new tb(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 cP{constructor(e,t,n,o,r,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,n=n|0,o=o|0,r=r|0,s=s|0,a=a|0),this.rawScrollLeft=o,this.rawScrollTop=a,t<0&&(t=0),o+t>n&&(o=n-t),o<0&&(o=0),r<0&&(r=0),a+r>s&&(a=s-r),a<0&&(a=0),this.width=t,this.scrollWidth=n,this.scrollLeft=o,this.height=r,this.scrollHeight=s,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 cP(this._forceIntegerValues,typeof e.width!="undefined"?e.width:this.width,typeof e.scrollWidth!="undefined"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height!="undefined"?e.height:this.height,typeof e.scrollHeight!="undefined"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new cP(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft!="undefined"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop!="undefined"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const n=this.width!==e.width,o=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,s=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:n,scrollWidthChanged:o,scrollLeftChanged:r,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class ZI extends _e{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new cP(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 n;const o=this._state.withScrollDimensions(e,t);this._setState(o,Boolean(this._smoothScrolling)),(n=this._smoothScrolling)===null||n===void 0||n.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=="undefined"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop=="undefined"?this._smoothScrolling.to.scrollTop:e.scrollTop};const n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let o;t?o=new ek(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):o=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=o}else{const n=this._state.withScrollPosition(e);this._smoothScrolling=ek.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{!this._smoothScrolling||(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return Boolean(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 n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}}class Vre{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}}function r9(i,e){const t=e-i;return function(n){return i+t*aot(n)}}function rot(i,e,t){return function(n){return n2.5*n){let r,s;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}}dP.INSTANCE=new dP;class MG extends Ud{get options(){return this._options}constructor(e,t,n){super(),this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new le),e.style.overflow="hidden",this._options=dot(t),this._scrollable=n,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const o={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new oot(this._scrollable,this._options,o)),this._horizontalScrollbar=this._register(new iot(this._scrollable,this._options,o)),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=ti(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ti(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ti(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,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new zd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=si(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,Nn&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel!="undefined"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity!="undefined"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity!="undefined"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis!="undefined"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal!="undefined"&&(this._options.horizontal=e.horizontal),typeof e.vertical!="undefined"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize!="undefined"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize!="undefined"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage!="undefined"&&(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 tb(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=si(this._mouseWheelToDispose),e)){const n=o=>{this._onMouseWheel(new tb(o))};this._mouseWheelToDispose.push(ke(this._listenOnDomNode,et.MOUSE_WHEEL,n,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const n=dP.INSTANCE;n.acceptStandardWheelEvent(e);let o=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!Nn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let d={};if(s){const u=Hre*s,h=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,h)}if(a){const u=Hre*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&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),o=!0)}let r=o;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(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,n=e.scrollLeft>0,o=n?" left":"",r=t?" top":"",s=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${o}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${r}${o}`)}}_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(),lot)}}class bbe extends MG{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new ZI({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Bc(o)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class AG extends MG{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class QI extends MG{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new ZI({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Bc(o)});super(e,t,n),this._register(n),this._element=e,this._register(this.onScroll(o=>{o.scrollTopChanged&&(this._element.scrollTop=o.scrollTop),o.scrollLeftChanged&&(this._element.scrollLeft=o.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 dot(i){const e={lazyRender:typeof i.lazyRender!="undefined"?i.lazyRender:!1,className:typeof i.className!="undefined"?i.className:"",useShadows:typeof i.useShadows!="undefined"?i.useShadows:!0,handleMouseWheel:typeof i.handleMouseWheel!="undefined"?i.handleMouseWheel:!0,flipAxes:typeof i.flipAxes!="undefined"?i.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof i.consumeMouseWheelIfScrollbarIsNeeded!="undefined"?i.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof i.alwaysConsumeMouseWheel!="undefined"?i.alwaysConsumeMouseWheel:!1,scrollYToX:typeof i.scrollYToX!="undefined"?i.scrollYToX:!1,mouseWheelScrollSensitivity:typeof i.mouseWheelScrollSensitivity!="undefined"?i.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof i.fastScrollSensitivity!="undefined"?i.fastScrollSensitivity:5,scrollPredominantAxis:typeof i.scrollPredominantAxis!="undefined"?i.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof i.mouseWheelSmoothScroll!="undefined"?i.mouseWheelSmoothScroll:!0,arrowSize:typeof i.arrowSize!="undefined"?i.arrowSize:11,listenOnDomNode:typeof i.listenOnDomNode!="undefined"?i.listenOnDomNode:null,horizontal:typeof i.horizontal!="undefined"?i.horizontal:1,horizontalScrollbarSize:typeof i.horizontalScrollbarSize!="undefined"?i.horizontalScrollbarSize:10,horizontalSliderSize:typeof i.horizontalSliderSize!="undefined"?i.horizontalSliderSize:0,horizontalHasArrows:typeof i.horizontalHasArrows!="undefined"?i.horizontalHasArrows:!1,vertical:typeof i.vertical!="undefined"?i.vertical:1,verticalScrollbarSize:typeof i.verticalScrollbarSize!="undefined"?i.verticalScrollbarSize:10,verticalHasArrows:typeof i.verticalHasArrows!="undefined"?i.verticalHasArrows:!1,verticalSliderSize:typeof i.verticalSliderSize!="undefined"?i.verticalSliderSize:0,scrollByPage:typeof i.scrollByPage!="undefined"?i.scrollByPage:!1};return e.horizontalSliderSize=typeof i.horizontalSliderSize!="undefined"?i.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof i.verticalSliderSize!="undefined"?i.verticalSliderSize:e.verticalScrollbarSize,Nn&&(e.className+=" mac"),e}class PG extends YI{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new Yr(this._context,n),this._mouseDownOperation=this._register(new uot(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const o=new Fit(this.viewHelper.viewDomNode);this._register(o.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(o.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ke(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Iv(a,!1,this.viewHelper.viewDomNode))}))})),this._register(o.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(o.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let r=0;this._register(o.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{r=a})),this._register(ke(this.viewHelper.viewDomNode,et.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(o.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,r))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=dP.INSTANCE;let t=0,n=xc.getZoomLevel(),o=!1,r=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new tb(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=xc.getZoomLevel(),u=c.deltaY>0?1:-1;xc.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(n=xc.getZoomLevel(),o=a(l),r=0),t=Date.now(),r+=c.deltaY,o&&(xc.setZoomLevel(n+r/5),c.preventDefault(),c.stopPropagation())};this._register(ke(this.viewHelper.viewDomNode,et.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return Nn?(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 o=new gbe(e,t).toPageCoordinates(),r=IG(this.viewHelper.viewDomNode);if(o.yr.y+r.height||o.xr.x+r.width)return null;const s=TG(this.viewHelper.viewDomNode,r,o);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),r,o,s,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){const o=nb(this.viewHelper.viewDomNode);o&&(n=o.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n: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&&(o||s&&a))u(),this._mouseDownOperation.start(n.type,e,t);else if(r)e.preventDefault();else if(l){const h=n.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(u(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}}class uot extends _e{constructor(e,t,n,o,r,s){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=o,this._createMouseTarget=r,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new Wit(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new hot(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new b5,this._currentSelection=new gt(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,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const o=this._findMousePosition(t,!0);if(!o||!o.position)return;this._mouseState.trySetCount(t.detail,o.position),t.detail=this._mouseState.count;const r=this._context.configuration.options;if(!r.get(90)&&r.get(35)&&!r.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&o.type===6&&o.position&&this._currentSelection.containsPosition(o.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);s&&s 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(o,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),()=>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,n=this._context.viewModel,o=this._context.viewLayout,r=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=o.getCurrentScrollTop()+e.relativePos.y,c=Dw.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return Fs.createOutsideEditor(r,u,"below",a)}const d=o.getLineNumberAtVerticalOffset(l);return Fs.createOutsideEditor(r,new ae(d,n.getLineMaxColumn(d)),"below",a)}const s=o.getLineNumberAtVerticalOffset(o.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return Fs.createOutsideEditor(r,new ae(s,n.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const n=this._getPositionOutsideEditor(e);if(n)return n;const o=this._createMouseTarget(e,t);if(!o.position)return null;if(o.type===8||o.type===5){const s=this._helpPositionJumpOverViewZone(o.detail);if(s)return Fs.createViewZone(o.type,o.element,o.mouseColumn,s,o.detail)}return o}_helpPositionJumpOverViewZone(e){const t=new ae(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,o=e.positionAfter;return n&&o?n.isBefore(t)?n:o:null}_dispatchMouse(e,t,n){!e.position||this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,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 hot extends _e{constructor(e,t,n,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=o,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new fot(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class fot extends _e{constructor(e,t,n,o,r,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=o,this._position=r,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Bc(()=>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,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),n=this._tick(),o=t*(n/1e3)*e,r=this._position.outsidePosition==="above"?-o:o;this._context.viewModel.viewLayout.deltaScrollNow(0,r),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=IG(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(143).horizontalScrollbarHeight,u=new v5(this._mouseEvent.pos.x,c.y+c.height-d-.1),h=TG(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=Fs.createOutsideEditor(this._position.mouseColumn,new ae(a,1),"above",this._position.outsideDistance):l=Fs.createOutsideEditor(this._position.mouseColumn,new ae(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Bc(()=>this._execute())}}class b5{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 n=new Date().getTime();n-this._lastSetMouseDownCountTime>b5.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=n,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)}}b5.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class xn{get event(){return this.emitter.event}constructor(e,t,n){const o=r=>this.emitter.fire(r);this.emitter=new le({onWillAddFirstListener:()=>e.addEventListener(t,o,n),onDidRemoveLastListener:()=>e.removeEventListener(t,o,n)})}dispose(){this.emitter.dispose()}}var Dm;(function(i){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),n=Object.assign({},e),o=Object.assign({},e);let r=0;const s={keydown:0,input:0,render:0};function a(){m(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}i.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,v()}i.onBeforeInput=c;function d(){s.input===0&&c(),queueMicrotask(u)}i.onInput=d;function u(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){m()}i.onKeyUp=h;function f(){m()}i.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(p),v())}i.onRenderStart=g;function p(){s.render===1&&(performance.mark("render/end"),s.render=2)}function v(){setTimeout(m)}function m(){s.keydown===2&&s.input===2&&s.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"),_("keydown",e),_("input",t),_("render",n),_("inputlatency",o),r++,y())}function _(E,I){const k=performance.getEntriesByName(E)[0].duration;I.total+=k,I.min=Math.min(I.min,k),I.max=Math.max(I.max,k)}function y(){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"),s.keydown=0,s.input=0,s.render=0}function w(){if(r===0)return;const E={keydown:L(e),input:L(t),render:L(n),total:L(o),sampleCount:r};return D(e),D(t),D(n),D(o),r=0,E}i.getAndClearMeasurements=w;function L(E){return{average:E.total/r,max:E.max,min:E.min}}function D(E){E.total=0,E.min=Number.MAX_VALUE,E.max=0}})(Dm||(Dm={}));class Pr{constructor(e,t,n,o,r){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=o,this.newlineCountBeforeSelection=r}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const n=e.getValue(),o=e.getSelectionStart(),r=e.getSelectionEnd();let s;if(t){const a=n.substring(0,o),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new Pr(n,o,r,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Pr(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,n,o,r,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((n=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&n!==void 0?n:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((r=(o=this.selection)===null||o===void 0?void 0:o.getEndPosition())!==null&&r!==void 0?r:null,h,1)}const d=this.value.substring(this.selectionStart,e);if(d.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.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,n){let o=0,r=-1;for(;(r=t.indexOf(` +`,r+1))!==-1;)o++;return[e,n*t.length,o]}static deduceInput(e,t,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const o=Math.min(Q0(e.value,t.value),e.selectionStart,t.selectionStart),r=Math.min(jA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(o,e.value.length-r);const s=t.value.substring(o,t.value.length-r),a=e.selectionStart-o,l=e.selectionEnd-o,c=t.selectionStart-o,d=t.selectionEnd-o;if(c===d){const h=e.selectionStart-o;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:s,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 n=Math.min(Q0(e.value,t.value),e.selectionEnd),o=Math.min(jA(e.value,t.value),e.value.length-e.selectionEnd),r=e.value.substring(n,e.value.length-o),s=t.value.substring(n,t.value.length-o);e.selectionStart-n;const a=e.selectionEnd-n;t.selectionStart-n;const l=t.selectionEnd-n;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:r.length-a,positionDelta:l-s.length}}}Pr.EMPTY=new Pr("",0,0,null,void 0);class HC{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const n=e*t,o=n+1,r=n+t;return new V(o,1,r+1,1)}static fromEditorSelection(e,t,n,o){const s=HC._getPageOfLine(t.startLineNumber,n),a=HC._getRangeForPage(s,n),l=HC._getPageOfLine(t.endLineNumber,n),c=HC._getRangeForPage(l,n);let d=a.intersectRanges(new V(1,1,t.startLineNumber,t.startColumn));if(o&&e.getValueLengthInRange(d,1)>500){const m=e.modifyPosition(d.getEndPosition(),-500);d=V.fromPositions(m,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new V(t.endLineNumber,t.endColumn,h,f));if(o&&e.getValueLengthInRange(g,1)>500){const m=e.modifyPosition(g.getStartPosition(),500);g=V.fromPositions(g.getStartPosition(),m)}const p=e.getValueInRange(g,1);let v;if(s===l||s+1===l)v=e.getValueInRange(t,1);else{const m=a.intersectRanges(t),_=c.intersectRanges(t);v=e.getValueInRange(m,1)+String.fromCharCode(8230)+e.getValueInRange(_,1)}return o&&v.length>2*500&&(v=v.substring(0,500)+String.fromCharCode(8230)+v.substring(v.length-500,v.length)),new Pr(u+v+p,u.length,u.length+v.length,t,d.endLineNumber-d.startLineNumber)}}var uP;(function(i){i.Tap="-monaco-textarea-synthetic-tap"})(uP||(uP={}));const bH={forceCopyWithSyntaxHighlighting:!1};class tk{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)}}tk.INSTANCE=new tk;class got{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 pot extends _e{get textAreaState(){return this._textAreaState}constructor(e,t,n,o){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=o,this._onFocus=this._register(new le),this.onFocus=this._onFocus.event,this._onBlur=this._register(new le),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new le),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new le),this.onCut=this._onCut.event,this._onPaste=this._register(new le),this.onPaste=this._onPaste.event,this._onType=this._register(new le),this.onType=this._onType.event,this._onCompositionStart=this._register(new le),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new le),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new le),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new le),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new bi(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new bi(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=Pr.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let r=null;this._register(this._textArea.onKeyDown(s=>{const a=new Pi(s);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),r=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(s=>{const a=new Pi(s);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(s=>{const a=new got;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&r&&r.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===s.data&&(r.code==="ArrowRight"||r.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:s.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:s.data});return}this._onCompositionStart.fire({data:s.data})})),this._register(this._textArea.onCompositionUpdate(s=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=Pr.readFromTextArea(this._textArea,this._textAreaState),d=Pr.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionUpdate.fire(s);return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Pr.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(s)})),this._register(this._textArea.onCompositionEnd(s=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=Pr.readFromTextArea(this._textArea,this._textAreaState),d=Pr.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Pr.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=Pr.readFromTextArea(this._textArea,this._textAreaState),l=Pr.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(gr(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(s=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(s),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(s=>{this._ensureClipboardGetsEditorSelection(s)})),this._register(this._textArea.onPaste(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),s.preventDefault(),!s.clipboardData)return;let[a,l]=CH.getTextData(s.clipboardData);!a||(l=l||tk.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const s=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!s&&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 ke(this._textArea.ownerDocument,"selectionchange",t=>{if(Dm.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const n=Date.now(),o=n-e;if(e=n,o<5)return;const r=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),r<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)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 gt(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(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};tk.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +`):t.text,n),e.preventDefault(),e.clipboardData&&CH.setTextData(e.clipboardData,t.text,t.html,n)}}const CH={getTextData(i){const e=i.getData(xo.text);let t=null;const n=i.getData("vscode-editor-data");if(typeof n=="string")try{t=JSON.parse(n),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&i.files.length>0?[Array.prototype.slice.call(i.files,0).map(r=>r.name).join(` +`),null]:[e,t]},setTextData(i,e,t,n){i.setData(xo.text,e),typeof t=="string"&&i.setData("text/html",t),i.setData("vscode-editor-data",JSON.stringify(n))}};class mot extends _e{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new xn(this._actual,"keydown")).event,this.onKeyUp=this._register(new xn(this._actual,"keyup")).event,this.onCompositionStart=this._register(new xn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new xn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new xn(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new xn(this._actual,"beforeinput")).event,this.onInput=this._register(new xn(this._actual,"input")).event,this.onCut=this._register(new xn(this._actual,"cut")).event,this.onCopy=this._register(new xn(this._actual,"copy")).event,this.onPaste=this._register(new xn(this._actual,"paste")).event,this.onFocus=this._register(new xn(this._actual,"focus")).event,this.onBlur=this._register(new xn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new le),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Dm.onKeyDown())),this._register(this.onBeforeInput(()=>Dm.onBeforeInput())),this._register(this.onInput(()=>Dm.onInput())),this._register(this.onKeyUp(()=>Dm.onKeyUp())),this._register(ke(this._actual,uP.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=nb(this._actual);return e?e.activeElement===this._actual:aG(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 n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.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,n){const o=this._actual;let r=null;const s=nb(o);s?r=s.activeElement:r=o.ownerDocument.activeElement;const a=r===o,l=o.selectionStart,c=o.selectionEnd;if(a&&l===t&&c===n){Fc&&window.parent!==window&&o.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),o.setSelectionRange(t,n),Fc&&window.parent!==window&&o.focus();return}try{const d=qQe(o);this.setIgnoreSelectionChangeTime("setSelectionRange"),o.focus(),o.setSelectionRange(t,n),GQe(o,d)}catch{}}}class vot extends PG{constructor(e,t,n){super(e,t,n),this._register(Ei.addTarget(this.viewHelper.linesContentDomNode)),this._register(ke(this.viewHelper.linesContentDomNode,Di.Tap,r=>this.onTap(r))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Change,r=>this.onChange(r))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Contextmenu,r=>this._onContextMenu(new Iv(r,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ke(this.viewHelper.linesContentDomNode,"pointerdown",r=>{const s=r.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const o=new Bit(this.viewHelper.viewDomNode);this._register(o.onPointerMove(this.viewHelper.viewDomNode,r=>this._onMouseMove(r))),this._register(o.onPointerUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(o.onPointerLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(o.onPointerDown(this.viewHelper.viewDomNode,(r,s)=>this._onMouseDown(r,s)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Iv(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 _ot extends PG{constructor(e,t,n){super(e,t,n),this._register(Ei.addTarget(this.viewHelper.linesContentDomNode)),this._register(ke(this.viewHelper.linesContentDomNode,Di.Tap,o=>this.onTap(o))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Change,o=>this.onChange(o))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Contextmenu,o=>this._onContextMenu(new Iv(o,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Iv(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const n=document.createEvent("CustomEvent");n.initEvent(uP.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(n),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class bot extends _e{constructor(e,t,n){super(),Ku&&sG.pointerEvents?this.handler=this._register(new vot(e,t,n)):window.TouchEvent?this.handler=this._register(new _ot(e,t,n)):this.handler=this._register(new PG(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class zb extends YI{}const vr=yn("themeService");function ro(i){return{id:i}}function yH(i){switch(i){case Ic.DARK:return"vs-dark";case Ic.HIGH_CONTRAST_DARK:return"hc-black";case Ic.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const Cbe={ThemingContribution:"base.contributions.theming"};class Cot{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new le}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),zt(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const ybe=new Cot;no.add(Cbe.ThemingContribution,ybe);function jd(i){return ybe.onColorThemeChange(i)}class yot extends _e{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 wbe=J("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("lineHighlight","Background color for the highlight of line at the cursor position.")),$re=J("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Ln},C("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));J("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},C("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);J("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);J("editor.symbolHighlightBackground",{dark:Jh,light:Jh,hcDark:null,hcLight:null},C("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);J("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const Sbe=J("editorCursor.foreground",{dark:"#AEAFAD",light:ve.black,hcDark:ve.white,hcLight:"#0F4A85"},C("caret","Color of the editor cursor.")),wot=J("editorCursor.background",null,C("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Vg=J("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},C("editorWhitespaces","Color of whitespace characters in the editor.")),Sot=J("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:ve.white,hcLight:"#292929"},C("editorLineNumbers","Color of editor line numbers.")),f2=J("editorIndentGuide.background",{dark:Vg,light:Vg,hcDark:Vg,hcLight:Vg},C("editorIndentGuides","Color of the editor indentation guides."),!1,C("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),g2=J("editorIndentGuide.activeBackground",{dark:Vg,light:Vg,hcDark:Vg,hcLight:Vg},C("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,C("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),JI=J("editorIndentGuide.background1",{dark:f2,light:f2,hcDark:f2,hcLight:f2},C("editorIndentGuides1","Color of the editor indentation guides (1).")),xot=J("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides2","Color of the editor indentation guides (2).")),Lot=J("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides3","Color of the editor indentation guides (3).")),Eot=J("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides4","Color of the editor indentation guides (4).")),Dot=J("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides5","Color of the editor indentation guides (5).")),kot=J("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides6","Color of the editor indentation guides (6).")),eT=J("editorIndentGuide.activeBackground1",{dark:g2,light:g2,hcDark:g2,hcLight:g2},C("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Iot=J("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Tot=J("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Not=J("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),Rot=J("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Mot=J("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),p2=J("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Wi,hcLight:Wi},C("editorActiveLineNumber","Color of editor active line number"),!1,C("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));J("editorLineNumber.activeForeground",{dark:p2,light:p2,hcDark:p2,hcLight:p2},C("editorActiveLineNumber","Color of editor active line number"));const Aot=J("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));J("editorRuler.foreground",{dark:"#5A5A5A",light:ve.lightgrey,hcDark:ve.white,hcLight:"#292929"},C("editorRuler","Color of the editor rulers."));J("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},C("editorCodeLensForeground","Foreground color of editor CodeLens"));J("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},C("editorBracketMatchBackground","Background color behind matching brackets"));J("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Ln,hcLight:Ln},C("editorBracketMatchBorder","Color for matching brackets boxes"));const Pot=J("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},C("editorOverviewRulerBorder","Color of the overview ruler border.")),Oot=J("editorOverviewRuler.background",null,C("editorOverviewRulerBackground","Background color of the editor overview ruler."));J("editorGutter.background",{dark:mr,light:mr,hcDark:mr,hcLight:mr},C("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));J("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:ve.fromHex("#fff").transparent(.8),hcLight:Ln},C("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Fot=J("editorUnnecessaryCode.opacity",{dark:ve.fromHex("#000a"),light:ve.fromHex("#0007"),hcDark:null,hcLight:null},C("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.`));J("editorGhostText.border",{dark:null,light:null,hcDark:ve.fromHex("#fff").transparent(.8),hcLight:ve.fromHex("#292929").transparent(.8)},C("editorGhostTextBorder","Border color of ghost text in the editor."));J("editorGhostText.foreground",{dark:ve.fromHex("#ffffff56"),light:ve.fromHex("#0007"),hcDark:null,hcLight:null},C("editorGhostTextForeground","Foreground color of the ghost text in the editor."));J("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorGhostTextBackground","Background color of the ghost text in the editor."));const m2=new ve(new Tn(0,122,204,.6)),xbe=J("editorOverviewRuler.rangeHighlightForeground",{dark:m2,light:m2,hcDark:m2,hcLight:m2},C("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Bot=J("editorOverviewRuler.errorForeground",{dark:new ve(new Tn(255,18,18,.7)),light:new ve(new Tn(255,18,18,.7)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:"#B5200D"},C("overviewRuleError","Overview ruler marker color for errors.")),Wot=J("editorOverviewRuler.warningForeground",{dark:$l,light:$l,hcDark:YD,hcLight:YD},C("overviewRuleWarning","Overview ruler marker color for warnings.")),Vot=J("editorOverviewRuler.infoForeground",{dark:Ma,light:Ma,hcDark:ZD,hcLight:ZD},C("overviewRuleInfo","Overview ruler marker color for infos.")),Lbe=J("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},C("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Ebe=J("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},C("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Dbe=J("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},C("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),kbe=J("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Ibe=J("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Tbe=J("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Hot=J("editorBracketHighlight.unexpectedBracket.foreground",{dark:new ve(new Tn(255,18,18,.8)),light:new ve(new Tn(255,18,18,.8)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:""},C("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),$ot=J("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),zot=J("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Uot=J("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),jot=J("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Kot=J("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),qot=J("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Got=J("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Xot=J("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Yot=J("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Zot=J("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Qot=J("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Jot=J("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));J("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},C("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));J("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},C("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));jd((i,e)=>{const t=i.getColor(mr),n=i.getColor(wbe),o=n&&!n.isTransparent()?n:t;o&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)});class tT extends zb{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ae(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 n=e.get(143);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.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 n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}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 ae(e,1));if(t.column!==1)return"";const n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){const o=Math.abs(this._lastCursorModelPosition.lineNumber-n);return o===0?''+n+"":String(o)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10===0?String(n):"":String(n)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=xs?this._lineHeight%2===0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=this._context.viewModel.getLineCount(),s=[];for(let a=n;a<=o;a++){const l=a-n,c=this._getLineRenderLineNumber(a);if(!c){s[l]="";continue}let d="";if(a===r&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){s[l]="";continue}this._renderFinalNewline==="dimmed"&&(d=" dimmed-line-number")}a===this._activeLineNumber&&(d=" active-line-number"),s[l]=`
${c}
`}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}tT.CLASS_NAME="line-numbers";jd((i,e)=>{const t=i.getColor(Sot),n=i.getColor(Aot);n?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class ib extends pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=ti(document.createElement("div")),this._domNode.setClassName(ib.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ti(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(ib.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.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 n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}}ib.CLASS_NAME="glyph-margin";ib.OUTER_CLASS_NAME="margin";const Ey="monaco-mouse-cursor-text";class ert{constructor(){this._onDidChange=new le,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 gE=new ert,xi=yn("keybindingService");var trt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nrt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class irt{constructor(e,t,n,o,r){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=o,this.distanceToModelLineEnd=r,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new ae(this.modelLineNumber,this.distanceToModelLineStart+1),n=new ae(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(n),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 s9=Fc;let wH=class extends pl{constructor(e,t,n,o){super(e),this._keybindingService=o,this._primaryCursorPosition=new ae(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,s=r.get(143);this._setAccessibilityOptions(r),this._contentLeft=s.contentLeft,this._contentWidth=s.contentWidth,this._contentHeight=s.height,this._fontInfo=r.get(50),this._lineHeight=r.get(66),this._emptySelectionClipboard=r.get(37),this._copyWithSyntaxHighlighting=r.get(25),this._visibleTextArea=null,this._selections=[new gt(1,1,1,1)],this._modelSelections=[new gt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ti(document.createElement("textarea")),vf.write(this.textArea,6),this.textArea.setClassName(`inputarea ${Ey}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",C("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ti(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,ls),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,m=null;if(bH.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&p.length<65536){const _=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);_&&(v=_.html,m=_.mode)}return{isFromEmptySelection:f,multicursorText:g,text:p,html:v,mode:m}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const u=this._selections[0];if(Nn&&u.isEmpty()){const f=u.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new Pr(g,g.length,g.length,V.fromPositions(f),0)}const h=500;if(Nn&&!u.isEmpty()&&l.getValueLengthInRange(u,0)0)return new Pr(f,g,g,V.fromPositions(h),0)}return Pr.EMPTY}return HC.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 mot(this.textArea.domNode));this._textAreaInput=this._register(new pot(c,d,Vl,{isAndroid:voe,isChrome:nG,isFirefox:Fc,isSafari:cp})),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!="undefined"?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 m=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),_=m.lastIndexOf(` +`),y=m.substring(_+1),w=y.lastIndexOf(" "),L=y.length-w-1,D=f.getStartPosition(),E=Math.min(D.column-1,L),I=D.column-1-E,k=y.substring(0,y.length-E),{tabSize:R}=this._context.viewModel.model.getOptions(),A=ort(this.textArea.domNode.ownerDocument,k,this._fontInfo,R);return{distanceToModelLineStart:I,widthOfHiddenTextBefore:A}})(),{distanceToModelLineEnd:v}=(()=>{const m=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),_=m.indexOf(` +`),y=_===-1?m:m.substring(0,_),w=y.indexOf(" "),L=w===-1?y.length:y.length-w-1,D=f.getEndPosition(),E=Math.min(this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column-E}})();this._context.viewModel.revealRange("keyboard",!0,V.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new irt(this._context,f.startLineNumber,g,p,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Ey} 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 ${Ey}`),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(gE.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',n=this._context.viewModel.getLineContent(e.lineNumber),o=Vc(t);let r=!0,s=e.column,a=!0,l=e.column,c=0;for(;c<50&&(r||a);){if(r&&s<=1&&(r=!1),r){const d=n.charCodeAt(s-2);o.get(d)!==0?r=!1:s--}if(a&&l>n.length&&(a=!1),a){const d=n.charCodeAt(l-1);o.get(d)!==0?a=!1:l++}c++}return[n.substring(s-1,l-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),n=Vc(this._context.configuration.options.get(129));let o=e.column,r=0;for(;o>1;){const s=t.charCodeAt(o-2);if(n.get(s)!==0||r>50)return t.substring(o-1,e.column-1);r++,o--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const n=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!gr(n.charCodeAt(0)))return n}return""}_getAriaLabel(e){var t,n,o;if(e.get(2)===1){const s=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(n=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||n===void 0?void 0:n.getAriaLabel(),l=(o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||o===void 0?void 0:o.getAriaLabel(),c=C("accessibilityModeOff","The editor is not accessible at this time.");return s?C("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,s):a?C("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?C("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===rh.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const o=e.get(143).wrappingColumn;if(o!==-1&&this._accessibilitySupport!==1){const r=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(o*r.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=s9?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._contentHeight=n.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:o}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${o*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;!gE.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new ae(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 o=this._visibleTextArea.visibleTextareaStart,r=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(s&&a&&o&&r&&r.left>=this._scrollLeft&&o.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+o.left-this._scrollLeft,h=r.left-o.left+1;if(uthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(s.lineNumber),g=f.tokens.findTokenIndexAtOffset(s.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),v=g===p,m=this._visibleTextArea.definePresentation(v?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:(oo.getColorMap()||[])[m.foreground],italic:m.italic,bold:m.bold,underline:m.underline,strikethrough:m.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 n=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(n<0||n>this._contentHeight){this._renderAtTopLeft();return}if(Nn){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const o=(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=o*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:s9?0:1,useCover:!1})}_newlinecount(e){let t=0,n=-1;do{if(n=e.indexOf(` +`,n+1),n===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:s9?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,n=this.textAreaCover;ss(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?ve.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),n.setTop(e.useCover?e.top:0),n.setLeft(e.useCover?e.left:0),n.setWidth(e.useCover?e.width:0),n.setHeight(e.useCover?e.height:0);const o=this._context.configuration.options;o.get(57)?n.setClassName("monaco-editor-background textAreaCover "+ib.OUTER_CLASS_NAME):o.get(67).renderType!==0?n.setClassName("monaco-editor-background textAreaCover "+tT.CLASS_NAME):n.setClassName("monaco-editor-background textAreaCover")}};wH=trt([nrt(3,xi)],wH);function ort(i,e,t,n){if(e.length===0)return 0;const o=i.createElement("div");o.style.position="absolute",o.style.top="-50000px",o.style.width="50000px";const r=i.createElement("span");ss(r,t),r.style.whiteSpace="pre",r.style.tabSize=`${n*t.spaceWidth}px`,r.append(e),o.appendChild(r),i.body.appendChild(o);const s=r.offsetWidth;return i.body.removeChild(o),s}function rrt(i,e,t){let n=0;for(let r=0;r!0,art=()=>!1,lrt=i=>i===" "||i===" ";class U1{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,n,o){var r;this.languageConfigurationService=o,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=n.options,a=s.get(143),l=s.get(50);this.readOnly=s.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(127),this.wordSeparators=s.get(129),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(76),this.multiCursorPaste=s.get(78),this.multiCursorLimit=s.get(79),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),this.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=(r=d==null?void 0:d.blockCommentStartToken)!==null&&r!==void 0?r: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 n of t)this._electricChars[n]=!0}return this._electricChars}onElectricCharacter(e,t,n){const o=s5(t,n-1),r=this.languageConfigurationService.getLanguageConfiguration(o.languageId).electricCharacter;return r?r.onElectricCharacter(e,o,n-o.firstCharOffset):null}normalizeIndentation(e){return hP(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,n){switch(t){case"beforeWhitespace":return lrt;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,n);case"always":return srt;case"never":return art}}_getLanguageDefinedShouldAutoClose(e,t){const n=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return o=>n.indexOf(o)!==-1}visibleColumnFromColumn(e,t){return or.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){const o=or.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),r=e.getLineMinColumn(t);if(os?s:o}}class kn{static fromModelState(e){return new crt(e)}static fromViewState(e){return new drt(e)}static fromModelSelection(e){const t=gt.liftSelection(e),n=new Br(V.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return kn.fromModelState(n)}static fromModelSelections(e){const t=[];for(let n=0,o=e.length;nr,c=o>s,d=os||mo||v0&&o--,j_.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,o)}static columnSelectRight(e,t,n){let o=0;const r=Math.min(n.fromViewLineNumber,n.toViewLineNumber),s=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let l=r;l<=s;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new ae(l,c));o=Math.max(o,d)}let a=n.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-j_e(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const n=t.lineNumber-1;return new ae(n,e.getLineMaxColumn(n))}else return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const o=e.getLineMinColumn(t.lineNumber),r=e.getLineContent(t.lineNumber),s=JD.atomicPosition(r,t.column-1,n,0);if(s!==-1&&s+1>=o)return new ae(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,n){const o=e.stickyTabStops?ii.leftPositionAtomicSoftTabs(t,n,e.tabSize):ii.leftPosition(t,n);return new a9(o.lineNumber,o.column,0)}static moveLeft(e,t,n,o,r){let s,a;if(n.hasSelection()&&!o)s=n.selection.startLineNumber,a=n.selection.startColumn;else{const l=n.position.delta(void 0,-(r-1)),c=t.normalizePosition(ii.clipPositionColumn(l,t),0),d=ii.left(e,t,c);s=d.lineNumber,a=d.column}return n.move(o,s,a,0)}static clipPositionColumn(e,t){return new ae(e.lineNumber,ii.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,n){return en?n:e}static rightPosition(e,t,n){return nd?(n=d,a?o=t.getLineMaxColumn(n):o=Math.min(t.getLineMaxColumn(n),o)):o=e.columnFromVisibleColumn(t,n,c),f?r=0:r=c-or.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize),l!==void 0){const g=new ae(n,o),p=t.normalizePosition(g,l);r=r+(o-p.column),n=p.lineNumber,o=p.column}return new a9(n,o,r)}static down(e,t,n,o,r,s,a){return this.vertical(e,t,n,o,r,n+s,a,4)}static moveDown(e,t,n,o,r){let s,a;n.hasSelection()&&!o?(s=n.selection.endLineNumber,a=n.selection.endColumn):(s=n.position.lineNumber,a=n.position.column);let l=0,c;do if(c=ii.down(e,t,s+l,a,n.leftoverVisibleColumns,r,!0),t.normalizePosition(new ae(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l1&&this._isBlankLine(t,r);)r--;for(;r>1&&!this._isBlankLine(t,r);)r--;return n.move(o,r,t.getLineMinColumn(r),0)}static moveToNextBlankLine(e,t,n,o){const r=t.getLineCount();let s=n.position.lineNumber;for(;s=h.length+1)return!1;const f=h.charAt(u.column-2),g=o.get(f);if(!g)return!1;if(Yp(f)){if(n==="never")return!1}else if(t==="never")return!1;const p=h.charAt(u.column-1);let v=!1;for(const m of g)m.open===f&&m.close===p&&(v=!0);if(!v)return!1;if(e==="auto"){let m=!1;for(let _=0,y=a.length;_1){const r=t.getLineContent(o.lineNumber),s=Ws(r),a=s===-1?r.length+1:s+1;if(o.column<=a){const l=n.visibleColumnFromColumn(t,o),c=or.prevIndentTabStop(l,n.indentSize),d=n.columnFromVisibleColumn(t,o.lineNumber,c);return new V(o.lineNumber,d,o.lineNumber,o.column)}}return V.fromPositions(ob.getPositionAfterDeleteLeft(o,t),o)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const n=xZe(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}else if(e.lineNumber>1){const n=e.lineNumber-1;return new ae(n,t.getLineMaxColumn(n))}else return e}static cut(e,t,n){const o=[];let r=null;n.sort((s,a)=>ae.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=n.length;s1&&(r==null?void 0:r.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 V(d,u,h,f);r=g,g.isEmpty()?o[s]=null:o[s]=new Qr(g,"")}else o[s]=null;else o[s]=new Qr(l,"")}return new Sa(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Qn{static _createWord(e,t,n,o,r){return{start:o,end:r,wordType:t,nextCharClass:n}}static _findPreviousWordOnLine(e,t,n){const o=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(o,e,n)}static _doFindPreviousWordOnLine(e,t,n){let o=0;for(let r=n.column-2;r>=0;r--){const s=e.charCodeAt(r),a=t.get(s);if(a===0){if(o===2)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1));o=1}else if(a===2){if(o===1)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1));o=2}else if(a===1&&o!==0)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1))}return o!==0?this._createWord(e,o,1,0,this._findEndOfWord(e,t,o,0)):null}static _findEndOfWord(e,t,n,o){const r=e.length;for(let s=o;s=0;r--){const s=e.charCodeAt(r),a=t.get(s);if(a===1||n===1&&a===2||n===2&&a===0)return r+1}return 0}static moveWordLeft(e,t,n,o){let r=n.lineNumber,s=n.column;s===1&&r>1&&(r=r-1,s=t.getLineMaxColumn(r));let a=Qn._findPreviousWordOnLine(e,t,new ae(r,s));if(o===0)return new ae(r,a?a.start+1:1);if(o===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1))),new ae(r,a?a.start+1:1);if(o===3){for(;a&&a.wordType===2;)a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1));return new ae(r,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1))),new ae(r,a?a.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===1)return n>1?new ae(n-1,e.getLineMaxColumn(n-1)):t;const r=e.getLineContent(n);for(let s=t.column-1;s>1;s--){const a=r.charCodeAt(s-2),l=r.charCodeAt(s-1);if(a===95&&l!==95)return new ae(n,s);if(a===45&&l!==45)return new ae(n,s);if((wm(a)||o2(a))&&kh(l))return new ae(n,s);if(kh(a)&&kh(l)&&s+1=l.start+1&&(l=Qn._findNextWordOnLine(e,t,new ae(r,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(r);return new ae(r,s)}static _moveWordPartRight(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===o)return n1?c=1:(l--,c=o.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=Qn._findPreviousWordOnLine(n,o,new ae(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=o.getLineMaxColumn(l))),new V(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;const o=new ae(n.positionLineNumber,n.positionColumn),r=this._deleteInsideWordWhitespace(t,o);return r||this._deleteInsideWordDetermineDeleteRange(e,t,o)}static _charAtIsWhitespace(e,t){const n=e.charCodeAt(t);return n===32||n===9}static _deleteInsideWordWhitespace(e,t){const n=e.getLineContent(t.lineNumber),o=n.length;if(o===0)return null;let r=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,r))return null;let s=Math.min(t.column-1,o-1);if(!this._charAtIsWhitespace(n,s))return null;for(;r>0&&this._charAtIsWhitespace(n,r-1);)r--;for(;s+11?new V(n.lineNumber-1,t.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumberu.start+1<=n.column&&n.column<=u.end+1,a=(u,h)=>(u=Math.min(u,n.column),h=Math.max(h,n.column),new V(n.lineNumber,u,n.lineNumber,h)),l=u=>{let h=u.start+1,f=u.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(o,h-2);)h--;return a(h,f)},c=Qn._findPreviousWordOnLine(e,t,n);if(c&&s(c))return l(c);const d=Qn._findNextWordOnLine(e,t,n);return d&&s(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,r+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),o=Qn._moveWordPartLeft(e,n);return new V(n.lineNumber,n.column,o.lineNumber,o.column)}static _findFirstNonWhitespaceChar(e,t){const n=e.length;for(let o=t;o=h.start+1&&(h=Qn._findNextWordOnLine(n,o,new ae(l,h.end+1))),h?c=h.start+1:cBoolean(e))}class Mr{static addCursorDown(e,t,n){const o=[];let r=0;for(let s=0,a=t.length;sc&&(d=c,u=e.model.getLineMaxColumn(d)),kn.fromModelState(new Br(new V(s.lineNumber,1,d,u),2,0,new ae(d,u),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,u=1;return d>c&&(d=c,u=e.getLineMaxColumn(d)),kn.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return kn.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,n,o){const r=e.model.validatePosition(o);return kn.fromModelState(Qn.word(e.cursorConfig,e.model,t.modelState,n,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new kn(t.modelState,t.viewState);const n=t.viewState.position.lineNumber,o=t.viewState.position.column;return kn.fromViewState(new Br(new V(n,o,n,o),0,0,new ae(n,o),0))}static moveTo(e,t,n,o,r){if(n){if(t.modelState.selectionStartKind===1)return this.word(e,t,n,o);if(t.modelState.selectionStartKind===2)return this.line(e,t,n,o,r)}const s=e.model.validatePosition(o),a=r?e.coordinatesConverter.validateViewPosition(new ae(r.lineNumber,r.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return kn.fromViewState(t.viewState.move(n,a.lineNumber,a.column,0))}static simpleMove(e,t,n,o,r,s){switch(n){case 0:return s===4?this._moveHalfLineLeft(e,t,o):this._moveLeft(e,t,o,r);case 1:return s===4?this._moveHalfLineRight(e,t,o):this._moveRight(e,t,o,r);case 2:return s===2?this._moveUpByViewLines(e,t,o,r):this._moveUpByModelLines(e,t,o,r);case 3:return s===2?this._moveDownByViewLines(e,t,o,r):this._moveDownByModelLines(e,t,o,r);case 4:return s===2?t.map(a=>kn.fromViewState(ii.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>kn.fromModelState(ii.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 5:return s===2?t.map(a=>kn.fromViewState(ii.moveToNextBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>kn.fromModelState(ii.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 6:return this._moveToViewMinColumn(e,t,o);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,o);case 8:return this._moveToViewCenterColumn(e,t,o);case 9:return this._moveToViewMaxColumn(e,t,o);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,o);default:return null}}static viewportMove(e,t,n,o,r){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(n){case 11:{const l=this._firstLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;cn.endLineNumber-1?s=n.endLineNumber-1:rkn.fromViewState(ii.moveLeft(e.cursorConfig,e,r.viewState,n,o)))}static _moveHalfLineLeft(e,t,n){const o=[];for(let r=0,s=t.length;rkn.fromViewState(ii.moveRight(e.cursorConfig,e,r.viewState,n,o)))}static _moveHalfLineRight(e,t,n){const o=[];for(let r=0,s=t.length;r1&&o.firstCharOffset===0){const p=Cy(e,t.startLineNumber-1);p.languageId===o.languageId&&(c=p.getLineContent())}const d=r.onEnter(i,c,a,l);if(!d)return null;const u=d.indentAction;let h=d.appendText;const f=d.removeText||0;h?u===Ho.Indent&&(h=" "+h):u===Ho.Indent||u===Ho.IndentOutdent?h=" ":h="";let g=W0e(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:u,appendText:h,removeText:f,indentation:g}}var drt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},urt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fM;const a9=Object.create(null);function __(i,e){if(e<=0)return"";a9[i]||(a9[i]=["",i]);const t=a9[i];for(let n=t.length;n<=e;n++)t[n]=t[n-1]+i;return t[e]}let Ec=fM=class{static unshiftIndent(e,t,n,o,r){const s=or.visibleColumnFromColumn(e,t,n);if(r){const a=__(" ",o),c=or.prevIndentTabStop(s,o)/o;return __(a,c)}else{const a=" ",c=or.prevRenderTabStop(s,n)/n;return __(a,c)}}static shiftIndent(e,t,n,o,r){const s=or.visibleColumnFromColumn(e,t,n);if(r){const a=__(" ",o),c=or.nextIndentTabStop(s,o)/o;return __(a,c)}else{const a=" ",c=or.nextRenderTabStop(s,n)/n;return __(a,c)}}constructor(e,t,n){this._languageConfigurationService=n,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){const n=this._selection.startLineNumber;let o=this._selection.endLineNumber;this._selection.endColumn===1&&n!==o&&(o=o-1);const{tabSize:r,indentSize:s,insertSpaces:a}=this._opts,l=n===o;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let u=n;u<=o;u++,c=d){d=0;const h=e.getLineContent(u);let f=Ws(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&&or.visibleColumnFromColumn(h,f+1,r)%s!==0&&e.tokenization.isCheapToTokenize(u-1)){const v=Dy(this._opts.autoIndent,e,new V(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(v){if(d=c,v.appendText)for(let m=0,_=v.appendText.length;m<_&&d1){let o,r=-1;for(o=e-1;o>=1;o--){if(i.tokenization.getLanguageIdAtPosition(o,0)!==n)return r;const s=i.getLineContent(o);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){r=o;continue}return o}}return-1}function C5(i,e,t,n=!0,o){if(i<4)return null;const r=o.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!r)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 s=grt(e,t,r);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(r.shouldIncrease(a)||r.shouldIndentNextLine(a))return{indentation:Si(a),action:Ho.Indent,line:s};if(r.shouldDecrease(a))return{indentation:Si(a),action:null,line:s};{if(s===1)return{indentation:Si(e.getLineContent(s)),action:null,line:s};const l=s-1,c=r.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let u=l-1;u>0;u--)if(!r.shouldIndentNextLine(e.getLineContent(u))){d=u;break}return{indentation:Si(e.getLineContent(d+1)),action:null,line:d+1}}if(n)return{indentation:Si(e.getLineContent(s)),action:null,line:s};for(let d=s;d>0;d--){const u=e.getLineContent(d);if(r.shouldIncrease(u))return{indentation:Si(u),action:Ho.Indent,line:d};if(r.shouldIndentNextLine(u)){let h=0;for(let f=d-1;f>0;f--)if(!r.shouldIndentNextLine(e.getLineContent(d))){h=f;break}return{indentation:Si(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(u))return{indentation:Si(u),action:null,line:d}}return{indentation:Si(e.getLineContent(1)),action:null,line:1}}}function pE(i,e,t,n,o,r){if(i<4)return null;const s=r.getLanguageConfiguration(t);if(!s)return null;const a=r.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=C5(i,e,n,void 0,r),c=e.getLineContent(n);if(l){const d=l.line;if(d!==void 0){let u=!0;for(let h=d;h0&&r.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=r.getLineContent().substring(0,t.startColumn-1);let d;t.isEmpty()?d=a.substr(t.startColumn-1-s.firstCharOffset):d=Cy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const u=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!u)return null;const h=c,f=Si(c),g={tokenization:{getLineTokens:_=>e.tokenization.getLineTokens(_),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(_,y)=>e.getLanguageIdAtPosition(_,y)},getLineContent:_=>_===t.startLineNumber?h:e.getLineContent(_)},p=Si(r.getLineContent()),v=C5(i,g,t.startLineNumber+1,void 0,o);if(!v){const _=l?p:f;return{beforeEnter:_,afterEnter:_}}let m=l?p:v.indentation;return v.action===Ho.Indent&&(m=n.shiftIndent(m)),u.shouldDecrease(d)&&(m=n.unshiftIndent(m)),{beforeEnter:l?p:f,afterEnter:m}}function mrt(i,e,t,n,o,r){if(i<4)return null;const s=Cy(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let d;if(t.isEmpty()?d=l.substr(t.startColumn-1-s.firstCharOffset):d=Cy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+d)&&a.shouldDecrease(c+n+d)){const u=C5(i,e,t.startLineNumber,!1,r);if(!u)return null;let h=u.indentation;return u.action!==Ho.Indent&&(h=o.unshiftIndent(h)),h}return null}function Nbe(i,e,t){const n=t.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;return!n||e<1||e>i.getLineCount()?null:n.getIndentMetadata(i.getLineContent(e))}class eo{static indent(e,t,n){if(t===null||n===null)return[];const o=[];for(let r=0,s=n.length;r1){let a;for(a=n-1;a>=1;a--){const d=t.getLineContent(a);if(Wu(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=Dy(e.autoIndent,t,new V(a,l,a,l),e.languageConfigurationService);c&&(r=c.indentation+c.appendText)}return o&&(o===Ho.Indent&&(r=eo.shiftIndent(e,r)),o===Ho.Outdent&&(r=eo.unshiftIndent(e,r)),r=e.normalizeIndentation(r)),r||null}static _replaceJumpToNextIndent(e,t,n,o){let r="";const s=n.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let d=0;dthis._compositionType(n,d,r,s,a,l));return new Sa(4,c,{shouldPushStackElementBefore:b2(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,n,o,r,s){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-o),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+r),d=new V(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===n&&s===0?null:new hM(d,n,0,s)}static _typeCommand(e,t,n){return n?new v2(e,t,!0):new Qr(e,t,!0)}static _enter(e,t,n,o){if(e.autoIndent===0)return eo._typeCommand(o,` + `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},i.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},i.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(n){if(!n.to)return null;let o;switch(n.to){case i.RawDirection.Left:o=0;break;case i.RawDirection.Right:o=1;break;case i.RawDirection.Up:o=2;break;case i.RawDirection.Down:o=3;break;case i.RawDirection.PrevBlankLine:o=4;break;case i.RawDirection.NextBlankLine:o=5;break;case i.RawDirection.WrappedLineStart:o=6;break;case i.RawDirection.WrappedLineFirstNonWhitespaceCharacter:o=7;break;case i.RawDirection.WrappedLineColumnCenter:o=8;break;case i.RawDirection.WrappedLineEnd:o=9;break;case i.RawDirection.WrappedLineLastNonWhitespaceCharacter:o=10;break;case i.RawDirection.ViewPortTop:o=11;break;case i.RawDirection.ViewPortBottom:o=13;break;case i.RawDirection.ViewPortCenter:o=12;break;case i.RawDirection.ViewPortIfOutside:o=14;break;default:return null}let r=0;switch(n.by){case i.RawUnit.Line:r=1;break;case i.RawUnit.WrappedLine:r=2;break;case i.RawUnit.Character:r=3;break;case i.RawUnit.HalfLine:r=4;break}return{direction:o,unit:r,select:!!n.select,value:n.value||1}}i.parse=t})(fP||(fP={}));function Dy(i,e,t,n){const o=Cy(e,t.startLineNumber,t.startColumn),r=n.getLanguageConfiguration(o.languageId);if(!r)return null;const s=o.getLineContent(),a=s.substr(0,t.startColumn-1-o.firstCharOffset);let l;t.isEmpty()?l=s.substr(t.startColumn-1-o.firstCharOffset):l=Cy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-o.firstCharOffset);let c="";if(t.startLineNumber>1&&o.firstCharOffset===0){const p=Cy(e,t.startLineNumber-1);p.languageId===o.languageId&&(c=p.getLineContent())}const d=r.onEnter(i,c,a,l);if(!d)return null;const u=d.indentAction;let h=d.appendText;const f=d.removeText||0;h?u===Ho.Indent&&(h=" "+h):u===Ho.Indent||u===Ho.IndentOutdent?h=" ":h="";let g=W0e(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:u,appendText:h,removeText:f,indentation:g}}var hrt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},frt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fM;const l9=Object.create(null);function __(i,e){if(e<=0)return"";l9[i]||(l9[i]=["",i]);const t=l9[i];for(let n=t.length;n<=e;n++)t[n]=t[n-1]+i;return t[e]}let Ec=fM=class{static unshiftIndent(e,t,n,o,r){const s=or.visibleColumnFromColumn(e,t,n);if(r){const a=__(" ",o),c=or.prevIndentTabStop(s,o)/o;return __(a,c)}else{const a=" ",c=or.prevRenderTabStop(s,n)/n;return __(a,c)}}static shiftIndent(e,t,n,o,r){const s=or.visibleColumnFromColumn(e,t,n);if(r){const a=__(" ",o),c=or.nextIndentTabStop(s,o)/o;return __(a,c)}else{const a=" ",c=or.nextRenderTabStop(s,n)/n;return __(a,c)}}constructor(e,t,n){this._languageConfigurationService=n,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){const n=this._selection.startLineNumber;let o=this._selection.endLineNumber;this._selection.endColumn===1&&n!==o&&(o=o-1);const{tabSize:r,indentSize:s,insertSpaces:a}=this._opts,l=n===o;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let u=n;u<=o;u++,c=d){d=0;const h=e.getLineContent(u);let f=Ws(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&&or.visibleColumnFromColumn(h,f+1,r)%s!==0&&e.tokenization.isCheapToTokenize(u-1)){const v=Dy(this._opts.autoIndent,e,new V(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(v){if(d=c,v.appendText)for(let m=0,_=v.appendText.length;m<_&&d1){let o,r=-1;for(o=e-1;o>=1;o--){if(i.tokenization.getLanguageIdAtPosition(o,0)!==n)return r;const s=i.getLineContent(o);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){r=o;continue}return o}}return-1}function y5(i,e,t,n=!0,o){if(i<4)return null;const r=o.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!r)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 s=mrt(e,t,r);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(r.shouldIncrease(a)||r.shouldIndentNextLine(a))return{indentation:Si(a),action:Ho.Indent,line:s};if(r.shouldDecrease(a))return{indentation:Si(a),action:null,line:s};{if(s===1)return{indentation:Si(e.getLineContent(s)),action:null,line:s};const l=s-1,c=r.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let u=l-1;u>0;u--)if(!r.shouldIndentNextLine(e.getLineContent(u))){d=u;break}return{indentation:Si(e.getLineContent(d+1)),action:null,line:d+1}}if(n)return{indentation:Si(e.getLineContent(s)),action:null,line:s};for(let d=s;d>0;d--){const u=e.getLineContent(d);if(r.shouldIncrease(u))return{indentation:Si(u),action:Ho.Indent,line:d};if(r.shouldIndentNextLine(u)){let h=0;for(let f=d-1;f>0;f--)if(!r.shouldIndentNextLine(e.getLineContent(d))){h=f;break}return{indentation:Si(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(u))return{indentation:Si(u),action:null,line:d}}return{indentation:Si(e.getLineContent(1)),action:null,line:1}}}function pE(i,e,t,n,o,r){if(i<4)return null;const s=r.getLanguageConfiguration(t);if(!s)return null;const a=r.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=y5(i,e,n,void 0,r),c=e.getLineContent(n);if(l){const d=l.line;if(d!==void 0){let u=!0;for(let h=d;h0&&r.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=r.getLineContent().substring(0,t.startColumn-1);let d;t.isEmpty()?d=a.substr(t.startColumn-1-s.firstCharOffset):d=Cy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const u=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!u)return null;const h=c,f=Si(c),g={tokenization:{getLineTokens:_=>e.tokenization.getLineTokens(_),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(_,y)=>e.getLanguageIdAtPosition(_,y)},getLineContent:_=>_===t.startLineNumber?h:e.getLineContent(_)},p=Si(r.getLineContent()),v=y5(i,g,t.startLineNumber+1,void 0,o);if(!v){const _=l?p:f;return{beforeEnter:_,afterEnter:_}}let m=l?p:v.indentation;return v.action===Ho.Indent&&(m=n.shiftIndent(m)),u.shouldDecrease(d)&&(m=n.unshiftIndent(m)),{beforeEnter:l?p:f,afterEnter:m}}function _rt(i,e,t,n,o,r){if(i<4)return null;const s=Cy(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let d;if(t.isEmpty()?d=l.substr(t.startColumn-1-s.firstCharOffset):d=Cy(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+d)&&a.shouldDecrease(c+n+d)){const u=y5(i,e,t.startLineNumber,!1,r);if(!u)return null;let h=u.indentation;return u.action!==Ho.Indent&&(h=o.unshiftIndent(h)),h}return null}function Nbe(i,e,t){const n=t.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;return!n||e<1||e>i.getLineCount()?null:n.getIndentMetadata(i.getLineContent(e))}class eo{static indent(e,t,n){if(t===null||n===null)return[];const o=[];for(let r=0,s=n.length;r1){let a;for(a=n-1;a>=1;a--){const d=t.getLineContent(a);if(Wu(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=Dy(e.autoIndent,t,new V(a,l,a,l),e.languageConfigurationService);c&&(r=c.indentation+c.appendText)}return o&&(o===Ho.Indent&&(r=eo.shiftIndent(e,r)),o===Ho.Outdent&&(r=eo.unshiftIndent(e,r)),r=e.normalizeIndentation(r)),r||null}static _replaceJumpToNextIndent(e,t,n,o){let r="";const s=n.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let d=0;dthis._compositionType(n,d,r,s,a,l));return new Sa(4,c,{shouldPushStackElementBefore:b2(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,n,o,r,s){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-o),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+r),d=new V(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===n&&s===0?null:new hM(d,n,0,s)}static _typeCommand(e,t,n){return n?new v2(e,t,!0):new Qr(e,t,!0)}static _enter(e,t,n,o){if(e.autoIndent===0)return eo._typeCommand(o,` `,n);if(!t.tokenization.isCheapToTokenize(o.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(o.startLineNumber),c=Si(l).substring(0,o.startColumn-1);return eo._typeCommand(o,` `+e.normalizeIndentation(c),n)}const r=Dy(e.autoIndent,t,o,e.languageConfigurationService);if(r){if(r.indentAction===Ho.None)return eo._typeCommand(o,` `+e.normalizeIndentation(r.indentation+r.appendText),n);if(r.indentAction===Ho.Indent)return eo._typeCommand(o,` `+e.normalizeIndentation(r.indentation+r.appendText),n);if(r.indentAction===Ho.IndentOutdent){const l=e.normalizeIndentation(r.indentation),c=e.normalizeIndentation(r.indentation+r.appendText),d=` `+c+` `+l;return n?new v2(o,d,!0):new hM(o,d,-1,c.length-l.length,!0)}else if(r.indentAction===Ho.Outdent){const l=eo.unshiftIndent(e,r.indentation);return eo._typeCommand(o,` -`+e.normalizeIndentation(l+r.appendText),n)}}const s=t.getLineContent(o.startLineNumber),a=Si(s).substring(0,o.startColumn-1);if(e.autoIndent>=4){const l=prt(e.autoIndent,t,o,{unshiftIndent:c=>eo.unshiftIndent(e,c),shiftIndent:c=>eo.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,o.getEndPosition());const d=o.endColumn,u=t.getLineContent(o.endLineNumber),h=Ws(u);if(h>=0?o=o.setEndPosition(o.endLineNumber,Math.max(o.endColumn,h+1)):o=o.setEndPosition(o.endLineNumber,t.getLineMaxColumn(o.endLineNumber)),n)return new v2(o,` +`+e.normalizeIndentation(l+r.appendText),n)}}const s=t.getLineContent(o.startLineNumber),a=Si(s).substring(0,o.startColumn-1);if(e.autoIndent>=4){const l=vrt(e.autoIndent,t,o,{unshiftIndent:c=>eo.unshiftIndent(e,c),shiftIndent:c=>eo.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,o.getEndPosition());const d=o.endColumn,u=t.getLineContent(o.endLineNumber),h=Ws(u);if(h>=0?o=o.setEndPosition(o.endLineNumber,Math.max(o.endColumn,h+1)):o=o.setEndPosition(o.endLineNumber,t.getLineMaxColumn(o.endLineNumber)),n)return new v2(o,` `+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 hM(o,` `+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return eo._typeCommand(o,` -`+e.normalizeIndentation(a),n)}static _isAutoIndentType(e,t,n){if(e.autoIndent<4)return!1;for(let o=0,r=n.length;oeo.shiftIndent(e,a),unshiftIndent:a=>eo.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(r)){const a=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);return a===0?eo._typeCommand(new V(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+o,!1):eo._typeCommand(new V(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+t.getLineContent(n.startLineNumber).substring(a-1,n.startColumn-1)+o,!1)}return null}static _isAutoClosingOvertype(e,t,n,o,r){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(r))return!1;for(let s=0,a=n.length;s2?d.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,v=o.length;pt.startsWith(l.open)),a=r.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,n,o){const r=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(o);if(!r)return null;let s=null;for(const a of r)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of n)if(t.getValueInRange(new V(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+o!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const n=t.close.charAt(t.close.length-1),o=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[];let r=null;for(const s of o)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!r||s.open.length>r.open.length)&&(r=s);return r}static _getAutoClosingPairClose(e,t,n,o,r){for(const g of n)if(!g.isEmpty())return null;const s=n.map(g=>{const p=g.getPosition();return r?{lineNumber:p.lineNumber,beforeColumn:p.column-o.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(g=>new ae(g.lineNumber,g.beforeColumn)),o);if(!a)return null;let l,c;if(Xp(o)?(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 s){const{lineNumber:p,beforeColumn:v,afterColumn:m}=g,_=t.getLineContent(p),y=_.substring(0,v-1),w=_.substring(m-1);if(w.startsWith(h)||(f=!1),w.length>0){const I=w.charAt(0);if(!eo._isBeforeClosingBrace(e,w)&&!c(I))return null}if(a.open.length===1&&(o==="'"||o==='"')&&l!=="always"){const I=Vc(e.wordSeparators);if(y.length>0){const k=y.charCodeAt(y.length-1);if(I.get(k)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const L=t.tokenization.getLineTokens(p),D=r5(L,v-1);if(!a.shouldAutoClose(D,v-D.firstCharOffset))return null;const E=a.findNeutralCharacter();if(E){const I=t.tokenization.getTokenTypeIfInsertingCharacter(p,v,E);if(!a.isOK(I))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,n,o,r,s,a){const l=[];for(let c=0,d=o.length;cnew Qr(new V(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Sa(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,n,r,l,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,n,r,l,!0,d):null}static typeWithInterceptors(e,t,n,o,r,s,a){if(!e&&a===` -`){const d=[];for(let u=0,h=r.length;u{const o=t.get(Jn).getFocusedCodeEditor();return o&&o.hasTextFocus()?this._runEditorCommand(t,o,n):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,n)=>{const o=Nd();return o&&["input","textarea"].indexOf(o.tagName.toLowerCase())>=0?(this.runDOMCommand(o),!0):!1}),e.addImplementation(0,"generic-dom",(t,n)=>{const o=t.get(Jn).getActiveCodeEditor();return o?(o.focus(),this._runEditorCommand(t,o,n)):!1})}_runEditorCommand(e,t,n){const o=this.runEditorCommand(e,t,n);return o||!0}}var Cr;(function(i){class e extends ho{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,y){if(!y.position)return;_.model.pushStackElement(),_.setCursorStates(y.source,3,[Mr.moveTo(_,_.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&_.revealPrimaryCursor(y.source,!0,!0)}}i.MoveTo=Ye(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),i.MoveToSelect=Ye(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ho{runCoreEditorCommand(_,y){_.model.pushStackElement();const w=this._getColumnSelectResult(_,_.getPrimaryCursorState(),_.getCursorColumnSelectData(),y);w!==null&&(_.setCursorStates(y.source,3,w.viewStates.map(L=>kn.fromViewState(L))),_.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?_.revealTopMostCursor(y.source):_.revealBottomMostCursor(y.source))}}i.ColumnSelect=Ye(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(m,_,y,w){if(typeof w.position=="undefined"||typeof w.viewPosition=="undefined"||typeof w.mouseColumn=="undefined")return null;const L=m.model.validatePosition(w.position),D=m.coordinatesConverter.validateViewPosition(new ae(w.viewPosition.lineNumber,w.viewPosition.column),L),E=w.doColumnSelect?y.fromViewLineNumber:D.lineNumber,I=w.doColumnSelect?y.fromViewVisualColumn:w.mouseColumn-1;return j_.columnSelect(m.cursorConfig,m,E,I,D.lineNumber,w.mouseColumn-1)}}),i.CursorColumnSelectLeft=Ye(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,w){return j_.columnSelectLeft(m.cursorConfig,m,y)}}),i.CursorColumnSelectRight=Ye(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,w){return j_.columnSelectRight(m.cursorConfig,m,y)}});class n extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,w,L){return j_.columnSelectUp(_.cursorConfig,_,w,this._isPaged)}}i.CursorColumnSelectUp=Ye(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3600,linux:{primary:0}}})),i.CursorColumnSelectPageUp=Ye(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,w,L){return j_.columnSelectDown(_.cursorConfig,_,w,this._isPaged)}}i.CursorColumnSelectDown=Ye(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3602,linux:{primary:0}}})),i.CursorColumnSelectPageDown=Ye(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends ho{constructor(){super({id:"cursorMove",precondition:void 0,description:fP.description})}runCoreEditorCommand(_,y){const w=fP.parse(y);!w||this._runCursorMove(_,y.source,w)}_runCursorMove(_,y,w){_.model.pushStackElement(),_.setCursorStates(y,3,r._move(_,_.getCursorStates(),w)),_.revealPrimaryCursor(y,!0)}static _move(_,y,w){const L=w.select,D=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 Mr.simpleMove(_,y,w.direction,L,D,w.unit);case 11:case 13:case 12:case 14:return Mr.viewportMove(_,y,w.direction,L,D);default:return null}}}i.CursorMoveImpl=r,i.CursorMove=Ye(new r);class s extends ho{constructor(_){super(_),this._staticArgs=_.args}runCoreEditorCommand(_,y){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||_.cursorConfig.pageSize}),_.model.pushStackElement(),_.setCursorStates(y.source,3,Mr.simpleMove(_,_.getCursorStates(),w.direction,w.select,w.value,w.unit)),_.revealPrimaryCursor(y.source,!0)}}i.CursorLeft=Ye(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),i.CursorLeftSelect=Ye(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1039}})),i.CursorRight=Ye(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),i.CursorRightSelect=Ye(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1041}})),i.CursorUp=Ye(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),i.CursorUpSelect=Ye(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),i.CursorPageUp=Ye(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:11}})),i.CursorPageUpSelect=Ye(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1035}})),i.CursorDown=Ye(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),i.CursorDownSelect=Ye(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),i.CursorPageDown=Ye(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:12}})),i.CursorPageDownSelect=Ye(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1036}})),i.CreateCursor=Ye(new class extends ho{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(m,_){if(!_.position)return;let y;_.wholeLine?y=Mr.line(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition):y=Mr.moveTo(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition);const w=m.getCursorStates();if(w.length>1){const L=y.modelState?y.modelState.position:null,D=y.viewState?y.viewState.position:null;for(let E=0,I=w.length;ED&&(L=D);const E=new V(L,1,L,m.model.getLineMaxColumn(L));let I=0;if(y.at)switch(y.at){case $C.RawAtArgument.Top:I=3;break;case $C.RawAtArgument.Center:I=1;break;case $C.RawAtArgument.Bottom:I=4;break}const k=m.coordinatesConverter.convertModelRangeToViewRange(E);m.revealRange(_.source,!1,k,I,0)}}),i.SelectAll=new class extends wH{constructor(){super(nJe)}runDOMCommand(m){Fc&&(m.focus(),m.select()),m.ownerDocument.execCommand("selectAll")}runEditorCommand(m,_,y){const w=_._getViewModel();!w||this.runCoreEditorCommand(w,y)}runCoreEditorCommand(m,_){m.model.pushStackElement(),m.setCursorStates("keyboard",3,[Mr.selectAll(m,m.getPrimaryCursorState())])}},i.SetSelection=Ye(new class extends ho{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(m,_){!_.selection||(m.model.pushStackElement(),m.setCursorStates(_.source,3,[kn.fromModelSelection(_.selection)]))}})})(Cr||(Cr={}));const _rt=Me.and(Q.textInputFocus,Q.columnSelection);function xS(i,e){Va.registerKeybindingRule({id:i,primary:e,when:_rt,weight:Yn+1})}xS(Cr.CursorColumnSelectLeft.id,1039);xS(Cr.CursorColumnSelectRight.id,1041);xS(Cr.CursorColumnSelectUp.id,1040);xS(Cr.CursorColumnSelectPageUp.id,1035);xS(Cr.CursorColumnSelectDown.id,1042);xS(Cr.CursorColumnSelectPageDown.id,1036);function Ure(i){return i.register(),i}var ky;(function(i){class e extends Ir{runEditorCommand(n,o,r){const s=o._getViewModel();!s||this.runCoreEditingCommand(o,s,r||{})}}i.CoreEditingCommand=e,i.LineBreakInsert=Ye(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.lineBreakInsert(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection)))}}),i.Outdent=Ye(new class extends e{constructor(){super({id:"outdent",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Me.and(Q.editorTextFocus,Q.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.outdent(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),i.Tab=Ye(new class extends e{constructor(){super({id:"tab",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Me.and(Q.editorTextFocus,Q.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.tab(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),i.DeleteLeft=Ye(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,n,o){const[r,s]=ob.deleteLeft(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection),n.getCursorAutoClosedCharacters());r&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(2)}}),i.DeleteRight=Ye(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,n,o){const[r,s]=ob.deleteRight(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection));r&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(3)}}),i.Undo=new class extends wH{constructor(){super(S0e)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,n,o){if(!(!n.hasModel()||n.getOption(90)===!0))return n.getModel().undo()}},i.Redo=new class extends wH{constructor(){super(x0e)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,n,o){if(!(!n.hasModel()||n.getOption(90)===!0))return n.getModel().redo()}}})(ky||(ky={}));class jre extends t5{constructor(e,t,n){super({id:e,precondition:void 0,description:n}),this._handlerId=t}runCommand(e,t){const n=e.get(Jn).getFocusedCodeEditor();!n||n.trigger("keyboard",this._handlerId,t)}}function Ub(i,e){Ure(new jre("default:"+i,i)),Ure(new jre(i,i,e))}Ub("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Ub("replacePreviousChar");Ub("compositionType");Ub("compositionStart");Ub("compositionEnd");Ub("paste");Ub("cut");class brt{constructor(e,t,n,o){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=o}paste(e,t,n,o){this.commandDelegate.paste(e,t,n,o)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,o){this.commandDelegate.compositionType(e,t,n,o)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Cr.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):o?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){Cr.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Cr.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),Cr.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),Cr.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Cr.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Cr.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Cr.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Cr.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Cr.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Cr.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Cr.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Cr.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Cr.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 y5{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 y5.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const n=Object.assign({},e);return n.position&&(n.position=t.convertViewPositionToModelPosition(n.position)),n.range&&(n.range=t.convertViewRangeToModelRange(n.range)),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}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 ae(e.afterLineNumber,1)).lineNumber}}}class Mbe{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 Vo("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const n=this.getStartLineNumber(),o=this.getEndLineNumber();if(to)return null;let r=0,s=0;for(let l=n;l<=o;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(r=c,s=1):s++)}if(e=o&&a<=r&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const n=t-e+1,o=this.getStartLineNumber(),r=this.getEndLineNumber();if(e<=o)return this._rendLineNumberStart+=n,null;if(e>r)return null;if(n+e>r)return this._lines.splice(e-this._rendLineNumberStart,r-e+1);const s=[];for(let u=0;un)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(n,a.toLineNumber);for(let d=l;d<=c;d++){const u=d-this._rendLineNumberStart;this._lines[u].onTokensChanged(),o=!0}}return o}}class Abe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Mbe(()=>this._host.createVisibleLine())}_createDomNode(){const e=ti(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 n=0,o=t.length;nt){const s=t,a=Math.min(n,r.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(r,s,a,o,t),r.linesLength+=a-s+1)}else if(r.rendLineNumberStart0&&(this._removeLinesBefore(r,s),r.linesLength-=s)}if(r.rendLineNumberStart=t,r.rendLineNumberStart+r.linesLength-1n){const s=Math.max(0,n-r.rendLineNumberStart+1),l=r.linesLength-1-s+1;l>0&&(this._removeLinesAfter(r,l),r.linesLength-=l)}return this._finishRendering(r,!1,o),r}_renderUntouchedLines(e,t,n,o,r){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=n;l++){const c=s+l;a[l].layoutLine(c,o[c-r])}}_insertLinesBefore(e,t,n,o,r){const s=[];let a=0;for(let l=t;l<=n;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n=0;a--){const l=e.lines[a];o[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,n){const o=document.createElement("div");Dg._ttPolicy&&(t=Dg._ttPolicy.createHTML(t)),o.innerHTML=t;for(let r=0;ri});Dg._sb=new yS(1e5);class Pbe extends pl{constructor(e){super(e),this._visibleLines=new Abe(this),this.domNode=this._visibleLines.domNode;const n=this._context.configuration.options.get(50);ss(this.domNode,n),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;en.shouldRender());for(let n=0,o=t.length;n'),o.appendString(r),o.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class yrt extends Pbe{constructor(e){super(e);const n=this._context.configuration.options.get(143);this._contentWidth=n.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._contentWidth=n.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 wrt extends Pbe{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._contentLeft=n.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),ss(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;ss(this.domNode,t.get(50));const n=t.get(143);return this._contentLeft=n.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 Srt extends pl{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ti(document.createElement("div")),vf.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ti(document.createElement("div")),vf.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].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 xrt(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,n,o,r){this._widgets[e.getId()].setPosition(t,n,o,r),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t];delete this._widgets[t];const o=n.domNode.domNode;o.parentNode.removeChild(o),o.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 n of t)this._widgets[n].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].render(e)}}class xrt{constructor(e,t,n){this._primaryAnchor=new Vx(null,null),this._secondaryAnchor=new Vx(null,null),this._context=e,this._viewDomNode=t,this._actual=n,this.domNode=ti(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const o=this._context.configuration.options,r=o.get(143);this._fixedOverflowWidgets=o.get(42),this._contentWidth=r.contentWidth,this._contentLeft=r.contentLeft,this._lineHeight=o.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 n=t.get(143);this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,n){this._affinity=e,this._primaryAnchor=o(t,this._context.viewModel,this._affinity),this._secondaryAnchor=o(n,this._context.viewModel,this._affinity);function o(r,s,a){if(!r)return new Vx(null,null);const l=s.model.validatePosition(r);if(s.coordinatesConverter.modelPositionIsVisible(l)){const c=s.coordinatesConverter.convertModelPositionToViewPosition(l,a!=null?a:void 0);return new Vx(r,c)}return new Vx(r,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,n,o){this._setPosition(o,e,t),this._preference=n,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,n,o){const r=e.top,s=r,a=e.top+e.height,l=o.viewportHeight-a,c=r-n,d=s>=n,u=a,h=l>=n;let f=e.left;return f+t>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-t),fc){const f=h-(c-o);h-=f,n-=f}if(h=m,w=f+n<=g.height-_;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,m),fitsBelow:w,belowTop:f,left:v}:{fitsAbove:y,aboveTop:a,fitsBelow:w,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Hx(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,n;const o=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),r=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((n=this._primaryAnchor.viewPosition)===null||n===void 0?void 0:n.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(r,this._affinity,this._lineHeight);return{primary:o,secondary:s};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 Kre(f,h,d)}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;const o=this._context.configuration.options.get(50);let r=t.left;return re.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"&&c9(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"&&c9(this._actual.afterRender,this._actual,this._renderData.position)}}class Vx{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class Hx{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class Kre{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}}function c9(i,e,...t){try{return i.call(e,...t)}catch{return null}}class Obe extends zb{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new gt(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(o=>o.positionLineNumber);t.sort((o,r)=>o-r),Lo(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const n=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=n.contentLeft,this._contentWidth=n.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),n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=this._cursorLineNumbers.length;let s=0;const a=[];for(let l=n;l<=o;l++){const c=l-n;for(;s=this._renderData.length?"":this._renderData[n]}_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 Lrt extends Obe{_renderOne(e){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Ert extends Obe{_renderOne(e){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}jd((i,e)=>{const t=i.getColor(wbe);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||i.defines(Hre)){const n=i.getColor(Hre);n&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${n}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${n}; }`),Hu(i.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 Drt extends zb{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 n=[],o=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:V.compareRangesUsingStarts(l.range,c.range)});const r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=r;l<=s;l++){const c=l-r;a[c]=""}this._renderWholeLineDecorations(e,n,a),this._renderNormalDecorations(e,n,a),this._renderResult=a}_renderWholeLineDecorations(e,t,n){const o=String(this._lineHeight),r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',u=Math.max(c.range.startLineNumber,r),h=Math.min(c.range.endLineNumber,s);for(let f=u;f<=h;f++){const g=f-r;n[g]+=d}}}_renderNormalDecorations(e,t,n){var o;const r=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,d=!1;for(let u=0,h=t.length;u';l[f]+=_}}}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class krt extends pl{constructor(e,t,n,o){super(e);const r=this._context.configuration.options,s=r.get(102),a=r.get(74),l=r.get(40),c=r.get(105),d={listenOnDomNode:n.domNode,className:"editor-scrollable "+CH(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new MG(t.domNode,d,this._context.viewLayout.getScrollable())),vf.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=ti(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(h,f,g)=>{const p={};if(f){const v=h.scrollTop;v&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,h.scrollTop=0)}if(g){const v=h.scrollLeft;v&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(ke(n.domNode,"scroll",h=>u(n.domNode,!0,!0))),this._register(ke(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(ke(o.domNode,"scroll",h=>u(o.domNode,!0,!1))),this._register(ke(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,n=t.get(102),o=t.get(74),r=t.get(40),s=t.get(105),a={vertical:n.vertical,horizontal:n.horizontal,verticalScrollbarSize:n.verticalScrollbarSize,horizontalScrollbarSize:n.horizontalScrollbarSize,scrollByPage:n.scrollByPage,handleMouseWheel:n.handleMouseWheel,mouseWheelScrollSensitivity:o,fastScrollSensitivity:r,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+CH(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class Fbe extends _e{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function w5(i,e){let t=0,n=0;const o=i.length;for(;no)throw new Vo("Illegal value for lineNumber");const r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(r&&r.offSide);let a=-2,l=-1,c=-2,d=-1;const u=E=>{if(a!==-1&&(a===-2||a>E-1)){a=-1,l=-1;for(let I=E-2;I>=0;I--){const k=this._computeIndentLevel(I);if(k>=0){a=I,l=k;break}}}if(c===-2){c=-1,d=-1;for(let I=E;I=0){c=I,d=k;break}}}};let h=-2,f=-1,g=-2,p=-1;const v=E=>{if(h===-2){h=-1,f=-1;for(let I=E-2;I>=0;I--){const k=this._computeIndentLevel(I);if(k>=0){h=I,f=k;break}}}if(g!==-1&&(g===-2||g=0){g=I,p=k;break}}}};let m=0,_=!0,y=0,w=!0,L=0,D=0;for(let E=0;_||w;E++){const I=e-E,k=e+E;E>1&&(I<1||I1&&(k>o||k>n)&&(w=!1),E>5e4&&(_=!1,w=!1);let R=-1;if(_&&I>=1){const P=this._computeIndentLevel(I-1);P>=0?(c=I-1,d=P,R=Math.ceil(P/this.textModel.getOptions().indentSize)):(u(I),R=this._getIndentLevelForWhitespaceLine(s,l,d))}let A=-1;if(w&&k<=o){const P=this._computeIndentLevel(k-1);P>=0?(h=k-1,f=P,A=Math.ceil(P/this.textModel.getOptions().indentSize)):(v(k),A=this._getIndentLevelForWhitespaceLine(s,f,p))}if(E===0){D=R;continue}if(E===1){if(k<=o&&A>=0&&D+1===A){_=!1,m=k,y=k,L=A;continue}if(I>=1&&R>=0&&R-1===D){w=!1,m=I,y=I,L=R;continue}if(m=e,y=e,L=D,L===0)return{startLineNumber:m,endLineNumber:y,indent:L}}_&&(R>=L?m=I:_=!1),w&&(A>=L?y=k:w=!1)}return{startLineNumber:m,endLineNumber:y,indent:L}}getLinesBracketGuides(e,t,n,o){var r;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new V(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(n&&l.length>0){const h=(e<=n.lineNumber&&n.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(V.fromPositions(n)).toArray()).filter(f=>V.strictContainsPosition(f.range,n));c=(r=nP(h,f=>a))===null||r===void 0?void 0:r.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new Bbe;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!o.includeInactive)continue;const g=u.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,d)+(o.highlightActive&&f?" "+u.activeClassName:""),p=h.openingBracketRange.getStartPosition(),v=h.closingBracketRange.getStartPosition(),m=o.horizontalGuides===N0.Enabled||o.horizontalGuides===N0.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){m&&s[h.range.startLineNumber-e].push(new v0(-1,h.openingBracketRange.getEndPosition().column,g,new mE(!1,v.column),-1,-1));continue}const _=this.getVisibleColumnFromPosition(v),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(y,_,h.minVisibleColumnIndentation+1);let L=!1;Ws(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&y>w&&s[p.lineNumber-e].push(new v0(w,-1,g,new mE(!1,p.column),-1,-1)),v.lineNumber<=t&&_>w&&s[v.lineNumber-e].push(new v0(w,-1,g,new mE(!L,v.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return or.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");const o=this.textModel.getOptions(),r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(r&&r.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/o.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const v=this._computeIndentLevel(p);if(v>=0){l=p,c=v;break}}}if(d!==-1&&(d===-2||d=0){d=p,u=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(s,c,u)}return a}_getIndentLevelForWhitespaceLine(e,t,n){const o=this.textModel.getOptions();return t===-1||n===-1?0:tl||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const w=_.horizontalLine?_.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",L=_.horizontalLine?((r=(o=e.visibleRangeForPosition(new ae(f,_.horizontalLine.endColumn)))===null||o===void 0?void 0:o.left)!==null&&r!==void 0?r:y+this._spaceWidth)-y:this._spaceWidth;v+=`
`}h[g]=v}this._renderResult=h}getGuidesByLine(e,t,n){const o=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?N0.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?N0.EnabledForActive:N0.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,r=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){const u=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);s=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=o?o[u-e]:[],g=new ap(f),p=r?r[u-e]:0;for(let v=1;v<=p;v++){const m=(v-1)*c+1,_=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=u&&u<=a&&v===l;h.push(...g.takeWhile(w=>w.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function j1(i){if(!(i&&i.isTransparent()))return i}jd((i,e)=>{const t=[{bracketColor:Lbe,guideColor:Vot,guideColorActive:Kot},{bracketColor:Ebe,guideColor:Hot,guideColorActive:qot},{bracketColor:Dbe,guideColor:$ot,guideColorActive:Got},{bracketColor:kbe,guideColor:zot,guideColorActive:Xot},{bracketColor:Ibe,guideColor:Uot,guideColorActive:Yot},{bracketColor:Tbe,guideColor:jot,guideColorActive:Zot}],n=new Bbe,o=[{indentColor:JI,indentColorActive:eT},{indentColor:wot,indentColorActive:Dot},{indentColor:Sot,indentColorActive:kot},{indentColor:xot,indentColorActive:Iot},{indentColor:Lot,indentColorActive:Tot},{indentColor:Eot,indentColorActive:Not}],r=t.map(a=>{var l,c;const d=i.getColor(a.bracketColor),u=i.getColor(a.guideColor),h=i.getColor(a.guideColorActive),f=j1((l=j1(u))!==null&&l!==void 0?l:d==null?void 0:d.transparent(.3)),g=j1((c=j1(h))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(kD),s=o.map(a=>{const l=i.getColor(a.indentColor),c=i.getColor(a.indentColorActive),d=j1(l),u=j1(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(kD);if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class d9{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 Nrt{constructor(){this._currentVisibleRange=new V(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Rrt{constructor(e,t,n,o,r,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=o,this.startScrollTop=r,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Mrt{constructor(e,t,n,o,r){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=o,this.scrollType=r,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new bi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Nrt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=o.get(114).enabled,this._maxNumberStickyLines=o.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Oh(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,n=t.get(50),o=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.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,ss(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Fre(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++)this._visibleLines.getVisibleLine(r).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let o=!1;for(let r=t;r<=n;r++)o=this._visibleLines.getVisibleLine(r).onSelectionChanged()||o;return o}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=t;o<=n;o++)this._visibleLines.getVisibleLine(o).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 n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Rrt(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Mrt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,r),!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),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(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 n=this._getViewLineDomNode(e);if(n===null)return null;const o=this._getLineNumberFor(n);if(o===-1||o<1||o>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(o)===1)return new ae(o,1);const r=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(os)return null;let a=this._visibleLines.getVisibleLine(o).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(o);return an)return-1;const o=new d9(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getWidth(o);return this._updateLineWidthsSlowIfDomDidLayout(o),r}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const n=e.endLineNumber,o=V.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!o)return null;const r=[];let s=0;const a=new d9(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(o.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let u=o.startLineNumber;u<=o.endLineNumber;u++){if(ud)continue;const h=u===o.startLineNumber?o.startColumn:1,f=u!==o.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(u):o.endColumn,p=this._visibleLines.getVisibleLine(u).getVisibleRangesForRange(u,h,g,a);if(!!p){if(t&&uthis._visibleLines.getEndLineNumber())return null;const o=new d9(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,o);return this._updateLineWidthsSlowIfDomDidLayout(o),r}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new zit(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(),n=this._visibleLines.getEndLineNumber();let o=1,r=!0;for(let s=t;s<=n;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){r=!1;continue}o=Math.max(o,a.getWidth(null))}return r&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(o),r}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++){const s=this._visibleLines.getVisibleLine(r);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=r)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let r=n;r<=o;r++)this._visibleLines.getVisibleLine(r).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 n=this._horizontalRevealRequest;if(e.startLineNumber<=n.minLineNumber&&n.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const o=this._computeScrollLeftToReveal(n);o&&(this._isViewportWrapping||this._ensureMaxLineWidth(o.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:o.scrollLeft},n.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),xs&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++)if(this._visibleLines.getVisibleLine(r).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 m=r[0].startLineNumber,_=r[0].endLineNumber;for(let y=1,w=r.length;yl){if(!d)return-1;v=u}else if(s===5||s===6)if(s===6&&a<=u&&h<=c)v=a;else{const m=Math.max(5*this._lineHeight,l*.2),_=u-m,y=h-l;v=Math.max(y,_)}else if(s===1||s===2)if(s===2&&a<=u&&h<=c)v=a;else{const m=(u+h)/2;v=Math.max(0,m-l/2)}else v=this._computeMinimumScrolling(a,c,u,h,s===3,s===4);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),n=this._context.configuration.options.get(143),o=t.left,r=o+t.width-n.verticalScrollbarWidth;let s=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)s=Math.min(s,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)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(s=Math.max(0,s-S5.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(o,r,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,n,o,r,s){e=e|0,t=t|0,n=n|0,o=o|0,r=!!r,s=!!s;const a=t-e;if(o-nt)return Math.max(0,o-a)}else return n;return e}}S5.HORIZONTAL_EXTRA_PX=30;class SH{constructor(e,t,n,o){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(n),this.zIndex=o!=null?o:0}}class Art{constructor(e,t){this.className=e,this.zIndex=t}}class Prt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Wbe extends zb{_render(e,t,n){const o=[];for(let a=e;a<=t;a++){const l=a-e;o[l]=new Prt}if(n.length===0)return o;n.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNameo)continue;const a=Math.max(s.startLineNumber,n),l=Math.min(r.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new Brt(a,l,r.preference.zIndex,r))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((n,o)=>n.lineNumber===o.lineNumber?n.lane===o.lane?n.zIndex===o.zIndex?o.type===n.type?n.type===0&&o.type===0?n.className0;){const o=t.peek();if(!o)break;const r=t.takeWhile(a=>a.lineNumber===o.lineNumber&&a.lane===o.lane);if(!r||r.length===0)break;const s=r[0];if(s.type===0){const a=[];for(const l of r){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}n.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,lane:s.lane}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(const n of Object.values(this._widgets))n.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay("none");else{const o=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],r=this._glyphMarginLeft+(n.renderInfo.lane-1)*this._lineHeight;n.domNode.setDisplay("block"),n.domNode.setTop(o),n.domNode.setLeft(r),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;nthis._decorationGlyphsToRender.length;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}}}class Frt{constructor(e,t,n,o){this.lineNumber=e,this.lane=t,this.zIndex=n,this.className=o,this.type=0}accept(e){return new Wrt(this.lineNumber,this.lane,e)}}class Brt{constructor(e,t,n,o){this.lineNumber=e,this.lane=t,this.zIndex=n,this.widget=o,this.type=1}}class Wrt{constructor(e,t,n){this.lineNumber=e,this.lane=t,this.combinedClassName=n}}class Vrt extends Wbe{constructor(e){super(),this._context=e;const n=this._context.configuration.options.get(143);this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.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(),n=[];let o=0;for(let r=0,s=t.length;r',l=[];for(let c=t;c<=n;c++){const d=c-t,u=o[d].getDecorations();let h="";for(const f of u)h+='
';r[a]=c}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Tc{constructor(e,t,n,o){this._rgba8Brand=void 0,this.r=Tc._clamp(e),this.g=Tc._clamp(t),this.b=Tc._clamp(n),this.a=Tc._clamp(o)}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}}Tc.Empty=new Tc(0,0,0,0);class nT extends _e{static getInstance(){return this._INSTANCE||(this._INSTANCE=new nT),this._INSTANCE}constructor(){super(),this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(oo.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=oo.getColorMap();if(!e){this._colors=[Tc.Empty],this._backgroundIsLight=!0;return}this._colors=[Tc.Empty];for(let n=1;n=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}nT._INSTANCE=null;const $rt=(()=>{const i=[];for(let e=32;e<=126;e++)i.push(e);return i.push(65533),i})(),zrt=(i,e)=>(i-=32,i<0||i>96?e<=2?(i+96)%96:96-1:i);class nk{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=nk.soften(e,12/15),this.charDataLight=nk.soften(e,50/60)}static soften(e,t){const n=new Uint8ClampedArray(e.length);for(let o=0,r=e.length;oe.width||n+g>e.height){console.warn("bad render request outside image data");return}const p=d?this.charDataLight:this.charDataNormal,v=zrt(o,c),m=e.width*4,_=a.r,y=a.g,w=a.b,L=r.r-_,D=r.g-y,E=r.b-w,I=Math.max(s,l),k=e.data;let R=v*h*f,A=n*m+t*4;for(let P=0;Pe.width||n+u>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(r/255),g=s.r,p=s.g,v=s.b,m=o.r-g,_=o.g-p,y=o.b-v,w=g+m*f,L=p+_*f,D=v+y*f,E=Math.max(r,a),I=e.data;let k=n*h+t*4;for(let R=0;R{const e=new Uint8ClampedArray(i.length/2);for(let t=0;t>1]=qre[i[t]]<<4|qre[i[t+1]]&15;return e},Xre={1:yv(()=>Gre("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:yv(()=>Gre("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class vE{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return Xre[e]?n=new nk(Xre[e](),e):n=vE.createFromSampleData(vE.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),n=t.getContext("2d");t.style.height=`${16}px`,t.height=16,t.width=96*10,t.style.width=96*10+"px",n.fillStyle="#ffffff",n.font=`bold ${16}px ${e}`,n.textBaseline="middle";let o=0;for(const r of $rt)n.fillText(String.fromCharCode(r),o,16/2),o+=10;return n.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const o=vE._downsample(e,t);return new nk(o,t)}static _downsampleChar(e,t,n,o,r){const s=1*r,a=2*r;let l=o,c=0;for(let d=0;d0){const c=255/l;for(let d=0;dvE.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=ik._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=ik._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const n=e.getColor(Eit);return n?new Tc(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Dit);return t?Tc._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 _E{constructor(e,t,n,o,r,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=o,this.sliderTop=r,this.sliderHeight=s,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),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,n,o,r,s,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 D=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(D+=Math.max(0,r-e.lineHeight-e.paddingBottom));const E=Math.max(1,Math.floor(r*r/D)),I=Math.max(0,e.minimapHeight-E),k=I/(d-r),R=c*k,A=I>0,P=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),N=Math.floor(e.paddingTop/e.lineHeight);return new _E(c,d,A,k,R,E,N,1,Math.min(a,P))}let v;if(s&&n!==a){const D=n-t+1;v=Math.floor(D*f/h)}else{const D=r/p;v=Math.floor(D*f/h)}const m=Math.floor(e.paddingTop/p);let _=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const D=r/p;_=Math.max(_,D-1)}let y;if(_>0){const D=r/p;y=(m+a+_-D-1)*f/h}else y=Math.max(0,(m+a)*f/h-v);y=Math.min(e.minimapHeight-v,y);const w=y/(d-r),L=c*w;if(g>=m+a+_){const D=y>0;return new _E(c,d,D,w,L,v,m,1,a)}else{let D;t>1?D=t+m:D=Math.max(1,c/p);let E,I=Math.max(1,Math.floor(D-L*h/f));Ic&&(I=Math.min(I,u.startLineNumber),E=Math.max(E,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?A=(t-I+E+R)*f/h:A=c/e.paddingTop*(E+R)*f/h,new _E(c,d,!0,w,A,v,E,I,k)}}}class gP{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}gP.INVALID=new gP(-1);class Yre{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Mbe(()=>gP.INVALID),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;const n=this._renderedLines._get().lines;for(let o=0,r=n.length;o1){for(let m=0,_=o-1;m<_;m++)v[m]=Math.round(m*r+s);v[o-1]=t}return[new ok(r,v),[]]}const a=n.minimapLines,l=a.length,c=[];let d=0,u=0,h=1;const f=10;let g=[],p=null;for(let v=0;v0&&this.minimapLines[n-1]>=e;)n--;let o=this.modelLineToMinimapLine(t)-1;for(;o+1t)return null}return[n+1,o+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),o=this.modelLineToMinimapLine(t);return e!==t&&o===n&&(o===this.minimapLines.length?n>1&&n--:o++),[n,o]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let n=this.minimapLines.length,o=0;for(let r=this.minimapLines.length-1;r>=0&&!(this.minimapLines[r]=0&&!(this.minimapLines[n]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(o)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,n]=ok.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const o of n)switch(o.type){case"deleted":this._actual.onLinesDeleted(o.deleteFromLineNumber,o.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(o.insertFromLineNumber,o.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,n){if(this._samplingState){const o=[];for(let r=0,s=t-e+1;r{if(n.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(n.button===0&&this._lastRenderData){const c=Yo(this._slider.domNode),d=c.top+c.height/2;this._startSliderDragging(n,d,this._lastRenderData.renderedLayout)}return}const r=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*n.offsetY;let l=Math.floor(s/r)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new SS,this._sliderPointerDownListener=No(this._slider.domNode,et.POINTER_DOWN,n=>{n.preventDefault(),n.stopPropagation(),n.button===0&&this._lastRenderData&&this._startSliderDragging(n,n.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Ei.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ke(this._domNode.domNode,Di.Start,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(n))},{passive:!1}),this._sliderTouchMoveListener=ke(this._domNode.domNode,Di.Change,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(n)},{passive:!1}),this._sliderTouchEndListener=No(this._domNode.domNode,Di.End,n=>{n.preventDefault(),n.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;const o=e.pageX;this._slider.toggleClassName("active",!0);const r=(s,a)=>{const l=Yo(this._domNode.domNode),c=Math.min(Math.abs(a-o),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(ls&&c>Urt){this._model.setScrollTop(n.scrollTop);return}const d=s-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&r(e.pageY,o),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>r(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}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 OG(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 n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Mre),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 n=_E.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(n.sliderNeeded?"block":"none"),this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this.renderDecorations(n),this._lastRenderData=this.renderLines(n)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(V.compareRangesUsingStarts);const n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:o,canvasInnerHeight:r}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,o,r);const d=new Zre(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,s),this._renderDecorationsLineHighlights(c,n,d,e,s);const u=new Zre(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,s,l,a,o),this._renderDecorationsHighlights(c,n,u,e,s,l,a,o)}}_renderSelectionLineHighlights(e,t,n,o,r){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=o.intersectWithViewport(l);if(!c)continue;const[d,u]=c;for(let g=d;g<=u;g++)n.set(g,!0);const h=o.getYForLineNumber(d,r),f=o.getYForLineNumber(u,r);a>=h||(a>s&&e.fillRect(Kp,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(Kp,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,n,o,r){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==ll.Inline)continue;const d=o.intersectWithViewport(l.range);if(!d)continue;const[u,h]=d,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let p=u;p<=h;p++){if(n.has(p))continue;n.set(p,!0);const v=o.getYForLineNumber(u,r);e.fillRect(Kp,v,e.canvas.width,r)}}}_renderSelectionsHighlights(e,t,n,o,r,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=o.intersectWithViewport(c);if(!d)continue;const[u,h]=d;for(let f=u;f<=h;f++)this.renderDecorationOnLine(e,n,c,this._selectionColor,o,f,r,r,s,a,l)}}_renderDecorationsHighlights(e,t,n,o,r,s,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const u=o.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 ll.Inline:this.renderDecorationOnLine(e,n,c.range,g,o,p,r,r,s,a,l);continue;case ll.Gutter:{const v=o.getYForLineNumber(p,r),m=2;this.renderDecoration(e,g,m,v,jrt,r);continue}}}}renderDecorationOnLine(e,t,n,o,r,s,a,l,c,d,u){const h=r.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=n,p=f===s?n.startColumn:1,v=g===s?n.endColumn:this._model.getLineMaxColumn(s),m=this.getXOffsetForPosition(t,s,p,c,d,u),_=this.getXOffsetForPosition(t,s,v,c,d,u);this.renderDecoration(e,o,m,h,_-m,a)}getXOffsetForPosition(e,t,n,o,r,s){if(n===1)return Kp;if((n-1)*r>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[Kp];let d=Kp;for(let u=1;u=s){l[u]=s;break}l[u]=g,d=g}e.set(t,l)}return n-1L?Math.floor((o-L)/2):0,E=h.a/255,I=new Tc(Math.round((h.r-u.r)*E+u.r),Math.round((h.g-u.g)*E+u.g),Math.round((h.b-u.b)*E+u.b),255);let k=e.topPaddingLineCount*o;const R=[];for(let H=0,B=n-t+1;H=0&&A_)return;const P=v.charCodeAt(L);if(P===9){const N=h-(L+D)%h;D+=N-1,w+=N*s}else if(P===32)w+=s;else{const N=wv(P)?2:1;for(let M=0;M_)return}}}}}class Zre{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let o=0,r=this._endLineNumber-this._startLineNumber+1;othis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class qrt extends pl{constructor(e){super(e);const n=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._domNode=ti(document.createElement("div")),vf.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,!0}addWidget(e){const t=ti(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 n=this._widgets[e.getId()];return n.preference===t?(this._updateMaxMinWidth(),!1):(n.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const o=this._widgets[t].domNode.domNode;delete this._widgets[t],o.parentNode.removeChild(o),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let n=0;const o=Object.keys(this._widgets);for(let r=0,s=o.length;r=3){const r=Math.floor(o/3),s=Math.floor(o/3),a=o-r-s,l=e,c=l+r,d=l+r+a;return[[0,l,c,l,d,l,c,l],[0,r,a,r+a,s,r+a+s,a+s,r+a+s]]}else if(n===2){const r=Math.floor(o/2),s=o-r,a=e,l=a+r;return[[0,a,a,a,l,a,a,a],[0,r,r,r,s,r+s,r+s,r+s]]}else{const r=e,s=o;return[[0,r,r,r,r,r,r,r],[0,s,s,s,s,s,s,s]]}}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&&ve.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 Xrt extends pl{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ti(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=oo.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Grt(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,n=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 n=this._settings.canvasWidth,o=this._settings.canvasHeight,r=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=o/a,c=6*this._settings.pixelRatio|0,d=c/2|0,u=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(u.fillStyle=ve.Format.CSS.formatHexA(e),u.fillRect(0,0,n,o)):(u.clearRect(0,0,n,o),u.fillStyle=ve.Format.CSS.formatHexA(e),u.fillRect(0,0,n,o)):u.clearRect(0,0,n,o);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,v=g.data;u.fillStyle=p;let m=0,_=0,y=0;for(let w=0,L=v.length/3;wo&&(P=o-d),k=P-d,R=P+d}k>y+1||D!==m?(w!==0&&u.fillRect(h[m],_,f[m],y-_),m=D,_=k,y=R):R>y&&(y=R)}u.fillRect(h[m],_,f[m],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,v=this._settings.x[7],m=this._settings.w[7];u.fillStyle=this._settings.cursorColor;let _=-100,y=-100;for(let w=0,L=this._cursorPositions.length;wo&&(E=o-p);const I=E-p,k=I+g;I>y+1?(w!==0&&u.fillRect(v,_,m,y-_),_=I,y=k):k>y&&(y=k)}u.fillRect(v,_,m,y-_)}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,o),u.stroke(),u.moveTo(0,0),u.lineTo(n,0),u.stroke())}}class Qre{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|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 Vbe{constructor(e,t,n,o){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=o,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.colorn&&(p=n-v);const m=d.color;let _=this._color2Id[m];_||(_=++this._lastAssignedId,this._color2Id[m]=_,this._id2Color[_]=m);const y=new Qre(p-v,p+v,_);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(Qre.compare),a}}class Zrt extends YI{constructor(e,t){super(),this._context=e;const n=this._context.configuration.options;this._domNode=ti(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Yrt(o=>this._context.viewLayout.getVerticalOffsetForLineNumber(o)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(66)),this._zoneManager.setPixelRatio(n.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(),n=this._zoneManager.resolveColorZones(),o=this._zoneManager.getId2Color(),r=this._domNode.domNode.getContext("2d");return r.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(r,n,o,e),!0}_renderOneLane(e,t,n,o){let r=0,s=0,a=0;for(const l of t){const c=l.colorId,d=l.from,u=l.to;c!==r?(e.fillRect(0,s,o,a-s),r=c,e.fillStyle=n[r],s=d,a=u):a>=d?a=Math.max(a,u):(e.fillRect(0,s,o,a-s),s=d,a=u)}e.fillRect(0,s,o,a-s)}}class Qrt extends pl{constructor(e){super(e),this.domNode=ti(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=ti(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(r),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let n=e-t;for(;n>0;){const o=this._renderedRulers.pop();this.domNode.removeChild(o),n--}}render(e){this._ensureRulersCount();for(let t=0,n=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 n=this._context.configuration.options.get(102);return this._useShadows=n.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 est{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class tst{constructor(e,t){this.lineNumber=e,this.ranges=t}}function nst(i){return new est(i)}function ist(i){return new tst(i.lineNumber,i.ranges.map(nst))}class yo extends zb{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,n=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){const o=this._typicalHalfwidthCharacterWidth/4;let r=null,s=null;if(n&&n.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!r&&c=0;c--)n[c].lineNumber===l&&(s=n[c].ranges[0]);r&&!r.startStyle&&(r=null),s&&!s.startStyle&&(s=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;C2(d-g)g&&(h.top=1),C2(u-p)'}_actualRenderOneSelection(e,t,n,o){if(o.length===0)return;const r=!!o[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=o[0].lineNumber,c=o[o.length-1].lineNumber;for(let d=0,u=o.length;d1,c)}this._previousFrameVisibleRangesWithStyle=r,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}yo.SELECTION_CLASS_NAME="selected-text";yo.SELECTION_TOP_LEFT="top-left-radius";yo.SELECTION_BOTTOM_LEFT="bottom-left-radius";yo.SELECTION_TOP_RIGHT="top-right-radius";yo.SELECTION_BOTTOM_RIGHT="bottom-right-radius";yo.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";yo.ROUNDED_PIECE_WIDTH=10;jd((i,e)=>{const t=i.getColor(Rnt);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function C2(i){return i<0?-i:i}class Jre{constructor(e,t,n,o,r,s,a){this.top=e,this.left=t,this.paddingLeft=n,this.width=o,this.height=r,this.textContent=s,this.textContentClassName=a}}class ese{constructor(e){this._context=e;const t=this._context.configuration.options,n=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ti(document.createElement("div")),this._domNode.setClassName(`cursor ${Ey}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),ss(this._domNode,n),this._domNode.setDisplay("none"),this._position=new ae(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,n=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),ss(this._domNode,n),!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,n=this._context.viewModel.getLineContent(e),[o,r]=mZe(n,t-1);return[new ae(e,o+1),n.substring(o,r)]}_prepareRender(e){let t="",n="";const[o,r]=this._getGraphemeAwarePosition();if(this._cursorStyle===Wr.Line||this._cursorStyle===Wr.LineThin){const h=e.visibleRangeForPosition(o);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===Wr.Line?(f=Roe(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=r,n=this._getTokenClassName(o))):f=Roe(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const v=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta;return new Jre(v,g,p,f,this._lineHeight,t,n)}const s=e.linesVisibleRangesForRange(new V(o.lineNumber,o.column,o.lineNumber,o.column+r.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=r===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Wr.Block&&(t=r,n=this._getTokenClassName(o));let d=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===Wr.Underline||this._cursorStyle===Wr.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new Jre(d,l.left,0,c,u,t,n)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${Ey} ${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 rk extends pl{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 ese(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=ti(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 zd,this._cursorFlatBlinkInterval=new UI,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 n=0,o=this._secondaryCursors.length;nt.length){const r=this._secondaryCursors.length-t.length;for(let s=0;s{for(let o=0,r=e.ranges.length;o{this._isVisible?this._hide():this._show()},rk.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},rk.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Wr.Line:e+=" cursor-line-style";break;case Wr.Block:e+=" cursor-block-style";break;case Wr.Underline:e+=" cursor-underline-style";break;case Wr.LineThin:e+=" cursor-line-thin-style";break;case Wr.BlockOutline:e+=" cursor-block-outline-style";break;case Wr.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=i.getColor(Sbe);if(t){let n=i.getColor(Cot);n||(n=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${n}; }`),Hu(i.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const u9=()=>{throw new Error("Invalid change accessor")};class ost extends pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._lineHeight=t.get(66),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=ti(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=ti(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 o of e)t.set(o.id,o);let n=!1;return this._context.viewModel.changeWhitespace(o=>{const r=Object.keys(this._zones);for(let s=0,a=r.length;s{const o={addZone:r=>(t=!0,this._addZone(n,r)),removeZone:r=>{!r||(t=this._removeZone(n,r)||t)},layoutZone:r=>{!r||(t=this._layoutZone(n,r)||t)}};rst(e,o),o.addZone=u9,o.removeZone=u9,o.layoutZone=u9}),t}_addZone(e,t){const n=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:ti(t.domNode),marginDomNode:t.marginDomNode?ti(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,n.heightInPx),r.domNode.setPosition("absolute"),r.domNode.domNode.style.width="100%",r.domNode.setDisplay("none"),r.domNode.setAttribute("monaco-view-zone",r.whitespaceId),this.domNode.appendChild(r.domNode),r.marginDomNode&&(r.marginDomNode.setPosition("absolute"),r.marginDomNode.domNode.style.width="100%",r.marginDomNode.setDisplay("none"),r.marginDomNode.setAttribute("monaco-view-zone",r.whitespaceId),this.marginDomNode.appendChild(r.marginDomNode)),this._zones[r.whitespaceId]=r,this.setShouldRender(),r.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute("monaco-visible-view-zone"),n.domNode.removeAttribute("monaco-view-zone"),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute("monaco-visible-view-zone"),n.marginDomNode.removeAttribute("monaco-view-zone"),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t],o=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=o.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,o.afterViewLineNumber,o.heightInPx),this._safeCallOnComputedHeight(n.delegate,o.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!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(n){en(n)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(n){en(n)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,n={};let o=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(n[s.id]=s,o=!0);const r=Object.keys(this._zones);for(let s=0,a=r.length;sa)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=R.endOffset&&(k++,R=n&&n[k]),N!==9&&N!==32||h&&!D&&P<=I)continue;if(u&&P>=E&&P<=I&&N===32){const H=P-1>=0?a.charCodeAt(P-1):0,B=P+1=0?a.charCodeAt(P-1):0;if(N===32&&H!==32&&H!==9)continue}if(n&&(!R||R.startOffset>P||R.endOffset<=P))continue;const M=e.visibleRangeForPosition(new ae(t,P+1));!M||(s?(A=Math.max(A,M.left),N===9?L+=this._renderArrow(f,v,M.left):L+=``):N===9?L+=`
${w?String.fromCharCode(65515):String.fromCharCode(8594)}
`:L+=`
${String.fromCharCode(y)}
`)}return s?(A=Math.round(A+v),``+L+""):L}_renderArrow(e,t,n){const o=t/7,r=t,s=e/2,a=n,l={x:0,y:o/2},c={x:100/125*r,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},v={x:c.x,y:-c.y},m={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class tse{constructor(e){const t=e.options,n=t.get(50),o=t.get(38);o==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):o==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.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 ust=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},hst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let xH=class extends YI{constructor(e,t,n,o,r,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new gt(1,1,1,1)],this._renderAnimationFrame=null;const l=new brt(t,o,r,e);this._context=new ast(t,n,o),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(yH,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ti(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ti(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ti(document.createElement("div")),vf.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new krt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new S5(this._context,this._linesContent),this._viewZones=new ost(this._context),this._viewParts.push(this._viewZones);const c=new Xrt(this._context);this._viewParts.push(c);const d=new Jrt(this._context);this._viewParts.push(d);const u=new yrt(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Lrt(this._context)),u.addDynamicOverlay(new yo(this._context)),u.addDynamicOverlay(new Trt(this._context)),u.addDynamicOverlay(new Drt(this._context)),u.addDynamicOverlay(new dst(this._context));const h=new wrt(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Ert(this._context)),h.addDynamicOverlay(new Hrt(this._context)),h.addDynamicOverlay(new Vrt(this._context)),h.addDynamicOverlay(new tT(this._context)),this._glyphMarginWidgets=new Ort(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new ib(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 Srt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new rk(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new qrt(this._context),this._viewParts.push(this._overlayWidgets);const g=new Qrt(this._context);this._viewParts.push(g);const p=new cst(this._context);this._viewParts.push(p);const v=new Krt(this._context);if(this._viewParts.push(v),c){const m=this._scrollbar.getOverviewRulerLayoutInfo();m.parent.insertBefore(c.getDomNode(),m.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(v.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new vot(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),Em.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(r=>{var s,a;const l=(a=(s=r.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:wy.Left;return{range:r.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(r=>({range:e.validateRange(r.preference.range),lane:r.preference.lane}))),t.sort((r,s)=>V.compareRangesUsingStarts(r.range,s.range));let n=null,o=null;for(const r of t)if(r.lane===wy.Left&&(!n||V.compareRangesUsingEnds(n,r.range)<0)&&(n=r.range),r.lane===wy.Right&&(!o||V.compareRangesUsingEnds(o,r.range)<0)&&(o=r.range),n&&o){if(n.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Git(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 ae(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)+" "+CH(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=GA(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){fst(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_actualRender(){if(!sG(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 n=new lst(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const o=new Hit(this._context.viewLayout,n,this._viewLines);for(const r of e)r.prepareRender(o);for(const r of e)r.render(o),r.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 n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),o=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const r=this._viewLines.visibleRangeForPosition(new ae(o.lineNumber,o.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?y5.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Zrt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.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,n,o,r,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(n=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&n!==void 0?n:null,(r=(o=e.position)===null||o===void 0?void 0:o.secondaryPosition)!==null&&r!==void 0?r:null,(a=(s=e.position)===null||s===void 0?void 0:s.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()}};xH=ust([hst(6,$t)],xH);function fst(i){try{return i()}catch(e){en(e)}}class Hbe{constructor(e,t,n,o,r,s){this.id=e,this.label=t,this.alias=n,this._precondition=o,this._run=r,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Tv(i){let e=0,t=0,n=0,o=0;for(let r=0,s=i.length;r=zl&&(t=t-i%zl),t}function _st(i,e){return i.reduce((t,n)=>so(t,e(n)),sa)}function $be(i,e){return i===e}function ak(i,e){const t=i,n=e;if(n-t<=0)return sa;const r=Math.floor(t/zl),s=Math.floor(n/zl),a=n-s*zl;if(r===s){const l=t-r*zl;return Io(0,a-l)}else return Io(s-r,a)}function Iy(i,e){return i=e}function zC(i){return Io(i.lineNumber-1,i.column-1)}function R0(i,e){const t=i,n=Math.floor(t/zl),o=t-n*zl,r=e,s=Math.floor(r/zl),a=r-s*zl;return new V(n+1,o+1,s+1,a+1)}function bst(i){const e=gf(i);return Io(e.length-1,e[e.length-1].length)}class Hg{static fromModelContentChanges(e){return e.map(n=>{const o=V.lift(n.range);return new Hg(zC(o.getStartPosition()),zC(o.getEndPosition()),bst(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${Ac(this.startOffset)}...${Ac(this.endOffset)}) -> ${Ac(this.newLength)}`}}class Cst{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>FG.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:ak(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Io(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Io(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Ac(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Io(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Io(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(o===0){const s=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 n=0;for(;;){const r=this.lineTokens,s=r.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(n>1500)break}const o=mst(e,t,this.lineIdx,this.lineCharOffset);return new um(o,0,-1,qo.getEmpty(),new K_(o))}}class Est{constructor(e,t){this.text=e,this._offset=sa,this.idx=0;const n=t.getRegExpStr(),o=n?new RegExp(n+`| -`,"gi"):null,r=[];let s,a=0,l=0,c=0,d=0;const u=[];for(let g=0;g<60;g++)u.push(new um(Io(0,g),0,-1,qo.getEmpty(),new K_(Io(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new um(Io(1,g),0,-1,qo.getEmpty(),new K_(Io(1,g))));if(o)for(o.lastIndex=0;(s=o.exec(e))!==null;){const g=s.index,p=s[0];if(p===` -`)a++,l=g+1;else{if(c!==g){let v;if(d===a){const m=g-c;if(mDst(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,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Dst(i){let e=Xl(i);return/^[\w ]+/.test(i)&&(e=`\\b${e}`),/[\w ]+$/.test(i)&&(e=`${e}\\b`),e}class jbe{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=VG.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function kst(i){if(i.length===0)return null;if(i.length===1)return i[0];let e=0;function t(){if(e>=i.length)return null;const s=e,a=i[s].listHeight;for(e++;e=2?Kbe(s===0&&e===i.length?i:i.slice(s,e),!1):i[s]}let n=t(),o=t();if(!o)return n;for(let s=t();s;s=t())ose(n,o)<=ose(o,s)?(n=h9(n,o),o=s):o=h9(o,s);return h9(n,o)}function Kbe(i,e=!1){if(i.length===0)return null;if(i.length===1)return i[0];let t=i.length;for(;t>3;){const n=t>>1;for(let o=0;o=3?i[2]:null,e)}function ose(i,e){return Math.abs(i.listHeight-e.listHeight)}function h9(i,e){return i.listHeight===e.listHeight?_f.create23(i,e,null,!1):i.listHeight>e.listHeight?Ist(i,e):Tst(e,i)}function Ist(i,e){i=i.toMutable();let t=i;const n=[];let o;for(;;){if(e.listHeight===t.listHeight){o=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let r=n.length-1;r>=0;r--){const s=n[r];o?s.childrenLength>=3?o=_f.create23(s.unappendChild(),o,null,!1):(s.appendChildOfSameHeight(o),o=void 0):s.handleChildrenChanged()}return o?_f.create23(i,o,null,!1):i}function Tst(i,e){i=i.toMutable();let t=i;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let o=e;for(let r=n.length-1;r>=0;r--){const s=n[r];o?s.childrenLength>=3?o=_f.create23(o,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(o),o=void 0):s.handleChildrenChanged()}return o?_f.create23(o,i,null,!1):i}class Nst{constructor(e){this.lastOffset=sa,this.nextNodes=[e],this.offsets=[sa],this.idxs=[]}readLongestNodeAt(e,t){if(Iy(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=$x(this.nextNodes);if(!n)return;const o=$x(this.offsets);if(Iy(e,o))return;if(Iy(o,e))if(so(o,n.length)<=e)this.nextNodeAfterCurrent();else{const r=f9(n);r!==-1?(this.nextNodes.push(n.getChild(r)),this.offsets.push(o),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const r=f9(n);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(r)),this.offsets.push(o),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=$x(this.offsets),t=$x(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=$x(this.nextNodes),o=f9(n,this.idxs[this.idxs.length-1]);if(o!==-1){this.nextNodes.push(n.getChild(o)),this.offsets.push(so(e,t.length)),this.idxs[this.idxs.length-1]=o;break}else this.idxs.pop()}}}function f9(i,e=-1){for(;;){if(e++,e>=i.childrenLength)return-1;if(i.getChild(e))return e}}function $x(i){return i.length>0?i[i.length-1]:void 0}function LH(i,e,t,n){return new Rst(i,e,t,n).parseDocument()}class Rst{constructor(e,t,n,o){if(this.tokenizer=e,this.createImmutableLists=o,this._itemsConstructed=0,this._itemsFromCache=0,n&&o)throw new Error("Not supported");this.oldNodeReader=n?new Nst(n):void 0,this.positionMapper=new Cst(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(qo.getEmpty(),0);return e||(e=_f.getEmpty()),e}parseList(e,t){const n=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===4&&r.childrenLength===0||n.push(r)}return this.oldNodeReader?kst(n):Kbe(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!mP(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),o=>t!==null&&!Iy(o.length,t)?!1:o.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new xst(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new K_(n.length);const o=e.merge(n.bracketIds),r=this.parseList(o,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===n.bracketId||s.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),lk.create(n.astNode,r,s.astNode)):lk.create(n.astNode,r,null)}default:throw new Error("unexpected")}}}function bP(i,e){if(i.length===0)return e;if(e.length===0)return i;const t=new ap(rse(i)),n=rse(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=t.dequeue();function r(c){if(c===void 0){const u=t.takeWhile(h=>!0)||[];return o&&u.unshift(o),u}const d=[];for(;o&&!mP(c);){const[u,h]=o.splitAt(c);d.push(u),c=ak(u.lengthAfter,c),o=h!=null?h:t.dequeue()}return mP(c)||d.push(new Dm(!1,c,c)),d}const s=[];function a(c,d,u){if(s.length>0&&$be(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new Hg(h.startOffset,d,so(h.newLength,u))}else s.push({startOffset:c,endOffset:d,newLength:u})}let l=sa;for(const c of n){const d=r(c.lengthBefore);if(c.modified){const u=_st(d,f=>f.lengthBefore),h=so(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=so(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return s}class Dm{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=ak(e,this.lengthAfter);return $be(t,sa)?[this,void 0]:this.modified?[new Dm(this.modified,this.lengthBefore,e),new Dm(this.modified,sa,t)]:[new Dm(this.modified,e,e),new Dm(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Ac(this.lengthBefore)} -> ${Ac(this.lengthAfter)}`}}function rse(i){const e=[];let t=sa;for(const n of i){const o=ak(t,n.startOffset);mP(o)||e.push(new Dm(!1,o,o));const r=ak(n.startOffset,n.endOffset);e.push(new Dm(!0,r,n.newLength)),t=n.endOffset}return e}class Mst extends _e{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new le,this.denseKeyProvider=new zbe,this.brackets=new jbe(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 n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),o=new Est(this.textModel.getValue(),n);this.initialAstWithoutTokens=LH(o,[],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(n=>new Hg(Io(n.fromLineNumber-1,0),Io(n.toLineNumber,0),Io(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Hg.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=bP(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=bP(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,n){const o=t,r=new Ube(this.textModel,this.brackets);return LH(r,e,o,n)}getBracketsInRange(e,t){this.flushQueue();const n=Io(e.startLineNumber-1,e.startColumn-1),o=Io(e.endLineNumber-1,e.endColumn-1);return new af(r=>{const s=this.initialAstWithoutTokens||this.astWithTokens;EH(s,sa,s.length,n,o,r,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=zC(e.getStartPosition()),o=zC(e.getEndPosition());return new af(r=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new Ast(r,t,this.textModel);DH(s,sa,s.length,n,o,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Gbe(t,sa,t.length,zC(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return qbe(t,sa,t.length,zC(e))}}function qbe(i,e,t,n){if(i.kind===4||i.kind===2){const o=[];for(const r of i.children)t=so(e,r.length),o.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let r=o.length-1;r>=0;r--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=o[r];if(Iy(s,n)){const l=qbe(i.children[r],s,a,n);if(l)return l}}return null}else{if(i.kind===3)return null;if(i.kind===1){const o=R0(e,t);return{bracketInfo:i.bracketInfo,range:o}}}return null}function Gbe(i,e,t,n){if(i.kind===4||i.kind===2){for(const o of i.children){if(t=so(e,o.length),Iy(n,t)){const r=Gbe(o,e,t,n);if(r)return r}e=t}return null}else{if(i.kind===3)return null;if(i.kind===1){const o=R0(e,t);return{bracketInfo:i.bracketInfo,range:o}}}return null}function EH(i,e,t,n,o,r,s,a,l,c,d=!1){if(s>200)return!0;e:for(;;)switch(i.kind){case 4:{const u=i.childrenLength;for(let h=0;h200)return!0;let c=!0;if(i.kind===2){let d=0;if(a){let f=a.get(i.openingBracket.text);f===void 0&&(f=0),d=f,f++,a.set(i.openingBracket.text,f)}const u=so(e,i.openingBracket.length);let h=-1;if(r.includeMinIndentation&&(h=i.computeMinIndentation(e,r.textModel)),c=r.push(new pst(R0(e,t),R0(e,u),i.closingBracket?R0(so(u,((l=i.child)===null||l===void 0?void 0:l.length)||sa),t):void 0,s,d,i,h)),e=u,c&&i.child){const f=i.child;if(t=so(e,f.length),Ty(e,o)&&kL(t,n)&&(c=DH(f,e,t,n,o,r,s+1,a),!c))return!1}a==null||a.set(i.openingBracket.text,d)}else{let d=e;for(const u of i.children){const h=d;if(d=so(d,u.length),Ty(h,o)&&Ty(n,d)&&(c=DH(u,h,d,n,o,r,s,a),!c))return!1}}return c}class Pst extends _e{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Kr),this.onDidChangeEmitter=new le,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(n=>{var o;(!n.languageId||((o=this.bracketPairsTree.value)===null||o===void 0?void 0:o.object.didLanguageChange(n.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=Ost(e.add(new Mst(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))||af.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))||af.empty}getBracketsInRange(e,t=!1){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketsInRange(e,t))||af.empty}findMatchingBracketUp(e,t,n){const o=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(o.lineNumber,o.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(V.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?y2(this._findMatchingBracketUp(l,o,g9(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(V.fromPositions(e,e)).filter(o=>o.closingBracketRange!==void 0&&(o.openingBracketRange.containsPosition(e)||o.closingBracketRange.containsPosition(e))).findLastMaxBy(Rc(o=>o.openingBracketRange.containsPosition(e)?o.openingBracketRange:o.closingBracketRange,V.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=g9(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,o){const r=t.getCount(),s=t.getLanguageId(o);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=o-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(Ch(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=o+1;c=l)break;if(Ch(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,o=this.textModel.tokenization.getLineTokens(n),r=this.textModel.getLineContent(n),s=o.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(s)).brackets;if(a&&!Ch(o.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,o,a,s),d=null;for(;;){const u=hd.findNextBracketInRange(a.forwardRegex,n,r,l,c);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const h=r.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof pg)return null;d=f}}l=u.endColumn-1}if(d)return d}if(s>0&&o.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(l)).brackets;if(c&&!Ch(o.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,o,c,l),h=hd.findPrevBracketInRange(c.reversedRegex,n,r,d,u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=r.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof pg?null:g}}}return null}_matchFoundBracket(e,t,n,o){if(!t)return null;const r=n?this._findMatchingBracketDown(t,e.getEndPosition(),o):this._findMatchingBracketUp(t,e.getStartPosition(),o);return r?r instanceof pg?r:[e,r]:null}_findMatchingBracketUp(e,t,n){const o=e.languageId,r=e.reversedRegex;let s=-1,a=0;const l=(c,d,u,h)=>{for(;;){if(n&&++a%100===0&&!n())return pg.INSTANCE;const f=hd.findPrevBracketInRange(r,c,d,u,h);if(!f)break;const g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===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 v=!0;for(;f>=0;f--){const m=d.getLanguageId(f)===o&&!Ch(d.getStandardTokenType(f));if(m)v?g=d.getStartOffset(f):(g=d.getStartOffset(f),p=d.getEndOffset(f));else if(v&&g!==p){const _=l(c,h,g,p);if(_)return _}v=m}if(v&&g!==p){const m=l(c,h,g,p);if(m)return m}}return null}_findMatchingBracketDown(e,t,n){const o=e.languageId,r=e.forwardRegex;let s=1,a=0;const l=(d,u,h,f)=>{for(;;){if(n&&++a%100===0&&!n())return pg.INSTANCE;const g=hd.findNextBracketInRange(r,d,u,h,f);if(!g)break;const p=u.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?s++:e.isClose(p)&&s--,s===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,v=0;d===t.lineNumber&&(g=u.findTokenIndexAtOffset(t.column-1),p=t.column-1,v=t.column-1);let m=!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===n.lineNumber){u=l.findTokenIndexAtOffset(n.column-1),h=n.column-1,f=n.column-1;const p=l.getLanguageId(u);o!==p&&(o=p,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let g=!0;for(;u>=0;u--){const p=l.getLanguageId(u);if(o!==p){if(r&&s&&g&&h!==f){const m=hd.findPrevBracketInRange(r.reversedRegex,a,d,h,f);if(m)return this._toFoundBracket(s,m);g=!1}o=p,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const v=!!r&&!Ch(l.getStandardTokenType(u));if(v)g?h=l.getStartOffset(u):(h=l.getStartOffset(u),f=l.getEndOffset(u));else if(s&&r&&g&&h!==f){const m=hd.findPrevBracketInRange(r.reversedRegex,a,d,h,f);if(m)return this._toFoundBracket(s,m)}g=v}if(s&&r&&g&&h!==f){const p=hd.findPrevBracketInRange(r.reversedRegex,a,d,h,f);if(p)return this._toFoundBracket(s,p)}}return null}findNextBracket(e){var t;const n=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(n))||null;const o=this.textModel.getLineCount();let r=null,s=null,a=null;for(let l=n.lineNumber;l<=o;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===n.lineNumber){h=c.findTokenIndexAtOffset(n.column-1),f=n.column-1,g=n.column-1;const v=c.getLanguageId(h);r!==v&&(r=v,s=this.languageConfigurationService.getLanguageConfiguration(r).brackets,a=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const o=g9(t),r=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const p=[];for(let v=0,m=g?g.brackets.length:0;v{for(;;){if(o&&++c%100===0&&!o())return pg.INSTANCE;const _=hd.findNextBracketInRange(f.forwardRegex,g,p,v,m);if(!_)break;const y=p.substring(_.startColumn-1,_.endColumn-1).toLowerCase(),w=f.textIsBracket[y];if(w&&(w.isOpen(y)?a[w.index]++:w.isClose(y)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(_,w,!1,o);v=_.endColumn-1}return null};let u=null,h=null;for(let f=n.lineNumber;f<=r;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),v=this.textModel.getLineContent(f);let m=0,_=0,y=0;if(f===n.lineNumber){m=g.findTokenIndexAtOffset(n.column-1),_=n.column-1,y=n.column-1;const L=g.getLanguageId(m);u!==L&&(u=L,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let w=!0;for(;me==null?void 0:e.dispose()}}function g9(i){if(typeof i=="undefined")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=i}}class pg{constructor(){this._searchCanceledBrand=void 0}}pg.INSTANCE=new pg;function y2(i){return i instanceof pg?null:i}class Fst extends _e{constructor(e){super(),this.textModel=e,this.colorProvider=new Xbe,this.onDidChangeEmitter=new le,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,n,o){return o?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new V(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Xbe{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}jd((i,e)=>{const t=[Lbe,Ebe,Dbe,kbe,Ibe,Tbe],n=new Xbe;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${i.getColor(Wot)}; }`);const o=t.map(r=>i.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const s=o[r%o.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(r)} { color: ${s}; }`)}});function w2(i){return i.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Jr{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,n,o){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=o}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${w2(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${w2(this.oldText)}")`:`(replace@${this.oldPosition} "${w2(this.oldText)}" with "${w2(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const o=t.length;hu(e,o,n),n+=4;for(let r=0;ri.length)return!1;if(t){if(!Xq(i,e))return!1;if(e.length===i.length)return!0;let r=e.length;return e.charAt(e.length-1)===n&&r--,i.charAt(r)===n}return e.charAt(e.length-1)!==n&&(e+=n),i.indexOf(e)===0}function Zbe(i){return i>=65&&i<=90||i>=97&&i<=122}function Vst(i,e=ls){return e?Zbe(i.charCodeAt(0))&&i.charCodeAt(1)===58:!1}function yh(i){return HA(i,!0)}class HG{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:AD(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}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,n=!1){if(e.scheme===t.scheme){if(e.scheme===hn.file)return kH(yh(e),yh(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(lse(e.authority,t.authority))return kH(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Rt.joinPath(e,...t)}basenameOrAuthority(e){return $c(e)||e.authority}basename(e){return Go.basename(e.path)}extname(e){return Go.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===hn.file?t=Rt.file(P_e(yh(e))).path:(t=Go.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===hn.file?t=Rt.file(A_e(yh(e))).path:t=Go.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!lse(e.authority,t.authority))return;if(e.scheme===hn.file){const r=qYe(yh(e),yh(t));return ls?Ybe(r):r}let n=e.path||"/";const o=t.path||"/";if(this._ignorePathCasing(e)){let r=0;for(const s=Math.min(n.length,o.length);rsse(n).length&&n[n.length-1]===t}else{const n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Bu){return cse(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Bu){let n=!1;if(e.scheme===hn.file){const o=yh(e);n=o!==void 0&&o.length===sse(o).length&&o[o.length-1]===t}else{t="/";const o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!cse(e,t)?e.with({path:e.path+"/"}):e}}const Vi=new HG(()=>!1);new HG(i=>i.scheme===hn.file?!xs:!0);new HG(i=>!0);const $G=Vi.isEqual.bind(Vi);Vi.isEqualOrParent.bind(Vi);Vi.getComparisonKey.bind(Vi);const Hst=Vi.basenameOrAuthority.bind(Vi),$c=Vi.basename.bind(Vi),$st=Vi.extname.bind(Vi),x5=Vi.dirname.bind(Vi),zst=Vi.joinPath.bind(Vi),Ust=Vi.normalizePath.bind(Vi),jst=Vi.relativePath.bind(Vi),ase=Vi.resolvePath.bind(Vi);Vi.isAbsolutePath.bind(Vi);const lse=Vi.isEqualAuthority.bind(Vi),cse=Vi.hasTrailingPathSeparator.bind(Vi);Vi.removeTrailingPathSeparator.bind(Vi);Vi.addTrailingPathSeparator.bind(Vi);var Nv;(function(i){i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function e(t){const n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&n.set(a,l)});const r=t.path.substring(0,t.path.indexOf(";"));return r&&n.set(i.META_DATA_MIME,r),n}i.parseMetaData=e})(Nv||(Nv={}));function K1(i){return i.toString()}class yr{static create(e,t){const n=e.getAlternativeVersionId(),o=IH(e);return new yr(n,n,o,o,t,t,[])}constructor(e,t,n,o,r,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=o,this.beforeCursorState=r,this.afterCursorState=s,this.changes=a}append(e,t,n,o,r){t.length>0&&(this.changes=Bst(this.changes,t)),this.afterEOL=n,this.afterVersionId=o,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,n){if(hu(e,t?t.length:0,n),n+=4,t)for(const o of t)hu(e,o.selectionStartLineNumber,n),n+=4,hu(e,o.selectionStartColumn,n),n+=4,hu(e,o.positionLineNumber,n),n+=4,hu(e,o.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const o=uu(e,t);t+=4;for(let r=0;rt.toString()).join(", ")}matchesResource(e){return(Rt.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 yr}append(e,t,n,o,r){this._data instanceof yr&&this._data.append(e,t,n,o,r)}close(){this._data instanceof yr&&(this._data=this._data.serialize())}open(){this._data instanceof yr||(this._data=yr.deserialize(this._data))}undo(){if(Rt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof yr&&(this._data=this._data.serialize());const e=yr.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Rt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof yr&&(this._data=this._data.serialize());const e=yr.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof yr&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Kst{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const o of this._editStackElementsArr){const r=K1(o.resource);this._editStackElementsMap.set(r,o)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=K1(e);return this._editStackElementsMap.has(t)}setModel(e){const t=K1(Rt.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=K1(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,o,r){const s=K1(e.uri);this._editStackElementsMap.get(s).append(e,t,n,o,r)}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=K1(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(`${$c(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function IH(i){return i.getEOL()===` -`?0:1}function mg(i){return i?i instanceof Qbe||i instanceof Kst:!1}class zG{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);mg(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);mg(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const n=this._undoRedoService.getLastElement(this._model.uri);if(mg(n)&&n.canAppend(this._model))return n;const o=new Qbe(C("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(o,t),o}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],IH(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n,o){const r=this._getOrCreateEditStackElement(e,o),s=this._model.applyEdits(t,!0),a=zG._computeCursorState(n,s),l=s.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),r.append(this._model,l.map(c=>c.textChange),IH(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(n){return en(n),null}}}class qst{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Gst(i,e,t,n,o){o.spacesDiff=0,o.looksLikeAlignment=!1;let r;for(r=0;r0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(s-l);if(d===0){o.spacesDiff=u,u>0&&0<=l-1&&l-10?o++:w>1&&r++,Gst(s,a,v,y,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const D=u.spacesDiff;D<=c&&d[D]++,s=v,a=y}let h=t;o!==r&&(h=o{const v=d[p];v>g&&(g=v,f=p)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function xa(i){return(i.metadata&1)>>>0}function Fi(i,e){i.metadata=i.metadata&254|e<<0}function as(i){return(i.metadata&2)>>>1===1}function Mi(i,e){i.metadata=i.metadata&253|(e?1:0)<<1}function Jbe(i){return(i.metadata&4)>>>2===1}function use(i,e){i.metadata=i.metadata&251|(e?1:0)<<2}function e1e(i){return(i.metadata&64)>>>6===1}function hse(i,e){i.metadata=i.metadata&191|(e?1:0)<<6}function Xst(i){return(i.metadata&24)>>>3}function fse(i,e){i.metadata=i.metadata&231|e<<3}function Yst(i){return(i.metadata&32)>>>5===1}function gse(i,e){i.metadata=i.metadata&223|(e?1:0)<<5}class t1e{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Fi(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,use(this,!1),hse(this,!1),fse(this,1),gse(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Mi(this,!1)}reset(e,t,n,o){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=o}setOptions(e){this.options=e;const t=this.options.className;use(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),hse(this,this.options.glyphMarginClassName!==null),fse(this,this.options.stickiness),gse(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const pn=new t1e(null,0,0);pn.parent=pn;pn.left=pn;pn.right=pn;Fi(pn,0);class p9{constructor(){this.root=pn,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,o,r,s){return this.root===pn?[]:oat(this,e,t,n,o,r,s)}search(e,t,n,o){return this.root===pn?[]:iat(this,e,t,n,o)}collectNodesFromOwner(e){return tat(this,e)}collectNodesPostOrder(){return nat(this)}insert(e){pse(this,e),this._normalizeDeltaIfNecessary()}delete(e){mse(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let o=0;for(;e!==this.root;)e===e.parent.right&&(o+=e.parent.delta),e=e.parent;const r=n.start+o,s=n.end+o;n.setCachedOffsets(r,s,t)}acceptReplace(e,t,n,o){const r=Jst(this,e,e+t);for(let s=0,a=r.length;st||n===1?!1:n===2?!0:e}function Qst(i,e,t,n,o){const r=Xst(i),s=r===0||r===2,a=r===1||r===2,l=t-e,c=n,d=Math.min(l,c),u=i.start;let h=!1;const f=i.end;let g=!1;e<=u&&f<=t&&Yst(i)&&(i.start=e,h=!0,i.end=e,g=!0);{const v=o?1:l>0?2:0;!h&&q1(u,s,e,v)&&(h=!0),!g&&q1(f,a,e,v)&&(g=!0)}if(d>0&&!o){const v=l>c?2:0;!h&&q1(u,s,e+d,v)&&(h=!0),!g&&q1(f,a,e+d,v)&&(g=!0)}{const v=o?1:0;!h&&q1(u,s,t,v)&&(i.start=e+c,h=!0),!g&&q1(f,a,t,v)&&(i.end=e+c,g=!0)}const p=c-l;h||(i.start=Math.max(0,u+p)),g||(i.end=Math.max(0,f+p)),i.start>i.end&&(i.end=i.start)}function Jst(i,e,t){let n=i.root,o=0,r=0,s=0,a=0;const l=[];let c=0;for(;n!==pn;){if(as(n)){Mi(n.left,!1),Mi(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;continue}if(!as(n.left)){if(r=o+n.maxEnd,rt){Mi(n,!0);continue}if(a=o+n.end,a>=e&&(n.setCachedOffsets(s,a,0),l[c++]=n),Mi(n,!0),n.right!==pn&&!as(n.right)){o+=n.delta,n=n.right;continue}}return Mi(i.root,!1),l}function eat(i,e,t,n){let o=i.root,r=0,s=0,a=0;const l=n-(t-e);for(;o!==pn;){if(as(o)){Mi(o.left,!1),Mi(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),Rv(o),o=o.parent;continue}if(!as(o.left)){if(s=r+o.maxEnd,st){o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(i.requestNormalizeDelta=!0),Mi(o,!0);continue}if(Mi(o,!0),o.right!==pn&&!as(o.right)){r+=o.delta,o=o.right;continue}}Mi(i.root,!1)}function tat(i,e){let t=i.root;const n=[];let o=0;for(;t!==pn;){if(as(t)){Mi(t.left,!1),Mi(t.right,!1),t=t.parent;continue}if(t.left!==pn&&!as(t.left)){t=t.left;continue}if(t.ownerId===e&&(n[o++]=t),Mi(t,!0),t.right!==pn&&!as(t.right)){t=t.right;continue}}return Mi(i.root,!1),n}function nat(i){let e=i.root;const t=[];let n=0;for(;e!==pn;){if(as(e)){Mi(e.left,!1),Mi(e.right,!1),e=e.parent;continue}if(e.left!==pn&&!as(e.left)){e=e.left;continue}if(e.right!==pn&&!as(e.right)){e=e.right;continue}t[n++]=e,Mi(e,!0)}return Mi(i.root,!1),t}function iat(i,e,t,n,o){let r=i.root,s=0,a=0,l=0;const c=[];let d=0;for(;r!==pn;){if(as(r)){Mi(r.left,!1),Mi(r.right,!1),r===r.parent.right&&(s-=r.parent.delta),r=r.parent;continue}if(r.left!==pn&&!as(r.left)){r=r.left;continue}a=s+r.start,l=s+r.end,r.setCachedOffsets(a,l,n);let u=!0;if(e&&r.ownerId&&r.ownerId!==e&&(u=!1),t&&Jbe(r)&&(u=!1),o&&!e1e(r)&&(u=!1),u&&(c[d++]=r),Mi(r,!0),r.right!==pn&&!as(r.right)){s+=r.delta,r=r.right;continue}}return Mi(i.root,!1),c}function oat(i,e,t,n,o,r,s){let a=i.root,l=0,c=0,d=0,u=0;const h=[];let f=0;for(;a!==pn;){if(as(a)){Mi(a.left,!1),Mi(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!as(a.left)){if(c=l+a.maxEnd,ct){Mi(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(d,u,r);let g=!0;n&&a.ownerId&&a.ownerId!==n&&(g=!1),o&&Jbe(a)&&(g=!1),s&&!e1e(a)&&(g=!1),g&&(h[f++]=a)}if(Mi(a,!0),a.right!==pn&&!as(a.right)){l+=a.delta,a=a.right;continue}}return Mi(i.root,!1),h}function pse(i,e){if(i.root===pn)return e.parent=pn,e.left=pn,e.right=pn,Fi(e,0),i.root=e,i.root;rat(i,e),Yp(e.parent);let t=e;for(;t!==i.root&&xa(t.parent)===1;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;xa(n)===1?(Fi(t.parent,0),Fi(n,0),Fi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,bE(i,t)),Fi(t.parent,0),Fi(t.parent.parent,1),CE(i,t.parent.parent))}else{const n=t.parent.parent.left;xa(n)===1?(Fi(t.parent,0),Fi(n,0),Fi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,CE(i,t)),Fi(t.parent,0),Fi(t.parent.parent,1),bE(i,t.parent.parent))}return Fi(i.root,0),e}function rat(i,e){let t=0,n=i.root;const o=e.start,r=e.end;for(;;)if(aat(o,r,n.start+t,n.end+t)<0)if(n.left===pn){e.start-=t,e.end-=t,e.maxEnd-=t,n.left=e;break}else n=n.left;else if(n.right===pn){e.start-=t+n.delta,e.end-=t+n.delta,e.maxEnd-=t+n.delta,n.right=e;break}else t+=n.delta,n=n.right;e.parent=n,e.left=pn,e.right=pn,Fi(e,1)}function mse(i,e){let t,n;if(e.left===pn?(t=e.right,n=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===pn?(t=e.left,n=e):(n=sat(e.right),t=n.right,t.start+=n.delta,t.end+=n.delta,t.delta+=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,n.delta=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0)),n===i.root){i.root=t,Fi(t,0),e.detach(),m9(),Rv(t),i.root.parent=pn;return}const o=xa(n)===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?t.parent=n.parent:(n.parent===e?t.parent=n:t.parent=n.parent,n.left=e.left,n.right=e.right,n.parent=e.parent,Fi(n,xa(e)),e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==pn&&(n.left.parent=n),n.right!==pn&&(n.right.parent=n)),e.detach(),o){Yp(t.parent),n!==e&&(Yp(n),Yp(n.parent)),m9();return}Yp(t),Yp(t.parent),n!==e&&(Yp(n),Yp(n.parent));let r;for(;t!==i.root&&xa(t)===0;)t===t.parent.left?(r=t.parent.right,xa(r)===1&&(Fi(r,0),Fi(t.parent,1),bE(i,t.parent),r=t.parent.right),xa(r.left)===0&&xa(r.right)===0?(Fi(r,1),t=t.parent):(xa(r.right)===0&&(Fi(r.left,0),Fi(r,1),CE(i,r),r=t.parent.right),Fi(r,xa(t.parent)),Fi(t.parent,0),Fi(r.right,0),bE(i,t.parent),t=i.root)):(r=t.parent.left,xa(r)===1&&(Fi(r,0),Fi(t.parent,1),CE(i,t.parent),r=t.parent.left),xa(r.left)===0&&xa(r.right)===0?(Fi(r,1),t=t.parent):(xa(r.left)===0&&(Fi(r.right,0),Fi(r,1),bE(i,r),r=t.parent.left),Fi(r,xa(t.parent)),Fi(t.parent,0),Fi(r.left,0),CE(i,t.parent),t=i.root));Fi(t,0),m9()}function sat(i){for(;i.left!==pn;)i=i.left;return i}function m9(){pn.parent=pn,pn.delta=0,pn.start=0,pn.end=0}function bE(i,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==pn&&(t.left.parent=e),t.parent=e.parent,e.parent===pn?i.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Rv(e),Rv(t)}function CE(i,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(i.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==pn&&(t.right.parent=e),t.parent=e.parent,e.parent===pn?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Rv(e),Rv(t)}function n1e(i){let e=i.end;if(i.left!==pn){const t=i.left.maxEnd;t>e&&(e=t)}if(i.right!==pn){const t=i.right.maxEnd+i.delta;t>e&&(e=t)}return e}function Rv(i){i.maxEnd=n1e(i)}function Yp(i){for(;i!==pn;){const e=n1e(i);if(i.maxEnd===e)return;i.maxEnd=e,i=i.parent}}function aat(i,e,t,n){return i===t?e-n:i-t}class TH{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!==Qt)return UG(this.right);let e=this;for(;e.parent!==Qt&&e.parent.left!==e;)e=e.parent;return e.parent===Qt?Qt:e.parent}prev(){if(this.left!==Qt)return i1e(this.left);let e=this;for(;e.parent!==Qt&&e.parent.right!==e;)e=e.parent;return e.parent===Qt?Qt:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Qt=new TH(null,0);Qt.parent=Qt;Qt.left=Qt;Qt.right=Qt;Qt.color=0;function UG(i){for(;i.left!==Qt;)i=i.left;return i}function i1e(i){for(;i.right!==Qt;)i=i.right;return i}function jG(i){return i===Qt?0:i.size_left+i.piece.length+jG(i.right)}function KG(i){return i===Qt?0:i.lf_left+i.piece.lineFeedCnt+KG(i.right)}function v9(){Qt.parent=Qt}function yE(i,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!==Qt&&(t.left.parent=e),t.parent=e.parent,e.parent===Qt?i.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function wE(i,e){const t=e.left;e.left=t.right,t.right!==Qt&&(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===Qt?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function S2(i,e){let t,n;if(e.left===Qt?(n=e,t=n.right):e.right===Qt?(n=e,t=n.left):(n=UG(e.right),t=n.right),n===i.root){i.root=t,t.color=0,e.detach(),v9(),i.root.parent=Qt;return}const o=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,IL(i,t)):(n.parent===e?t.parent=n:t.parent=n.parent,IL(i,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==Qt&&(n.left.parent=n),n.right!==Qt&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,IL(i,n)),e.detach(),t.parent.left===t){const s=jG(t),a=KG(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,rg(i,t.parent,l,c)}}if(IL(i,t.parent),o){v9();return}let r;for(;t!==i.root&&t.color===0;)t===t.parent.left?(r=t.parent.right,r.color===1&&(r.color=0,t.parent.color=1,yE(i,t.parent),r=t.parent.right),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.right.color===0&&(r.left.color=0,r.color=1,wE(i,r),r=t.parent.right),r.color=t.parent.color,t.parent.color=0,r.right.color=0,yE(i,t.parent),t=i.root)):(r=t.parent.left,r.color===1&&(r.color=0,t.parent.color=1,wE(i,t.parent),r=t.parent.left),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.left.color===0&&(r.right.color=0,r.color=1,yE(i,r),r=t.parent.left),r.color=t.parent.color,t.parent.color=0,r.left.color=0,wE(i,t.parent),t=i.root));t.color=0,v9()}function vse(i,e){for(IL(i,e);e!==i.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,yE(i,e)),e.parent.color=0,e.parent.parent.color=1,wE(i,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,wE(i,e)),e.parent.color=0,e.parent.parent.color=1,yE(i,e.parent.parent))}i.root.color=0}function rg(i,e,t,n){for(;e!==i.root&&e!==Qt;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function IL(i,e){let t=0,n=0;if(e!==i.root){for(;e!==i.root&&e===e.parent.right;)e=e.parent;if(e!==i.root)for(e=e.parent,t=jG(e.left)-e.size_left,n=KG(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==i.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}const Yf=65535;function o1e(i){let e;return i[i.length-1]<65536?e=new Uint16Array(i.length):e=new Uint32Array(i.length),e.set(i,0),e}class lat{constructor(e,t,n,o,r){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=o,this.isBasicASCII=r}}function lg(i,e=!0){const t=[0];let n=1;for(let o=0,r=i.length;o126)&&(s=!1)}const a=new lat(o1e(i),n,o,r,s);return i.length=0,a}class Ga{constructor(e,t,n,o,r){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=o,this.length=r}}class q_{constructor(e,t){this.buffer=e,this.lineStarts=t}}class dat{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Qt&&e.iterate(e.root,n=>(n!==Qt&&this._pieces.push(n.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 uat{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let o=0;o=e){n[o]=null,t=!0;continue}}if(t){const o=[];for(const r of n)r!==null&&o.push(r);this._cache=o}}}class hat{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new q_("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Qt,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let o=null;for(let r=0,s=e.length;r0){e[r].lineStarts||(e[r].lineStarts=lg(e[r].buffer));const a=new Ga(r+1,{line:0,column:0},{line:e[r].lineStarts.length-1,column:e[r].buffer.length-e[r].lineStarts[e[r].lineStarts.length-1]},e[r].lineStarts.length-1,e[r].buffer.length);this._buffers.push(e[r]),o=this.rbInsertRight(o,a)}this._searchCache=new uat(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Yf,n=t-Math.floor(t/3),o=n*2;let r="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(s<=n||s+d0){const l=r.replace(/\r\n|\r|\n/g,e);a.push(new q_(l,lg(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 dat(this,e)}getOffsetAt(e,t){let n=0,o=this.root;for(;o!==Qt;)if(o.left!==Qt&&o.lf_left+1>=e)o=o.left;else{if(o.lf_left+o.piece.lineFeedCnt+1>=e)return n+=o.size_left,n+=this.getAccumulatedValue(o,e-o.lf_left-2)+t-1;e-=o.lf_left+o.piece.lineFeedCnt,n+=o.size_left+o.piece.length,o=o.right}return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const o=e;for(;t!==Qt;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const r=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+r.index,r.index===0){const s=this.getOffsetAt(n+1,1),a=o-s;return new ae(n+1,a+1)}return new ae(n+1,r.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===Qt){const r=this.getOffsetAt(n+1,1),s=o-e-r;return new ae(n+1,s+1)}else t=t.right;return new ae(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),o=this.nodeAt2(e.endLineNumber,e.endColumn),r=this.getValueInRange2(n,o);return t?t!==this._EOL||!this._EOLNormalized?r.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?r:r.replace(/\r\n|\r|\n/g,t):r}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 n=e.node;const o=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let s=o.substring(r+e.remainder,r+n.piece.length);for(n=n.next();n!==Qt;){const a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,n.piece.length);n=n.next()}return s}getLinesContent(){const e=[];let t=0,n="",o=!1;return this.iterate(this.root,r=>{if(r===Qt)return!0;const s=r.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,d=s.start.line,u=s.end.line;let h=c[d]+s.start.column;if(o&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=n,n="",o=!1,a===0))return!0;if(d===u)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(o=!0,n+=l.substr(h,a-1)):n+=l.substr(h,a),!0;n+=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++]=n;for(let f=d+1;fw+g,t.reset(0)):(_=h.buffer,y=w=>w,t.reset(g));do if(v=t.next(_),v){if(y(v.index)>=p)return d;this.positionInBuffer(e,y(v.index)-f,m);const w=this.getLineFeedCnt(e.piece.bufferIndex,r,m),L=m.line===r.line?m.column-r.column+o:m.column+1,D=L+v[0].length;if(u[d++]=H_(new V(n+w,L,n+w,D),v,l),y(v.index)+v[0].length>=p||d>=c)return d}while(v);return d}findMatchesLineByLine(e,t,n,o){const r=[];let s=0;const a=new MC(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,n,o,s,r),r;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 m=this._buffers[f.piece.bufferIndex].lineStarts,_=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=m[d.line+p],w=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,w,d,this.positionInBuffer(f,y-_),t,n,o,s,r),s>=o)return r;h+=p}const v=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const m=this.getLineContent(h).substring(v,e.endColumn-1);return s=this._findMatchesInLine(t,a,m,e.endLineNumber,v,s,r,n,o),r}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(v),h,v,s,r,n,o),s>=o)return r;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,v=this.getLineContent(h).substring(p,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,p,s,r,n,o),r}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,d,u,t,n,o,s,r),r}_findMatchesInLine(e,t,n,o,r,s,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=n.length;let p=-f;for(;(p=n.indexOf(h,p+f))!==-1;)if((!d||dG(d,n,g,p,f))&&(a[s++]=new HD(new V(o,p+1+r,o,p+1+f+r),null),s>=c))return s;return s}let u;t.reset(0);do if(u=t.next(n),u&&(a[s++]=H_(new V(o,u.index+1+r,o,u.index+1+u[0].length+r),u,l),s>=c))return s;while(u);return s}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Qt){const{node:o,remainder:r,nodeStartOffset:s}=this.nodeAt(e),a=o.piece,l=a.bufferIndex,c=this.positionInBuffer(o,r);if(o.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){const d=[];let u=new Ga(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(o,r)===10){const p={line:u.start.line+1,column:0};u=new Ga(u.bufferIndex,p,u.end,this.getLineFeedCnt(u.bufferIndex,p,u.end),u.length-1),t+=` +`+e.normalizeIndentation(a),n)}static _isAutoIndentType(e,t,n){if(e.autoIndent<4)return!1;for(let o=0,r=n.length;oeo.shiftIndent(e,a),unshiftIndent:a=>eo.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(r)){const a=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);return a===0?eo._typeCommand(new V(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+o,!1):eo._typeCommand(new V(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+t.getLineContent(n.startLineNumber).substring(a-1,n.startColumn-1)+o,!1)}return null}static _isAutoClosingOvertype(e,t,n,o,r){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(r))return!1;for(let s=0,a=n.length;s2?d.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,v=o.length;pt.startsWith(l.open)),a=r.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,n,o){const r=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(o);if(!r)return null;let s=null;for(const a of r)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of n)if(t.getValueInRange(new V(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+o!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const n=t.close.charAt(t.close.length-1),o=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[];let r=null;for(const s of o)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!r||s.open.length>r.open.length)&&(r=s);return r}static _getAutoClosingPairClose(e,t,n,o,r){for(const g of n)if(!g.isEmpty())return null;const s=n.map(g=>{const p=g.getPosition();return r?{lineNumber:p.lineNumber,beforeColumn:p.column-o.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(g=>new ae(g.lineNumber,g.beforeColumn)),o);if(!a)return null;let l,c;if(Yp(o)?(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 s){const{lineNumber:p,beforeColumn:v,afterColumn:m}=g,_=t.getLineContent(p),y=_.substring(0,v-1),w=_.substring(m-1);if(w.startsWith(h)||(f=!1),w.length>0){const I=w.charAt(0);if(!eo._isBeforeClosingBrace(e,w)&&!c(I))return null}if(a.open.length===1&&(o==="'"||o==='"')&&l!=="always"){const I=Vc(e.wordSeparators);if(y.length>0){const k=y.charCodeAt(y.length-1);if(I.get(k)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const L=t.tokenization.getLineTokens(p),D=s5(L,v-1);if(!a.shouldAutoClose(D,v-D.firstCharOffset))return null;const E=a.findNeutralCharacter();if(E){const I=t.tokenization.getTokenTypeIfInsertingCharacter(p,v,E);if(!a.isOK(I))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,n,o,r,s,a){const l=[];for(let c=0,d=o.length;cnew Qr(new V(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Sa(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,n,r,l,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,n,r,l,!0,d):null}static typeWithInterceptors(e,t,n,o,r,s,a){if(!e&&a===` +`){const d=[];for(let u=0,h=r.length;u{const o=t.get(Jn).getFocusedCodeEditor();return o&&o.hasTextFocus()?this._runEditorCommand(t,o,n):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,n)=>{const o=Nd();return o&&["input","textarea"].indexOf(o.tagName.toLowerCase())>=0?(this.runDOMCommand(o),!0):!1}),e.addImplementation(0,"generic-dom",(t,n)=>{const o=t.get(Jn).getActiveCodeEditor();return o?(o.focus(),this._runEditorCommand(t,o,n)):!1})}_runEditorCommand(e,t,n){const o=this.runEditorCommand(e,t,n);return o||!0}}var Cr;(function(i){class e extends ho{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,y){if(!y.position)return;_.model.pushStackElement(),_.setCursorStates(y.source,3,[Mr.moveTo(_,_.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&_.revealPrimaryCursor(y.source,!0,!0)}}i.MoveTo=Ye(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),i.MoveToSelect=Ye(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ho{runCoreEditorCommand(_,y){_.model.pushStackElement();const w=this._getColumnSelectResult(_,_.getPrimaryCursorState(),_.getCursorColumnSelectData(),y);w!==null&&(_.setCursorStates(y.source,3,w.viewStates.map(L=>kn.fromViewState(L))),_.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?_.revealTopMostCursor(y.source):_.revealBottomMostCursor(y.source))}}i.ColumnSelect=Ye(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(m,_,y,w){if(typeof w.position=="undefined"||typeof w.viewPosition=="undefined"||typeof w.mouseColumn=="undefined")return null;const L=m.model.validatePosition(w.position),D=m.coordinatesConverter.validateViewPosition(new ae(w.viewPosition.lineNumber,w.viewPosition.column),L),E=w.doColumnSelect?y.fromViewLineNumber:D.lineNumber,I=w.doColumnSelect?y.fromViewVisualColumn:w.mouseColumn-1;return j_.columnSelect(m.cursorConfig,m,E,I,D.lineNumber,w.mouseColumn-1)}}),i.CursorColumnSelectLeft=Ye(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,w){return j_.columnSelectLeft(m.cursorConfig,m,y)}}),i.CursorColumnSelectRight=Ye(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,w){return j_.columnSelectRight(m.cursorConfig,m,y)}});class n extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,w,L){return j_.columnSelectUp(_.cursorConfig,_,w,this._isPaged)}}i.CursorColumnSelectUp=Ye(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3600,linux:{primary:0}}})),i.CursorColumnSelectPageUp=Ye(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,w,L){return j_.columnSelectDown(_.cursorConfig,_,w,this._isPaged)}}i.CursorColumnSelectDown=Ye(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3602,linux:{primary:0}}})),i.CursorColumnSelectPageDown=Ye(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends ho{constructor(){super({id:"cursorMove",precondition:void 0,description:fP.description})}runCoreEditorCommand(_,y){const w=fP.parse(y);!w||this._runCursorMove(_,y.source,w)}_runCursorMove(_,y,w){_.model.pushStackElement(),_.setCursorStates(y,3,r._move(_,_.getCursorStates(),w)),_.revealPrimaryCursor(y,!0)}static _move(_,y,w){const L=w.select,D=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 Mr.simpleMove(_,y,w.direction,L,D,w.unit);case 11:case 13:case 12:case 14:return Mr.viewportMove(_,y,w.direction,L,D);default:return null}}}i.CursorMoveImpl=r,i.CursorMove=Ye(new r);class s extends ho{constructor(_){super(_),this._staticArgs=_.args}runCoreEditorCommand(_,y){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||_.cursorConfig.pageSize}),_.model.pushStackElement(),_.setCursorStates(y.source,3,Mr.simpleMove(_,_.getCursorStates(),w.direction,w.select,w.value,w.unit)),_.revealPrimaryCursor(y.source,!0)}}i.CursorLeft=Ye(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),i.CursorLeftSelect=Ye(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1039}})),i.CursorRight=Ye(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),i.CursorRightSelect=Ye(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1041}})),i.CursorUp=Ye(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),i.CursorUpSelect=Ye(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),i.CursorPageUp=Ye(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:11}})),i.CursorPageUpSelect=Ye(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1035}})),i.CursorDown=Ye(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),i.CursorDownSelect=Ye(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),i.CursorPageDown=Ye(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:12}})),i.CursorPageDownSelect=Ye(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1036}})),i.CreateCursor=Ye(new class extends ho{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(m,_){if(!_.position)return;let y;_.wholeLine?y=Mr.line(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition):y=Mr.moveTo(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition);const w=m.getCursorStates();if(w.length>1){const L=y.modelState?y.modelState.position:null,D=y.viewState?y.viewState.position:null;for(let E=0,I=w.length;ED&&(L=D);const E=new V(L,1,L,m.model.getLineMaxColumn(L));let I=0;if(y.at)switch(y.at){case $C.RawAtArgument.Top:I=3;break;case $C.RawAtArgument.Center:I=1;break;case $C.RawAtArgument.Bottom:I=4;break}const k=m.coordinatesConverter.convertModelRangeToViewRange(E);m.revealRange(_.source,!1,k,I,0)}}),i.SelectAll=new class extends SH{constructor(){super(oJe)}runDOMCommand(m){Fc&&(m.focus(),m.select()),m.ownerDocument.execCommand("selectAll")}runEditorCommand(m,_,y){const w=_._getViewModel();!w||this.runCoreEditorCommand(w,y)}runCoreEditorCommand(m,_){m.model.pushStackElement(),m.setCursorStates("keyboard",3,[Mr.selectAll(m,m.getPrimaryCursorState())])}},i.SetSelection=Ye(new class extends ho{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(m,_){!_.selection||(m.model.pushStackElement(),m.setCursorStates(_.source,3,[kn.fromModelSelection(_.selection)]))}})})(Cr||(Cr={}));const Crt=Me.and(Q.textInputFocus,Q.columnSelection);function xS(i,e){Va.registerKeybindingRule({id:i,primary:e,when:Crt,weight:Yn+1})}xS(Cr.CursorColumnSelectLeft.id,1039);xS(Cr.CursorColumnSelectRight.id,1041);xS(Cr.CursorColumnSelectUp.id,1040);xS(Cr.CursorColumnSelectPageUp.id,1035);xS(Cr.CursorColumnSelectDown.id,1042);xS(Cr.CursorColumnSelectPageDown.id,1036);function jre(i){return i.register(),i}var ky;(function(i){class e extends Ir{runEditorCommand(n,o,r){const s=o._getViewModel();!s||this.runCoreEditingCommand(o,s,r||{})}}i.CoreEditingCommand=e,i.LineBreakInsert=Ye(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.lineBreakInsert(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection)))}}),i.Outdent=Ye(new class extends e{constructor(){super({id:"outdent",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Me.and(Q.editorTextFocus,Q.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.outdent(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),i.Tab=Ye(new class extends e{constructor(){super({id:"tab",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Me.and(Q.editorTextFocus,Q.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.tab(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),i.DeleteLeft=Ye(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,n,o){const[r,s]=ob.deleteLeft(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection),n.getCursorAutoClosedCharacters());r&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(2)}}),i.DeleteRight=Ye(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,n,o){const[r,s]=ob.deleteRight(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection));r&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(3)}}),i.Undo=new class extends SH{constructor(){super(S0e)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,n,o){if(!(!n.hasModel()||n.getOption(90)===!0))return n.getModel().undo()}},i.Redo=new class extends SH{constructor(){super(x0e)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,n,o){if(!(!n.hasModel()||n.getOption(90)===!0))return n.getModel().redo()}}})(ky||(ky={}));class Kre extends n5{constructor(e,t,n){super({id:e,precondition:void 0,description:n}),this._handlerId=t}runCommand(e,t){const n=e.get(Jn).getFocusedCodeEditor();!n||n.trigger("keyboard",this._handlerId,t)}}function Ub(i,e){jre(new Kre("default:"+i,i)),jre(new Kre(i,i,e))}Ub("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Ub("replacePreviousChar");Ub("compositionType");Ub("compositionStart");Ub("compositionEnd");Ub("paste");Ub("cut");class yrt{constructor(e,t,n,o){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=o}paste(e,t,n,o){this.commandDelegate.paste(e,t,n,o)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,o){this.commandDelegate.compositionType(e,t,n,o)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Cr.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):o?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){Cr.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Cr.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),Cr.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),Cr.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Cr.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Cr.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Cr.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Cr.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Cr.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Cr.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Cr.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Cr.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Cr.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 w5{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 w5.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const n=Object.assign({},e);return n.position&&(n.position=t.convertViewPositionToModelPosition(n.position)),n.range&&(n.range=t.convertViewRangeToModelRange(n.range)),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}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 ae(e.afterLineNumber,1)).lineNumber}}}class Mbe{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 Vo("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const n=this.getStartLineNumber(),o=this.getEndLineNumber();if(to)return null;let r=0,s=0;for(let l=n;l<=o;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(r=c,s=1):s++)}if(e=o&&a<=r&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const n=t-e+1,o=this.getStartLineNumber(),r=this.getEndLineNumber();if(e<=o)return this._rendLineNumberStart+=n,null;if(e>r)return null;if(n+e>r)return this._lines.splice(e-this._rendLineNumberStart,r-e+1);const s=[];for(let u=0;un)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(n,a.toLineNumber);for(let d=l;d<=c;d++){const u=d-this._rendLineNumberStart;this._lines[u].onTokensChanged(),o=!0}}return o}}class Abe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Mbe(()=>this._host.createVisibleLine())}_createDomNode(){const e=ti(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 n=0,o=t.length;nt){const s=t,a=Math.min(n,r.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(r,s,a,o,t),r.linesLength+=a-s+1)}else if(r.rendLineNumberStart0&&(this._removeLinesBefore(r,s),r.linesLength-=s)}if(r.rendLineNumberStart=t,r.rendLineNumberStart+r.linesLength-1n){const s=Math.max(0,n-r.rendLineNumberStart+1),l=r.linesLength-1-s+1;l>0&&(this._removeLinesAfter(r,l),r.linesLength-=l)}return this._finishRendering(r,!1,o),r}_renderUntouchedLines(e,t,n,o,r){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=n;l++){const c=s+l;a[l].layoutLine(c,o[c-r])}}_insertLinesBefore(e,t,n,o,r){const s=[];let a=0;for(let l=t;l<=n;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n=0;a--){const l=e.lines[a];o[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,n){const o=document.createElement("div");Dg._ttPolicy&&(t=Dg._ttPolicy.createHTML(t)),o.innerHTML=t;for(let r=0;ri});Dg._sb=new yS(1e5);class Pbe extends pl{constructor(e){super(e),this._visibleLines=new Abe(this),this.domNode=this._visibleLines.domNode;const n=this._context.configuration.options.get(50);ss(this.domNode,n),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;en.shouldRender());for(let n=0,o=t.length;n'),o.appendString(r),o.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class Srt extends Pbe{constructor(e){super(e);const n=this._context.configuration.options.get(143);this._contentWidth=n.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._contentWidth=n.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 xrt extends Pbe{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._contentLeft=n.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),ss(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;ss(this.domNode,t.get(50));const n=t.get(143);return this._contentLeft=n.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 Lrt extends pl{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ti(document.createElement("div")),vf.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ti(document.createElement("div")),vf.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].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 Ert(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,n,o,r){this._widgets[e.getId()].setPosition(t,n,o,r),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t];delete this._widgets[t];const o=n.domNode.domNode;o.parentNode.removeChild(o),o.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 n of t)this._widgets[n].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].render(e)}}class Ert{constructor(e,t,n){this._primaryAnchor=new Vx(null,null),this._secondaryAnchor=new Vx(null,null),this._context=e,this._viewDomNode=t,this._actual=n,this.domNode=ti(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const o=this._context.configuration.options,r=o.get(143);this._fixedOverflowWidgets=o.get(42),this._contentWidth=r.contentWidth,this._contentLeft=r.contentLeft,this._lineHeight=o.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 n=t.get(143);this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,n){this._affinity=e,this._primaryAnchor=o(t,this._context.viewModel,this._affinity),this._secondaryAnchor=o(n,this._context.viewModel,this._affinity);function o(r,s,a){if(!r)return new Vx(null,null);const l=s.model.validatePosition(r);if(s.coordinatesConverter.modelPositionIsVisible(l)){const c=s.coordinatesConverter.convertModelPositionToViewPosition(l,a!=null?a:void 0);return new Vx(r,c)}return new Vx(r,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,n,o){this._setPosition(o,e,t),this._preference=n,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,n,o){const r=e.top,s=r,a=e.top+e.height,l=o.viewportHeight-a,c=r-n,d=s>=n,u=a,h=l>=n;let f=e.left;return f+t>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-t),fc){const f=h-(c-o);h-=f,n-=f}if(h=m,w=f+n<=g.height-_;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,m),fitsBelow:w,belowTop:f,left:v}:{fitsAbove:y,aboveTop:a,fitsBelow:w,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Hx(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,n;const o=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),r=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((n=this._primaryAnchor.viewPosition)===null||n===void 0?void 0:n.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(r,this._affinity,this._lineHeight);return{primary:o,secondary:s};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 qre(f,h,d)}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;const o=this._context.configuration.options.get(50);let r=t.left;return re.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"&&d9(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"&&d9(this._actual.afterRender,this._actual,this._renderData.position)}}class Vx{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class Hx{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class qre{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}}function d9(i,e,...t){try{return i.call(e,...t)}catch{return null}}class Obe extends zb{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new gt(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(o=>o.positionLineNumber);t.sort((o,r)=>o-r),Lo(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const n=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=n.contentLeft,this._contentWidth=n.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),n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=this._cursorLineNumbers.length;let s=0;const a=[];for(let l=n;l<=o;l++){const c=l-n;for(;s=this._renderData.length?"":this._renderData[n]}_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 Drt extends Obe{_renderOne(e){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class krt extends Obe{_renderOne(e){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}jd((i,e)=>{const t=i.getColor(wbe);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||i.defines($re)){const n=i.getColor($re);n&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${n}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${n}; }`),Hu(i.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 Irt extends zb{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 n=[],o=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:V.compareRangesUsingStarts(l.range,c.range)});const r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=r;l<=s;l++){const c=l-r;a[c]=""}this._renderWholeLineDecorations(e,n,a),this._renderNormalDecorations(e,n,a),this._renderResult=a}_renderWholeLineDecorations(e,t,n){const o=String(this._lineHeight),r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',u=Math.max(c.range.startLineNumber,r),h=Math.min(c.range.endLineNumber,s);for(let f=u;f<=h;f++){const g=f-r;n[g]+=d}}}_renderNormalDecorations(e,t,n){var o;const r=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,d=!1;for(let u=0,h=t.length;u';l[f]+=_}}}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Trt extends pl{constructor(e,t,n,o){super(e);const r=this._context.configuration.options,s=r.get(102),a=r.get(74),l=r.get(40),c=r.get(105),d={listenOnDomNode:n.domNode,className:"editor-scrollable "+yH(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new AG(t.domNode,d,this._context.viewLayout.getScrollable())),vf.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=ti(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(h,f,g)=>{const p={};if(f){const v=h.scrollTop;v&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,h.scrollTop=0)}if(g){const v=h.scrollLeft;v&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(ke(n.domNode,"scroll",h=>u(n.domNode,!0,!0))),this._register(ke(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(ke(o.domNode,"scroll",h=>u(o.domNode,!0,!1))),this._register(ke(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,n=t.get(102),o=t.get(74),r=t.get(40),s=t.get(105),a={vertical:n.vertical,horizontal:n.horizontal,verticalScrollbarSize:n.verticalScrollbarSize,horizontalScrollbarSize:n.horizontalScrollbarSize,scrollByPage:n.scrollByPage,handleMouseWheel:n.handleMouseWheel,mouseWheelScrollSensitivity:o,fastScrollSensitivity:r,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+yH(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class Fbe extends _e{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function S5(i,e){let t=0,n=0;const o=i.length;for(;no)throw new Vo("Illegal value for lineNumber");const r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(r&&r.offSide);let a=-2,l=-1,c=-2,d=-1;const u=E=>{if(a!==-1&&(a===-2||a>E-1)){a=-1,l=-1;for(let I=E-2;I>=0;I--){const k=this._computeIndentLevel(I);if(k>=0){a=I,l=k;break}}}if(c===-2){c=-1,d=-1;for(let I=E;I=0){c=I,d=k;break}}}};let h=-2,f=-1,g=-2,p=-1;const v=E=>{if(h===-2){h=-1,f=-1;for(let I=E-2;I>=0;I--){const k=this._computeIndentLevel(I);if(k>=0){h=I,f=k;break}}}if(g!==-1&&(g===-2||g=0){g=I,p=k;break}}}};let m=0,_=!0,y=0,w=!0,L=0,D=0;for(let E=0;_||w;E++){const I=e-E,k=e+E;E>1&&(I<1||I1&&(k>o||k>n)&&(w=!1),E>5e4&&(_=!1,w=!1);let R=-1;if(_&&I>=1){const P=this._computeIndentLevel(I-1);P>=0?(c=I-1,d=P,R=Math.ceil(P/this.textModel.getOptions().indentSize)):(u(I),R=this._getIndentLevelForWhitespaceLine(s,l,d))}let A=-1;if(w&&k<=o){const P=this._computeIndentLevel(k-1);P>=0?(h=k-1,f=P,A=Math.ceil(P/this.textModel.getOptions().indentSize)):(v(k),A=this._getIndentLevelForWhitespaceLine(s,f,p))}if(E===0){D=R;continue}if(E===1){if(k<=o&&A>=0&&D+1===A){_=!1,m=k,y=k,L=A;continue}if(I>=1&&R>=0&&R-1===D){w=!1,m=I,y=I,L=R;continue}if(m=e,y=e,L=D,L===0)return{startLineNumber:m,endLineNumber:y,indent:L}}_&&(R>=L?m=I:_=!1),w&&(A>=L?y=k:w=!1)}return{startLineNumber:m,endLineNumber:y,indent:L}}getLinesBracketGuides(e,t,n,o){var r;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new V(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(n&&l.length>0){const h=(e<=n.lineNumber&&n.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(V.fromPositions(n)).toArray()).filter(f=>V.strictContainsPosition(f.range,n));c=(r=nP(h,f=>a))===null||r===void 0?void 0:r.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new Bbe;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!o.includeInactive)continue;const g=u.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,d)+(o.highlightActive&&f?" "+u.activeClassName:""),p=h.openingBracketRange.getStartPosition(),v=h.closingBracketRange.getStartPosition(),m=o.horizontalGuides===N0.Enabled||o.horizontalGuides===N0.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){m&&s[h.range.startLineNumber-e].push(new v0(-1,h.openingBracketRange.getEndPosition().column,g,new mE(!1,v.column),-1,-1));continue}const _=this.getVisibleColumnFromPosition(v),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(y,_,h.minVisibleColumnIndentation+1);let L=!1;Ws(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&y>w&&s[p.lineNumber-e].push(new v0(w,-1,g,new mE(!1,p.column),-1,-1)),v.lineNumber<=t&&_>w&&s[v.lineNumber-e].push(new v0(w,-1,g,new mE(!L,v.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return or.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");const o=this.textModel.getOptions(),r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(r&&r.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/o.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const v=this._computeIndentLevel(p);if(v>=0){l=p,c=v;break}}}if(d!==-1&&(d===-2||d=0){d=p,u=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(s,c,u)}return a}_getIndentLevelForWhitespaceLine(e,t,n){const o=this.textModel.getOptions();return t===-1||n===-1?0:tl||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const w=_.horizontalLine?_.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",L=_.horizontalLine?((r=(o=e.visibleRangeForPosition(new ae(f,_.horizontalLine.endColumn)))===null||o===void 0?void 0:o.left)!==null&&r!==void 0?r:y+this._spaceWidth)-y:this._spaceWidth;v+=`
`}h[g]=v}this._renderResult=h}getGuidesByLine(e,t,n){const o=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?N0.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?N0.EnabledForActive:N0.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,r=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){const u=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);s=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=o?o[u-e]:[],g=new lp(f),p=r?r[u-e]:0;for(let v=1;v<=p;v++){const m=(v-1)*c+1,_=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=u&&u<=a&&v===l;h.push(...g.takeWhile(w=>w.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function j1(i){if(!(i&&i.isTransparent()))return i}jd((i,e)=>{const t=[{bracketColor:Lbe,guideColor:$ot,guideColorActive:Got},{bracketColor:Ebe,guideColor:zot,guideColorActive:Xot},{bracketColor:Dbe,guideColor:Uot,guideColorActive:Yot},{bracketColor:kbe,guideColor:jot,guideColorActive:Zot},{bracketColor:Ibe,guideColor:Kot,guideColorActive:Qot},{bracketColor:Tbe,guideColor:qot,guideColorActive:Jot}],n=new Bbe,o=[{indentColor:JI,indentColorActive:eT},{indentColor:xot,indentColorActive:Iot},{indentColor:Lot,indentColorActive:Tot},{indentColor:Eot,indentColorActive:Not},{indentColor:Dot,indentColorActive:Rot},{indentColor:kot,indentColorActive:Mot}],r=t.map(a=>{var l,c;const d=i.getColor(a.bracketColor),u=i.getColor(a.guideColor),h=i.getColor(a.guideColorActive),f=j1((l=j1(u))!==null&&l!==void 0?l:d==null?void 0:d.transparent(.3)),g=j1((c=j1(h))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(kD),s=o.map(a=>{const l=i.getColor(a.indentColor),c=i.getColor(a.indentColorActive),d=j1(l),u=j1(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(kD);if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class u9{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 Mrt{constructor(){this._currentVisibleRange=new V(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Art{constructor(e,t,n,o,r,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=o,this.startScrollTop=r,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Prt{constructor(e,t,n,o,r){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=o,this.scrollType=r,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new bi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Mrt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=o.get(114).enabled,this._maxNumberStickyLines=o.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Oh(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,n=t.get(50),o=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.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,ss(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Bre(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++)this._visibleLines.getVisibleLine(r).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let o=!1;for(let r=t;r<=n;r++)o=this._visibleLines.getVisibleLine(r).onSelectionChanged()||o;return o}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=t;o<=n;o++)this._visibleLines.getVisibleLine(o).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 n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Art(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Prt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,r),!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),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(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 n=this._getViewLineDomNode(e);if(n===null)return null;const o=this._getLineNumberFor(n);if(o===-1||o<1||o>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(o)===1)return new ae(o,1);const r=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(os)return null;let a=this._visibleLines.getVisibleLine(o).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(o);return an)return-1;const o=new u9(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getWidth(o);return this._updateLineWidthsSlowIfDomDidLayout(o),r}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const n=e.endLineNumber,o=V.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!o)return null;const r=[];let s=0;const a=new u9(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(o.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let u=o.startLineNumber;u<=o.endLineNumber;u++){if(ud)continue;const h=u===o.startLineNumber?o.startColumn:1,f=u!==o.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(u):o.endColumn,p=this._visibleLines.getVisibleLine(u).getVisibleRangesForRange(u,h,g,a);if(!!p){if(t&&uthis._visibleLines.getEndLineNumber())return null;const o=new u9(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,o);return this._updateLineWidthsSlowIfDomDidLayout(o),r}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new jit(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(),n=this._visibleLines.getEndLineNumber();let o=1,r=!0;for(let s=t;s<=n;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){r=!1;continue}o=Math.max(o,a.getWidth(null))}return r&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(o),r}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++){const s=this._visibleLines.getVisibleLine(r);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=r)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let r=n;r<=o;r++)this._visibleLines.getVisibleLine(r).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 n=this._horizontalRevealRequest;if(e.startLineNumber<=n.minLineNumber&&n.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const o=this._computeScrollLeftToReveal(n);o&&(this._isViewportWrapping||this._ensureMaxLineWidth(o.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:o.scrollLeft},n.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),xs&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++)if(this._visibleLines.getVisibleLine(r).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 m=r[0].startLineNumber,_=r[0].endLineNumber;for(let y=1,w=r.length;yl){if(!d)return-1;v=u}else if(s===5||s===6)if(s===6&&a<=u&&h<=c)v=a;else{const m=Math.max(5*this._lineHeight,l*.2),_=u-m,y=h-l;v=Math.max(y,_)}else if(s===1||s===2)if(s===2&&a<=u&&h<=c)v=a;else{const m=(u+h)/2;v=Math.max(0,m-l/2)}else v=this._computeMinimumScrolling(a,c,u,h,s===3,s===4);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),n=this._context.configuration.options.get(143),o=t.left,r=o+t.width-n.verticalScrollbarWidth;let s=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)s=Math.min(s,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)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(s=Math.max(0,s-x5.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(o,r,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,n,o,r,s){e=e|0,t=t|0,n=n|0,o=o|0,r=!!r,s=!!s;const a=t-e;if(o-nt)return Math.max(0,o-a)}else return n;return e}}x5.HORIZONTAL_EXTRA_PX=30;class xH{constructor(e,t,n,o){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(n),this.zIndex=o!=null?o:0}}class Ort{constructor(e,t){this.className=e,this.zIndex=t}}class Frt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Wbe extends zb{_render(e,t,n){const o=[];for(let a=e;a<=t;a++){const l=a-e;o[l]=new Frt}if(n.length===0)return o;n.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNameo)continue;const a=Math.max(s.startLineNumber,n),l=Math.min(r.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new Vrt(a,l,r.preference.zIndex,r))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((n,o)=>n.lineNumber===o.lineNumber?n.lane===o.lane?n.zIndex===o.zIndex?o.type===n.type?n.type===0&&o.type===0?n.className0;){const o=t.peek();if(!o)break;const r=t.takeWhile(a=>a.lineNumber===o.lineNumber&&a.lane===o.lane);if(!r||r.length===0)break;const s=r[0];if(s.type===0){const a=[];for(const l of r){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}n.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,lane:s.lane}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(const n of Object.values(this._widgets))n.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay("none");else{const o=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],r=this._glyphMarginLeft+(n.renderInfo.lane-1)*this._lineHeight;n.domNode.setDisplay("block"),n.domNode.setTop(o),n.domNode.setLeft(r),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;nthis._decorationGlyphsToRender.length;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}}}class Wrt{constructor(e,t,n,o){this.lineNumber=e,this.lane=t,this.zIndex=n,this.className=o,this.type=0}accept(e){return new Hrt(this.lineNumber,this.lane,e)}}class Vrt{constructor(e,t,n,o){this.lineNumber=e,this.lane=t,this.zIndex=n,this.widget=o,this.type=1}}class Hrt{constructor(e,t,n){this.lineNumber=e,this.lane=t,this.combinedClassName=n}}class $rt extends Wbe{constructor(e){super(),this._context=e;const n=this._context.configuration.options.get(143);this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.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(),n=[];let o=0;for(let r=0,s=t.length;r',l=[];for(let c=t;c<=n;c++){const d=c-t,u=o[d].getDecorations();let h="";for(const f of u)h+='
';r[a]=c}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Tc{constructor(e,t,n,o){this._rgba8Brand=void 0,this.r=Tc._clamp(e),this.g=Tc._clamp(t),this.b=Tc._clamp(n),this.a=Tc._clamp(o)}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}}Tc.Empty=new Tc(0,0,0,0);class nT extends _e{static getInstance(){return this._INSTANCE||(this._INSTANCE=new nT),this._INSTANCE}constructor(){super(),this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(oo.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=oo.getColorMap();if(!e){this._colors=[Tc.Empty],this._backgroundIsLight=!0;return}this._colors=[Tc.Empty];for(let n=1;n=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}nT._INSTANCE=null;const Urt=(()=>{const i=[];for(let e=32;e<=126;e++)i.push(e);return i.push(65533),i})(),jrt=(i,e)=>(i-=32,i<0||i>96?e<=2?(i+96)%96:96-1:i);class nk{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=nk.soften(e,12/15),this.charDataLight=nk.soften(e,50/60)}static soften(e,t){const n=new Uint8ClampedArray(e.length);for(let o=0,r=e.length;oe.width||n+g>e.height){console.warn("bad render request outside image data");return}const p=d?this.charDataLight:this.charDataNormal,v=jrt(o,c),m=e.width*4,_=a.r,y=a.g,w=a.b,L=r.r-_,D=r.g-y,E=r.b-w,I=Math.max(s,l),k=e.data;let R=v*h*f,A=n*m+t*4;for(let P=0;Pe.width||n+u>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(r/255),g=s.r,p=s.g,v=s.b,m=o.r-g,_=o.g-p,y=o.b-v,w=g+m*f,L=p+_*f,D=v+y*f,E=Math.max(r,a),I=e.data;let k=n*h+t*4;for(let R=0;R{const e=new Uint8ClampedArray(i.length/2);for(let t=0;t>1]=Gre[i[t]]<<4|Gre[i[t+1]]&15;return e},Yre={1:yv(()=>Xre("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:yv(()=>Xre("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class vE{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return Yre[e]?n=new nk(Yre[e](),e):n=vE.createFromSampleData(vE.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),n=t.getContext("2d");t.style.height=`${16}px`,t.height=16,t.width=96*10,t.style.width=96*10+"px",n.fillStyle="#ffffff",n.font=`bold ${16}px ${e}`,n.textBaseline="middle";let o=0;for(const r of Urt)n.fillText(String.fromCharCode(r),o,16/2),o+=10;return n.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const o=vE._downsample(e,t);return new nk(o,t)}static _downsampleChar(e,t,n,o,r){const s=1*r,a=2*r;let l=o,c=0;for(let d=0;d0){const c=255/l;for(let d=0;dvE.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=ik._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=ik._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const n=e.getColor(kit);return n?new Tc(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Iit);return t?Tc._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 _E{constructor(e,t,n,o,r,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=o,this.sliderTop=r,this.sliderHeight=s,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),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,n,o,r,s,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 D=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(D+=Math.max(0,r-e.lineHeight-e.paddingBottom));const E=Math.max(1,Math.floor(r*r/D)),I=Math.max(0,e.minimapHeight-E),k=I/(d-r),R=c*k,A=I>0,P=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),N=Math.floor(e.paddingTop/e.lineHeight);return new _E(c,d,A,k,R,E,N,1,Math.min(a,P))}let v;if(s&&n!==a){const D=n-t+1;v=Math.floor(D*f/h)}else{const D=r/p;v=Math.floor(D*f/h)}const m=Math.floor(e.paddingTop/p);let _=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const D=r/p;_=Math.max(_,D-1)}let y;if(_>0){const D=r/p;y=(m+a+_-D-1)*f/h}else y=Math.max(0,(m+a)*f/h-v);y=Math.min(e.minimapHeight-v,y);const w=y/(d-r),L=c*w;if(g>=m+a+_){const D=y>0;return new _E(c,d,D,w,L,v,m,1,a)}else{let D;t>1?D=t+m:D=Math.max(1,c/p);let E,I=Math.max(1,Math.floor(D-L*h/f));Ic&&(I=Math.min(I,u.startLineNumber),E=Math.max(E,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?A=(t-I+E+R)*f/h:A=c/e.paddingTop*(E+R)*f/h,new _E(c,d,!0,w,A,v,E,I,k)}}}class gP{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}gP.INVALID=new gP(-1);class Zre{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Mbe(()=>gP.INVALID),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;const n=this._renderedLines._get().lines;for(let o=0,r=n.length;o1){for(let m=0,_=o-1;m<_;m++)v[m]=Math.round(m*r+s);v[o-1]=t}return[new ok(r,v),[]]}const a=n.minimapLines,l=a.length,c=[];let d=0,u=0,h=1;const f=10;let g=[],p=null;for(let v=0;v0&&this.minimapLines[n-1]>=e;)n--;let o=this.modelLineToMinimapLine(t)-1;for(;o+1t)return null}return[n+1,o+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),o=this.modelLineToMinimapLine(t);return e!==t&&o===n&&(o===this.minimapLines.length?n>1&&n--:o++),[n,o]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let n=this.minimapLines.length,o=0;for(let r=this.minimapLines.length-1;r>=0&&!(this.minimapLines[r]=0&&!(this.minimapLines[n]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(o)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,n]=ok.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const o of n)switch(o.type){case"deleted":this._actual.onLinesDeleted(o.deleteFromLineNumber,o.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(o.insertFromLineNumber,o.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,n){if(this._samplingState){const o=[];for(let r=0,s=t-e+1;r{if(n.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(n.button===0&&this._lastRenderData){const c=Yo(this._slider.domNode),d=c.top+c.height/2;this._startSliderDragging(n,d,this._lastRenderData.renderedLayout)}return}const r=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*n.offsetY;let l=Math.floor(s/r)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new SS,this._sliderPointerDownListener=No(this._slider.domNode,et.POINTER_DOWN,n=>{n.preventDefault(),n.stopPropagation(),n.button===0&&this._lastRenderData&&this._startSliderDragging(n,n.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Ei.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ke(this._domNode.domNode,Di.Start,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(n))},{passive:!1}),this._sliderTouchMoveListener=ke(this._domNode.domNode,Di.Change,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(n)},{passive:!1}),this._sliderTouchEndListener=No(this._domNode.domNode,Di.End,n=>{n.preventDefault(),n.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;const o=e.pageX;this._slider.toggleClassName("active",!0);const r=(s,a)=>{const l=Yo(this._domNode.domNode),c=Math.min(Math.abs(a-o),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(ls&&c>Krt){this._model.setScrollTop(n.scrollTop);return}const d=s-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&r(e.pageY,o),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>r(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}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 FG(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 n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Are),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 n=_E.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(n.sliderNeeded?"block":"none"),this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this.renderDecorations(n),this._lastRenderData=this.renderLines(n)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(V.compareRangesUsingStarts);const n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:o,canvasInnerHeight:r}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,o,r);const d=new Qre(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,s),this._renderDecorationsLineHighlights(c,n,d,e,s);const u=new Qre(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,s,l,a,o),this._renderDecorationsHighlights(c,n,u,e,s,l,a,o)}}_renderSelectionLineHighlights(e,t,n,o,r){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=o.intersectWithViewport(l);if(!c)continue;const[d,u]=c;for(let g=d;g<=u;g++)n.set(g,!0);const h=o.getYForLineNumber(d,r),f=o.getYForLineNumber(u,r);a>=h||(a>s&&e.fillRect(qp,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(qp,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,n,o,r){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==ll.Inline)continue;const d=o.intersectWithViewport(l.range);if(!d)continue;const[u,h]=d,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let p=u;p<=h;p++){if(n.has(p))continue;n.set(p,!0);const v=o.getYForLineNumber(u,r);e.fillRect(qp,v,e.canvas.width,r)}}}_renderSelectionsHighlights(e,t,n,o,r,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=o.intersectWithViewport(c);if(!d)continue;const[u,h]=d;for(let f=u;f<=h;f++)this.renderDecorationOnLine(e,n,c,this._selectionColor,o,f,r,r,s,a,l)}}_renderDecorationsHighlights(e,t,n,o,r,s,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const u=o.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 ll.Inline:this.renderDecorationOnLine(e,n,c.range,g,o,p,r,r,s,a,l);continue;case ll.Gutter:{const v=o.getYForLineNumber(p,r),m=2;this.renderDecoration(e,g,m,v,qrt,r);continue}}}}renderDecorationOnLine(e,t,n,o,r,s,a,l,c,d,u){const h=r.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=n,p=f===s?n.startColumn:1,v=g===s?n.endColumn:this._model.getLineMaxColumn(s),m=this.getXOffsetForPosition(t,s,p,c,d,u),_=this.getXOffsetForPosition(t,s,v,c,d,u);this.renderDecoration(e,o,m,h,_-m,a)}getXOffsetForPosition(e,t,n,o,r,s){if(n===1)return qp;if((n-1)*r>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[qp];let d=qp;for(let u=1;u=s){l[u]=s;break}l[u]=g,d=g}e.set(t,l)}return n-1L?Math.floor((o-L)/2):0,E=h.a/255,I=new Tc(Math.round((h.r-u.r)*E+u.r),Math.round((h.g-u.g)*E+u.g),Math.round((h.b-u.b)*E+u.b),255);let k=e.topPaddingLineCount*o;const R=[];for(let H=0,B=n-t+1;H=0&&A_)return;const P=v.charCodeAt(L);if(P===9){const N=h-(L+D)%h;D+=N-1,w+=N*s}else if(P===32)w+=s;else{const N=wv(P)?2:1;for(let M=0;M_)return}}}}}class Qre{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let o=0,r=this._endLineNumber-this._startLineNumber+1;othis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class Xrt extends pl{constructor(e){super(e);const n=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._domNode=ti(document.createElement("div")),vf.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,!0}addWidget(e){const t=ti(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 n=this._widgets[e.getId()];return n.preference===t?(this._updateMaxMinWidth(),!1):(n.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const o=this._widgets[t].domNode.domNode;delete this._widgets[t],o.parentNode.removeChild(o),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let n=0;const o=Object.keys(this._widgets);for(let r=0,s=o.length;r=3){const r=Math.floor(o/3),s=Math.floor(o/3),a=o-r-s,l=e,c=l+r,d=l+r+a;return[[0,l,c,l,d,l,c,l],[0,r,a,r+a,s,r+a+s,a+s,r+a+s]]}else if(n===2){const r=Math.floor(o/2),s=o-r,a=e,l=a+r;return[[0,a,a,a,l,a,a,a],[0,r,r,r,s,r+s,r+s,r+s]]}else{const r=e,s=o;return[[0,r,r,r,r,r,r,r],[0,s,s,s,s,s,s,s]]}}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&&ve.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 Zrt extends pl{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ti(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=oo.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Yrt(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,n=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 n=this._settings.canvasWidth,o=this._settings.canvasHeight,r=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=o/a,c=6*this._settings.pixelRatio|0,d=c/2|0,u=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(u.fillStyle=ve.Format.CSS.formatHexA(e),u.fillRect(0,0,n,o)):(u.clearRect(0,0,n,o),u.fillStyle=ve.Format.CSS.formatHexA(e),u.fillRect(0,0,n,o)):u.clearRect(0,0,n,o);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,v=g.data;u.fillStyle=p;let m=0,_=0,y=0;for(let w=0,L=v.length/3;wo&&(P=o-d),k=P-d,R=P+d}k>y+1||D!==m?(w!==0&&u.fillRect(h[m],_,f[m],y-_),m=D,_=k,y=R):R>y&&(y=R)}u.fillRect(h[m],_,f[m],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,v=this._settings.x[7],m=this._settings.w[7];u.fillStyle=this._settings.cursorColor;let _=-100,y=-100;for(let w=0,L=this._cursorPositions.length;wo&&(E=o-p);const I=E-p,k=I+g;I>y+1?(w!==0&&u.fillRect(v,_,m,y-_),_=I,y=k):k>y&&(y=k)}u.fillRect(v,_,m,y-_)}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,o),u.stroke(),u.moveTo(0,0),u.lineTo(n,0),u.stroke())}}class Jre{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|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 Vbe{constructor(e,t,n,o){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=o,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.colorn&&(p=n-v);const m=d.color;let _=this._color2Id[m];_||(_=++this._lastAssignedId,this._color2Id[m]=_,this._id2Color[_]=m);const y=new Jre(p-v,p+v,_);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(Jre.compare),a}}class Jrt extends YI{constructor(e,t){super(),this._context=e;const n=this._context.configuration.options;this._domNode=ti(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Qrt(o=>this._context.viewLayout.getVerticalOffsetForLineNumber(o)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(66)),this._zoneManager.setPixelRatio(n.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(),n=this._zoneManager.resolveColorZones(),o=this._zoneManager.getId2Color(),r=this._domNode.domNode.getContext("2d");return r.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(r,n,o,e),!0}_renderOneLane(e,t,n,o){let r=0,s=0,a=0;for(const l of t){const c=l.colorId,d=l.from,u=l.to;c!==r?(e.fillRect(0,s,o,a-s),r=c,e.fillStyle=n[r],s=d,a=u):a>=d?a=Math.max(a,u):(e.fillRect(0,s,o,a-s),s=d,a=u)}e.fillRect(0,s,o,a-s)}}class est extends pl{constructor(e){super(e),this.domNode=ti(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=ti(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(r),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let n=e-t;for(;n>0;){const o=this._renderedRulers.pop();this.domNode.removeChild(o),n--}}render(e){this._ensureRulersCount();for(let t=0,n=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 n=this._context.configuration.options.get(102);return this._useShadows=n.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 nst{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class ist{constructor(e,t){this.lineNumber=e,this.ranges=t}}function ost(i){return new nst(i)}function rst(i){return new ist(i.lineNumber,i.ranges.map(ost))}class yo extends zb{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,n=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){const o=this._typicalHalfwidthCharacterWidth/4;let r=null,s=null;if(n&&n.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!r&&c=0;c--)n[c].lineNumber===l&&(s=n[c].ranges[0]);r&&!r.startStyle&&(r=null),s&&!s.startStyle&&(s=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;C2(d-g)g&&(h.top=1),C2(u-p)'}_actualRenderOneSelection(e,t,n,o){if(o.length===0)return;const r=!!o[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=o[0].lineNumber,c=o[o.length-1].lineNumber;for(let d=0,u=o.length;d1,c)}this._previousFrameVisibleRangesWithStyle=r,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}yo.SELECTION_CLASS_NAME="selected-text";yo.SELECTION_TOP_LEFT="top-left-radius";yo.SELECTION_BOTTOM_LEFT="bottom-left-radius";yo.SELECTION_TOP_RIGHT="top-right-radius";yo.SELECTION_BOTTOM_RIGHT="bottom-right-radius";yo.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";yo.ROUNDED_PIECE_WIDTH=10;jd((i,e)=>{const t=i.getColor(Ant);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function C2(i){return i<0?-i:i}class ese{constructor(e,t,n,o,r,s,a){this.top=e,this.left=t,this.paddingLeft=n,this.width=o,this.height=r,this.textContent=s,this.textContentClassName=a}}class tse{constructor(e){this._context=e;const t=this._context.configuration.options,n=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ti(document.createElement("div")),this._domNode.setClassName(`cursor ${Ey}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),ss(this._domNode,n),this._domNode.setDisplay("none"),this._position=new ae(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,n=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),ss(this._domNode,n),!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,n=this._context.viewModel.getLineContent(e),[o,r]=_Ze(n,t-1);return[new ae(e,o+1),n.substring(o,r)]}_prepareRender(e){let t="",n="";const[o,r]=this._getGraphemeAwarePosition();if(this._cursorStyle===Wr.Line||this._cursorStyle===Wr.LineThin){const h=e.visibleRangeForPosition(o);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===Wr.Line?(f=Moe(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=r,n=this._getTokenClassName(o))):f=Moe(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const v=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta;return new ese(v,g,p,f,this._lineHeight,t,n)}const s=e.linesVisibleRangesForRange(new V(o.lineNumber,o.column,o.lineNumber,o.column+r.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=r===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Wr.Block&&(t=r,n=this._getTokenClassName(o));let d=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===Wr.Underline||this._cursorStyle===Wr.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new ese(d,l.left,0,c,u,t,n)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${Ey} ${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 rk extends pl{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 tse(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=ti(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 zd,this._cursorFlatBlinkInterval=new UI,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 n=0,o=this._secondaryCursors.length;nt.length){const r=this._secondaryCursors.length-t.length;for(let s=0;s{for(let o=0,r=e.ranges.length;o{this._isVisible?this._hide():this._show()},rk.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},rk.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Wr.Line:e+=" cursor-line-style";break;case Wr.Block:e+=" cursor-block-style";break;case Wr.Underline:e+=" cursor-underline-style";break;case Wr.LineThin:e+=" cursor-line-thin-style";break;case Wr.BlockOutline:e+=" cursor-block-outline-style";break;case Wr.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=i.getColor(Sbe);if(t){let n=i.getColor(wot);n||(n=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${n}; }`),Hu(i.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const h9=()=>{throw new Error("Invalid change accessor")};class sst extends pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._lineHeight=t.get(66),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=ti(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=ti(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 o of e)t.set(o.id,o);let n=!1;return this._context.viewModel.changeWhitespace(o=>{const r=Object.keys(this._zones);for(let s=0,a=r.length;s{const o={addZone:r=>(t=!0,this._addZone(n,r)),removeZone:r=>{!r||(t=this._removeZone(n,r)||t)},layoutZone:r=>{!r||(t=this._layoutZone(n,r)||t)}};ast(e,o),o.addZone=h9,o.removeZone=h9,o.layoutZone=h9}),t}_addZone(e,t){const n=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:ti(t.domNode),marginDomNode:t.marginDomNode?ti(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,n.heightInPx),r.domNode.setPosition("absolute"),r.domNode.domNode.style.width="100%",r.domNode.setDisplay("none"),r.domNode.setAttribute("monaco-view-zone",r.whitespaceId),this.domNode.appendChild(r.domNode),r.marginDomNode&&(r.marginDomNode.setPosition("absolute"),r.marginDomNode.domNode.style.width="100%",r.marginDomNode.setDisplay("none"),r.marginDomNode.setAttribute("monaco-view-zone",r.whitespaceId),this.marginDomNode.appendChild(r.marginDomNode)),this._zones[r.whitespaceId]=r,this.setShouldRender(),r.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute("monaco-visible-view-zone"),n.domNode.removeAttribute("monaco-view-zone"),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute("monaco-visible-view-zone"),n.marginDomNode.removeAttribute("monaco-view-zone"),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t],o=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=o.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,o.afterViewLineNumber,o.heightInPx),this._safeCallOnComputedHeight(n.delegate,o.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!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(n){en(n)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(n){en(n)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,n={};let o=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(n[s.id]=s,o=!0);const r=Object.keys(this._zones);for(let s=0,a=r.length;sa)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=R.endOffset&&(k++,R=n&&n[k]),N!==9&&N!==32||h&&!D&&P<=I)continue;if(u&&P>=E&&P<=I&&N===32){const H=P-1>=0?a.charCodeAt(P-1):0,B=P+1=0?a.charCodeAt(P-1):0;if(N===32&&H!==32&&H!==9)continue}if(n&&(!R||R.startOffset>P||R.endOffset<=P))continue;const M=e.visibleRangeForPosition(new ae(t,P+1));!M||(s?(A=Math.max(A,M.left),N===9?L+=this._renderArrow(f,v,M.left):L+=``):N===9?L+=`
${w?String.fromCharCode(65515):String.fromCharCode(8594)}
`:L+=`
${String.fromCharCode(y)}
`)}return s?(A=Math.round(A+v),``+L+""):L}_renderArrow(e,t,n){const o=t/7,r=t,s=e/2,a=n,l={x:0,y:o/2},c={x:100/125*r,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},v={x:c.x,y:-c.y},m={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class nse{constructor(e){const t=e.options,n=t.get(50),o=t.get(38);o==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):o==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.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 fst=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},gst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let LH=class extends YI{constructor(e,t,n,o,r,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new gt(1,1,1,1)],this._renderAnimationFrame=null;const l=new yrt(t,o,r,e);this._context=new cst(t,n,o),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(wH,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ti(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ti(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ti(document.createElement("div")),vf.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Trt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new x5(this._context,this._linesContent),this._viewZones=new sst(this._context),this._viewParts.push(this._viewZones);const c=new Zrt(this._context);this._viewParts.push(c);const d=new tst(this._context);this._viewParts.push(d);const u=new Srt(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Drt(this._context)),u.addDynamicOverlay(new yo(this._context)),u.addDynamicOverlay(new Rrt(this._context)),u.addDynamicOverlay(new Irt(this._context)),u.addDynamicOverlay(new hst(this._context));const h=new xrt(this._context);this._viewParts.push(h),h.addDynamicOverlay(new krt(this._context)),h.addDynamicOverlay(new zrt(this._context)),h.addDynamicOverlay(new $rt(this._context)),h.addDynamicOverlay(new tT(this._context)),this._glyphMarginWidgets=new Brt(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new ib(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 Lrt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new rk(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Xrt(this._context),this._viewParts.push(this._overlayWidgets);const g=new est(this._context);this._viewParts.push(g);const p=new ust(this._context);this._viewParts.push(p);const v=new Grt(this._context);if(this._viewParts.push(v),c){const m=this._scrollbar.getOverviewRulerLayoutInfo();m.parent.insertBefore(c.getDomNode(),m.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(v.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new bot(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),Dm.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(r=>{var s,a;const l=(a=(s=r.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:wy.Left;return{range:r.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(r=>({range:e.validateRange(r.preference.range),lane:r.preference.lane}))),t.sort((r,s)=>V.compareRangesUsingStarts(r.range,s.range));let n=null,o=null;for(const r of t)if(r.lane===wy.Left&&(!n||V.compareRangesUsingEnds(n,r.range)<0)&&(n=r.range),r.lane===wy.Right&&(!o||V.compareRangesUsingEnds(o,r.range)<0)&&(o=r.range),n&&o){if(n.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Yit(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 ae(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)+" "+yH(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=GA(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){pst(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_actualRender(){if(!aG(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 n=new dst(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const o=new zit(this._context.viewLayout,n,this._viewLines);for(const r of e)r.prepareRender(o);for(const r of e)r.render(o),r.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 n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),o=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const r=this._viewLines.visibleRangeForPosition(new ae(o.lineNumber,o.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?w5.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Jrt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.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,n,o,r,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(n=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&n!==void 0?n:null,(r=(o=e.position)===null||o===void 0?void 0:o.secondaryPosition)!==null&&r!==void 0?r:null,(a=(s=e.position)===null||s===void 0?void 0:s.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()}};LH=fst([gst(6,$t)],LH);function pst(i){try{return i()}catch(e){en(e)}}class Hbe{constructor(e,t,n,o,r,s){this.id=e,this.label=t,this.alias=n,this._precondition=o,this._run=r,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Tv(i){let e=0,t=0,n=0,o=0;for(let r=0,s=i.length;r=zl&&(t=t-i%zl),t}function Cst(i,e){return i.reduce((t,n)=>so(t,e(n)),sa)}function $be(i,e){return i===e}function ak(i,e){const t=i,n=e;if(n-t<=0)return sa;const r=Math.floor(t/zl),s=Math.floor(n/zl),a=n-s*zl;if(r===s){const l=t-r*zl;return Io(0,a-l)}else return Io(s-r,a)}function Iy(i,e){return i=e}function zC(i){return Io(i.lineNumber-1,i.column-1)}function R0(i,e){const t=i,n=Math.floor(t/zl),o=t-n*zl,r=e,s=Math.floor(r/zl),a=r-s*zl;return new V(n+1,o+1,s+1,a+1)}function yst(i){const e=gf(i);return Io(e.length-1,e[e.length-1].length)}class Hg{static fromModelContentChanges(e){return e.map(n=>{const o=V.lift(n.range);return new Hg(zC(o.getStartPosition()),zC(o.getEndPosition()),yst(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${Ac(this.startOffset)}...${Ac(this.endOffset)}) -> ${Ac(this.newLength)}`}}class wst{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>BG.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:ak(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Io(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Io(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Ac(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Io(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Io(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(o===0){const s=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 n=0;for(;;){const r=this.lineTokens,s=r.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(n>1500)break}const o=_st(e,t,this.lineIdx,this.lineCharOffset);return new hm(o,0,-1,qo.getEmpty(),new K_(o))}}class kst{constructor(e,t){this.text=e,this._offset=sa,this.idx=0;const n=t.getRegExpStr(),o=n?new RegExp(n+`| +`,"gi"):null,r=[];let s,a=0,l=0,c=0,d=0;const u=[];for(let g=0;g<60;g++)u.push(new hm(Io(0,g),0,-1,qo.getEmpty(),new K_(Io(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new hm(Io(1,g),0,-1,qo.getEmpty(),new K_(Io(1,g))));if(o)for(o.lastIndex=0;(s=o.exec(e))!==null;){const g=s.index,p=s[0];if(p===` +`)a++,l=g+1;else{if(c!==g){let v;if(d===a){const m=g-c;if(mIst(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,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Ist(i){let e=Xl(i);return/^[\w ]+/.test(i)&&(e=`\\b${e}`),/[\w ]+$/.test(i)&&(e=`${e}\\b`),e}class jbe{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=HG.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Tst(i){if(i.length===0)return null;if(i.length===1)return i[0];let e=0;function t(){if(e>=i.length)return null;const s=e,a=i[s].listHeight;for(e++;e=2?Kbe(s===0&&e===i.length?i:i.slice(s,e),!1):i[s]}let n=t(),o=t();if(!o)return n;for(let s=t();s;s=t())rse(n,o)<=rse(o,s)?(n=f9(n,o),o=s):o=f9(o,s);return f9(n,o)}function Kbe(i,e=!1){if(i.length===0)return null;if(i.length===1)return i[0];let t=i.length;for(;t>3;){const n=t>>1;for(let o=0;o=3?i[2]:null,e)}function rse(i,e){return Math.abs(i.listHeight-e.listHeight)}function f9(i,e){return i.listHeight===e.listHeight?_f.create23(i,e,null,!1):i.listHeight>e.listHeight?Nst(i,e):Rst(e,i)}function Nst(i,e){i=i.toMutable();let t=i;const n=[];let o;for(;;){if(e.listHeight===t.listHeight){o=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let r=n.length-1;r>=0;r--){const s=n[r];o?s.childrenLength>=3?o=_f.create23(s.unappendChild(),o,null,!1):(s.appendChildOfSameHeight(o),o=void 0):s.handleChildrenChanged()}return o?_f.create23(i,o,null,!1):i}function Rst(i,e){i=i.toMutable();let t=i;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let o=e;for(let r=n.length-1;r>=0;r--){const s=n[r];o?s.childrenLength>=3?o=_f.create23(o,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(o),o=void 0):s.handleChildrenChanged()}return o?_f.create23(o,i,null,!1):i}class Mst{constructor(e){this.lastOffset=sa,this.nextNodes=[e],this.offsets=[sa],this.idxs=[]}readLongestNodeAt(e,t){if(Iy(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=$x(this.nextNodes);if(!n)return;const o=$x(this.offsets);if(Iy(e,o))return;if(Iy(o,e))if(so(o,n.length)<=e)this.nextNodeAfterCurrent();else{const r=g9(n);r!==-1?(this.nextNodes.push(n.getChild(r)),this.offsets.push(o),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const r=g9(n);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(r)),this.offsets.push(o),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=$x(this.offsets),t=$x(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=$x(this.nextNodes),o=g9(n,this.idxs[this.idxs.length-1]);if(o!==-1){this.nextNodes.push(n.getChild(o)),this.offsets.push(so(e,t.length)),this.idxs[this.idxs.length-1]=o;break}else this.idxs.pop()}}}function g9(i,e=-1){for(;;){if(e++,e>=i.childrenLength)return-1;if(i.getChild(e))return e}}function $x(i){return i.length>0?i[i.length-1]:void 0}function EH(i,e,t,n){return new Ast(i,e,t,n).parseDocument()}class Ast{constructor(e,t,n,o){if(this.tokenizer=e,this.createImmutableLists=o,this._itemsConstructed=0,this._itemsFromCache=0,n&&o)throw new Error("Not supported");this.oldNodeReader=n?new Mst(n):void 0,this.positionMapper=new wst(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(qo.getEmpty(),0);return e||(e=_f.getEmpty()),e}parseList(e,t){const n=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===4&&r.childrenLength===0||n.push(r)}return this.oldNodeReader?Tst(n):Kbe(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!mP(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),o=>t!==null&&!Iy(o.length,t)?!1:o.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new Est(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new K_(n.length);const o=e.merge(n.bracketIds),r=this.parseList(o,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===n.bracketId||s.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),lk.create(n.astNode,r,s.astNode)):lk.create(n.astNode,r,null)}default:throw new Error("unexpected")}}}function bP(i,e){if(i.length===0)return e;if(e.length===0)return i;const t=new lp(sse(i)),n=sse(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=t.dequeue();function r(c){if(c===void 0){const u=t.takeWhile(h=>!0)||[];return o&&u.unshift(o),u}const d=[];for(;o&&!mP(c);){const[u,h]=o.splitAt(c);d.push(u),c=ak(u.lengthAfter,c),o=h!=null?h:t.dequeue()}return mP(c)||d.push(new km(!1,c,c)),d}const s=[];function a(c,d,u){if(s.length>0&&$be(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new Hg(h.startOffset,d,so(h.newLength,u))}else s.push({startOffset:c,endOffset:d,newLength:u})}let l=sa;for(const c of n){const d=r(c.lengthBefore);if(c.modified){const u=Cst(d,f=>f.lengthBefore),h=so(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=so(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return s}class km{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=ak(e,this.lengthAfter);return $be(t,sa)?[this,void 0]:this.modified?[new km(this.modified,this.lengthBefore,e),new km(this.modified,sa,t)]:[new km(this.modified,e,e),new km(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Ac(this.lengthBefore)} -> ${Ac(this.lengthAfter)}`}}function sse(i){const e=[];let t=sa;for(const n of i){const o=ak(t,n.startOffset);mP(o)||e.push(new km(!1,o,o));const r=ak(n.startOffset,n.endOffset);e.push(new km(!0,r,n.newLength)),t=n.endOffset}return e}class Pst extends _e{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new le,this.denseKeyProvider=new zbe,this.brackets=new jbe(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 n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),o=new kst(this.textModel.getValue(),n);this.initialAstWithoutTokens=EH(o,[],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(n=>new Hg(Io(n.fromLineNumber-1,0),Io(n.toLineNumber,0),Io(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Hg.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=bP(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=bP(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,n){const o=t,r=new Ube(this.textModel,this.brackets);return EH(r,e,o,n)}getBracketsInRange(e,t){this.flushQueue();const n=Io(e.startLineNumber-1,e.startColumn-1),o=Io(e.endLineNumber-1,e.endColumn-1);return new af(r=>{const s=this.initialAstWithoutTokens||this.astWithTokens;DH(s,sa,s.length,n,o,r,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=zC(e.getStartPosition()),o=zC(e.getEndPosition());return new af(r=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new Ost(r,t,this.textModel);kH(s,sa,s.length,n,o,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Gbe(t,sa,t.length,zC(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return qbe(t,sa,t.length,zC(e))}}function qbe(i,e,t,n){if(i.kind===4||i.kind===2){const o=[];for(const r of i.children)t=so(e,r.length),o.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let r=o.length-1;r>=0;r--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=o[r];if(Iy(s,n)){const l=qbe(i.children[r],s,a,n);if(l)return l}}return null}else{if(i.kind===3)return null;if(i.kind===1){const o=R0(e,t);return{bracketInfo:i.bracketInfo,range:o}}}return null}function Gbe(i,e,t,n){if(i.kind===4||i.kind===2){for(const o of i.children){if(t=so(e,o.length),Iy(n,t)){const r=Gbe(o,e,t,n);if(r)return r}e=t}return null}else{if(i.kind===3)return null;if(i.kind===1){const o=R0(e,t);return{bracketInfo:i.bracketInfo,range:o}}}return null}function DH(i,e,t,n,o,r,s,a,l,c,d=!1){if(s>200)return!0;e:for(;;)switch(i.kind){case 4:{const u=i.childrenLength;for(let h=0;h200)return!0;let c=!0;if(i.kind===2){let d=0;if(a){let f=a.get(i.openingBracket.text);f===void 0&&(f=0),d=f,f++,a.set(i.openingBracket.text,f)}const u=so(e,i.openingBracket.length);let h=-1;if(r.includeMinIndentation&&(h=i.computeMinIndentation(e,r.textModel)),c=r.push(new vst(R0(e,t),R0(e,u),i.closingBracket?R0(so(u,((l=i.child)===null||l===void 0?void 0:l.length)||sa),t):void 0,s,d,i,h)),e=u,c&&i.child){const f=i.child;if(t=so(e,f.length),Ty(e,o)&&kL(t,n)&&(c=kH(f,e,t,n,o,r,s+1,a),!c))return!1}a==null||a.set(i.openingBracket.text,d)}else{let d=e;for(const u of i.children){const h=d;if(d=so(d,u.length),Ty(h,o)&&Ty(n,d)&&(c=kH(u,h,d,n,o,r,s,a),!c))return!1}}return c}class Fst extends _e{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Kr),this.onDidChangeEmitter=new le,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(n=>{var o;(!n.languageId||((o=this.bracketPairsTree.value)===null||o===void 0?void 0:o.object.didLanguageChange(n.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=Bst(e.add(new Pst(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))||af.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))||af.empty}getBracketsInRange(e,t=!1){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketsInRange(e,t))||af.empty}findMatchingBracketUp(e,t,n){const o=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(o.lineNumber,o.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(V.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?y2(this._findMatchingBracketUp(l,o,p9(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(V.fromPositions(e,e)).filter(o=>o.closingBracketRange!==void 0&&(o.openingBracketRange.containsPosition(e)||o.closingBracketRange.containsPosition(e))).findLastMaxBy(Rc(o=>o.openingBracketRange.containsPosition(e)?o.openingBracketRange:o.closingBracketRange,V.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=p9(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,o){const r=t.getCount(),s=t.getLanguageId(o);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=o-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(Ch(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=o+1;c=l)break;if(Ch(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,o=this.textModel.tokenization.getLineTokens(n),r=this.textModel.getLineContent(n),s=o.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(s)).brackets;if(a&&!Ch(o.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,o,a,s),d=null;for(;;){const u=hd.findNextBracketInRange(a.forwardRegex,n,r,l,c);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const h=r.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof pg)return null;d=f}}l=u.endColumn-1}if(d)return d}if(s>0&&o.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(l)).brackets;if(c&&!Ch(o.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,o,c,l),h=hd.findPrevBracketInRange(c.reversedRegex,n,r,d,u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=r.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof pg?null:g}}}return null}_matchFoundBracket(e,t,n,o){if(!t)return null;const r=n?this._findMatchingBracketDown(t,e.getEndPosition(),o):this._findMatchingBracketUp(t,e.getStartPosition(),o);return r?r instanceof pg?r:[e,r]:null}_findMatchingBracketUp(e,t,n){const o=e.languageId,r=e.reversedRegex;let s=-1,a=0;const l=(c,d,u,h)=>{for(;;){if(n&&++a%100===0&&!n())return pg.INSTANCE;const f=hd.findPrevBracketInRange(r,c,d,u,h);if(!f)break;const g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===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 v=!0;for(;f>=0;f--){const m=d.getLanguageId(f)===o&&!Ch(d.getStandardTokenType(f));if(m)v?g=d.getStartOffset(f):(g=d.getStartOffset(f),p=d.getEndOffset(f));else if(v&&g!==p){const _=l(c,h,g,p);if(_)return _}v=m}if(v&&g!==p){const m=l(c,h,g,p);if(m)return m}}return null}_findMatchingBracketDown(e,t,n){const o=e.languageId,r=e.forwardRegex;let s=1,a=0;const l=(d,u,h,f)=>{for(;;){if(n&&++a%100===0&&!n())return pg.INSTANCE;const g=hd.findNextBracketInRange(r,d,u,h,f);if(!g)break;const p=u.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?s++:e.isClose(p)&&s--,s===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,v=0;d===t.lineNumber&&(g=u.findTokenIndexAtOffset(t.column-1),p=t.column-1,v=t.column-1);let m=!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===n.lineNumber){u=l.findTokenIndexAtOffset(n.column-1),h=n.column-1,f=n.column-1;const p=l.getLanguageId(u);o!==p&&(o=p,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let g=!0;for(;u>=0;u--){const p=l.getLanguageId(u);if(o!==p){if(r&&s&&g&&h!==f){const m=hd.findPrevBracketInRange(r.reversedRegex,a,d,h,f);if(m)return this._toFoundBracket(s,m);g=!1}o=p,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const v=!!r&&!Ch(l.getStandardTokenType(u));if(v)g?h=l.getStartOffset(u):(h=l.getStartOffset(u),f=l.getEndOffset(u));else if(s&&r&&g&&h!==f){const m=hd.findPrevBracketInRange(r.reversedRegex,a,d,h,f);if(m)return this._toFoundBracket(s,m)}g=v}if(s&&r&&g&&h!==f){const p=hd.findPrevBracketInRange(r.reversedRegex,a,d,h,f);if(p)return this._toFoundBracket(s,p)}}return null}findNextBracket(e){var t;const n=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(n))||null;const o=this.textModel.getLineCount();let r=null,s=null,a=null;for(let l=n.lineNumber;l<=o;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===n.lineNumber){h=c.findTokenIndexAtOffset(n.column-1),f=n.column-1,g=n.column-1;const v=c.getLanguageId(h);r!==v&&(r=v,s=this.languageConfigurationService.getLanguageConfiguration(r).brackets,a=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const o=p9(t),r=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const p=[];for(let v=0,m=g?g.brackets.length:0;v{for(;;){if(o&&++c%100===0&&!o())return pg.INSTANCE;const _=hd.findNextBracketInRange(f.forwardRegex,g,p,v,m);if(!_)break;const y=p.substring(_.startColumn-1,_.endColumn-1).toLowerCase(),w=f.textIsBracket[y];if(w&&(w.isOpen(y)?a[w.index]++:w.isClose(y)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(_,w,!1,o);v=_.endColumn-1}return null};let u=null,h=null;for(let f=n.lineNumber;f<=r;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),v=this.textModel.getLineContent(f);let m=0,_=0,y=0;if(f===n.lineNumber){m=g.findTokenIndexAtOffset(n.column-1),_=n.column-1,y=n.column-1;const L=g.getLanguageId(m);u!==L&&(u=L,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let w=!0;for(;me==null?void 0:e.dispose()}}function p9(i){if(typeof i=="undefined")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=i}}class pg{constructor(){this._searchCanceledBrand=void 0}}pg.INSTANCE=new pg;function y2(i){return i instanceof pg?null:i}class Wst extends _e{constructor(e){super(),this.textModel=e,this.colorProvider=new Xbe,this.onDidChangeEmitter=new le,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,n,o){return o?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new V(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Xbe{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}jd((i,e)=>{const t=[Lbe,Ebe,Dbe,kbe,Ibe,Tbe],n=new Xbe;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${i.getColor(Hot)}; }`);const o=t.map(r=>i.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const s=o[r%o.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(r)} { color: ${s}; }`)}});function w2(i){return i.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Jr{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,n,o){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=o}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${w2(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${w2(this.oldText)}")`:`(replace@${this.oldPosition} "${w2(this.oldText)}" with "${w2(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const o=t.length;hu(e,o,n),n+=4;for(let r=0;ri.length)return!1;if(t){if(!Yq(i,e))return!1;if(e.length===i.length)return!0;let r=e.length;return e.charAt(e.length-1)===n&&r--,i.charAt(r)===n}return e.charAt(e.length-1)!==n&&(e+=n),i.indexOf(e)===0}function Zbe(i){return i>=65&&i<=90||i>=97&&i<=122}function $st(i,e=ls){return e?Zbe(i.charCodeAt(0))&&i.charCodeAt(1)===58:!1}function yh(i){return HA(i,!0)}class $G{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:AD(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}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,n=!1){if(e.scheme===t.scheme){if(e.scheme===hn.file)return IH(yh(e),yh(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(cse(e.authority,t.authority))return IH(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Rt.joinPath(e,...t)}basenameOrAuthority(e){return $c(e)||e.authority}basename(e){return Go.basename(e.path)}extname(e){return Go.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===hn.file?t=Rt.file(P_e(yh(e))).path:(t=Go.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===hn.file?t=Rt.file(A_e(yh(e))).path:t=Go.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!cse(e.authority,t.authority))return;if(e.scheme===hn.file){const r=XYe(yh(e),yh(t));return ls?Ybe(r):r}let n=e.path||"/";const o=t.path||"/";if(this._ignorePathCasing(e)){let r=0;for(const s=Math.min(n.length,o.length);rase(n).length&&n[n.length-1]===t}else{const n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Bu){return dse(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Bu){let n=!1;if(e.scheme===hn.file){const o=yh(e);n=o!==void 0&&o.length===ase(o).length&&o[o.length-1]===t}else{t="/";const o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!dse(e,t)?e.with({path:e.path+"/"}):e}}const Vi=new $G(()=>!1);new $G(i=>i.scheme===hn.file?!xs:!0);new $G(i=>!0);const zG=Vi.isEqual.bind(Vi);Vi.isEqualOrParent.bind(Vi);Vi.getComparisonKey.bind(Vi);const zst=Vi.basenameOrAuthority.bind(Vi),$c=Vi.basename.bind(Vi),Ust=Vi.extname.bind(Vi),L5=Vi.dirname.bind(Vi),jst=Vi.joinPath.bind(Vi),Kst=Vi.normalizePath.bind(Vi),qst=Vi.relativePath.bind(Vi),lse=Vi.resolvePath.bind(Vi);Vi.isAbsolutePath.bind(Vi);const cse=Vi.isEqualAuthority.bind(Vi),dse=Vi.hasTrailingPathSeparator.bind(Vi);Vi.removeTrailingPathSeparator.bind(Vi);Vi.addTrailingPathSeparator.bind(Vi);var Nv;(function(i){i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function e(t){const n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&n.set(a,l)});const r=t.path.substring(0,t.path.indexOf(";"));return r&&n.set(i.META_DATA_MIME,r),n}i.parseMetaData=e})(Nv||(Nv={}));function K1(i){return i.toString()}class yr{static create(e,t){const n=e.getAlternativeVersionId(),o=TH(e);return new yr(n,n,o,o,t,t,[])}constructor(e,t,n,o,r,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=o,this.beforeCursorState=r,this.afterCursorState=s,this.changes=a}append(e,t,n,o,r){t.length>0&&(this.changes=Vst(this.changes,t)),this.afterEOL=n,this.afterVersionId=o,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,n){if(hu(e,t?t.length:0,n),n+=4,t)for(const o of t)hu(e,o.selectionStartLineNumber,n),n+=4,hu(e,o.selectionStartColumn,n),n+=4,hu(e,o.positionLineNumber,n),n+=4,hu(e,o.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const o=uu(e,t);t+=4;for(let r=0;rt.toString()).join(", ")}matchesResource(e){return(Rt.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 yr}append(e,t,n,o,r){this._data instanceof yr&&this._data.append(e,t,n,o,r)}close(){this._data instanceof yr&&(this._data=this._data.serialize())}open(){this._data instanceof yr||(this._data=yr.deserialize(this._data))}undo(){if(Rt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof yr&&(this._data=this._data.serialize());const e=yr.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Rt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof yr&&(this._data=this._data.serialize());const e=yr.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof yr&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Gst{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const o of this._editStackElementsArr){const r=K1(o.resource);this._editStackElementsMap.set(r,o)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=K1(e);return this._editStackElementsMap.has(t)}setModel(e){const t=K1(Rt.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=K1(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,o,r){const s=K1(e.uri);this._editStackElementsMap.get(s).append(e,t,n,o,r)}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=K1(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(`${$c(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function TH(i){return i.getEOL()===` +`?0:1}function mg(i){return i?i instanceof Qbe||i instanceof Gst:!1}class UG{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);mg(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);mg(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const n=this._undoRedoService.getLastElement(this._model.uri);if(mg(n)&&n.canAppend(this._model))return n;const o=new Qbe(C("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(o,t),o}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],TH(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n,o){const r=this._getOrCreateEditStackElement(e,o),s=this._model.applyEdits(t,!0),a=UG._computeCursorState(n,s),l=s.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),r.append(this._model,l.map(c=>c.textChange),TH(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(n){return en(n),null}}}class Xst{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Yst(i,e,t,n,o){o.spacesDiff=0,o.looksLikeAlignment=!1;let r;for(r=0;r0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(s-l);if(d===0){o.spacesDiff=u,u>0&&0<=l-1&&l-10?o++:w>1&&r++,Yst(s,a,v,y,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const D=u.spacesDiff;D<=c&&d[D]++,s=v,a=y}let h=t;o!==r&&(h=o{const v=d[p];v>g&&(g=v,f=p)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function xa(i){return(i.metadata&1)>>>0}function Fi(i,e){i.metadata=i.metadata&254|e<<0}function as(i){return(i.metadata&2)>>>1===1}function Mi(i,e){i.metadata=i.metadata&253|(e?1:0)<<1}function Jbe(i){return(i.metadata&4)>>>2===1}function hse(i,e){i.metadata=i.metadata&251|(e?1:0)<<2}function e1e(i){return(i.metadata&64)>>>6===1}function fse(i,e){i.metadata=i.metadata&191|(e?1:0)<<6}function Zst(i){return(i.metadata&24)>>>3}function gse(i,e){i.metadata=i.metadata&231|e<<3}function Qst(i){return(i.metadata&32)>>>5===1}function pse(i,e){i.metadata=i.metadata&223|(e?1:0)<<5}class t1e{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Fi(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,hse(this,!1),fse(this,!1),gse(this,1),pse(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Mi(this,!1)}reset(e,t,n,o){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=o}setOptions(e){this.options=e;const t=this.options.className;hse(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),fse(this,this.options.glyphMarginClassName!==null),gse(this,this.options.stickiness),pse(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const pn=new t1e(null,0,0);pn.parent=pn;pn.left=pn;pn.right=pn;Fi(pn,0);class m9{constructor(){this.root=pn,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,o,r,s){return this.root===pn?[]:sat(this,e,t,n,o,r,s)}search(e,t,n,o){return this.root===pn?[]:rat(this,e,t,n,o)}collectNodesFromOwner(e){return iat(this,e)}collectNodesPostOrder(){return oat(this)}insert(e){mse(this,e),this._normalizeDeltaIfNecessary()}delete(e){vse(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let o=0;for(;e!==this.root;)e===e.parent.right&&(o+=e.parent.delta),e=e.parent;const r=n.start+o,s=n.end+o;n.setCachedOffsets(r,s,t)}acceptReplace(e,t,n,o){const r=tat(this,e,e+t);for(let s=0,a=r.length;st||n===1?!1:n===2?!0:e}function eat(i,e,t,n,o){const r=Zst(i),s=r===0||r===2,a=r===1||r===2,l=t-e,c=n,d=Math.min(l,c),u=i.start;let h=!1;const f=i.end;let g=!1;e<=u&&f<=t&&Qst(i)&&(i.start=e,h=!0,i.end=e,g=!0);{const v=o?1:l>0?2:0;!h&&q1(u,s,e,v)&&(h=!0),!g&&q1(f,a,e,v)&&(g=!0)}if(d>0&&!o){const v=l>c?2:0;!h&&q1(u,s,e+d,v)&&(h=!0),!g&&q1(f,a,e+d,v)&&(g=!0)}{const v=o?1:0;!h&&q1(u,s,t,v)&&(i.start=e+c,h=!0),!g&&q1(f,a,t,v)&&(i.end=e+c,g=!0)}const p=c-l;h||(i.start=Math.max(0,u+p)),g||(i.end=Math.max(0,f+p)),i.start>i.end&&(i.end=i.start)}function tat(i,e,t){let n=i.root,o=0,r=0,s=0,a=0;const l=[];let c=0;for(;n!==pn;){if(as(n)){Mi(n.left,!1),Mi(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;continue}if(!as(n.left)){if(r=o+n.maxEnd,rt){Mi(n,!0);continue}if(a=o+n.end,a>=e&&(n.setCachedOffsets(s,a,0),l[c++]=n),Mi(n,!0),n.right!==pn&&!as(n.right)){o+=n.delta,n=n.right;continue}}return Mi(i.root,!1),l}function nat(i,e,t,n){let o=i.root,r=0,s=0,a=0;const l=n-(t-e);for(;o!==pn;){if(as(o)){Mi(o.left,!1),Mi(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),Rv(o),o=o.parent;continue}if(!as(o.left)){if(s=r+o.maxEnd,st){o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(i.requestNormalizeDelta=!0),Mi(o,!0);continue}if(Mi(o,!0),o.right!==pn&&!as(o.right)){r+=o.delta,o=o.right;continue}}Mi(i.root,!1)}function iat(i,e){let t=i.root;const n=[];let o=0;for(;t!==pn;){if(as(t)){Mi(t.left,!1),Mi(t.right,!1),t=t.parent;continue}if(t.left!==pn&&!as(t.left)){t=t.left;continue}if(t.ownerId===e&&(n[o++]=t),Mi(t,!0),t.right!==pn&&!as(t.right)){t=t.right;continue}}return Mi(i.root,!1),n}function oat(i){let e=i.root;const t=[];let n=0;for(;e!==pn;){if(as(e)){Mi(e.left,!1),Mi(e.right,!1),e=e.parent;continue}if(e.left!==pn&&!as(e.left)){e=e.left;continue}if(e.right!==pn&&!as(e.right)){e=e.right;continue}t[n++]=e,Mi(e,!0)}return Mi(i.root,!1),t}function rat(i,e,t,n,o){let r=i.root,s=0,a=0,l=0;const c=[];let d=0;for(;r!==pn;){if(as(r)){Mi(r.left,!1),Mi(r.right,!1),r===r.parent.right&&(s-=r.parent.delta),r=r.parent;continue}if(r.left!==pn&&!as(r.left)){r=r.left;continue}a=s+r.start,l=s+r.end,r.setCachedOffsets(a,l,n);let u=!0;if(e&&r.ownerId&&r.ownerId!==e&&(u=!1),t&&Jbe(r)&&(u=!1),o&&!e1e(r)&&(u=!1),u&&(c[d++]=r),Mi(r,!0),r.right!==pn&&!as(r.right)){s+=r.delta,r=r.right;continue}}return Mi(i.root,!1),c}function sat(i,e,t,n,o,r,s){let a=i.root,l=0,c=0,d=0,u=0;const h=[];let f=0;for(;a!==pn;){if(as(a)){Mi(a.left,!1),Mi(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!as(a.left)){if(c=l+a.maxEnd,ct){Mi(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(d,u,r);let g=!0;n&&a.ownerId&&a.ownerId!==n&&(g=!1),o&&Jbe(a)&&(g=!1),s&&!e1e(a)&&(g=!1),g&&(h[f++]=a)}if(Mi(a,!0),a.right!==pn&&!as(a.right)){l+=a.delta,a=a.right;continue}}return Mi(i.root,!1),h}function mse(i,e){if(i.root===pn)return e.parent=pn,e.left=pn,e.right=pn,Fi(e,0),i.root=e,i.root;aat(i,e),Zp(e.parent);let t=e;for(;t!==i.root&&xa(t.parent)===1;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;xa(n)===1?(Fi(t.parent,0),Fi(n,0),Fi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,bE(i,t)),Fi(t.parent,0),Fi(t.parent.parent,1),CE(i,t.parent.parent))}else{const n=t.parent.parent.left;xa(n)===1?(Fi(t.parent,0),Fi(n,0),Fi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,CE(i,t)),Fi(t.parent,0),Fi(t.parent.parent,1),bE(i,t.parent.parent))}return Fi(i.root,0),e}function aat(i,e){let t=0,n=i.root;const o=e.start,r=e.end;for(;;)if(cat(o,r,n.start+t,n.end+t)<0)if(n.left===pn){e.start-=t,e.end-=t,e.maxEnd-=t,n.left=e;break}else n=n.left;else if(n.right===pn){e.start-=t+n.delta,e.end-=t+n.delta,e.maxEnd-=t+n.delta,n.right=e;break}else t+=n.delta,n=n.right;e.parent=n,e.left=pn,e.right=pn,Fi(e,1)}function vse(i,e){let t,n;if(e.left===pn?(t=e.right,n=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===pn?(t=e.left,n=e):(n=lat(e.right),t=n.right,t.start+=n.delta,t.end+=n.delta,t.delta+=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,n.delta=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0)),n===i.root){i.root=t,Fi(t,0),e.detach(),v9(),Rv(t),i.root.parent=pn;return}const o=xa(n)===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?t.parent=n.parent:(n.parent===e?t.parent=n:t.parent=n.parent,n.left=e.left,n.right=e.right,n.parent=e.parent,Fi(n,xa(e)),e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==pn&&(n.left.parent=n),n.right!==pn&&(n.right.parent=n)),e.detach(),o){Zp(t.parent),n!==e&&(Zp(n),Zp(n.parent)),v9();return}Zp(t),Zp(t.parent),n!==e&&(Zp(n),Zp(n.parent));let r;for(;t!==i.root&&xa(t)===0;)t===t.parent.left?(r=t.parent.right,xa(r)===1&&(Fi(r,0),Fi(t.parent,1),bE(i,t.parent),r=t.parent.right),xa(r.left)===0&&xa(r.right)===0?(Fi(r,1),t=t.parent):(xa(r.right)===0&&(Fi(r.left,0),Fi(r,1),CE(i,r),r=t.parent.right),Fi(r,xa(t.parent)),Fi(t.parent,0),Fi(r.right,0),bE(i,t.parent),t=i.root)):(r=t.parent.left,xa(r)===1&&(Fi(r,0),Fi(t.parent,1),CE(i,t.parent),r=t.parent.left),xa(r.left)===0&&xa(r.right)===0?(Fi(r,1),t=t.parent):(xa(r.left)===0&&(Fi(r.right,0),Fi(r,1),bE(i,r),r=t.parent.left),Fi(r,xa(t.parent)),Fi(t.parent,0),Fi(r.left,0),CE(i,t.parent),t=i.root));Fi(t,0),v9()}function lat(i){for(;i.left!==pn;)i=i.left;return i}function v9(){pn.parent=pn,pn.delta=0,pn.start=0,pn.end=0}function bE(i,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==pn&&(t.left.parent=e),t.parent=e.parent,e.parent===pn?i.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Rv(e),Rv(t)}function CE(i,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(i.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==pn&&(t.right.parent=e),t.parent=e.parent,e.parent===pn?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Rv(e),Rv(t)}function n1e(i){let e=i.end;if(i.left!==pn){const t=i.left.maxEnd;t>e&&(e=t)}if(i.right!==pn){const t=i.right.maxEnd+i.delta;t>e&&(e=t)}return e}function Rv(i){i.maxEnd=n1e(i)}function Zp(i){for(;i!==pn;){const e=n1e(i);if(i.maxEnd===e)return;i.maxEnd=e,i=i.parent}}function cat(i,e,t,n){return i===t?e-n:i-t}class NH{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!==Qt)return jG(this.right);let e=this;for(;e.parent!==Qt&&e.parent.left!==e;)e=e.parent;return e.parent===Qt?Qt:e.parent}prev(){if(this.left!==Qt)return i1e(this.left);let e=this;for(;e.parent!==Qt&&e.parent.right!==e;)e=e.parent;return e.parent===Qt?Qt:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Qt=new NH(null,0);Qt.parent=Qt;Qt.left=Qt;Qt.right=Qt;Qt.color=0;function jG(i){for(;i.left!==Qt;)i=i.left;return i}function i1e(i){for(;i.right!==Qt;)i=i.right;return i}function KG(i){return i===Qt?0:i.size_left+i.piece.length+KG(i.right)}function qG(i){return i===Qt?0:i.lf_left+i.piece.lineFeedCnt+qG(i.right)}function _9(){Qt.parent=Qt}function yE(i,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!==Qt&&(t.left.parent=e),t.parent=e.parent,e.parent===Qt?i.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function wE(i,e){const t=e.left;e.left=t.right,t.right!==Qt&&(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===Qt?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function S2(i,e){let t,n;if(e.left===Qt?(n=e,t=n.right):e.right===Qt?(n=e,t=n.left):(n=jG(e.right),t=n.right),n===i.root){i.root=t,t.color=0,e.detach(),_9(),i.root.parent=Qt;return}const o=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,IL(i,t)):(n.parent===e?t.parent=n:t.parent=n.parent,IL(i,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==Qt&&(n.left.parent=n),n.right!==Qt&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,IL(i,n)),e.detach(),t.parent.left===t){const s=KG(t),a=qG(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,rg(i,t.parent,l,c)}}if(IL(i,t.parent),o){_9();return}let r;for(;t!==i.root&&t.color===0;)t===t.parent.left?(r=t.parent.right,r.color===1&&(r.color=0,t.parent.color=1,yE(i,t.parent),r=t.parent.right),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.right.color===0&&(r.left.color=0,r.color=1,wE(i,r),r=t.parent.right),r.color=t.parent.color,t.parent.color=0,r.right.color=0,yE(i,t.parent),t=i.root)):(r=t.parent.left,r.color===1&&(r.color=0,t.parent.color=1,wE(i,t.parent),r=t.parent.left),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.left.color===0&&(r.right.color=0,r.color=1,yE(i,r),r=t.parent.left),r.color=t.parent.color,t.parent.color=0,r.left.color=0,wE(i,t.parent),t=i.root));t.color=0,_9()}function _se(i,e){for(IL(i,e);e!==i.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,yE(i,e)),e.parent.color=0,e.parent.parent.color=1,wE(i,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,wE(i,e)),e.parent.color=0,e.parent.parent.color=1,yE(i,e.parent.parent))}i.root.color=0}function rg(i,e,t,n){for(;e!==i.root&&e!==Qt;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function IL(i,e){let t=0,n=0;if(e!==i.root){for(;e!==i.root&&e===e.parent.right;)e=e.parent;if(e!==i.root)for(e=e.parent,t=KG(e.left)-e.size_left,n=qG(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==i.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}const Yf=65535;function o1e(i){let e;return i[i.length-1]<65536?e=new Uint16Array(i.length):e=new Uint32Array(i.length),e.set(i,0),e}class dat{constructor(e,t,n,o,r){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=o,this.isBasicASCII=r}}function lg(i,e=!0){const t=[0];let n=1;for(let o=0,r=i.length;o126)&&(s=!1)}const a=new dat(o1e(i),n,o,r,s);return i.length=0,a}class Ga{constructor(e,t,n,o,r){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=o,this.length=r}}class q_{constructor(e,t){this.buffer=e,this.lineStarts=t}}class hat{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Qt&&e.iterate(e.root,n=>(n!==Qt&&this._pieces.push(n.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 fat{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let o=0;o=e){n[o]=null,t=!0;continue}}if(t){const o=[];for(const r of n)r!==null&&o.push(r);this._cache=o}}}class gat{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new q_("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Qt,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let o=null;for(let r=0,s=e.length;r0){e[r].lineStarts||(e[r].lineStarts=lg(e[r].buffer));const a=new Ga(r+1,{line:0,column:0},{line:e[r].lineStarts.length-1,column:e[r].buffer.length-e[r].lineStarts[e[r].lineStarts.length-1]},e[r].lineStarts.length-1,e[r].buffer.length);this._buffers.push(e[r]),o=this.rbInsertRight(o,a)}this._searchCache=new fat(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Yf,n=t-Math.floor(t/3),o=n*2;let r="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(s<=n||s+d0){const l=r.replace(/\r\n|\r|\n/g,e);a.push(new q_(l,lg(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 hat(this,e)}getOffsetAt(e,t){let n=0,o=this.root;for(;o!==Qt;)if(o.left!==Qt&&o.lf_left+1>=e)o=o.left;else{if(o.lf_left+o.piece.lineFeedCnt+1>=e)return n+=o.size_left,n+=this.getAccumulatedValue(o,e-o.lf_left-2)+t-1;e-=o.lf_left+o.piece.lineFeedCnt,n+=o.size_left+o.piece.length,o=o.right}return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const o=e;for(;t!==Qt;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const r=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+r.index,r.index===0){const s=this.getOffsetAt(n+1,1),a=o-s;return new ae(n+1,a+1)}return new ae(n+1,r.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===Qt){const r=this.getOffsetAt(n+1,1),s=o-e-r;return new ae(n+1,s+1)}else t=t.right;return new ae(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),o=this.nodeAt2(e.endLineNumber,e.endColumn),r=this.getValueInRange2(n,o);return t?t!==this._EOL||!this._EOLNormalized?r.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?r:r.replace(/\r\n|\r|\n/g,t):r}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 n=e.node;const o=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let s=o.substring(r+e.remainder,r+n.piece.length);for(n=n.next();n!==Qt;){const a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,n.piece.length);n=n.next()}return s}getLinesContent(){const e=[];let t=0,n="",o=!1;return this.iterate(this.root,r=>{if(r===Qt)return!0;const s=r.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,d=s.start.line,u=s.end.line;let h=c[d]+s.start.column;if(o&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=n,n="",o=!1,a===0))return!0;if(d===u)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(o=!0,n+=l.substr(h,a-1)):n+=l.substr(h,a),!0;n+=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++]=n;for(let f=d+1;fw+g,t.reset(0)):(_=h.buffer,y=w=>w,t.reset(g));do if(v=t.next(_),v){if(y(v.index)>=p)return d;this.positionInBuffer(e,y(v.index)-f,m);const w=this.getLineFeedCnt(e.piece.bufferIndex,r,m),L=m.line===r.line?m.column-r.column+o:m.column+1,D=L+v[0].length;if(u[d++]=H_(new V(n+w,L,n+w,D),v,l),y(v.index)+v[0].length>=p||d>=c)return d}while(v);return d}findMatchesLineByLine(e,t,n,o){const r=[];let s=0;const a=new MC(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,n,o,s,r),r;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 m=this._buffers[f.piece.bufferIndex].lineStarts,_=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=m[d.line+p],w=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,w,d,this.positionInBuffer(f,y-_),t,n,o,s,r),s>=o)return r;h+=p}const v=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const m=this.getLineContent(h).substring(v,e.endColumn-1);return s=this._findMatchesInLine(t,a,m,e.endLineNumber,v,s,r,n,o),r}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(v),h,v,s,r,n,o),s>=o)return r;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,v=this.getLineContent(h).substring(p,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,p,s,r,n,o),r}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,d,u,t,n,o,s,r),r}_findMatchesInLine(e,t,n,o,r,s,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=n.length;let p=-f;for(;(p=n.indexOf(h,p+f))!==-1;)if((!d||uG(d,n,g,p,f))&&(a[s++]=new HD(new V(o,p+1+r,o,p+1+f+r),null),s>=c))return s;return s}let u;t.reset(0);do if(u=t.next(n),u&&(a[s++]=H_(new V(o,u.index+1+r,o,u.index+1+u[0].length+r),u,l),s>=c))return s;while(u);return s}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Qt){const{node:o,remainder:r,nodeStartOffset:s}=this.nodeAt(e),a=o.piece,l=a.bufferIndex,c=this.positionInBuffer(o,r);if(o.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){const d=[];let u=new Ga(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(o,r)===10){const p={line:u.start.line+1,column:0};u=new Ga(u.bufferIndex,p,u.end,this.getLineFeedCnt(u.bufferIndex,p,u.end),u.length-1),t+=` `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(o,r-1)===13){const p=this.positionInBuffer(o,r-1);this.deleteNodeTail(o,p),t="\r"+t,o.piece.length===0&&d.push(o)}else this.deleteNodeTail(o,c);else this.deleteNodeTail(o,c);const h=this.createNewPieces(t);u.length>0&&this.rbInsertRight(o,u);let f=o;for(let g=0;g=0;s--)r=this.rbInsertLeft(r,o[s]);this.validateCRLFWithPrevNode(r),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` `);const n=this.createNewPieces(e),o=this.rbInsertRight(t,n[0]);let r=o;for(let s=1;s=h)c=u+1;else break;return n?(n.line=u,n.column=l-f,null):{line:u,column:l-f}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;const o=this._buffers[e].lineStarts;if(n.line===o.length-1)return n.line-t.line;const r=o[n.line+1],s=o[n.line]+n.column;if(r>s+1)return n.line-t.line;const a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tYf){const d=[];for(;e.length>Yf;){const h=e.charCodeAt(Yf-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,Yf-1),e=e.substring(Yf-1)):(f=e.substring(0,Yf),e=e.substring(Yf));const g=lg(f);d.push(new Ga(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 q_(f,g))}const u=lg(e);return d.push(new Ga(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 q_(e,u)),d}let t=this._buffers[0].buffer.length;const n=lg(e,!1);let o=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},o=this._lastChangeBufferPos;for(let d=0;d=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this.getAccumulatedValue(n,e-n.lf_left-1),d=this._buffers[n.piece.bufferIndex].buffer,u=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return s+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-n.lf_left)}),d.substring(u+l,u+c-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this._buffers[n.piece.bufferIndex].buffer,d=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);o=c.substring(d+l,d+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,s+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==Qt;){const s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(n,0),l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return o+=s.substring(l,l+a-t),o}else{const a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);o+=s.substr(a,n.piece.length)}n=n.next()}return o}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==Qt;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){const n=e.piece,o=this.positionInBuffer(e,t),r=o.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){const s=this.getLineFeedCnt(e.piece.bufferIndex,n.start,o);if(s!==r)return{index:s,remainder:0}}return{index:r,remainder:o.column}}getAccumulatedValue(e,t){if(t<0)return 0;const n=e.piece,o=this._buffers[n.bufferIndex].lineStarts,r=n.start.line+t+1;return r>n.end.line?o[n.end.line]+n.end.column-o[n.start.line]-n.start.column:o[r]-o[n.start.line]-n.start.column}deleteNodeTail(e,t){const n=e.piece,o=n.lineFeedCnt,r=this.offsetInBuffer(n.bufferIndex,n.end),s=t,a=this.offsetInBuffer(n.bufferIndex,s),l=this.getLineFeedCnt(n.bufferIndex,n.start,s),c=l-o,d=a-r,u=n.length+d;e.piece=new Ga(n.bufferIndex,n.start,s,l,u),rg(this,e,d,c)}deleteNodeHead(e,t){const n=e.piece,o=n.lineFeedCnt,r=this.offsetInBuffer(n.bufferIndex,n.start),s=t,a=this.getLineFeedCnt(n.bufferIndex,s,n.end),l=this.offsetInBuffer(n.bufferIndex,s),c=a-o,d=r-l,u=n.length+d;e.piece=new Ga(n.bufferIndex,s,n.end,a,u),rg(this,e,d,c)}shrinkNode(e,t,n){const o=e.piece,r=o.start,s=o.end,a=o.length,l=o.lineFeedCnt,c=t,d=this.getLineFeedCnt(o.bufferIndex,o.start,c),u=this.offsetInBuffer(o.bufferIndex,t)-this.offsetInBuffer(o.bufferIndex,r);e.piece=new Ga(o.bufferIndex,o.start,c,d,u),rg(this,e,u-a,d-l);const h=new Ga(o.bufferIndex,n,s,this.getLineFeedCnt(o.bufferIndex,n,s),this.offsetInBuffer(o.bufferIndex,s)-this.offsetInBuffer(o.bufferIndex,n)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` `);const n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),o=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const r=lg(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){o+=t.size_left;const r={node:t,remainder:e-t.size_left,nodeStartOffset:o};return this._searchCache.set(r),r}else e-=t.size_left+t.piece.length,o+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let n=this.root,o=0;for(;n!==Qt;)if(n.left!==Qt&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const r=this.getAccumulatedValue(n,e-n.lf_left-2),s=this.getAccumulatedValue(n,e-n.lf_left-1);return o+=n.size_left,{node:n,remainder:Math.min(r+t-1,s),nodeStartOffset:o}}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const r=this.getAccumulatedValue(n,e-n.lf_left-2);if(r+t-1<=n.piece.length)return{node:n,remainder:r+t-1,nodeStartOffset:o};t-=n.piece.length-r;break}else e-=n.lf_left+n.piece.lineFeedCnt,o+=n.size_left+n.piece.length,n=n.right;for(n=n.next();n!==Qt;){if(n.piece.lineFeedCnt>0){const r=this.getAccumulatedValue(n,0),s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,r),nodeStartOffset:s}}else if(n.piece.length>=t-1){const r=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:r}}else t-=n.piece.length;n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const n=this._buffers[e.piece.bufferIndex],o=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(o)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` `)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Qt||e.piece.lineFeedCnt===0)return!1;const t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,o=t.start.line,r=n[o]+t.start.column;return o===n.length-1||n[o+1]>r+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(r)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Qt||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 n=[],o=this._buffers[e.piece.bufferIndex].lineStarts;let r;e.piece.end.column===0?r={line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:r={line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Ga(e.piece.bufferIndex,e.piece.start,r,a,s),rg(this,e,-1,-1),e.piece.length===0&&n.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 Ga(t.piece.bufferIndex,l,t.piece.end,d,c),rg(this,t,-1,-1),t.piece.length===0&&n.push(t);const u=this.createNewPieces(`\r `);this.rbInsertRight(e,u[0]);for(let h=0;hv.sortIndex-m.sortIndex)}this._mightContainRTL=o,this._mightContainUnusualLineTerminators=r,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&u.length>0){u.sort((p,v)=>v.lineNumber-p.lineNumber),g=[];for(let p=0,v=u.length;p0&&u[p-1].lineNumber===m)continue;const _=u[p].oldContent,y=this.getLineContent(m);y.length===0||y===_||Ws(y)!==-1||g.push(m)}}return this._onDidChangeContent.fire(),new bet(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const n=e[0].range,o=e[e.length-1].range,r=new V(n.startLineNumber,n.startColumn,o.endLineNumber,o.endColumn);let s=n.startLineNumber,a=n.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),s=v.endLineNumber,a=v.endColumn}const c=l.join(""),[d,u,h]=Tv(c);return{sortIndex:0,identifier:e[0].identifier,range:r,rangeOffset:this.getOffsetAt(r.startLineNumber,r.startColumn),rangeLength:this.getValueLengthInRange(r,0),text:c,eolCount:d,firstLineLength:u,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Ny._sortOpsDescending);const t=[];for(let n=0;n0){const h=l.eolCount+1;h===1?u=new V(c,d,c,d+l.firstLineLength):u=new V(c,d,c+h-1,l.lastLineLength+1)}else u=new V(c,d,c,d);n=u.endLineNumber,o=u.endColumn,t.push(u),r=l}return t}static _sortOpsAscending(e,t){const n=V.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){const n=V.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}}class fat{constructor(e,t,n,o,r,s,a,l,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=o,this._crlf=r,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?` +`?2:1)?_=v.text:_=v.text.replace(/\r\n|\r|\n/g,E)}l[p]={sortIndex:p,identifier:v.identifier||null,range:m,rangeOffset:this.getOffsetAt(m.startLineNumber,m.startColumn),rangeLength:this.getValueLengthInRange(m),text:_,eolCount:y,firstLineLength:w,lastLineLength:L,forceMoveMarkers:Boolean(v.forceMoveMarkers),isAutoWhitespaceEdit:v.isAutoWhitespaceEdit||!1}}l.sort(Ny._sortOpsAscending);let c=!1;for(let p=0,v=l.length-1;pv.sortIndex-m.sortIndex)}this._mightContainRTL=o,this._mightContainUnusualLineTerminators=r,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&u.length>0){u.sort((p,v)=>v.lineNumber-p.lineNumber),g=[];for(let p=0,v=u.length;p0&&u[p-1].lineNumber===m)continue;const _=u[p].oldContent,y=this.getLineContent(m);y.length===0||y===_||Ws(y)!==-1||g.push(m)}}return this._onDidChangeContent.fire(),new yet(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const n=e[0].range,o=e[e.length-1].range,r=new V(n.startLineNumber,n.startColumn,o.endLineNumber,o.endColumn);let s=n.startLineNumber,a=n.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),s=v.endLineNumber,a=v.endColumn}const c=l.join(""),[d,u,h]=Tv(c);return{sortIndex:0,identifier:e[0].identifier,range:r,rangeOffset:this.getOffsetAt(r.startLineNumber,r.startColumn),rangeLength:this.getValueLengthInRange(r,0),text:c,eolCount:d,firstLineLength:u,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Ny._sortOpsDescending);const t=[];for(let n=0;n0){const h=l.eolCount+1;h===1?u=new V(c,d,c,d+l.firstLineLength):u=new V(c,d,c+h-1,l.lastLineLength+1)}else u=new V(c,d,c,d);n=u.endLineNumber,o=u.endColumn,t.push(u),r=l}return t}static _sortOpsAscending(e,t){const n=V.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){const n=V.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}}class pat{constructor(e,t,n,o,r,s,a,l,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=o,this._crlf=r,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?` `:`\r `:n>t/2?`\r `:` `}create(e){const t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` -`&&(this._cr>0||this._crlf>0)))for(let r=0,s=n.length;r=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=cat(this._tmpLineStarts,e);this.chunks.push(new q_(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=pw(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=q_e(e)))}finish(e=!0){return this._finish(),new fat(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=lg(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class gat{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,n){if(e>=this._store.length)return;if(t===0){this.insert(e,n);return}else if(n===0){this.delete(e,t);return}const o=this._store.slice(0,e),r=this._store.slice(e+t),s=pat(n,this._default);this._store=o.concat(s,r)}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 n=[];for(let o=0;o0){const n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e){n.appendLineTokens(t);return}}this._tokens.push(new mat(e,[t]))}finalize(){return this._tokens}}class vat{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new RH(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class _at extends vat{constructor(e,t,n,o){super(e,t),this._textModel=n,this._languageIdCodec=o}updateTokensUntilLine(e,t){const n=this._textModel.getLanguageId();for(;;){const o=this.getFirstInvalidLine();if(!o||o.lineNumber>t)break;const r=this._textModel.getLineContent(o.lineNumber),s=zx(this._languageIdCodec,n,this.tokenizationSupport,r,!0,o.startState);e.add(o.lineNumber,s.tokens),this.store.setEndState(o.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const n=this.getStartState(e.lineNumber);if(!n)return 0;const o=this._textModel.getLanguageId(),r=this._textModel.getLineContent(e.lineNumber),s=r.substring(0,e.column-1)+t+r.substring(e.column-1),a=zx(this._languageIdCodec,o,this.tokenizationSupport,s,!0,n),l=new pr(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,n){const o=e.lineNumber,r=e.column,s=this.getStartState(o);if(!s)return null;const a=this._textModel.getLineContent(o),l=a.substring(0,r-1)+n+a.substring(r-1+t),c=this._textModel.getLanguageIdAtPosition(o,0),d=zx(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new pr(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&&n>0&&(n--,t--),this._lineEndStates.replace(e.startLineNumber,n,t)}}class Cat{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(n=>n.contains(e));if(t!==-1){const n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Cn(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new Cn(n.start,e):this._ranges.splice(t,1,new Cn(n.start,e),new Cn(e+1,n.endExclusive))}}addRange(e){Cn.addRange(e,this._ranges)}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let o=n;for(;!(o>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function zx(i,e,t,n,o,r){let s=null;if(t)try{s=t.tokenizeEncoded(n,o,r.clone())}catch(a){en(a)}return s||(s=h5(i.encodeLanguageId(e),r)),pr.convertToEndOffset(s.tokens,n.length),s}class yat{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,Ag(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{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 n=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return n?(this._tokenizerWithStateStore.updateTokensUntilLine(e,n.lineNumber),n.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new ln(e,t))}}const cg=new Uint32Array(0).buffer;class Lh{static deleteBeginning(e,t){return e===null||e===cg?e:Lh.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===cg)return e;const n=kg(e),o=n[n.length-2];return Lh.delete(e,t,o)}static delete(e,t,n){if(e===null||e===cg||t===n)return e;const o=kg(e),r=o.length>>>1;if(t===0&&o[o.length-2]===n)return cg;const s=pr.findIndexInTokensArray(o,t),a=s>0?o[s-1<<1]:0,l=o[s<<1];if(nd&&(o[c++]=g,o[c++]=o[(f<<1)+1],d=g)}if(c===o.length)return e;const h=new Uint32Array(c);return h.set(o.subarray(0,c),0),h.buffer}static append(e,t){if(t===cg)return e;if(e===cg)return t;if(e===null)return e;if(t===null)return null;const n=kg(e),o=kg(t),r=o.length>>>1,s=new Uint32Array(n.length+o.length);s.set(n,0);let a=n.length;const l=n[n.length-2];for(let c=0;c>>1;let s=pr.findIndexInTokensArray(o,t);s>0&&o[s-1<<1]===t&&s--;for(let a=s;a0}getTokens(e,t,n){let o=null;if(t1&&(r=is.getLanguageId(o[1])!==e),!r)return cg}if(!o||o.length===0){const r=new Uint32Array(2);return r[0]=t,r[1]=_se(e),r.buffer}return o[o.length-2]=t,o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:o}_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 n=[];for(let o=0;o=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Lh.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Lh.deleteEnding(this._lineTokens[t],e.startColumn-1);const n=e.endLineNumber-1;let o=null;n=this._len)){if(t===0){this._lineTokens[o]=Lh.insert(this._lineTokens[o],e.column-1,n);return}this._lineTokens[o]=Lh.deleteEnding(this._lineTokens[o],e.column-1),this._lineTokens[o]=Lh.insert(this._lineTokens[o],e.column-1,n),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const n=[];for(let o=0,r=e.length;o>>0}class qG{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 n=e;if(t.length>0){const r=t[0].getRange(),s=t[t.length-1].getRange();if(!r||!s)return e;n=e.plusRange(r).plusRange(s)}let o=null;for(let r=0,s=this._pieces.length;rn.endLineNumber){o=o||{index:r};break}if(a.removeTokens(n),a.isEmpty()){this._pieces.splice(r,1),r--,s--;continue}if(a.endLineNumbern.endLineNumber){o=o||{index:r};continue}const[l,c]=a.split(n);if(l.isEmpty()){o=o||{index:r};continue}c.isEmpty()||(this._pieces.splice(r,1,l,c),r++,s++,o=o||{index:r})}return o=o||{index:this._pieces.length},t.length>0&&(this._pieces=W4(this._pieces,o.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const n=this._pieces;if(n.length===0)return t;const o=qG._findFirstPieceWithLine(n,e),r=n[o].getLineTokens(e);if(!r)return t;const s=t.getCount(),a=r.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,_=~m>>>0;for(;lt)o=r-1;else{for(;r>n&&e[r-1].startLineNumber<=t&&t<=e[r-1].endLineNumber;)r--;return r}}return n}acceptEdit(e,t,n,o,r){for(const s of this._pieces)s.acceptEdit(e,t,n,o,r)}}class CP extends Fbe{constructor(e,t,n,o,r,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=n,this._bracketPairsTextModelPart=o,this._languageId=r,this._attachedViews=s,this._semanticTokens=new qG(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new le),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new le),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new le),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new wat(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[n,o,r]=Tv(t.text);this._semanticTokens.acceptEdit(t.range,n,o,r,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 Vo("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,n){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,n)}tokenizeLineWithEdit(e,t,n){return this.grammarTokens.tokenizeLineWithEdit(e,t,n)}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 n=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),n=this._textModel.getLineContent(t.lineNumber),o=this.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1),[s,a]=CP._findLanguageBoundaries(o,r),l=TD(t.column,this.getLanguageConfiguration(o.getLanguageId(r)).getWordDefinition(),n.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(r>0&&s===t.column-1){const[c,d]=CP._findLanguageBoundaries(o,r-1),u=TD(t.column,this.getLanguageConfiguration(o.getLanguageId(r-1)).getWordDefinition(),n.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 n=e.getLanguageId(t);let o=0;for(let s=t;s>=0&&e.getLanguageId(s)===n;s--)o=e.getStartOffset(s);let r=e.getLineContent().length;for(let s=t,a=e.getCount();s{const s=this.getLanguageId();r.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(o.onDidChangeVisibleRanges(({view:r,state:s})=>{if(s){let a=this._attachedViewStates.get(r);a||(a=new Sat(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(r,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(r)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new RH(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const n=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=oo.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return en(l),[null,null]}return[s,a]},[o,r]=n();if(o&&r?this._tokenizer=new _at(this._textModel.getLineCount(),o,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={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))}};o&&o.createBackgroundTokenizer&&!o.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=o.createBackgroundTokenizer(this._textModel,s)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new yat(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),(o==null?void 0:o.backgroundTokenizerShouldOnlyVerifyTokens)&&o.createBackgroundTokenizer?(this._debugBackgroundTokens=new dk(this._languageIdCodec),this._debugBackgroundStates=new RH(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=o.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,n,o;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const r of e.changes){const[s,a]=Tv(r.text);this._tokens.acceptEdit(r.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(r.range,s,a)}(n=this._debugBackgroundStates)===null||n===void 0||n.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.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=ln.joinMany([...this._attachedViewStates].map(([t,n])=>n.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var n,o;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const r=new NH,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(r,e,t),a=this.setTokens(r.finalize());if(s)for(const l of a.changes)(n=this._backgroundTokenizer.value)===null||n===void 0||n.requestTokens(l.fromLineNumber,l.toLineNumber+1);(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.checkFinished()}forceTokenization(e){var t,n;const o=new NH;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(o,e),this.setTokens(o.finalize()),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const n=this._textModel.getLineContent(e),o=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,n);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const r=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,n);!o.equals(r)&&((t=this._debugBackgroundTokenizer.value)===null||t===void 0?void 0:t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return o}getTokenTypeIfInsertingCharacter(e,t,n){if(!this._tokenizer)return 0;const o=this._textModel.validatePosition(new ae(e,t));return this.forceTokenization(o.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(o,n)}tokenizeLineWithEdit(e,t,n){if(!this._tokenizer)return null;const o=this._textModel.validatePosition(e);return this.forceTokenization(o.lineNumber),this._tokenizer.tokenizeLineWithEdit(o,t,n)}get hasTokens(){return this._tokens.hasTokens}}class Sat extends _e{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new bi(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Lo(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 xat{constructor(){this.changeType=1}}class Gu{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",o=0;for(const r of t)n+=e.substring(o,r.column-1),o=r.column-1,n+=r.options.content;return n+=e.substring(o),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new Gu(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new Gu(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,o)=>n.lineNumber===o.lineNumber?n.column===o.column?n.order-o.order:n.column-o.column:n.lineNumber-o.lineNumber),t}constructor(e,t,n,o,r){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=o,this.order=r}}class bse{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class Lat{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Eat{constructor(e,t,n,o){this.changeType=4,this.injectedTexts=o,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class Dat{constructor(){this.changeType=5}}class Ry{constructor(e,t,n,o){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=o,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;t=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},P_;function Iat(i){const e=new r1e;return e.acceptChunk(i),e.finish()}function Tat(i){const e=new r1e;let t;for(;typeof(t=i.read())=="string";)e.acceptChunk(t);return e.finish()}function Cse(i,e){let t;return typeof i=="string"?t=Iat(i):vet(i)?t=Tat(i):t=i,t.create(e)}let x2=0;const Nat=999,Rat=1e4;class Mat{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,n=0;do{const o=this._source.read();if(o===null)return this._eos=!0,t===0?null:e.join("");if(o.length>0&&(e[t++]=o,n+=o.length),n>=64*1024)return e.join("")}while(!0)}}const Ux=()=>{throw new Error("Invalid change accessor")};let bf=P_=class extends _e{static resolveOptions(e,t){if(t.detectIndentation){const n=dse(e,t.tabSize,t.insertSpaces);return new sM({tabSize:n.tabSize,indentSize:"tabSize",insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new sM(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 Td(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,n,o=null,r,s,a){super(),this._undoRedoService=r,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new le),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Bat(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new le),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new le),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new le),this._eventEmitter=this._register(new Wat),this._languageSelectionListener=this._register(new Kr),this._deltaDecorationCallCnt=0,this._attachedViews=new Vat,x2++,this.id="$model"+x2,this.isForSimpleWidget=n.isForSimpleWidget,typeof o=="undefined"||o===null?this._associatedResource=Rt.parse("inmemory://model/"+x2):this._associatedResource=o,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=Cse(e,n.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=P_.resolveOptions(this._buffer,n);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 Pst(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Irt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Fst(this)),this._tokenizationTextModelPart=new CP(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new V(1,1,u,this._buffer.getLineLength(u)+1),0);n.largeFileOptimizations?(this._isTooLargeForTokenization=h>P_.LARGE_FILE_SIZE_THRESHOLD||u>P_.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>P_.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>P_._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=G_e(x2),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new yse,this._commandManager=new zG(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 Ny([],"",` -`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=_e.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 M0(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Mc();const{textBuffer:t,disposable:n}=Cse(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,o,r,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:o}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:r,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),r=this.getLineCount(),s=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new yse,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Ry([new xat],this._versionId,!1,!1),this._createContentChanged2(new V(1,1,r,s),0,o,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r +`&&(this._cr>0||this._crlf>0)))for(let r=0,s=n.length;r=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=uat(this._tmpLineStarts,e);this.chunks.push(new q_(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=pw(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=q_e(e)))}finish(e=!0){return this._finish(),new pat(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=lg(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class mat{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,n){if(e>=this._store.length)return;if(t===0){this.insert(e,n);return}else if(n===0){this.delete(e,t);return}const o=this._store.slice(0,e),r=this._store.slice(e+t),s=vat(n,this._default);this._store=o.concat(s,r)}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 n=[];for(let o=0;o0){const n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e){n.appendLineTokens(t);return}}this._tokens.push(new _at(e,[t]))}finalize(){return this._tokens}}class bat{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new MH(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class Cat extends bat{constructor(e,t,n,o){super(e,t),this._textModel=n,this._languageIdCodec=o}updateTokensUntilLine(e,t){const n=this._textModel.getLanguageId();for(;;){const o=this.getFirstInvalidLine();if(!o||o.lineNumber>t)break;const r=this._textModel.getLineContent(o.lineNumber),s=zx(this._languageIdCodec,n,this.tokenizationSupport,r,!0,o.startState);e.add(o.lineNumber,s.tokens),this.store.setEndState(o.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const n=this.getStartState(e.lineNumber);if(!n)return 0;const o=this._textModel.getLanguageId(),r=this._textModel.getLineContent(e.lineNumber),s=r.substring(0,e.column-1)+t+r.substring(e.column-1),a=zx(this._languageIdCodec,o,this.tokenizationSupport,s,!0,n),l=new pr(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,n){const o=e.lineNumber,r=e.column,s=this.getStartState(o);if(!s)return null;const a=this._textModel.getLineContent(o),l=a.substring(0,r-1)+n+a.substring(r-1+t),c=this._textModel.getLanguageIdAtPosition(o,0),d=zx(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new pr(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&&n>0&&(n--,t--),this._lineEndStates.replace(e.startLineNumber,n,t)}}class wat{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(n=>n.contains(e));if(t!==-1){const n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Cn(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new Cn(n.start,e):this._ranges.splice(t,1,new Cn(n.start,e),new Cn(e+1,n.endExclusive))}}addRange(e){Cn.addRange(e,this._ranges)}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let o=n;for(;!(o>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function zx(i,e,t,n,o,r){let s=null;if(t)try{s=t.tokenizeEncoded(n,o,r.clone())}catch(a){en(a)}return s||(s=f5(i.encodeLanguageId(e),r)),pr.convertToEndOffset(s.tokens,n.length),s}class Sat{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,Ag(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{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 n=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return n?(this._tokenizerWithStateStore.updateTokensUntilLine(e,n.lineNumber),n.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new ln(e,t))}}const cg=new Uint32Array(0).buffer;class Lh{static deleteBeginning(e,t){return e===null||e===cg?e:Lh.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===cg)return e;const n=kg(e),o=n[n.length-2];return Lh.delete(e,t,o)}static delete(e,t,n){if(e===null||e===cg||t===n)return e;const o=kg(e),r=o.length>>>1;if(t===0&&o[o.length-2]===n)return cg;const s=pr.findIndexInTokensArray(o,t),a=s>0?o[s-1<<1]:0,l=o[s<<1];if(nd&&(o[c++]=g,o[c++]=o[(f<<1)+1],d=g)}if(c===o.length)return e;const h=new Uint32Array(c);return h.set(o.subarray(0,c),0),h.buffer}static append(e,t){if(t===cg)return e;if(e===cg)return t;if(e===null)return e;if(t===null)return null;const n=kg(e),o=kg(t),r=o.length>>>1,s=new Uint32Array(n.length+o.length);s.set(n,0);let a=n.length;const l=n[n.length-2];for(let c=0;c>>1;let s=pr.findIndexInTokensArray(o,t);s>0&&o[s-1<<1]===t&&s--;for(let a=s;a0}getTokens(e,t,n){let o=null;if(t1&&(r=is.getLanguageId(o[1])!==e),!r)return cg}if(!o||o.length===0){const r=new Uint32Array(2);return r[0]=t,r[1]=bse(e),r.buffer}return o[o.length-2]=t,o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:o}_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 n=[];for(let o=0;o=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Lh.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Lh.deleteEnding(this._lineTokens[t],e.startColumn-1);const n=e.endLineNumber-1;let o=null;n=this._len)){if(t===0){this._lineTokens[o]=Lh.insert(this._lineTokens[o],e.column-1,n);return}this._lineTokens[o]=Lh.deleteEnding(this._lineTokens[o],e.column-1),this._lineTokens[o]=Lh.insert(this._lineTokens[o],e.column-1,n),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const n=[];for(let o=0,r=e.length;o>>0}class GG{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 n=e;if(t.length>0){const r=t[0].getRange(),s=t[t.length-1].getRange();if(!r||!s)return e;n=e.plusRange(r).plusRange(s)}let o=null;for(let r=0,s=this._pieces.length;rn.endLineNumber){o=o||{index:r};break}if(a.removeTokens(n),a.isEmpty()){this._pieces.splice(r,1),r--,s--;continue}if(a.endLineNumbern.endLineNumber){o=o||{index:r};continue}const[l,c]=a.split(n);if(l.isEmpty()){o=o||{index:r};continue}c.isEmpty()||(this._pieces.splice(r,1,l,c),r++,s++,o=o||{index:r})}return o=o||{index:this._pieces.length},t.length>0&&(this._pieces=V4(this._pieces,o.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const n=this._pieces;if(n.length===0)return t;const o=GG._findFirstPieceWithLine(n,e),r=n[o].getLineTokens(e);if(!r)return t;const s=t.getCount(),a=r.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,_=~m>>>0;for(;lt)o=r-1;else{for(;r>n&&e[r-1].startLineNumber<=t&&t<=e[r-1].endLineNumber;)r--;return r}}return n}acceptEdit(e,t,n,o,r){for(const s of this._pieces)s.acceptEdit(e,t,n,o,r)}}class CP extends Fbe{constructor(e,t,n,o,r,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=n,this._bracketPairsTextModelPart=o,this._languageId=r,this._attachedViews=s,this._semanticTokens=new GG(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new le),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new le),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new le),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new xat(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[n,o,r]=Tv(t.text);this._semanticTokens.acceptEdit(t.range,n,o,r,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 Vo("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,n){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,n)}tokenizeLineWithEdit(e,t,n){return this.grammarTokens.tokenizeLineWithEdit(e,t,n)}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 n=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),n=this._textModel.getLineContent(t.lineNumber),o=this.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1),[s,a]=CP._findLanguageBoundaries(o,r),l=TD(t.column,this.getLanguageConfiguration(o.getLanguageId(r)).getWordDefinition(),n.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(r>0&&s===t.column-1){const[c,d]=CP._findLanguageBoundaries(o,r-1),u=TD(t.column,this.getLanguageConfiguration(o.getLanguageId(r-1)).getWordDefinition(),n.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 n=e.getLanguageId(t);let o=0;for(let s=t;s>=0&&e.getLanguageId(s)===n;s--)o=e.getStartOffset(s);let r=e.getLineContent().length;for(let s=t,a=e.getCount();s{const s=this.getLanguageId();r.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(o.onDidChangeVisibleRanges(({view:r,state:s})=>{if(s){let a=this._attachedViewStates.get(r);a||(a=new Lat(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(r,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(r)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new MH(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const n=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=oo.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return en(l),[null,null]}return[s,a]},[o,r]=n();if(o&&r?this._tokenizer=new Cat(this._textModel.getLineCount(),o,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={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))}};o&&o.createBackgroundTokenizer&&!o.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=o.createBackgroundTokenizer(this._textModel,s)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Sat(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),(o==null?void 0:o.backgroundTokenizerShouldOnlyVerifyTokens)&&o.createBackgroundTokenizer?(this._debugBackgroundTokens=new dk(this._languageIdCodec),this._debugBackgroundStates=new MH(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=o.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,n,o;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const r of e.changes){const[s,a]=Tv(r.text);this._tokens.acceptEdit(r.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(r.range,s,a)}(n=this._debugBackgroundStates)===null||n===void 0||n.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.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=ln.joinMany([...this._attachedViewStates].map(([t,n])=>n.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var n,o;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const r=new RH,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(r,e,t),a=this.setTokens(r.finalize());if(s)for(const l of a.changes)(n=this._backgroundTokenizer.value)===null||n===void 0||n.requestTokens(l.fromLineNumber,l.toLineNumber+1);(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.checkFinished()}forceTokenization(e){var t,n;const o=new RH;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(o,e),this.setTokens(o.finalize()),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const n=this._textModel.getLineContent(e),o=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,n);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const r=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,n);!o.equals(r)&&((t=this._debugBackgroundTokenizer.value)===null||t===void 0?void 0:t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return o}getTokenTypeIfInsertingCharacter(e,t,n){if(!this._tokenizer)return 0;const o=this._textModel.validatePosition(new ae(e,t));return this.forceTokenization(o.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(o,n)}tokenizeLineWithEdit(e,t,n){if(!this._tokenizer)return null;const o=this._textModel.validatePosition(e);return this.forceTokenization(o.lineNumber),this._tokenizer.tokenizeLineWithEdit(o,t,n)}get hasTokens(){return this._tokens.hasTokens}}class Lat extends _e{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new bi(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Lo(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 Eat{constructor(){this.changeType=1}}class Gu{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",o=0;for(const r of t)n+=e.substring(o,r.column-1),o=r.column-1,n+=r.options.content;return n+=e.substring(o),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new Gu(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new Gu(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,o)=>n.lineNumber===o.lineNumber?n.column===o.column?n.order-o.order:n.column-o.column:n.lineNumber-o.lineNumber),t}constructor(e,t,n,o,r){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=o,this.order=r}}class Cse{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class Dat{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class kat{constructor(e,t,n,o){this.changeType=4,this.injectedTexts=o,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class Iat{constructor(){this.changeType=5}}class Ry{constructor(e,t,n,o){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=o,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;t=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},b9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},P_;function Nat(i){const e=new r1e;return e.acceptChunk(i),e.finish()}function Rat(i){const e=new r1e;let t;for(;typeof(t=i.read())=="string";)e.acceptChunk(t);return e.finish()}function yse(i,e){let t;return typeof i=="string"?t=Nat(i):bet(i)?t=Rat(i):t=i,t.create(e)}let x2=0;const Mat=999,Aat=1e4;class Pat{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,n=0;do{const o=this._source.read();if(o===null)return this._eos=!0,t===0?null:e.join("");if(o.length>0&&(e[t++]=o,n+=o.length),n>=64*1024)return e.join("")}while(!0)}}const Ux=()=>{throw new Error("Invalid change accessor")};let bf=P_=class extends _e{static resolveOptions(e,t){if(t.detectIndentation){const n=use(e,t.tabSize,t.insertSpaces);return new sM({tabSize:n.tabSize,indentSize:"tabSize",insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new sM(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 Td(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,n,o=null,r,s,a){super(),this._undoRedoService=r,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new le),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Vat(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new le),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new le),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new le),this._eventEmitter=this._register(new Hat),this._languageSelectionListener=this._register(new Kr),this._deltaDecorationCallCnt=0,this._attachedViews=new $at,x2++,this.id="$model"+x2,this.isForSimpleWidget=n.isForSimpleWidget,typeof o=="undefined"||o===null?this._associatedResource=Rt.parse("inmemory://model/"+x2):this._associatedResource=o,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=yse(e,n.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=P_.resolveOptions(this._buffer,n);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 Fst(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Nrt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Wst(this)),this._tokenizationTextModelPart=new CP(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new V(1,1,u,this._buffer.getLineLength(u)+1),0);n.largeFileOptimizations?(this._isTooLargeForTokenization=h>P_.LARGE_FILE_SIZE_THRESHOLD||u>P_.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>P_.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>P_._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=G_e(x2),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new wse,this._commandManager=new UG(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 Ny([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=_e.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 M0(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Mc();const{textBuffer:t,disposable:n}=yse(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,o,r,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:o}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:r,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),r=this.getLineCount(),s=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new wse,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Ry([new Eat],this._versionId,!1,!1),this._createContentChanged2(new V(1,1,r,s),0,o,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r `:` -`;if(this._buffer.getEOL()===t)return;const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),r=this.getLineCount(),s=this.getLineMaxColumn(r);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Ry([new Dat],this._versionId,!1,!1),this._createContentChanged2(new V(1,1,r,s),0,o,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,o=t.length;n0}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 n=this._buffer.getLineCount();for(let o=1;o<=n;o++){const r=this._buffer.getLineLength(o);r>=Rat?t+=r:e+=r}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!="undefined"?e.tabSize:this._options.tabSize,n=typeof e.indentSize!="undefined"?e.indentSize:this._options.originalIndentSize,o=typeof e.insertSpaces!="undefined"?e.insertSpaces:this._options.insertSpaces,r=typeof e.trimAutoWhitespace!="undefined"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions!="undefined"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new sM({tabSize:t,indentSize:n,insertSpaces:o,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:r,bracketPairColorizationOptions:s});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 n=dse(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),hP(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(K_e.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(n=>({range:n.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 Vo("Operation would exceed heap memory limits");const n=this.getFullModelRange(),o=this.getValueInRange(n,e);return t?this._buffer.getBOM()+o:o}createSnapshot(e=!1){return new Mat(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n,e);return t?this._buffer.getBOM().length+o:o}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 Vo("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Vo("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` -`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),n=e.startLineNumber,o=e.startColumn;let r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1),s=Math.floor(typeof o=="number"&&!isNaN(o)?o:1);if(r<1)r=1,s=1;else if(r>t)r=t,s=this.getLineMaxColumn(r);else if(s<=1)s=1;else{const u=this.getLineMaxColumn(r);s>=u&&(s=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 n===r&&o===s&&a===c&&l===d&&e instanceof V&&!(e instanceof gt)?e:new V(r,s,c,d)}_isValidPosition(e,t,n){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const o=this._buffer.getLineCount();if(e>o)return!1;if(t===1)return!0;const r=this.getLineMaxColumn(e);if(t>r)return!1;if(n===1){const s=this._buffer.getLineCharCode(e,t-2);if(gr(s))return!1}return!0}_validatePosition(e,t,n){const o=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),r=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),s=this._buffer.getLineCount();if(o<1)return new ae(1,1);if(o>s)return new ae(s,this.getLineMaxColumn(s));if(r<=1)return new ae(o,1);const a=this.getLineMaxColumn(o);if(r>=a)return new ae(o,a);if(n===1){const l=this._buffer.getLineCharCode(o,r-2);if(gr(l))return new ae(o,r-1)}return new ae(o,r)}validatePosition(e){return this._assertNotDisposed(),e instanceof ae&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(n,o,0)||!this._isValidPosition(r,s,0))return!1;if(t===1){const a=o>1?this._buffer.getLineCharCode(n,o-2):0,l=s>1&&s<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,s-2):0,c=gr(a),d=gr(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof V&&!(e instanceof gt)&&this._isValidRange(e,1))return e;const n=this._validatePosition(e.startLineNumber,e.startColumn,0),o=this._validatePosition(e.endLineNumber,e.endColumn,0),r=n.lineNumber,s=n.column,a=o.lineNumber,l=o.column;{const c=s>1?this._buffer.getLineCharCode(r,s-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=gr(c),h=gr(d);return!u&&!h?new V(r,s,a,l):r===a&&s===l?new V(r,s-1,a,l-1):u&&h?new V(r,s-1,a,l+1):u?new V(r,s-1,a,l):new V(r,s,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new V(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,n,o){return this._buffer.findMatchesLineByLine(e,t,n,o)}findMatches(e,t,n,o,r,s,a=Nat){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>V.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)=>V.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!n&&e.indexOf(` +`;if(this._buffer.getEOL()===t)return;const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),r=this.getLineCount(),s=this.getLineMaxColumn(r);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Ry([new Iat],this._versionId,!1,!1),this._createContentChanged2(new V(1,1,r,s),0,o,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,o=t.length;n0}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 n=this._buffer.getLineCount();for(let o=1;o<=n;o++){const r=this._buffer.getLineLength(o);r>=Aat?t+=r:e+=r}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!="undefined"?e.tabSize:this._options.tabSize,n=typeof e.indentSize!="undefined"?e.indentSize:this._options.originalIndentSize,o=typeof e.insertSpaces!="undefined"?e.insertSpaces:this._options.insertSpaces,r=typeof e.trimAutoWhitespace!="undefined"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions!="undefined"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new sM({tabSize:t,indentSize:n,insertSpaces:o,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:r,bracketPairColorizationOptions:s});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 n=use(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),hP(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(K_e.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(n=>({range:n.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 Vo("Operation would exceed heap memory limits");const n=this.getFullModelRange(),o=this.getValueInRange(n,e);return t?this._buffer.getBOM()+o:o}createSnapshot(e=!1){return new Pat(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n,e);return t?this._buffer.getBOM().length+o:o}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 Vo("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Vo("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),n=e.startLineNumber,o=e.startColumn;let r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1),s=Math.floor(typeof o=="number"&&!isNaN(o)?o:1);if(r<1)r=1,s=1;else if(r>t)r=t,s=this.getLineMaxColumn(r);else if(s<=1)s=1;else{const u=this.getLineMaxColumn(r);s>=u&&(s=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 n===r&&o===s&&a===c&&l===d&&e instanceof V&&!(e instanceof gt)?e:new V(r,s,c,d)}_isValidPosition(e,t,n){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const o=this._buffer.getLineCount();if(e>o)return!1;if(t===1)return!0;const r=this.getLineMaxColumn(e);if(t>r)return!1;if(n===1){const s=this._buffer.getLineCharCode(e,t-2);if(gr(s))return!1}return!0}_validatePosition(e,t,n){const o=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),r=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),s=this._buffer.getLineCount();if(o<1)return new ae(1,1);if(o>s)return new ae(s,this.getLineMaxColumn(s));if(r<=1)return new ae(o,1);const a=this.getLineMaxColumn(o);if(r>=a)return new ae(o,a);if(n===1){const l=this._buffer.getLineCharCode(o,r-2);if(gr(l))return new ae(o,r-1)}return new ae(o,r)}validatePosition(e){return this._assertNotDisposed(),e instanceof ae&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(n,o,0)||!this._isValidPosition(r,s,0))return!1;if(t===1){const a=o>1?this._buffer.getLineCharCode(n,o-2):0,l=s>1&&s<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,s-2):0,c=gr(a),d=gr(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof V&&!(e instanceof gt)&&this._isValidRange(e,1))return e;const n=this._validatePosition(e.startLineNumber,e.startColumn,0),o=this._validatePosition(e.endLineNumber,e.endColumn,0),r=n.lineNumber,s=n.column,a=o.lineNumber,l=o.column;{const c=s>1?this._buffer.getLineCharCode(r,s-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=gr(c),h=gr(d);return!u&&!h?new V(r,s,a,l):r===a&&s===l?new V(r,s-1,a,l-1):u&&h?new V(r,s-1,a,l+1):u?new V(r,s-1,a,l):new V(r,s,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new V(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,n,o){return this._buffer.findMatchesLineByLine(e,t,n,o)}findMatches(e,t,n,o,r,s,a=Mat){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>V.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)=>V.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!n&&e.indexOf(` `)<0){const h=new A_(e,n,o,r).parseSearchRequest();if(!h)return[];d=f=>this.findMatchesLineByLine(f,h,s,a)}else d=u=>c2.findMatches(this,new A_(e,n,o,r),u,s,a);return c.map(d).reduce((u,h)=>u.concat(h),[])}findNextMatch(e,t,n,o,r,s){this._assertNotDisposed();const a=this.validatePosition(t);if(!n&&e.indexOf(` `)<0){const c=new A_(e,n,o,r).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new V(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),h=this.findMatchesLineByLine(u,c,s,1);return c2.findNextMatch(this,new A_(e,n,o,r),a,s),h.length>0||(u=new V(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,c,s,1),h.length>0)?h[0]:null}return c2.findNextMatch(this,new A_(e,n,o,r),a,s)}findPreviousMatch(e,t,n,o,r,s){this._assertNotDisposed();const a=this.validatePosition(t);return c2.findPreviousMatch(this,new A_(e,n,o,r),a,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` -`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof Q6?e:new Q6(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let n=0,o=e.length;n({range:this.validateRange(a.range),text:a.text}));let s=!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){s=!1;break}}if(s)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)===` +`?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 J6?e:new J6(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let n=0,o=e.length;n({range:this.validateRange(a.range),text:a.text}));let s=!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){s=!1;break}}if(s)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&p&&p.length>0&&p.charAt(0)===` `)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)===` -`)){u=!1;break}}if(u){const h=new V(c,1,c,d);t.push(new Q6(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,n,o)}_applyUndo(e,t,n,o){const r=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new V(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(r,t,!0,!1,n,o)}_applyRedo(e,t,n,o){const r=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new V(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(r,t,!1,!0,n,o)}_applyUndoRedoEdits(e,t,n,o,r,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=o,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(r)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const n=this._buffer.getLineCount(),o=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),s=o.changes;if(this._trimAutoWhitespaceLines=o.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,d=s.length;c=0;k--){const R=f+k,A=y+k;I.takeFromEndWhile(N=>N.lineNumber>A);const P=I.takeFromEndWhile(N=>N.lineNumber===A);a.push(new bse(R,this.getLineContent(A),P))}if(mF.lineNumberF.lineNumber===B)}a.push(new Eat(R+1,f+v,M,N))}l+=_}this._emitContentChangedEvent(new Ry(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return o.reverseEdits===null?void 0:o.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 n=Array.from(e).map(o=>new bse(o,this.getLineContent(o),this._getInjectedTextInLine(o)));this._onDidChangeInjectedText.fire(new s1e(n))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const n={addDecoration:(r,s)=>this._deltaDecorationsImpl(e,[],[{range:r,options:s}])[0],changeDecoration:(r,s)=>{this._changeDecorationImpl(r,s)},changeDecorationOptions:(r,s)=>{this._changeDecorationOptionsImpl(r,Sse(s))},removeDecoration:r=>{this._deltaDecorationsImpl(e,[r],[])},deltaDecorations:(r,s)=>r.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,r,s)};let o=null;try{o=t(n)}catch(r){en(r)}return n.addDecoration=Ux,n.changeDecoration=Ux,n.changeDecorationOptions=Ux,n.removeDecoration=Ux,n.deltaDecorations=Ux,o}deltaDecorations(e,t,n=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."),en(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){const o=e?this._decorations[e]:null;if(!o)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:wse[n]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(o),delete this._decorations[o.id],null;const r=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),a=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);return this._decorationsTree.delete(o),o.reset(this.getVersionId(),s,a,r),o.setOptions(wse[n]),this._decorationsTree.insert(o),o.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let n=0,o=t.length;nthis.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,o=!1,r=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),d=new V(a,1,l,c),u=this._getDecorationsInRange(d,n,o,r);return qW(u,this._decorationProvider.getDecorationsInRange(d,n,o)),u}getDecorationsInRange(e,t=0,n=!1,o=!1,r=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,n,r);return qW(a,this._decorationProvider.getDecorationsInRange(s,t,n,o)),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),n=t+this._buffer.getLineLength(e),o=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return Gu.fromDecorations(o).filter(r=>r.lineNumber===e)}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,n,o){const r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,s,t,n,o)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const n=this._decorations[e];if(!n)return;if(n.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(n.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),s=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,s,o),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber)}_changeDecorationOptionsImpl(e,t){const n=this._decorations[e];if(!n)return;const o=!!(n.options.overviewRuler&&n.options.overviewRuler.color),r=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){const s=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber)}if(n.options.before||t.before){const s=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}o!==r?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n,o=!1){const r=this.getVersionId(),s=t.length;let a=0;const l=n.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 Aat(this.getLineContent(e))+1}};bf._MODEL_SYNC_LIMIT=50*1024*1024;bf.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;bf.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;bf.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;bf.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:vs.tabSize,indentSize:vs.indentSize,insertSpaces:vs.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:vs.trimAutoWhitespace,largeFileOptimizations:vs.largeFileOptimizations,bracketPairColorizationOptions:vs.bracketPairColorizationOptions};bf=P_=kat([_9(4,L5),_9(5,Ki),_9(6,Ti)],bf);function Aat(i){let e=0;for(const t of i)if(t===" "||t===" ")e++;else break;return e}function b9(i){return!!(i.options.overviewRuler&&i.options.overviewRuler.color)}function C9(i){return!!i.options.after||!!i.options.before}class yse{constructor(){this._decorationsTree0=new p9,this._decorationsTree1=new p9,this._injectedTextDecorationsTree=new p9}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const n of t)n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,o,r,s){const a=e.getVersionId(),l=this._intervalSearch(t,n,o,r,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,n,o,r,s){const a=this._decorationsTree0.intervalSearch(e,t,n,o,r,s),l=this._decorationsTree1.intervalSearch(e,t,n,o,r,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,n,o,r,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,n,o){const r=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,n,o,!1,r,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const n=e.getVersionId(),o=this._injectedTextDecorationsTree.search(t,!1,n,!1);return this._ensureNodesHaveRanges(e,o).filter(r=>r.options.showIfCollapsed||!r.range.isEmpty())}getAll(e,t,n,o,r){const s=e.getVersionId(),a=this._search(t,n,o,s,r);return this._ensureNodesHaveRanges(e,a)}_search(e,t,n,o,r){if(n)return this._decorationsTree1.search(e,t,o,r);{const s=this._decorationsTree0.search(e,t,o,r),a=this._decorationsTree1.search(e,t,o,r),l=this._injectedTextDecorationsTree.search(e,t,o,r);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),o=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(o)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){C9(e)?this._injectedTextDecorationsTree.insert(e):b9(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){C9(e)?this._injectedTextDecorationsTree.delete(e):b9(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){C9(e)?this._injectedTextDecorationsTree.resolveNode(e,t):b9(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,o){this._decorationsTree0.acceptReplace(e,t,n,o),this._decorationsTree1.acceptReplace(e,t,n,o),this._injectedTextDecorationsTree.acceptReplace(e,t,n,o)}}function Zf(i){return i.replace(/[^a-z0-9\-_]/gi," ")}class l1e{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Pat extends l1e{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Yl.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 n=e?t.getColor(e.id):null;return n?n.toString():""}}class Oat{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:wy.Left}}class Fat extends l1e{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"?ve.fromHex(e):t.getColor(e.id)}}class Mv{static from(e){return e instanceof Mv?e:new Mv(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 Jt{static register(e){return new Jt(e)}static createDynamic(e){return new Jt(e)}constructor(e){var t,n,o,r,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Zf(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(n=e.blockIsAfterEnd)!==null&&n!==void 0?n:null,this.blockPadding=(o=e.blockPadding)!==null&&o!==void 0?o:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Zf(e.className):null,this.shouldFillLineOnLineBreak=(r=e.shouldFillLineOnLineBreak)!==null&&r!==void 0?r: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 Pat(e.overviewRuler):null,this.minimap=e.minimap?new Fat(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Oat(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Zf(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Zf(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Zf(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Zf(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Zf(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Zf(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Zf(e.afterContentClassName):null,this.after=e.after?Mv.from(e.after):null,this.before=e.before?Mv.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}Jt.EMPTY=Jt.register({description:"empty"});const wse=[Jt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Jt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Jt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Jt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function Sse(i){return i instanceof Jt?i:Jt.createDynamic(i)}class Bat extends _e{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new le),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 Wat extends _e{constructor(){super(),this._fastEmitter=this._register(new le),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new le),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 Vat{constructor(){this._onDidChangeVisibleRanges=new le,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Hat(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 Hat{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const n=e.map(o=>new ln(o.startLineNumber,o.endLineNumber+1));this.handleStateChange({visibleLineRanges:n,stabilized:t})}}class yP{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Br(new V(1,1,1,1),0,0,new ae(1,1),0),new Br(new V(1,1,1,1),0,0,new ae(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 kn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?gt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):gt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,o){return t.equals(n)?o:e.normalizePosition(t,2)}static _validateViewState(e,t){const n=t.position,o=t.selectionStart.getStartPosition(),r=t.selectionStart.getEndPosition(),s=e.normalizePosition(n,2),a=this._validatePositionWithCache(e,o,n,s),l=this._validatePositionWithCache(e,r,o,a);return n.equals(s)&&o.equals(a)&&r.equals(l)?t:new Br(V.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+o.column-a.column,s,t.leftoverVisibleColumns+n.column-s.column)}_setState(e,t,n){if(n&&(n=yP._validateViewState(e.viewModel,n)),t){const o=e.model.validateRange(t.selectionStart),r=t.selectionStart.equalsRange(o)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new Br(o,t.selectionStartKind,r,s,a)}else{if(!n)return;const o=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),r=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));t=new Br(o,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,r,n.leftoverVisibleColumns)}if(n){const o=e.coordinatesConverter.validateViewRange(n.selectionStart,t.selectionStart),r=e.coordinatesConverter.validateViewPosition(n.position,t.position);n=new Br(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}else{const o=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),r=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new V(o.lineNumber,o.column,r.lineNumber,r.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);n=new Br(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=n,this._updateTrackedRange(e)}}class xse{constructor(e){this.context=e,this.cursors=[new yP(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 Tet(this.cursors,Rc(e=>e.viewState.position,ae.compare)).viewState.position}getBottomMostViewPosition(){return Iet(this.cursors,Rc(e=>e.viewState.position,ae.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(kn.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,n=e.length;if(tn){const o=t-n;for(let r=0;r=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 n=0,o=e.length;nn.selection,V.compareRangesUsingStarts));for(let n=0;nu&&p.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),n--}}}}class Lse{constructor(e,t,n,o){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=o}}class $at{constructor(){this.type=0}}class zat{constructor(){this.type=1}}class Uat{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class jat{constructor(e,t,n){this.selections=e,this.modelSelections=t,this.reason=n,this.type=3}}class G1{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 L2{constructor(){this.type=5}}class Kat{constructor(e){this.type=6,this.isFocused=e}}class qat{constructor(){this.type=7}}class E2{constructor(){this.type=8}}class c1e{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class MH{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class AH{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class pM{constructor(e,t,n,o,r,s,a){this.source=e,this.minimalReveal=t,this.range=n,this.selections=o,this.verticalType=r,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class Gat{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 Xat{constructor(e){this.theme=e,this.type=14}}class Yat{constructor(e){this.type=15,this.ranges=e}}class Zat{constructor(){this.type=16}}class Qat{constructor(){this.type=17}}class Jat extends _e{constructor(){super(),this._onEvent=this._register(new le),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,n=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,n=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 n of t)n.handleEvents(e)}}}class elt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class GG{constructor(e,t,n,o){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,this.contentHeight=o,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 GG(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class XG{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 XG(this.oldHasFocus,e.hasFocus)}}class YG{constructor(e,t,n,o,r,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=o,this.scrollWidth=r,this.scrollLeft=s,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 YG(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class tlt{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class nlt{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class wP{constructor(e,t,n,o,r,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=o,this.source=r,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=e.length,o=t.length;if(n!==o)return!1;for(let r=0;r0){const e=this._cursors.getSelections();for(let t=0;ts&&(o=o.slice(0,s),r=!0);const a=SE.from(this._model,this);return this._cursors.setStates(o),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,a,r)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,n,o,r,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=V.fromPositions(a[0],a[0]),e.emitViewEvent(new pM(t,n,l,c,o,r,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let n=0,o=t.length;n0){const r=kn.fromModelSelections(n.resultingSelection);this.setStates(e,"modelChange",n.isUndoing?5:n.isRedoing?6:2,r)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const r=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,kn.fromModelSelections(r))}}}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(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,o){this.setStates(e,t,o,kn.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const n=[],o=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,o),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,n,o,r){const s=SE.from(this._model,this);if(s.equals(o))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new jat(l,a,n)),!o||o.cursorState.length!==s.cursorState.length||s.cursorState.some((c,d)=>!c.modelState.equals(o.cursorState[d].modelState))){const c=o?o.cursorState.map(u=>u.modelState.selection):null,d=o?o.modelVersionId:0;e.emitOutgoingEvent(new wP(c,a,d,s.modelVersionId,t||"keyboard",n,r))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let n=0,o=e.length;n=0)return null;const s=r.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=r.text.length-s[2].length-1,u=r.text.lastIndexOf(c,d-1);if(u===-1)return null;t.push([u,d])}return t}executeEdits(e,t,n,o){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(n)),r&&(n[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),n,c=>{if(r)for(let u=0,h=r.length;u0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,n,o=0){if(this.context.cursorConfig.readOnly)return;const r=SE.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){en(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,o,r,!1)&&this.revealPrimary(t,n,!1,0,!0,0)}getAutoClosedCharacters(){return Ese.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new xE(this._model,this.getSelections())}endComposition(e,t){const n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(eo.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,n){this._executeEdit(()=>{if(n==="keyboard"){const o=t.length;let r=0;for(;r{const c=l.getPosition();return new gt(c.lineNumber,c.column+r,c.lineNumber,c.column+r)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(eo.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,o,r))},e,s)}paste(e,t,n,o,r){this._executeEdit(()=>{this._executeEditOperation(eo.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,o||[]))},e,r,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(ob.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,n){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Sa(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}executeCommands(e,t,n){this._executeEdit(()=>{this._executeEditOperation(new Sa(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}}class SE{static from(e,t){return new SE(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,n=this.cursorState.length;t=t.length||!t[n].strictContainsRange(e[n]))return!1;return!0}}class ult{static executeCommands(e,t,n){const o={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(o,n);for(let s=0,a=o.trackedRanges.length;s0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,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),v=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new gt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new gt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in r)r.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,n=e.length;t{V.isEmpty(u)&&h===""||o.push({identifier:{major:t,minor:r++},range:u,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:s,addTrackedEditOperation:(u,h,f)=>{a=!0,s(u,h,f)},trackSelection:(u,h)=>{const f=gt.liftSelection(u);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const m=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===m?g=2:g=3}else g=1;const p=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=v,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{n.getEditOperations(e.model,d)}catch(u){return en(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:o,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((n,o)=>-V.compareRangesUsingEnds(n.range,o.range));const t={};for(let n=1;nr.identifier.major?s=o.identifier.major:s=r.identifier.major,t[s.toString()]=!0;for(let a=0;a0&&n--}}return t}}class hlt{constructor(e,t,n){this.text=e,this.startSelection=t,this.endSelection=n}}class xE{static _capture(e,t){const n=[];for(const o of t){if(o.startLineNumber!==o.endLineNumber)return null;n.push(new hlt(e.getLineContent(o.startLineNumber),o.startColumn-1,o.endColumn-1))}return n}constructor(e,t){this._original=xE._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const n=xE._capture(e,t);if(!n||this._original.length!==n.length)return null;const o=[];for(let r=0,s=this._original.length;rww,tokenizeEncoded:(i,e,t)=>h5(0,t)};function glt(i,e,t){return flt(this,void 0,void 0,function*(){if(!t)return kse(e,i.languageIdCodec,Dse);const n=yield oo.getOrCreate(t);return kse(e,i.languageIdCodec,n||Dse)})}function plt(i,e,t,n,o,r,s){let a="
",l=n,c=0,d=!0;for(let u=0,h=e.getCount();u0;)s&&d?(g+=" ",d=!1):(g+=" ",d=!0),v--;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+="\uFFFD",d=!1;break;case 13:g+="​",d=!1;break;case 32:s&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(p),d=!1}}if(a+=`${g}`,f>o||l>=o)break}return a+="
",a}function kse(i,e,t){let n='
';const o=gf(i);let r=t.getInitialState();for(let s=0,a=o.length;s0&&(n+="
");const c=t.tokenizeEncoded(l,!0,r);pr.convertToEndOffset(c.tokens,l.length);const u=new pr(c.tokens,l,e).inflate();let h=0;for(let f=0,g=u.getCount();f${UA(l.substring(h,v))}`,h=v}r=c.endState}return n+="
",n}class mlt{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,n=this._changes,o=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,o)}}class vlt{constructor(e,t,n,o,r){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=o,this.minWidth=r,this.prefixSum=0}}class uk{constructor(e,t,n,o){this._instanceId=G_e(++uk.INSTANCE_COUNT),this._pendingChanges=new mlt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=n,this._paddingBottom=o}static findInsertionIndex(e,t,n){let o=0,r=e.length;for(;o>>1;t===e[s].afterLineNumber?n{t=!0,o=o|0,r=r|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new vlt(l,o,r,s,a)),l},changeOneWhitespace:(o,r,s)=>{t=!0,r=r|0,s=s|0,this._pendingChanges.change({id:o,newAfterLineNumber:r,newHeight:s})},removeWhitespace:o=>{t=!0,this._pendingChanges.remove({id:o})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.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 n){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const o=new Set;for(const l of n)o.add(l.id);const r=new Map;for(const l of t)r.set(l.id,l);const s=l=>{const c=[];for(const d of l)if(!o.has(d.id)){if(r.has(d.id)){const u=r.get(d.id);d.afterLineNumber=u.newAfterLineNumber,d.height=u.newHeight}c.push(d)}return c},a=s(this._arr).concat(s(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=uk.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 n=0,o=t.length;nt&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let n=0,o=this._arr.length;n=t.length||t[a+1].afterLineNumber>=e)return a;n=a+1|0}else o=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const n=this._findLastWhitespaceBeforeLineNumber(e)+1;return n1?n=this._lineHeight*(e-1):n=0;const o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return n+o+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const n=this._lineHeight*e,o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return n+o+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,n=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,n=this._lineHeight;let o=1,r=t;for(;o=a+n)o=s+1;else{if(e>=a)return s;r=s}}return o>t?t:o}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this._lineHeight,o=this.getLineNumberAtOrAfterVerticalOffset(e)|0,r=this.getVerticalOffsetForLineNumber(o)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(o)|0;const l=this.getWhitespacesCount()|0;let c,d;a===-1?(a=l,d=s+1,c=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let u=r,h=u;const f=5e5;let g=0;r>=f&&(g=Math.floor(r/f)*f,g=Math.floor(g/n)*n,h-=g);const p=[],v=e+(t-e)/2;let m=-1;for(let L=o;L<=s;L++){if(m===-1){const D=u,E=u+n;(D<=v&&vv)&&(m=L)}for(u+=n,p[L-o]=h,h+=n;d===L;)h+=c,u+=c,a++,a>=l?d=s+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){s=L;break}}m===-1&&(m=s);const _=this.getVerticalOffsetForLineNumber(s)|0;let y=o,w=s;return yt&&w--,{bigNumbersDelta:g,startLineNumber:o,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:m,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:w}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let n;t>=1?n=this._lineHeight*t:n=0;let o;return e>0?o=this.getWhitespacesAccumulatedHeight(e-1):o=0,n+o+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;const o=this.getVerticalOffsetForWhitespaceIndex(n),r=this.getHeightForWhitespaceIndex(n);if(e>=o+r)return-1;for(;t=a+l)t=s+1;else{if(e>=a)return s;n=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;const o=this.getHeightForWhitespaceIndex(t),r=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:r,afterLineNumber:s,verticalOffset:n,height:o}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),o=this.getWhitespacesCount()-1;if(n<0)return[];const r=[];for(let s=n;s<=o;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;r.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}return r}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}}uk.INSTANCE_COUNT=0;const _lt=125;class TL{constructor(e,t,n,o){e=e|0,t=t|0,n=n|0,o=o|0,e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),o<0&&(o=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=o,this.scrollHeight=Math.max(n,o)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class blt extends _e{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new le),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new TL(0,0,0,0),this._scrollable=this._register(new ZI({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 n=t.contentWidth!==e.contentWidth,o=t.contentHeight!==e.contentHeight;(n||o)&&this._onDidContentSizeChange.fire(new GG(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 Clt extends _e{constructor(e,t,n){super(),this._configuration=e;const o=this._configuration.options,r=o.get(143),s=o.get(83);this._linesLayout=new uk(t,o.get(66),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new blt(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new TL(r.contentWidth,0,r.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)?_lt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const n=t.get(83);this._linesLayout.setPadding(n.top,n.bottom)}if(e.hasChanged(143)){const n=t.get(143),o=n.contentWidth,r=n.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new TL(o,s.contentWidth,r,this._getContentHeight(o,r,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 o=this._configuration.options.get(102);return o.horizontal===2||e>=t?0:o.horizontalScrollbarSize}_getContentHeight(e,t,n){const o=this._configuration.options;let r=this._linesLayout.getLinesTotalHeight();return o.get(104)?r+=Math.max(0,t-o.get(66)-o.get(83).bottom):r+=this._getHorizontalScrollbarHeight(e,n),r}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,o=e.contentWidth;this._scrollable.setScrollDimensions(new TL(t,e.contentWidth,n,this._getContentHeight(t,n,o)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new yre(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new yre(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,n=e.get(144),o=e.get(50),r=e.get(143);if(n.isViewportWrapping){const s=e.get(72);return t>r.contentWidth+o.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+r.verticalScrollbarWidth:t}else{const s=e.get(103)*o.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+r.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 TL(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),o=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);return{scrollTop:t,scrollTopWithoutViewZones:t-o,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 n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}}class ylt{constructor(e,t,n,o,r){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=o,this._coordinatesConverter=r,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 n=this._decorationsCache[t];if(!n){const o=e.range,r=e.options;let s;if(r.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(o.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(o.endLineNumber,this.model.getLineMaxColumn(o.endLineNumber)),1);s=new V(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(o,1);n=new J0e(s,r),this._decorationsCache[t]=n}return n}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,n=!1){const o=new V(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(o,t,n).inlineDecorations[0]}_getDecorationsInRange(e,t,n){const o=this._linesCollection.getDecorationsInRange(e,this.editorId,FA(this.configuration.options),t,n),r=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let d=r;d<=s;d++)c[d-r]=[];for(let d=0,u=o.length;dt===1)}function JG(i,e){return d1e(i,e.range,t=>t===2)}function d1e(i,e,t){for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const o=i.tokenization.getLineTokens(n),r=n===e.startLineNumber,s=n===e.endLineNumber;let a=r?o.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(o.getStandardTokenType(a)))return!1;a++}}return!0}function y9(i,e){return i===null?e?SP.INSTANCE:xP.INSTANCE:new wlt(i,e)}class wlt{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,n){this._assertVisible();const o=n>0?this._projectionData.breakOffsets[n-1]:0,r=this._projectionData.breakOffsets[n];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new Gu(0,0,c+1,this._projectionData.injectionOptions[d],0));s=Gu.applyInjectedText(e.getLineContent(t),a).substring(o,r)}else s=e.getValueInRange({startLineNumber:t,startColumn:o+1,endLineNumber:t,endColumn:r+1});return n>0&&(s=Ise(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){const o=new Array;return this.getViewLinesData(e,t,n,1,0,[!0],o),o[0]}getViewLinesData(e,t,n,o,r,s,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,_=l.breakOffsets[p];for(;g_)break;if(m0?l.wrappedTextIndentLength:0,I=E+Math.max(w-m,0),k=E+Math.min(L-m,_-m);I!==k&&v.push(new Itt(I,k,D.inlineClassName,D.inlineClassNameAffectsLetterSpacing))}}if(L<=_)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:pr.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=n;f0?o.wrappedTextIndentLength:0,s=n>0?o.breakOffsets[n-1]:0,a=o.breakOffsets[n],l=e.sliceAndInflate(s,a,r);let c=l.getLineContent();n>0&&(c=Ise(o.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(n)+1,u=c.length+1,h=n+1=w9.length)for(let e=1;e<=i;e++)w9[e]=Slt(e);return w9[i]}function Slt(i){return new Array(i+1).join(" ")}class xlt{constructor(e,t,n,o,r,s,a,l,c,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=o,this.fontInfo=r,this.tabSize=s,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 Elt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const n=this.model.getLinesContent(),o=this.model.getInjectedTextDecorations(this._editorId),r=n.length,s=this.createLineBreaksComputer(),a=new ap(Gu.fromDecorations(o));for(let p=0;pm.lineNumber===p+1);s.addRequest(n[p],v,t?t[p]:null)}const l=s.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(V.compareRangesUsingStarts);let u=1,h=0,f=-1,g=f+1=u&&v<=h,_=y9(l[p],!m);c[p]=_.getViewLineCount(),this.modelLineProjections[p]=_}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new aet(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),n=Llt(t),o=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(V.compareRangesUsingStarts);if(n.length===o.length){let h=!1;for(let f=0;f({range:h,options:Jt.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,r);const s=n;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,n,o,r){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===n,c=this.wrappingIndent===o,d=this.wordBreak===r;if(s&&a&&l&&c&&d)return!1;const u=s&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=o,this.wordBreak=r;let h=null;if(u){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,u=o.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,u=d+l-1,g=u+1,p=g+(r-l)-1,c=!0):rt?t:e|0}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);const o=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),a=this.model.guides.getActiveIndentGuide(o.lineNumber,r.lineNumber,s.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),n=t.index,o=t.remainder;return new Tse(n+1,o)}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],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,o)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,o)}getViewLineInfosGroupedByModelRanges(e,t){const n=this.getViewLineInfo(e),o=this.getViewLineInfo(t),r=new Array;let s=this.getModelStartPositionOfViewLine(n),a=new Array;for(let l=n.modelLineNumber;l<=o.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===n.modelLineNumber?n.modelLineWrappedLineIdx:0,u=l===o.modelLineNumber?o.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),v=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===d.modelLineWrappedLineIdx?new v0(f.visibleColumn,g,f.className,new mE(f.horizontalLine.top,p.column),-1,-1):v.lineNumber!!f))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let r=[];const s=[],a=[],l=n.lineNumber-1,c=o.lineNumber-1;let d=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const v=p.getViewLineNumberOfModelPosition(0,g===l?n.column:1),m=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),_=m-v+1;let y=0;_>1&&p.getViewLineMinColumn(this.model,g+1,m)===1&&(y=v===0?1:2),s.push(_),a.push(y),d===null&&(d=new ae(g+1,0))}else d!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}d!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,o.lineNumber)),d=null);const u=t-e+1,h=new Array(u);let f=0;for(let g=0,p=r.length;gt&&(g=!0,f=t-r+1),u.getViewLinesData(this.model,c+1,h,f,r-e,n,l),r+=f,g)break}return l}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);const o=this.projectedModelLineLineCounts.getIndexOf(e-1),r=o.index,s=o.remainder,a=this.modelLineProjections[r],l=a.getViewLineMinColumn(this.model,r+1,s),c=a.getViewLineMaxColumn(this.model,r+1,s);tc&&(t=c);const d=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new ae(r+1,d)).equals(n)?new ae(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){const n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),o=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new V(n.lineNumber,n.column,o.lineNumber,o.column)}convertViewPositionToModelPosition(e,t){const n=this.getViewLineInfo(e),o=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new ae(n.modelLineNumber,o))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new V(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2,o=!1,r=!1){const s=this.model.validatePosition(new ae(e,t)),a=s.lineNumber,l=s.column;let c=a-1,d=!1;if(r)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new ae(o?0:1,1);const u=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return d?r?h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,1,n):h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(c+1),n):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(u,l,n),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return V.fromPositions(n)}else{const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),o=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new V(n.lineNumber,n.column,o.lineNumber,o.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){const r=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(n===0&&!this.modelLineProjections[n].isVisible())return 1;const o=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(o,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n,o,r){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new V(s.lineNumber,1,a.lineNumber,a.column),t,n,o,r);let l=[];const c=s.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 ae(p+1,p===c?s.column:1));else if(u!==null){const m=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new V(u.lineNumber,u.column,p,m),t,n,o)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new V(u.lineNumber,u.column,a.lineNumber,a.column),t,n,o)),u=null),l.sort((p,v)=>{const m=V.compareRangesUsingStarts(p.range,v.range);return m===0?p.idv.id?1:0:m});const h=[];let f=0,g=null;for(const p of l){const v=p.id;g!==v&&(g=v,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 n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function Llt(i){if(i.length===0)return[];const e=i.slice();e.sort(V.compareRangesUsingStarts);const t=[];let n=e[0].startLineNumber,o=e[0].endLineNumber;for(let r=1,s=e.length;ro+1?(t.push(new V(n,1,o,1)),n=a.startLineNumber,o=a.endLineNumber):a.endLineNumber>o&&(o=a.endLineNumber)}return t.push(new V(n,1,o,1)),t}class Tse{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class Nse{constructor(e,t){this.modelRange=e,this.viewLines=t}}class Elt{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,n,o){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,n,o)}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 Dlt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new klt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,o){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,n,o)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new MH(t,n)}onModelLinesInserted(e,t,n,o){return new AH(t,n)}onModelLineChanged(e,t,n){return[!1,new c1e(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const n=t-e+1,o=new Array(n);for(let r=0;rt)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class Ilt extends _e{constructor(e,t,n,o,r,s,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new Nlt,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=n,this._eventDispatcher=new Jat,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new bi(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=eX.create(this.model),this.model.isTooLargeForTokenization())this._lines=new Dlt(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 xlt(this._editorId,this.model,o,r,u,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new dlt(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Clt(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Gat(d)),this._eventDispatcher.emitOutgoingEvent(new YG(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 ylt(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(nT.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Zat)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Xat(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 V(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 Kat(e)),this._eventDispatcher.emitOutgoingEvent(new XG(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new $at)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new zat)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new ae(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new Mse(t,this._viewportStart.startLineDelta)}return new Mse(null,0)}_onConfigurationChanged(e,t){const n=this._captureStableViewport(),o=this._configuration.options,r=o.get(50),s=o.get(137),a=o.get(144),l=o.get(136),c=o.get(128);this._lines.setWrappingSettings(r,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new L2),e.emitViewEvent(new E2),e.emitViewEvent(new G1(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 G1(null))),e.emitViewEvent(new Uat(t)),this.viewLayout.onConfigurationChanged(t),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout),U1.shouldRecreate(t)&&(this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const n=this._eventDispatcher.beginEmitViewEvents();let o=!1,r=!1;const s=e instanceof M0?e.rawContentChangedEvent.changes:e.changes,a=e instanceof M0?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const u of s)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 ap(c);for(const u of s)switch(u.changeType){case 1:{this._lines.onModelFlushed(),n.emitViewEvent(new L2),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),o=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,u.fromLineNumber,u.toLineNumber);h!==null&&(n.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),o=!0;break}case 4:{const h=d.takeCount(u.detail.length),f=this._lines.onModelLinesInserted(a,u.fromLineNumber,u.toLineNumber,h);f!==null&&(n.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),o=!0;break}case 2:{const h=d.dequeue(),[f,g,p,v]=this._lines.onModelLineChanged(a,u.lineNumber,h);r=f,g&&n.emitViewEvent(g),p&&(n.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),v&&(n.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!o&&r&&(n.emitViewEvent(new E2),n.emitViewEvent(new G1(null)),this._cursor.onLineMappingChanged(n),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 n=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(n){const o=this.coordinatesConverter.convertModelPositionToViewPosition(n.getStartPosition()),r=this.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber);this.viewLayout.setScrollPosition({scrollTop:r+this._viewportStart.startLineDelta},1)}}try{const n=this._eventDispatcher.beginEmitViewEvents();e instanceof M0&&n.emitOutgoingEvent(new alt(e.contentChangedEvent)),this._cursor.onModelContentChanged(n,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let n=0,o=e.ranges.length;n{this._eventDispatcher.emitSingleViewEvent(new qat),this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new slt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new rlt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new L2),t.emitViewEvent(new E2),t.emitViewEvent(new G1(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new llt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new G1(e)),this._eventDispatcher.emitOutgoingEvent(new olt(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas)return;this.previousHiddenAreas=n;const o=this._captureStableViewport();let r=!1;try{const s=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(n),r&&(s.emitViewEvent(new L2),s.emitViewEvent(new E2),s.emitViewEvent(new G1(null)),this._cursor.onLineMappingChanged(s),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new nlt)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),n=Math.max(20,Math.round(e.height/t)),o=this.viewLayout.getLinesViewportData(),r=Math.max(1,o.completelyVisibleStartLineNumber-n),s=Math.min(this.getLineCount(),o.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new V(r,this.getLineMinColumn(r),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(n.length===0)return[t];const o=[];let r=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,u=n.length;dl||(sa.toInlineDecoration(e))]),new Zl(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,n,o,s.tokens,t,r,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){const o=this._lines.getViewLinesData(e,t,n);return new ktt(this.getTabSize(),o)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,FA(this._configuration.options)),n=new Tlt;for(const o of t){const r=o.options,s=r.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.startLineNumber,o.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.endLineNumber,o.range.endColumn);n.accept(l,r.zIndex,c,d,a)}return n.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const n=t.options.overviewRuler;n==null||n.invalidateCachedColor();const o=t.options.minimap;o==null||o.invalidateCachedColor()}}getValueInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}getValueLengthInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(n,t)}modifyPosition(e,t){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(n,t)}deduceModelPositionRelativeToViewPosition(e,t,n){const o=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=n:t+=n);const s=this.model.getOffsetAt(o)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,n){const o=n?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(V.compareRangesUsingStarts);let r=!1,s=!1;for(const l of e)l.isEmpty()?r=!0:s=!0;if(!s){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])+o);return c}if(r&&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,n?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,n?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const n=this.model.getLanguageId();if(n===Gl||e.length!==1)return null;let o=e[0];if(o.isEmpty()){if(!t)return null;const d=o.startLineNumber;o=new V(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const r=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===al.fontFamily;let c;return l?c=al.fontFamily:(c=r.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${al.fontFamily}`),{mode:n,html:`
`+this._getHTMLToCopy(o,s)+"
"}}_getHTMLToCopy(e,t){const n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=n;c<=r;c++){const d=this.model.tokenization.getLineTokens(c),u=d.getLineContent(),h=c===n?o-1:0,f=c===r?s-1:u.length;u===""?l+="
":l+=plt(u,d.inflate(),t,h,f,a,ls)}return l}_getColorMap(){const e=oo.getColorMap(),t=["#000000"];if(e)for(let n=1,o=e.length;nthis._cursor.setStates(o,e,t,n))}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,n=0){this._withViewEventsCollector(o=>this._cursor.setSelections(o,e,t,n))}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 ilt);return}this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit(o=>this._cursor.executeEdits(o,e,t,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(n=>this._cursor.type(n,e,t))}compositionType(e,t,n,o,r){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,n,o,r))}paste(e,t,n,o){this._executeCursorEdit(r=>this._cursor.paste(r,e,t,n,o))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(n=>this._cursor.executeCommand(n,e,t))}executeCommands(e,t){this._executeCursorEdit(n=>this._cursor.executeCommands(n,e,t))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector(o=>this._cursor.revealPrimary(o,e,n,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),n=new V(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new pM(e,!1,n,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),n=new V(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new pM(e,!1,n,null,0,!0,0)))}revealRange(e,t,n,o,r){this._withViewEventsCollector(s=>s.emitViewEvent(new pM(e,!1,n,null,o,t,r)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Qat),this._eventDispatcher.emitOutgoingEvent(new tlt))}_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 eX{static create(e){const t=e._setTrackedRange(null,new V(1,1,1,1),1);return new eX(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,n,o,r){this._model=e,this._viewLineNumber=t,this._isValid=n,this._modelTrackedRange=o,this._startLineDelta=r}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const n=e.coordinatesConverter.convertViewPositionToModelPosition(new ae(t,e.getLineMinColumn(t))),o=e.model._setTrackedRange(this._modelTrackedRange,new V(n.lineNumber,n.column,n.lineNumber,n.column),1),r=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=o,this._startLineDelta=s-r}invalidate(){this._isValid=!1}}class Tlt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,o,r){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===r&&c+1>=n){o>c&&(a[a.length-1]=o);return}a.push(r,n,o)}else{const a=new KD(e,t,[r,n,o]);this._asMap[e]=a,this.asArray.push(a)}}}class Nlt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const n=this.hiddenAreas.get(e);n&&Rse(n,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,n)=>Rlt(t,n),[]);return Rse(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Rlt(i,e){const t=[];let n=0,o=0;for(;n0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let o=this.breakOffsets[e]-t;return e>0&&(o+=this.wrappedTextIndentLength),o}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let o=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let r=0;rthis.injectionOffsets[r];r++)o0?this.breakOffsets[r-1]:0,t===0)if(e<=s)o=r-1;else if(e>l)n=r+1;else break;else if(e=l)n=r+1;else break}let a=e-s;return r>0&&(a+=this.wrappedTextIndentLength),new D2(r,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const o=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.normalizeOffsetInInputWithInjectionsAroundInjections(o,n);if(r!==o)return this.offsetInInputWithInjectionsToOutputPosition(r,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new D2(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const o=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&Ase(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let o=n.offsetInInputWithInjections;if(Pse(this.injectionOptions[n.injectedTextIndex].cursorStops))return o;let r=n.injectedTextIndex-1;for(;r>=0&&this.injectionOffsets[r]===this.injectionOffsets[n.injectedTextIndex]&&!(Ase(this.injectionOptions[r].cursorStops)||(o-=this.injectionOptions[r].content.length,Pse(this.injectionOptions[r].cursorStops)));)r--;return o}}else if(t===1||t===4){let o=n.offsetInInputWithInjections+n.length,r=n.injectedTextIndex;for(;r+1=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)o-=this.injectionOptions[r-1].content.length,r--;return o}Q4()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.getInjectedTextAtOffset(n);return o?{options:this.injectionOptions[o.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let o=0;for(let r=0;re)break;if(e<=l)return{injectedTextIndex:r,offsetInInputWithInjections:a,length:s};o+=s}}}}function Ase(i){return i==null?!0:i===Nu.Right||i===Nu.Both}function Pse(i){return i==null?!0:i===Nu.Left||i===Nu.Both}class D2{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new ae(e+this.outputLineIndex,this.outputOffset+1)}}class tX{static create(e){return new tX(e.get(132),e.get(131))}constructor(e,t){this.classifier=new Alt(e,t)}createLineBreaksComputer(e,t,n,o,r){const s=[],a=[],l=[];return{addRequest:(c,d,u)=>{s.push(c),a.push(d),l.push(u)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let u=0,h=s.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 PH=[],OH=[];function Plt(i,e,t,n,o,r,s,a){if(o===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,u=e.breakOffsetsVisibleColumn,h=u1e(t,n,o,r,s),f=o-h,g=PH,p=OH;let v=0,m=0,_=0,y=o;const w=d.length;let L=0;if(L>=0){let D=Math.abs(u[L]-y);for(;L+1=D)break;D=E,L++}}for(;LD&&(D=m,E=_);let I=0,k=0,R=0,A=0;if(E<=y){let N=E,M=D===0?0:t.charCodeAt(D-1),H=D===0?0:i.get(M),B=!0;for(let F=D;Fm&&FH(M,H,z,K,c)&&(I=$,k=N),N+=j,N>y){$>m?(R=$,A=N-j):(R=F+1,A=N),N-k>f&&(I=0),B=!1;break}M=z,H=K}if(B){v>0&&(g[v]=d[d.length-1],p[v]=u[d.length-1],v++);break}}if(I===0){let N=E,M=t.charCodeAt(D),H=i.get(M),B=!1;for(let F=D-1;F>=m;F--){const $=F+1,z=t.charCodeAt(F);if(z===9){B=!0;break}let K,j;if(J0(z)?(F--,K=0,j=2):(K=i.get(z),j=wv(z)?r:1),N<=y){if(R===0&&(R=$,A=N),N<=y-f)break;if(FH(z,K,M,H,c)){I=$,k=N;break}}N-=j,M=z,H=K}if(I!==0){const F=f-(A-k);if(F<=n){const $=t.charCodeAt(R);let z;gr($)?z=2:z=EE($,A,n,r),F-z<0&&(I=0)}}if(B){L--;continue}}if(I===0&&(I=R,k=A),I<=m){const N=t.charCodeAt(m);gr(N)?(I=m+2,k=_+2):(I=m+1,k=_+EE(N,_,n,r))}for(m=I,g[v]=I,_=k,p[v]=k,v++,y=k+f;L<0||L=P)break;P=N,L++}}return v===0?null:(g.length=v,p.length=v,PH=e.breakOffsets,OH=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function Olt(i,e,t,n,o,r,s,a){const l=Gu.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(k=>k.options),d=t.map(k=>k.column-1)):(c=null,d=null),o===-1)return c?new LE(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new LE(d,c,[l.length],[],0):null;const h=a==="keepAll",f=u1e(l,n,o,r,s),g=o-f,p=[],v=[];let m=0,_=0,y=0,w=o,L=l.charCodeAt(0),D=i.get(L),E=EE(L,0,n,r),I=1;gr(L)&&(E+=1,L=l.charCodeAt(1),D=i.get(L),I++);for(let k=I;kw&&((_===0||E-y>g)&&(_=R,y=E-N),p[m]=_,v[m]=y,m++,w=y+g,_=0),L=A,D=P}return m===0&&(!t||t.length===0)?null:(p[m]=u,v[m]=E,new LE(d,c,p,v,f))}function EE(i,e,t,n){return i===9?t-e%t:wv(i)||i<32?n:1}function Ose(i,e){return e-i%e}function FH(i,e,t,n,o){return t!==32&&(e===2&&n!==2||e!==1&&n===1||!o&&e===3&&n!==2||!o&&n===3&&e!==1)}function u1e(i,e,t,n,o){let r=0;if(o!==0){const s=Ws(i);if(s!==-1){for(let l=0;lt&&(r=0)}}return r}const S9=vp("domLineBreaksComputer",{createHTML:i=>i});class nX{static create(){return new nX}constructor(){}createLineBreaksComputer(e,t,n,o,r){const s=[],a=[];return{addRequest:(l,c,d)=>{s.push(l),a.push(c)},finalize:()=>Flt(s,e,t,n,o,r,a)}}}function Flt(i,e,t,n,o,r,s){var a;function l(k){const R=s[k];if(R){const A=Gu.applyInjectedText(i[k],R),P=R.map(M=>M.options),N=R.map(M=>M.column-1);return new LE(N,P,[A.length],[],0)}else return null}if(n===-1){const k=[];for(let R=0,A=i.length;Rc?(A=0,P=0):N=c-B}const M=R.substr(A),H=Blt(M,P,t,N,g,h);p[k]=A,v[k]=P,m[k]=M,_[k]=H[0],y[k]=H[1]}const w=g.build(),L=(a=S9==null?void 0:S9.createHTML(w))!==null&&a!==void 0?a:w;f.innerHTML=L,f.style.position="absolute",f.style.top="10000",r==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const D=document.createRange(),E=Array.prototype.slice.call(f.children,0),I=[];for(let k=0;kz.options),F=$.map(z=>z.column-1)):(B=null,F=null),I[k]=new LE(F,B,A,H,N)}return document.body.removeChild(f),I}function Blt(i,e,t,n,o,r){if(r!==0){const h=String(r);o.appendString('
');const s=i.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[i.length]=l,d[i.length]=a,o.appendString("
"),[c,d]}function Wlt(i,e,t,n){if(t.length<=1)return null;const o=Array.prototype.slice.call(e.children,0),r=[];try{BH(i,o,n,0,null,t.length-1,null,r)}catch(s){return console.log(s),null}return r.length===0?null:(r.push(t.length),r)}function BH(i,e,t,n,o,r,s,a){if(n===r||(o=o||x9(i,e,t[n],t[n+1]),s=s||x9(i,e,t[r],t[r+1]),Math.abs(o[0].top-s[0].top)<=.1))return;if(n+1===r){a.push(r);return}const l=n+(r-n)/2|0,c=x9(i,e,t[l],t[l+1]);BH(i,e,t,n,o,l,c,a),BH(i,e,t,l,c,r,s,a)}function x9(i,e,t,n){return i.setStart(e[t/16384|0].firstChild,t%16384),i.setEnd(e[n/16384|0].firstChild,n%16384),i.getClientRects()}class Vlt extends _e{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new $q),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,n){this._editor=e,this._instantiationService=n;for(const o of t){if(this._pending.has(o.id)){en(new Error(`Cannot have two contributions with the same id ${o.id}`));continue}this._pending.set(o.id,o)}this._instantiateSome(0),this._register(Ag(()=>{this._instantiateSome(1)})),this._register(Ag(()=>{this._instantiateSome(2)})),this._register(Ag(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(Ag(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);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 n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){en(n)}}}}var Hlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Qf=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$lt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},O_;let zlt=0;class Ult{constructor(e,t,n,o,r,s){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=o,this.listenersToRemove=r,this.attachedView=s}dispose(){si(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let Nw=O_=class extends _e{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,n,o,r,s,a,l,c,d,u,h){var f;super(),this.languageConfigurationService=u,this._deliveryQueue=MYe(),this._contributions=this._register(new Vlt),this._onDidDispose=this._register(new le),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new Fse({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new Fse({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),r.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++zlt,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,g,d)),this._register(this._configuration.onDidChange(m=>{this._onDidChangeConfiguration.fire(m);const _=this._configuration.options;if(m.hasChanged(143)){const y=_.get(143);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=r,this._commandService=s,this._themeService=l,this._register(new jlt(this,this._contextKeyService)),this._register(new Klt(this,this._contextKeyService,h)),this._instantiationService=o.createChild(new E5([Ut,this._contextKeyService])),this._modelData=null,this._focusTracker=new qlt(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(n.contributions)?p=n.contributions:p=by.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const m of by.getEditorActions()){if(this._actions.has(m.id)){en(new Error(`Cannot have two actions with the same id ${m.id}`));continue}const _=new Hbe(m.id,m.label,m.alias,(f=m.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(y=>Promise.resolve(m.runEditorCommand(y,this,null))),this._contextKeyService);this._actions.set(_.id,_)}const v=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new QQe(this._domElement,{onDragEnter:()=>{},onDragOver:m=>{if(!v())return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this.showDropIndicatorAt(_.position)},onDrop:m=>$lt(this,void 0,void 0,function*(){if(!v()||(this.removeDropIndicator(),!m.dataTransfer))return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this._onDropIntoEditor.fire({position:_.position,event:m})}),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,n){return new fH(e,t,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return KI.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?Qn.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let n=0;return e&&e.lineEnding&&e.lineEnding===` +`)){u=!1;break}}if(u){const h=new V(c,1,c,d);t.push(new J6(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,n,o)}_applyUndo(e,t,n,o){const r=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new V(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(r,t,!0,!1,n,o)}_applyRedo(e,t,n,o){const r=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new V(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(r,t,!1,!0,n,o)}_applyUndoRedoEdits(e,t,n,o,r,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=o,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(r)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const n=this._buffer.getLineCount(),o=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),s=o.changes;if(this._trimAutoWhitespaceLines=o.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,d=s.length;c=0;k--){const R=f+k,A=y+k;I.takeFromEndWhile(N=>N.lineNumber>A);const P=I.takeFromEndWhile(N=>N.lineNumber===A);a.push(new Cse(R,this.getLineContent(A),P))}if(mF.lineNumberF.lineNumber===B)}a.push(new kat(R+1,f+v,M,N))}l+=_}this._emitContentChangedEvent(new Ry(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return o.reverseEdits===null?void 0:o.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 n=Array.from(e).map(o=>new Cse(o,this.getLineContent(o),this._getInjectedTextInLine(o)));this._onDidChangeInjectedText.fire(new s1e(n))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const n={addDecoration:(r,s)=>this._deltaDecorationsImpl(e,[],[{range:r,options:s}])[0],changeDecoration:(r,s)=>{this._changeDecorationImpl(r,s)},changeDecorationOptions:(r,s)=>{this._changeDecorationOptionsImpl(r,xse(s))},removeDecoration:r=>{this._deltaDecorationsImpl(e,[r],[])},deltaDecorations:(r,s)=>r.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,r,s)};let o=null;try{o=t(n)}catch(r){en(r)}return n.addDecoration=Ux,n.changeDecoration=Ux,n.changeDecorationOptions=Ux,n.removeDecoration=Ux,n.deltaDecorations=Ux,o}deltaDecorations(e,t,n=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."),en(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){const o=e?this._decorations[e]:null;if(!o)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:Sse[n]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(o),delete this._decorations[o.id],null;const r=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),a=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);return this._decorationsTree.delete(o),o.reset(this.getVersionId(),s,a,r),o.setOptions(Sse[n]),this._decorationsTree.insert(o),o.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let n=0,o=t.length;nthis.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,o=!1,r=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),d=new V(a,1,l,c),u=this._getDecorationsInRange(d,n,o,r);return GW(u,this._decorationProvider.getDecorationsInRange(d,n,o)),u}getDecorationsInRange(e,t=0,n=!1,o=!1,r=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,n,r);return GW(a,this._decorationProvider.getDecorationsInRange(s,t,n,o)),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),n=t+this._buffer.getLineLength(e),o=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return Gu.fromDecorations(o).filter(r=>r.lineNumber===e)}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,n,o){const r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,s,t,n,o)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const n=this._decorations[e];if(!n)return;if(n.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(n.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),s=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,s,o),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber)}_changeDecorationOptionsImpl(e,t){const n=this._decorations[e];if(!n)return;const o=!!(n.options.overviewRuler&&n.options.overviewRuler.color),r=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){const s=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber)}if(n.options.before||t.before){const s=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}o!==r?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n,o=!1){const r=this.getVersionId(),s=t.length;let a=0;const l=n.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 Oat(this.getLineContent(e))+1}};bf._MODEL_SYNC_LIMIT=50*1024*1024;bf.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;bf.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;bf.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;bf.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:vs.tabSize,indentSize:vs.indentSize,insertSpaces:vs.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:vs.trimAutoWhitespace,largeFileOptimizations:vs.largeFileOptimizations,bracketPairColorizationOptions:vs.bracketPairColorizationOptions};bf=P_=Tat([b9(4,E5),b9(5,Ki),b9(6,Ti)],bf);function Oat(i){let e=0;for(const t of i)if(t===" "||t===" ")e++;else break;return e}function C9(i){return!!(i.options.overviewRuler&&i.options.overviewRuler.color)}function y9(i){return!!i.options.after||!!i.options.before}class wse{constructor(){this._decorationsTree0=new m9,this._decorationsTree1=new m9,this._injectedTextDecorationsTree=new m9}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const n of t)n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,o,r,s){const a=e.getVersionId(),l=this._intervalSearch(t,n,o,r,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,n,o,r,s){const a=this._decorationsTree0.intervalSearch(e,t,n,o,r,s),l=this._decorationsTree1.intervalSearch(e,t,n,o,r,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,n,o,r,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,n,o){const r=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,n,o,!1,r,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const n=e.getVersionId(),o=this._injectedTextDecorationsTree.search(t,!1,n,!1);return this._ensureNodesHaveRanges(e,o).filter(r=>r.options.showIfCollapsed||!r.range.isEmpty())}getAll(e,t,n,o,r){const s=e.getVersionId(),a=this._search(t,n,o,s,r);return this._ensureNodesHaveRanges(e,a)}_search(e,t,n,o,r){if(n)return this._decorationsTree1.search(e,t,o,r);{const s=this._decorationsTree0.search(e,t,o,r),a=this._decorationsTree1.search(e,t,o,r),l=this._injectedTextDecorationsTree.search(e,t,o,r);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),o=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(o)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){y9(e)?this._injectedTextDecorationsTree.insert(e):C9(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){y9(e)?this._injectedTextDecorationsTree.delete(e):C9(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){y9(e)?this._injectedTextDecorationsTree.resolveNode(e,t):C9(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,o){this._decorationsTree0.acceptReplace(e,t,n,o),this._decorationsTree1.acceptReplace(e,t,n,o),this._injectedTextDecorationsTree.acceptReplace(e,t,n,o)}}function Zf(i){return i.replace(/[^a-z0-9\-_]/gi," ")}class l1e{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Fat extends l1e{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Yl.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 n=e?t.getColor(e.id):null;return n?n.toString():""}}class Bat{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:wy.Left}}class Wat extends l1e{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"?ve.fromHex(e):t.getColor(e.id)}}class Mv{static from(e){return e instanceof Mv?e:new Mv(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 Jt{static register(e){return new Jt(e)}static createDynamic(e){return new Jt(e)}constructor(e){var t,n,o,r,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Zf(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(n=e.blockIsAfterEnd)!==null&&n!==void 0?n:null,this.blockPadding=(o=e.blockPadding)!==null&&o!==void 0?o:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Zf(e.className):null,this.shouldFillLineOnLineBreak=(r=e.shouldFillLineOnLineBreak)!==null&&r!==void 0?r: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 Fat(e.overviewRuler):null,this.minimap=e.minimap?new Wat(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Bat(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Zf(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Zf(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Zf(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Zf(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Zf(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Zf(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Zf(e.afterContentClassName):null,this.after=e.after?Mv.from(e.after):null,this.before=e.before?Mv.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}Jt.EMPTY=Jt.register({description:"empty"});const Sse=[Jt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Jt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Jt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Jt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function xse(i){return i instanceof Jt?i:Jt.createDynamic(i)}class Vat extends _e{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new le),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 Hat extends _e{constructor(){super(),this._fastEmitter=this._register(new le),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new le),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 $at{constructor(){this._onDidChangeVisibleRanges=new le,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new zat(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 zat{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const n=e.map(o=>new ln(o.startLineNumber,o.endLineNumber+1));this.handleStateChange({visibleLineRanges:n,stabilized:t})}}class yP{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Br(new V(1,1,1,1),0,0,new ae(1,1),0),new Br(new V(1,1,1,1),0,0,new ae(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 kn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?gt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):gt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,o){return t.equals(n)?o:e.normalizePosition(t,2)}static _validateViewState(e,t){const n=t.position,o=t.selectionStart.getStartPosition(),r=t.selectionStart.getEndPosition(),s=e.normalizePosition(n,2),a=this._validatePositionWithCache(e,o,n,s),l=this._validatePositionWithCache(e,r,o,a);return n.equals(s)&&o.equals(a)&&r.equals(l)?t:new Br(V.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+o.column-a.column,s,t.leftoverVisibleColumns+n.column-s.column)}_setState(e,t,n){if(n&&(n=yP._validateViewState(e.viewModel,n)),t){const o=e.model.validateRange(t.selectionStart),r=t.selectionStart.equalsRange(o)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new Br(o,t.selectionStartKind,r,s,a)}else{if(!n)return;const o=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),r=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));t=new Br(o,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,r,n.leftoverVisibleColumns)}if(n){const o=e.coordinatesConverter.validateViewRange(n.selectionStart,t.selectionStart),r=e.coordinatesConverter.validateViewPosition(n.position,t.position);n=new Br(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}else{const o=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),r=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new V(o.lineNumber,o.column,r.lineNumber,r.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);n=new Br(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=n,this._updateTrackedRange(e)}}class Lse{constructor(e){this.context=e,this.cursors=[new yP(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 Ret(this.cursors,Rc(e=>e.viewState.position,ae.compare)).viewState.position}getBottomMostViewPosition(){return Net(this.cursors,Rc(e=>e.viewState.position,ae.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(kn.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,n=e.length;if(tn){const o=t-n;for(let r=0;r=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 n=0,o=e.length;nn.selection,V.compareRangesUsingStarts));for(let n=0;nu&&p.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),n--}}}}class Ese{constructor(e,t,n,o){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=o}}class Uat{constructor(){this.type=0}}class jat{constructor(){this.type=1}}class Kat{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class qat{constructor(e,t,n){this.selections=e,this.modelSelections=t,this.reason=n,this.type=3}}class G1{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 L2{constructor(){this.type=5}}class Gat{constructor(e){this.type=6,this.isFocused=e}}class Xat{constructor(){this.type=7}}class E2{constructor(){this.type=8}}class c1e{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class AH{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class PH{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class pM{constructor(e,t,n,o,r,s,a){this.source=e,this.minimalReveal=t,this.range=n,this.selections=o,this.verticalType=r,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class Yat{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 Zat{constructor(e){this.theme=e,this.type=14}}class Qat{constructor(e){this.type=15,this.ranges=e}}class Jat{constructor(){this.type=16}}class elt{constructor(){this.type=17}}class tlt extends _e{constructor(){super(),this._onEvent=this._register(new le),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,n=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,n=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 n of t)n.handleEvents(e)}}}class nlt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class XG{constructor(e,t,n,o){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,this.contentHeight=o,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 XG(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class YG{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 YG(this.oldHasFocus,e.hasFocus)}}class ZG{constructor(e,t,n,o,r,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=o,this.scrollWidth=r,this.scrollLeft=s,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 ZG(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class ilt{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class olt{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class wP{constructor(e,t,n,o,r,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=o,this.source=r,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=e.length,o=t.length;if(n!==o)return!1;for(let r=0;r0){const e=this._cursors.getSelections();for(let t=0;ts&&(o=o.slice(0,s),r=!0);const a=SE.from(this._model,this);return this._cursors.setStates(o),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,a,r)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,n,o,r,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=V.fromPositions(a[0],a[0]),e.emitViewEvent(new pM(t,n,l,c,o,r,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let n=0,o=t.length;n0){const r=kn.fromModelSelections(n.resultingSelection);this.setStates(e,"modelChange",n.isUndoing?5:n.isRedoing?6:2,r)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const r=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,kn.fromModelSelections(r))}}}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(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,o){this.setStates(e,t,o,kn.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const n=[],o=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,o),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,n,o,r){const s=SE.from(this._model,this);if(s.equals(o))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new qat(l,a,n)),!o||o.cursorState.length!==s.cursorState.length||s.cursorState.some((c,d)=>!c.modelState.equals(o.cursorState[d].modelState))){const c=o?o.cursorState.map(u=>u.modelState.selection):null,d=o?o.modelVersionId:0;e.emitOutgoingEvent(new wP(c,a,d,s.modelVersionId,t||"keyboard",n,r))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let n=0,o=e.length;n=0)return null;const s=r.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=r.text.length-s[2].length-1,u=r.text.lastIndexOf(c,d-1);if(u===-1)return null;t.push([u,d])}return t}executeEdits(e,t,n,o){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(n)),r&&(n[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),n,c=>{if(r)for(let u=0,h=r.length;u0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,n,o=0){if(this.context.cursorConfig.readOnly)return;const r=SE.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){en(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,o,r,!1)&&this.revealPrimary(t,n,!1,0,!0,0)}getAutoClosedCharacters(){return Dse.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new xE(this._model,this.getSelections())}endComposition(e,t){const n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(eo.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,n){this._executeEdit(()=>{if(n==="keyboard"){const o=t.length;let r=0;for(;r{const c=l.getPosition();return new gt(c.lineNumber,c.column+r,c.lineNumber,c.column+r)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(eo.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,o,r))},e,s)}paste(e,t,n,o,r){this._executeEdit(()=>{this._executeEditOperation(eo.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,o||[]))},e,r,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(ob.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,n){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Sa(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}executeCommands(e,t,n){this._executeEdit(()=>{this._executeEditOperation(new Sa(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}}class SE{static from(e,t){return new SE(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,n=this.cursorState.length;t=t.length||!t[n].strictContainsRange(e[n]))return!1;return!0}}class flt{static executeCommands(e,t,n){const o={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(o,n);for(let s=0,a=o.trackedRanges.length;s0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,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),v=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new gt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new gt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in r)r.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,n=e.length;t{V.isEmpty(u)&&h===""||o.push({identifier:{major:t,minor:r++},range:u,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:s,addTrackedEditOperation:(u,h,f)=>{a=!0,s(u,h,f)},trackSelection:(u,h)=>{const f=gt.liftSelection(u);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const m=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===m?g=2:g=3}else g=1;const p=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=v,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{n.getEditOperations(e.model,d)}catch(u){return en(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:o,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((n,o)=>-V.compareRangesUsingEnds(n.range,o.range));const t={};for(let n=1;nr.identifier.major?s=o.identifier.major:s=r.identifier.major,t[s.toString()]=!0;for(let a=0;a0&&n--}}return t}}class glt{constructor(e,t,n){this.text=e,this.startSelection=t,this.endSelection=n}}class xE{static _capture(e,t){const n=[];for(const o of t){if(o.startLineNumber!==o.endLineNumber)return null;n.push(new glt(e.getLineContent(o.startLineNumber),o.startColumn-1,o.endColumn-1))}return n}constructor(e,t){this._original=xE._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const n=xE._capture(e,t);if(!n||this._original.length!==n.length)return null;const o=[];for(let r=0,s=this._original.length;rww,tokenizeEncoded:(i,e,t)=>f5(0,t)};function mlt(i,e,t){return plt(this,void 0,void 0,function*(){if(!t)return Ise(e,i.languageIdCodec,kse);const n=yield oo.getOrCreate(t);return Ise(e,i.languageIdCodec,n||kse)})}function vlt(i,e,t,n,o,r,s){let a="
",l=n,c=0,d=!0;for(let u=0,h=e.getCount();u0;)s&&d?(g+=" ",d=!1):(g+=" ",d=!0),v--;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+="\uFFFD",d=!1;break;case 13:g+="​",d=!1;break;case 32:s&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(p),d=!1}}if(a+=`${g}`,f>o||l>=o)break}return a+="
",a}function Ise(i,e,t){let n='
';const o=gf(i);let r=t.getInitialState();for(let s=0,a=o.length;s0&&(n+="
");const c=t.tokenizeEncoded(l,!0,r);pr.convertToEndOffset(c.tokens,l.length);const u=new pr(c.tokens,l,e).inflate();let h=0;for(let f=0,g=u.getCount();f${UA(l.substring(h,v))}`,h=v}r=c.endState}return n+="
",n}class _lt{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,n=this._changes,o=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,o)}}class blt{constructor(e,t,n,o,r){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=o,this.minWidth=r,this.prefixSum=0}}class uk{constructor(e,t,n,o){this._instanceId=G_e(++uk.INSTANCE_COUNT),this._pendingChanges=new _lt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=n,this._paddingBottom=o}static findInsertionIndex(e,t,n){let o=0,r=e.length;for(;o>>1;t===e[s].afterLineNumber?n{t=!0,o=o|0,r=r|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new blt(l,o,r,s,a)),l},changeOneWhitespace:(o,r,s)=>{t=!0,r=r|0,s=s|0,this._pendingChanges.change({id:o,newAfterLineNumber:r,newHeight:s})},removeWhitespace:o=>{t=!0,this._pendingChanges.remove({id:o})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.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 n){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const o=new Set;for(const l of n)o.add(l.id);const r=new Map;for(const l of t)r.set(l.id,l);const s=l=>{const c=[];for(const d of l)if(!o.has(d.id)){if(r.has(d.id)){const u=r.get(d.id);d.afterLineNumber=u.newAfterLineNumber,d.height=u.newHeight}c.push(d)}return c},a=s(this._arr).concat(s(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=uk.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 n=0,o=t.length;nt&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let n=0,o=this._arr.length;n=t.length||t[a+1].afterLineNumber>=e)return a;n=a+1|0}else o=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const n=this._findLastWhitespaceBeforeLineNumber(e)+1;return n1?n=this._lineHeight*(e-1):n=0;const o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return n+o+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const n=this._lineHeight*e,o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return n+o+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,n=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,n=this._lineHeight;let o=1,r=t;for(;o=a+n)o=s+1;else{if(e>=a)return s;r=s}}return o>t?t:o}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this._lineHeight,o=this.getLineNumberAtOrAfterVerticalOffset(e)|0,r=this.getVerticalOffsetForLineNumber(o)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(o)|0;const l=this.getWhitespacesCount()|0;let c,d;a===-1?(a=l,d=s+1,c=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let u=r,h=u;const f=5e5;let g=0;r>=f&&(g=Math.floor(r/f)*f,g=Math.floor(g/n)*n,h-=g);const p=[],v=e+(t-e)/2;let m=-1;for(let L=o;L<=s;L++){if(m===-1){const D=u,E=u+n;(D<=v&&vv)&&(m=L)}for(u+=n,p[L-o]=h,h+=n;d===L;)h+=c,u+=c,a++,a>=l?d=s+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){s=L;break}}m===-1&&(m=s);const _=this.getVerticalOffsetForLineNumber(s)|0;let y=o,w=s;return yt&&w--,{bigNumbersDelta:g,startLineNumber:o,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:m,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:w}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let n;t>=1?n=this._lineHeight*t:n=0;let o;return e>0?o=this.getWhitespacesAccumulatedHeight(e-1):o=0,n+o+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;const o=this.getVerticalOffsetForWhitespaceIndex(n),r=this.getHeightForWhitespaceIndex(n);if(e>=o+r)return-1;for(;t=a+l)t=s+1;else{if(e>=a)return s;n=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;const o=this.getHeightForWhitespaceIndex(t),r=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:r,afterLineNumber:s,verticalOffset:n,height:o}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),o=this.getWhitespacesCount()-1;if(n<0)return[];const r=[];for(let s=n;s<=o;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;r.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}return r}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}}uk.INSTANCE_COUNT=0;const Clt=125;class TL{constructor(e,t,n,o){e=e|0,t=t|0,n=n|0,o=o|0,e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),o<0&&(o=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=o,this.scrollHeight=Math.max(n,o)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class ylt extends _e{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new le),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new TL(0,0,0,0),this._scrollable=this._register(new ZI({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 n=t.contentWidth!==e.contentWidth,o=t.contentHeight!==e.contentHeight;(n||o)&&this._onDidContentSizeChange.fire(new XG(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 wlt extends _e{constructor(e,t,n){super(),this._configuration=e;const o=this._configuration.options,r=o.get(143),s=o.get(83);this._linesLayout=new uk(t,o.get(66),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new ylt(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new TL(r.contentWidth,0,r.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)?Clt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const n=t.get(83);this._linesLayout.setPadding(n.top,n.bottom)}if(e.hasChanged(143)){const n=t.get(143),o=n.contentWidth,r=n.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new TL(o,s.contentWidth,r,this._getContentHeight(o,r,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 o=this._configuration.options.get(102);return o.horizontal===2||e>=t?0:o.horizontalScrollbarSize}_getContentHeight(e,t,n){const o=this._configuration.options;let r=this._linesLayout.getLinesTotalHeight();return o.get(104)?r+=Math.max(0,t-o.get(66)-o.get(83).bottom):r+=this._getHorizontalScrollbarHeight(e,n),r}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,o=e.contentWidth;this._scrollable.setScrollDimensions(new TL(t,e.contentWidth,n,this._getContentHeight(t,n,o)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new wre(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new wre(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,n=e.get(144),o=e.get(50),r=e.get(143);if(n.isViewportWrapping){const s=e.get(72);return t>r.contentWidth+o.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+r.verticalScrollbarWidth:t}else{const s=e.get(103)*o.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+r.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 TL(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),o=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);return{scrollTop:t,scrollTopWithoutViewZones:t-o,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 n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}}class Slt{constructor(e,t,n,o,r){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=o,this._coordinatesConverter=r,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 n=this._decorationsCache[t];if(!n){const o=e.range,r=e.options;let s;if(r.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(o.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(o.endLineNumber,this.model.getLineMaxColumn(o.endLineNumber)),1);s=new V(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(o,1);n=new J0e(s,r),this._decorationsCache[t]=n}return n}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,n=!1){const o=new V(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(o,t,n).inlineDecorations[0]}_getDecorationsInRange(e,t,n){const o=this._linesCollection.getDecorationsInRange(e,this.editorId,FA(this.configuration.options),t,n),r=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let d=r;d<=s;d++)c[d-r]=[];for(let d=0,u=o.length;dt===1)}function eX(i,e){return d1e(i,e.range,t=>t===2)}function d1e(i,e,t){for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const o=i.tokenization.getLineTokens(n),r=n===e.startLineNumber,s=n===e.endLineNumber;let a=r?o.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(o.getStandardTokenType(a)))return!1;a++}}return!0}function w9(i,e){return i===null?e?SP.INSTANCE:xP.INSTANCE:new xlt(i,e)}class xlt{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,n){this._assertVisible();const o=n>0?this._projectionData.breakOffsets[n-1]:0,r=this._projectionData.breakOffsets[n];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new Gu(0,0,c+1,this._projectionData.injectionOptions[d],0));s=Gu.applyInjectedText(e.getLineContent(t),a).substring(o,r)}else s=e.getValueInRange({startLineNumber:t,startColumn:o+1,endLineNumber:t,endColumn:r+1});return n>0&&(s=Tse(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){const o=new Array;return this.getViewLinesData(e,t,n,1,0,[!0],o),o[0]}getViewLinesData(e,t,n,o,r,s,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,_=l.breakOffsets[p];for(;g_)break;if(m0?l.wrappedTextIndentLength:0,I=E+Math.max(w-m,0),k=E+Math.min(L-m,_-m);I!==k&&v.push(new Ntt(I,k,D.inlineClassName,D.inlineClassNameAffectsLetterSpacing))}}if(L<=_)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:pr.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=n;f0?o.wrappedTextIndentLength:0,s=n>0?o.breakOffsets[n-1]:0,a=o.breakOffsets[n],l=e.sliceAndInflate(s,a,r);let c=l.getLineContent();n>0&&(c=Tse(o.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(n)+1,u=c.length+1,h=n+1=S9.length)for(let e=1;e<=i;e++)S9[e]=Llt(e);return S9[i]}function Llt(i){return new Array(i+1).join(" ")}class Elt{constructor(e,t,n,o,r,s,a,l,c,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=o,this.fontInfo=r,this.tabSize=s,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 klt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const n=this.model.getLinesContent(),o=this.model.getInjectedTextDecorations(this._editorId),r=n.length,s=this.createLineBreaksComputer(),a=new lp(Gu.fromDecorations(o));for(let p=0;pm.lineNumber===p+1);s.addRequest(n[p],v,t?t[p]:null)}const l=s.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(V.compareRangesUsingStarts);let u=1,h=0,f=-1,g=f+1=u&&v<=h,_=w9(l[p],!m);c[p]=_.getViewLineCount(),this.modelLineProjections[p]=_}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new det(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),n=Dlt(t),o=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(V.compareRangesUsingStarts);if(n.length===o.length){let h=!1;for(let f=0;f({range:h,options:Jt.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,r);const s=n;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,n,o,r){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===n,c=this.wrappingIndent===o,d=this.wordBreak===r;if(s&&a&&l&&c&&d)return!1;const u=s&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=o,this.wordBreak=r;let h=null;if(u){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,u=o.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,u=d+l-1,g=u+1,p=g+(r-l)-1,c=!0):rt?t:e|0}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);const o=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),a=this.model.guides.getActiveIndentGuide(o.lineNumber,r.lineNumber,s.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),n=t.index,o=t.remainder;return new Nse(n+1,o)}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],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,o)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,o)}getViewLineInfosGroupedByModelRanges(e,t){const n=this.getViewLineInfo(e),o=this.getViewLineInfo(t),r=new Array;let s=this.getModelStartPositionOfViewLine(n),a=new Array;for(let l=n.modelLineNumber;l<=o.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===n.modelLineNumber?n.modelLineWrappedLineIdx:0,u=l===o.modelLineNumber?o.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),v=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===d.modelLineWrappedLineIdx?new v0(f.visibleColumn,g,f.className,new mE(f.horizontalLine.top,p.column),-1,-1):v.lineNumber!!f))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let r=[];const s=[],a=[],l=n.lineNumber-1,c=o.lineNumber-1;let d=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const v=p.getViewLineNumberOfModelPosition(0,g===l?n.column:1),m=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),_=m-v+1;let y=0;_>1&&p.getViewLineMinColumn(this.model,g+1,m)===1&&(y=v===0?1:2),s.push(_),a.push(y),d===null&&(d=new ae(g+1,0))}else d!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}d!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,o.lineNumber)),d=null);const u=t-e+1,h=new Array(u);let f=0;for(let g=0,p=r.length;gt&&(g=!0,f=t-r+1),u.getViewLinesData(this.model,c+1,h,f,r-e,n,l),r+=f,g)break}return l}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);const o=this.projectedModelLineLineCounts.getIndexOf(e-1),r=o.index,s=o.remainder,a=this.modelLineProjections[r],l=a.getViewLineMinColumn(this.model,r+1,s),c=a.getViewLineMaxColumn(this.model,r+1,s);tc&&(t=c);const d=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new ae(r+1,d)).equals(n)?new ae(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){const n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),o=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new V(n.lineNumber,n.column,o.lineNumber,o.column)}convertViewPositionToModelPosition(e,t){const n=this.getViewLineInfo(e),o=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new ae(n.modelLineNumber,o))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new V(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2,o=!1,r=!1){const s=this.model.validatePosition(new ae(e,t)),a=s.lineNumber,l=s.column;let c=a-1,d=!1;if(r)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new ae(o?0:1,1);const u=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return d?r?h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,1,n):h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(c+1),n):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(u,l,n),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return V.fromPositions(n)}else{const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),o=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new V(n.lineNumber,n.column,o.lineNumber,o.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){const r=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(n===0&&!this.modelLineProjections[n].isVisible())return 1;const o=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(o,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n,o,r){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new V(s.lineNumber,1,a.lineNumber,a.column),t,n,o,r);let l=[];const c=s.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 ae(p+1,p===c?s.column:1));else if(u!==null){const m=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new V(u.lineNumber,u.column,p,m),t,n,o)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new V(u.lineNumber,u.column,a.lineNumber,a.column),t,n,o)),u=null),l.sort((p,v)=>{const m=V.compareRangesUsingStarts(p.range,v.range);return m===0?p.idv.id?1:0:m});const h=[];let f=0,g=null;for(const p of l){const v=p.id;g!==v&&(g=v,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 n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function Dlt(i){if(i.length===0)return[];const e=i.slice();e.sort(V.compareRangesUsingStarts);const t=[];let n=e[0].startLineNumber,o=e[0].endLineNumber;for(let r=1,s=e.length;ro+1?(t.push(new V(n,1,o,1)),n=a.startLineNumber,o=a.endLineNumber):a.endLineNumber>o&&(o=a.endLineNumber)}return t.push(new V(n,1,o,1)),t}class Nse{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class Rse{constructor(e,t){this.modelRange=e,this.viewLines=t}}class klt{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,n,o){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,n,o)}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 Ilt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Tlt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,o){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,n,o)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new AH(t,n)}onModelLinesInserted(e,t,n,o){return new PH(t,n)}onModelLineChanged(e,t,n){return[!1,new c1e(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const n=t-e+1,o=new Array(n);for(let r=0;rt)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class Nlt extends _e{constructor(e,t,n,o,r,s,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new Mlt,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=n,this._eventDispatcher=new tlt,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new bi(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=tX.create(this.model),this.model.isTooLargeForTokenization())this._lines=new Ilt(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 Elt(this._editorId,this.model,o,r,u,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new hlt(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new wlt(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Yat(d)),this._eventDispatcher.emitOutgoingEvent(new ZG(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 Slt(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(nT.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Jat)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Zat(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 V(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 Gat(e)),this._eventDispatcher.emitOutgoingEvent(new YG(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Uat)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new jat)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new ae(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new Ase(t,this._viewportStart.startLineDelta)}return new Ase(null,0)}_onConfigurationChanged(e,t){const n=this._captureStableViewport(),o=this._configuration.options,r=o.get(50),s=o.get(137),a=o.get(144),l=o.get(136),c=o.get(128);this._lines.setWrappingSettings(r,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new L2),e.emitViewEvent(new E2),e.emitViewEvent(new G1(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 G1(null))),e.emitViewEvent(new Kat(t)),this.viewLayout.onConfigurationChanged(t),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout),U1.shouldRecreate(t)&&(this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const n=this._eventDispatcher.beginEmitViewEvents();let o=!1,r=!1;const s=e instanceof M0?e.rawContentChangedEvent.changes:e.changes,a=e instanceof M0?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const u of s)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 lp(c);for(const u of s)switch(u.changeType){case 1:{this._lines.onModelFlushed(),n.emitViewEvent(new L2),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),o=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,u.fromLineNumber,u.toLineNumber);h!==null&&(n.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),o=!0;break}case 4:{const h=d.takeCount(u.detail.length),f=this._lines.onModelLinesInserted(a,u.fromLineNumber,u.toLineNumber,h);f!==null&&(n.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),o=!0;break}case 2:{const h=d.dequeue(),[f,g,p,v]=this._lines.onModelLineChanged(a,u.lineNumber,h);r=f,g&&n.emitViewEvent(g),p&&(n.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),v&&(n.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!o&&r&&(n.emitViewEvent(new E2),n.emitViewEvent(new G1(null)),this._cursor.onLineMappingChanged(n),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 n=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(n){const o=this.coordinatesConverter.convertModelPositionToViewPosition(n.getStartPosition()),r=this.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber);this.viewLayout.setScrollPosition({scrollTop:r+this._viewportStart.startLineDelta},1)}}try{const n=this._eventDispatcher.beginEmitViewEvents();e instanceof M0&&n.emitOutgoingEvent(new clt(e.contentChangedEvent)),this._cursor.onModelContentChanged(n,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let n=0,o=e.ranges.length;n{this._eventDispatcher.emitSingleViewEvent(new Xat),this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new llt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new alt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new L2),t.emitViewEvent(new E2),t.emitViewEvent(new G1(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new U1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new dlt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new G1(e)),this._eventDispatcher.emitOutgoingEvent(new slt(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas)return;this.previousHiddenAreas=n;const o=this._captureStableViewport();let r=!1;try{const s=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(n),r&&(s.emitViewEvent(new L2),s.emitViewEvent(new E2),s.emitViewEvent(new G1(null)),this._cursor.onLineMappingChanged(s),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new olt)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),n=Math.max(20,Math.round(e.height/t)),o=this.viewLayout.getLinesViewportData(),r=Math.max(1,o.completelyVisibleStartLineNumber-n),s=Math.min(this.getLineCount(),o.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new V(r,this.getLineMinColumn(r),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(n.length===0)return[t];const o=[];let r=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,u=n.length;dl||(sa.toInlineDecoration(e))]),new Zl(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,n,o,s.tokens,t,r,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){const o=this._lines.getViewLinesData(e,t,n);return new Ttt(this.getTabSize(),o)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,FA(this._configuration.options)),n=new Rlt;for(const o of t){const r=o.options,s=r.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.startLineNumber,o.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.endLineNumber,o.range.endColumn);n.accept(l,r.zIndex,c,d,a)}return n.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const n=t.options.overviewRuler;n==null||n.invalidateCachedColor();const o=t.options.minimap;o==null||o.invalidateCachedColor()}}getValueInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}getValueLengthInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(n,t)}modifyPosition(e,t){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(n,t)}deduceModelPositionRelativeToViewPosition(e,t,n){const o=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=n:t+=n);const s=this.model.getOffsetAt(o)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,n){const o=n?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(V.compareRangesUsingStarts);let r=!1,s=!1;for(const l of e)l.isEmpty()?r=!0:s=!0;if(!s){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])+o);return c}if(r&&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,n?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,n?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const n=this.model.getLanguageId();if(n===Gl||e.length!==1)return null;let o=e[0];if(o.isEmpty()){if(!t)return null;const d=o.startLineNumber;o=new V(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const r=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===al.fontFamily;let c;return l?c=al.fontFamily:(c=r.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${al.fontFamily}`),{mode:n,html:`
`+this._getHTMLToCopy(o,s)+"
"}}_getHTMLToCopy(e,t){const n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=n;c<=r;c++){const d=this.model.tokenization.getLineTokens(c),u=d.getLineContent(),h=c===n?o-1:0,f=c===r?s-1:u.length;u===""?l+="
":l+=vlt(u,d.inflate(),t,h,f,a,ls)}return l}_getColorMap(){const e=oo.getColorMap(),t=["#000000"];if(e)for(let n=1,o=e.length;nthis._cursor.setStates(o,e,t,n))}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,n=0){this._withViewEventsCollector(o=>this._cursor.setSelections(o,e,t,n))}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 rlt);return}this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit(o=>this._cursor.executeEdits(o,e,t,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(n=>this._cursor.type(n,e,t))}compositionType(e,t,n,o,r){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,n,o,r))}paste(e,t,n,o){this._executeCursorEdit(r=>this._cursor.paste(r,e,t,n,o))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(n=>this._cursor.executeCommand(n,e,t))}executeCommands(e,t){this._executeCursorEdit(n=>this._cursor.executeCommands(n,e,t))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector(o=>this._cursor.revealPrimary(o,e,n,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),n=new V(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new pM(e,!1,n,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),n=new V(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new pM(e,!1,n,null,0,!0,0)))}revealRange(e,t,n,o,r){this._withViewEventsCollector(s=>s.emitViewEvent(new pM(e,!1,n,null,o,t,r)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new elt),this._eventDispatcher.emitOutgoingEvent(new ilt))}_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 tX{static create(e){const t=e._setTrackedRange(null,new V(1,1,1,1),1);return new tX(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,n,o,r){this._model=e,this._viewLineNumber=t,this._isValid=n,this._modelTrackedRange=o,this._startLineDelta=r}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const n=e.coordinatesConverter.convertViewPositionToModelPosition(new ae(t,e.getLineMinColumn(t))),o=e.model._setTrackedRange(this._modelTrackedRange,new V(n.lineNumber,n.column,n.lineNumber,n.column),1),r=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=o,this._startLineDelta=s-r}invalidate(){this._isValid=!1}}class Rlt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,o,r){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===r&&c+1>=n){o>c&&(a[a.length-1]=o);return}a.push(r,n,o)}else{const a=new KD(e,t,[r,n,o]);this._asMap[e]=a,this.asArray.push(a)}}}class Mlt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const n=this.hiddenAreas.get(e);n&&Mse(n,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,n)=>Alt(t,n),[]);return Mse(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Alt(i,e){const t=[];let n=0,o=0;for(;n0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let o=this.breakOffsets[e]-t;return e>0&&(o+=this.wrappedTextIndentLength),o}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let o=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let r=0;rthis.injectionOffsets[r];r++)o0?this.breakOffsets[r-1]:0,t===0)if(e<=s)o=r-1;else if(e>l)n=r+1;else break;else if(e=l)n=r+1;else break}let a=e-s;return r>0&&(a+=this.wrappedTextIndentLength),new D2(r,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const o=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.normalizeOffsetInInputWithInjectionsAroundInjections(o,n);if(r!==o)return this.offsetInInputWithInjectionsToOutputPosition(r,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new D2(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const o=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&Pse(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let o=n.offsetInInputWithInjections;if(Ose(this.injectionOptions[n.injectedTextIndex].cursorStops))return o;let r=n.injectedTextIndex-1;for(;r>=0&&this.injectionOffsets[r]===this.injectionOffsets[n.injectedTextIndex]&&!(Pse(this.injectionOptions[r].cursorStops)||(o-=this.injectionOptions[r].content.length,Ose(this.injectionOptions[r].cursorStops)));)r--;return o}}else if(t===1||t===4){let o=n.offsetInInputWithInjections+n.length,r=n.injectedTextIndex;for(;r+1=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)o-=this.injectionOptions[r-1].content.length,r--;return o}J4()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.getInjectedTextAtOffset(n);return o?{options:this.injectionOptions[o.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let o=0;for(let r=0;re)break;if(e<=l)return{injectedTextIndex:r,offsetInInputWithInjections:a,length:s};o+=s}}}}function Pse(i){return i==null?!0:i===Nu.Right||i===Nu.Both}function Ose(i){return i==null?!0:i===Nu.Left||i===Nu.Both}class D2{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new ae(e+this.outputLineIndex,this.outputOffset+1)}}class nX{static create(e){return new nX(e.get(132),e.get(131))}constructor(e,t){this.classifier=new Olt(e,t)}createLineBreaksComputer(e,t,n,o,r){const s=[],a=[],l=[];return{addRequest:(c,d,u)=>{s.push(c),a.push(d),l.push(u)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let u=0,h=s.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 OH=[],FH=[];function Flt(i,e,t,n,o,r,s,a){if(o===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,u=e.breakOffsetsVisibleColumn,h=u1e(t,n,o,r,s),f=o-h,g=OH,p=FH;let v=0,m=0,_=0,y=o;const w=d.length;let L=0;if(L>=0){let D=Math.abs(u[L]-y);for(;L+1=D)break;D=E,L++}}for(;LD&&(D=m,E=_);let I=0,k=0,R=0,A=0;if(E<=y){let N=E,M=D===0?0:t.charCodeAt(D-1),H=D===0?0:i.get(M),B=!0;for(let F=D;Fm&&BH(M,H,z,K,c)&&(I=$,k=N),N+=j,N>y){$>m?(R=$,A=N-j):(R=F+1,A=N),N-k>f&&(I=0),B=!1;break}M=z,H=K}if(B){v>0&&(g[v]=d[d.length-1],p[v]=u[d.length-1],v++);break}}if(I===0){let N=E,M=t.charCodeAt(D),H=i.get(M),B=!1;for(let F=D-1;F>=m;F--){const $=F+1,z=t.charCodeAt(F);if(z===9){B=!0;break}let K,j;if(J0(z)?(F--,K=0,j=2):(K=i.get(z),j=wv(z)?r:1),N<=y){if(R===0&&(R=$,A=N),N<=y-f)break;if(BH(z,K,M,H,c)){I=$,k=N;break}}N-=j,M=z,H=K}if(I!==0){const F=f-(A-k);if(F<=n){const $=t.charCodeAt(R);let z;gr($)?z=2:z=EE($,A,n,r),F-z<0&&(I=0)}}if(B){L--;continue}}if(I===0&&(I=R,k=A),I<=m){const N=t.charCodeAt(m);gr(N)?(I=m+2,k=_+2):(I=m+1,k=_+EE(N,_,n,r))}for(m=I,g[v]=I,_=k,p[v]=k,v++,y=k+f;L<0||L=P)break;P=N,L++}}return v===0?null:(g.length=v,p.length=v,OH=e.breakOffsets,FH=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function Blt(i,e,t,n,o,r,s,a){const l=Gu.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(k=>k.options),d=t.map(k=>k.column-1)):(c=null,d=null),o===-1)return c?new LE(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new LE(d,c,[l.length],[],0):null;const h=a==="keepAll",f=u1e(l,n,o,r,s),g=o-f,p=[],v=[];let m=0,_=0,y=0,w=o,L=l.charCodeAt(0),D=i.get(L),E=EE(L,0,n,r),I=1;gr(L)&&(E+=1,L=l.charCodeAt(1),D=i.get(L),I++);for(let k=I;kw&&((_===0||E-y>g)&&(_=R,y=E-N),p[m]=_,v[m]=y,m++,w=y+g,_=0),L=A,D=P}return m===0&&(!t||t.length===0)?null:(p[m]=u,v[m]=E,new LE(d,c,p,v,f))}function EE(i,e,t,n){return i===9?t-e%t:wv(i)||i<32?n:1}function Fse(i,e){return e-i%e}function BH(i,e,t,n,o){return t!==32&&(e===2&&n!==2||e!==1&&n===1||!o&&e===3&&n!==2||!o&&n===3&&e!==1)}function u1e(i,e,t,n,o){let r=0;if(o!==0){const s=Ws(i);if(s!==-1){for(let l=0;lt&&(r=0)}}return r}const x9=_p("domLineBreaksComputer",{createHTML:i=>i});class iX{static create(){return new iX}constructor(){}createLineBreaksComputer(e,t,n,o,r){const s=[],a=[];return{addRequest:(l,c,d)=>{s.push(l),a.push(c)},finalize:()=>Wlt(s,e,t,n,o,r,a)}}}function Wlt(i,e,t,n,o,r,s){var a;function l(k){const R=s[k];if(R){const A=Gu.applyInjectedText(i[k],R),P=R.map(M=>M.options),N=R.map(M=>M.column-1);return new LE(N,P,[A.length],[],0)}else return null}if(n===-1){const k=[];for(let R=0,A=i.length;Rc?(A=0,P=0):N=c-B}const M=R.substr(A),H=Vlt(M,P,t,N,g,h);p[k]=A,v[k]=P,m[k]=M,_[k]=H[0],y[k]=H[1]}const w=g.build(),L=(a=x9==null?void 0:x9.createHTML(w))!==null&&a!==void 0?a:w;f.innerHTML=L,f.style.position="absolute",f.style.top="10000",r==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const D=document.createRange(),E=Array.prototype.slice.call(f.children,0),I=[];for(let k=0;kz.options),F=$.map(z=>z.column-1)):(B=null,F=null),I[k]=new LE(F,B,A,H,N)}return document.body.removeChild(f),I}function Vlt(i,e,t,n,o,r){if(r!==0){const h=String(r);o.appendString('
');const s=i.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[i.length]=l,d[i.length]=a,o.appendString("
"),[c,d]}function Hlt(i,e,t,n){if(t.length<=1)return null;const o=Array.prototype.slice.call(e.children,0),r=[];try{WH(i,o,n,0,null,t.length-1,null,r)}catch(s){return console.log(s),null}return r.length===0?null:(r.push(t.length),r)}function WH(i,e,t,n,o,r,s,a){if(n===r||(o=o||L9(i,e,t[n],t[n+1]),s=s||L9(i,e,t[r],t[r+1]),Math.abs(o[0].top-s[0].top)<=.1))return;if(n+1===r){a.push(r);return}const l=n+(r-n)/2|0,c=L9(i,e,t[l],t[l+1]);WH(i,e,t,n,o,l,c,a),WH(i,e,t,l,c,r,s,a)}function L9(i,e,t,n){return i.setStart(e[t/16384|0].firstChild,t%16384),i.setEnd(e[n/16384|0].firstChild,n%16384),i.getClientRects()}class $lt extends _e{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new zq),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,n){this._editor=e,this._instantiationService=n;for(const o of t){if(this._pending.has(o.id)){en(new Error(`Cannot have two contributions with the same id ${o.id}`));continue}this._pending.set(o.id,o)}this._instantiateSome(0),this._register(Ag(()=>{this._instantiateSome(1)})),this._register(Ag(()=>{this._instantiateSome(2)})),this._register(Ag(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(Ag(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);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 n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){en(n)}}}}var zlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Qf=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ult=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},O_;let jlt=0;class Klt{constructor(e,t,n,o,r,s){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=o,this.listenersToRemove=r,this.attachedView=s}dispose(){si(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let Nw=O_=class extends _e{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,n,o,r,s,a,l,c,d,u,h){var f;super(),this.languageConfigurationService=u,this._deliveryQueue=PYe(),this._contributions=this._register(new $lt),this._onDidDispose=this._register(new le),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new Bse({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new Bse({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),r.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++jlt,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,g,d)),this._register(this._configuration.onDidChange(m=>{this._onDidChangeConfiguration.fire(m);const _=this._configuration.options;if(m.hasChanged(143)){const y=_.get(143);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=r,this._commandService=s,this._themeService=l,this._register(new qlt(this,this._contextKeyService)),this._register(new Glt(this,this._contextKeyService,h)),this._instantiationService=o.createChild(new D5([Ut,this._contextKeyService])),this._modelData=null,this._focusTracker=new Xlt(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(n.contributions)?p=n.contributions:p=by.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const m of by.getEditorActions()){if(this._actions.has(m.id)){en(new Error(`Cannot have two actions with the same id ${m.id}`));continue}const _=new Hbe(m.id,m.label,m.alias,(f=m.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(y=>Promise.resolve(m.runEditorCommand(y,this,null))),this._contextKeyService);this._actions.set(_.id,_)}const v=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new eJe(this._domElement,{onDragEnter:()=>{},onDragOver:m=>{if(!v())return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this.showDropIndicatorAt(_.position)},onDrop:m=>Ult(this,void 0,void 0,function*(){if(!v()||(this.removeDropIndicator(),!m.dataTransfer))return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this._onDropIntoEditor.fire({position:_.position,event:m})}),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,n){return new gH(e,t,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return KI.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?Qn.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let n=0;return e&&e.lineEnding&&e.lineEnding===` `?n=1:e&&e.lineEnding&&e.lineEnding===`\r -`&&(n=2),this._modelData.model.getValue(n,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 n=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),n&&this.hasModel()&&this.focus();const r={oldModelUrl:o?o.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(r),this._postDetachModelCleanup(o),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const n in t)this._removeDecorationType(e+"-"+n)}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,n,o){const r=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,o)}getTopForLineNumber(e,t=!1){return this._modelData?O_._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?O_._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,n,o=!1){const r=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,o)}getBottomForLineNumber(e,t=!1){return this._modelData?O_._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var n;(n=this._modelData)===null||n===void 0||n.viewModel.setHiddenAreas(e.map(o=>V.lift(o)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return or.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(!!this._modelData){if(!ae.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,n,o){if(!this._modelData)return;if(!V.isIRange(e))throw new Error("Invalid arguments");const r=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(r);this._modelData.viewModel.revealRange("api",n,s,t,o)}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,n){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new V(e,1,e,1),t,!1,n)}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,n,o){if(!ae.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new V(e.lineNumber,e.column,e.lineNumber,e.column),t,n,o)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const n=gt.isISelection(e),o=V.isIRange(e);if(!n&&!o)throw new Error("Invalid arguments");if(n)this._setSelectionImpl(e,t);else if(o){const r={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(r,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const n=new gt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,o){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new V(e,1,t,1),n,!1,o)}revealRange(e,t=0,n=!1,o=!0){this._revealRange(e,n?1:0,o,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,n,o){if(!V.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(V.lift(e),t,n,o)}setSelections(e,t="api",n=0){if(!!this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let o=0,r=e.length;o0&&this._modelData.viewModel.restoreCursorState(n):this._modelData.viewModel.restoreCursorState([n]),this._contributions.restoreViewState(t.contributionsState||{});const o=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(o)}}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,n){switch(n=n||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const r=n;this._type(e,r.text||"");return}case"replacePreviousChar":{const r=n;this._compositionType(e,r.text||"",r.replaceCharCnt||0,0,0);return}case"compositionType":{const r=n;this._compositionType(e,r.text||"",r.replacePrevCharCnt||0,r.replaceNextCharCnt||0,r.positionDelta||0);return}case"paste":{const r=n;this._paste(e,r.text||"",r.pasteOnNewLine||!1,r.multicursorText||null,r.mode||null);return}case"cut":this._cut(e);return}const o=this.getAction(t);if(o){Promise.resolve(o.run(n)).then(void 0,en);return}!this._modelData||this._triggerEditorCommand(e,t,n)||this._triggerCommand(t,n)}_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,n,o,r){!this._modelData||this._modelData.viewModel.compositionType(t,n,o,r,e)}_paste(e,t,n,o,r){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,n,o,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new V(a.lineNumber,a.column,l.lineNumber,l.column),languageId:r})}_cut(e){!this._modelData||this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){const o=by.getEditorCommand(t);return o?(n=n||{},n.source=e,this._instantiationService.invokeFunction(r=>{Promise.resolve(o.runEditorCommand(r,this,n)).then(void 0,en)}),!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,n){if(!this._modelData||this._configuration.options.get(90))return!1;let o;return n?Array.isArray(n)?o=()=>n:o=n:o=()=>null,this._modelData.viewModel.executeEdits(e,t,o),!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 Glt(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,FA(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,FA(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 n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(n)}}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 n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(n)}}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 n=this._glyphMarginWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(n)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(n)}}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),n=this._configuration.options,o=n.get(143),r=O_._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft();return{top:r,left:s,height:n.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){ss(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 n=e.onBeforeAttached(),o=new Ilt(this._id,this._configuration,e,nX.create(),tX.create(this._configuration.options),a=>Bc(a),this.languageConfigurationService,this._themeService,n);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(o.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=C("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(D5.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:C("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",r,s,a,l)},type:r=>{this._type("keyboard",r)},compositionType:(r,s,a,l)=>{this._compositionType("keyboard",r,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(r,s,a,l)=>{const c={text:r,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:r=>{const s={text:r};this._commandService.executeCommand("type",s)},compositionType:(r,s,a,l)=>{if(a||l){const c={text:r,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:r,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const n=new y5(e.coordinatesConverter);return n.onKeyDown=r=>this._onKeyDown.fire(r),n.onKeyUp=r=>this._onKeyUp.fire(r),n.onContextMenu=r=>this._onContextMenu.fire(r),n.onMouseMove=r=>this._onMouseMove.fire(r),n.onMouseLeave=r=>this._onMouseLeave.fire(r),n.onMouseDown=r=>this._onMouseDown.fire(r),n.onMouseUp=r=>this._onMouseUp.fire(r),n.onMouseDrag=r=>this._onMouseDrag.fire(r),n.onMouseDrop=r=>this._onMouseDrop.fire(r),n.onMouseDropCanceled=r=>this._onMouseDropCanceled.fire(r),n.onMouseWheel=r=>this._onMouseWheel.fire(r),[new xH(t,this._configuration,this._themeService.getColorTheme(),e,n,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 V(e.lineNumber,e.column,e.lineNumber,e.column),options:O_.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};Nw.dropIntoEditorDecorationOptions=Jt.register({description:"workbench-dnd-target",className:"dnd-target"});Nw=O_=Hlt([Qf(3,$t),Qf(4,Jn),Qf(5,_o),Qf(6,Ut),Qf(7,vr),Qf(8,Ao),Qf(9,_p),Qf(10,Ti),Qf(11,pt)],Nw);class Fse extends _e{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new le(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new le(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 Ms extends le{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class jlt extends _e{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Q.editorSimpleInput.bindTo(t),this._editorFocus=Q.focus.bindTo(t),this._textInputFocus=Q.textInputFocus.bindTo(t),this._editorTextFocus=Q.editorTextFocus.bindTo(t),this._tabMovesFocus=Q.tabMovesFocus.bindTo(t),this._editorReadonly=Q.readOnly.bindTo(t),this._inDiffEditor=Q.inDiffEditor.bindTo(t),this._editorColumnSelection=Q.columnSelection.bindTo(t),this._hasMultipleSelections=Q.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Q.hasNonEmptySelection.bindTo(t),this._canUndo=Q.canUndo.bindTo(t),this._canRedo=Q.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(Sw.onDidChangeTabFocus(n=>this._tabMovesFocus.set(n))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Sw.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(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class Klt extends _e{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=Q.languageId.bindTo(t),this._hasCompletionItemProvider=Q.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Q.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Q.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Q.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Q.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Q.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Q.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Q.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Q.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Q.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Q.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Q.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Q.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=Q.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Q.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Q.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Q.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Q.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=Q.isInWalkThroughSnippet.bindTo(t);const o=()=>this._update();this._register(e.onDidChangeModel(o)),this._register(e.onDidChangeModelLanguage(o)),this._register(n.completionProvider.onDidChange(o)),this._register(n.codeActionProvider.onDidChange(o)),this._register(n.codeLensProvider.onDidChange(o)),this._register(n.definitionProvider.onDidChange(o)),this._register(n.declarationProvider.onDidChange(o)),this._register(n.implementationProvider.onDidChange(o)),this._register(n.typeDefinitionProvider.onDidChange(o)),this._register(n.hoverProvider.onDidChange(o)),this._register(n.documentHighlightProvider.onDidChange(o)),this._register(n.documentSymbolProvider.onDidChange(o)),this._register(n.referenceProvider.onDidChange(o)),this._register(n.renameProvider.onDidChange(o)),this._register(n.documentFormattingEditProvider.onDidChange(o)),this._register(n.documentRangeFormattingEditProvider.onDidChange(o)),this._register(n.signatureHelpProvider.onDidChange(o)),this._register(n.inlayHintsProvider.onDidChange(o)),o()}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===hn.walkThroughSnippet)})}}class qlt extends _e{constructor(e){super(),this._onChange=this._register(new le),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(pf(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 Glt{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,n){return this._editor.onDidChangeModelDecorations(o=>{this._isChangingDecorations||e.call(t,o)},n)}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 n of this._decorationIds){const o=e.getDecorationRange(n);o&&t.push(o)}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 Xlt=encodeURIComponent("");function L9(i){return Xlt+encodeURIComponent(i.toString())+Ylt}const Zlt=encodeURIComponent('');function Jlt(i){return Zlt+encodeURIComponent(i.toString())+Qlt}jd((i,e)=>{const t=i.getColor(Yh);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${L9(t)}") repeat-x bottom left; }`);const n=i.getColor($l);n&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${L9(n)}") repeat-x bottom left; }`);const o=i.getColor(Ma);o&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${L9(o)}") repeat-x bottom left; }`);const r=i.getColor(Snt);r&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Jlt(r)}") no-repeat bottom left; }`);const s=i.getColor(Pot);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var ect=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tct=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},nct=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let WH=class extends _e{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new le),this._onCodeEditorAdd=this._register(new le),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new le),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new le),this._onDiffEditorAdd=this._register(new le),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new le),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new oa,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 n of t){if(n.hasTextFocus())return n;n.hasWidgetFocus()&&(e=n)}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(n=>n.removeDecorationsByType(e))))}setModelProperty(e,t,n){const o=e.toString();let r;this._modelProperties.has(o)?r=this._modelProperties.get(o):(r=new Map,this._modelProperties.set(o,r)),r.set(t,n)}getModelProperty(e,t){const n=e.toString();if(this._modelProperties.has(n))return this._modelProperties.get(n).get(t)}openCodeEditor(e,t,n){return nct(this,void 0,void 0,function*(){for(const o of this._codeEditorOpenHandlers){const r=yield o(e,t,n);if(r!==null)return r}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return zt(t)}};WH=ect([tct(0,vr)],WH);var ict=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Bse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},oct=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let LP=class extends WH{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((n,o,r)=>oct(this,void 0,void 0,function*(){return o?this.doOpenEditor(o,n):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 r=t.resource.scheme;if(r===hn.http||r===hn.https)return b0e(t.resource.toString()),e}return null}const o=t.options?t.options.selection:null;if(o)if(typeof o.endLineNumber=="number"&&typeof o.endColumn=="number")e.setSelection(o),e.revealRangeInCenter(o,1);else{const r={lineNumber:o.startLineNumber,column:o.startColumn};e.setPosition(r),e.revealPositionInCenter(r,1)}return e}findModel(e,t){const n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n}};LP=ict([Bse(0,Ut),Bse(1,vr)],LP);Mn(Jn,LP,0);const LS=yn("layoutService");var h1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},f1e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let EP=class{get dimension(){return this._dimension||(this._dimension=bS(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=st.None,this.offset={top:0,quickPickTop:0}}};EP=h1e([f1e(0,Jn)],EP);let VH=class extends EP{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};VH=h1e([f1e(1,Jn)],VH);Mn(LS,EP,1);const iT=yn("dialogService");var rct=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Wse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},k2=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function I2(i){return i.scheme===hn.file?i.fsPath:i.path}let g1e=0;class T2{constructor(e,t,n,o,r,s,a){this.id=++g1e,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=o,this.groupOrder=r,this.sourceId=s,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Vse{constructor(e,t){this.resourceLabel=e,this.reason=t}}class Hse{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,o]of this.elements)(o.reason===0?e:t).push(o.resourceLabel);const n=[];return e.length>0&&n.push(C({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&&n.push(C({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.join(` -`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class sct{constructor(e,t,n,o,r,s,a){this.id=++g1e,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=n,this.groupId=o,this.groupOrder=r,this.sourceId=s,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,n){this.removedResources||(this.removedResources=new Hse),this.removedResources.has(t)||this.removedResources.set(t,new Vse(e,n))}setValid(e,t,n){n?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new Hse),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Vse(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class p1e{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` -`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const n of this._past)t(n.actual)&&this._setElementValidFlag(n,e);for(const n of this._future)t(n.actual)&&this._setElementValidFlag(n,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 n=0,o=this._past.length;n=0;n--)t.push(this._future[n].id);return new a1e(e,t)}restoreSnapshot(e){const t=e.elements.length;let n=!0,o=0,r=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[o])&&(n=!1,r=0),!n&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let a=this._future.length-1;a>=0;a--,o++){const l=this._future[a];n&&(o>=t||l.id!==e.elements[o])&&(n=!1,s=a),!n&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}r!==-1&&(this._past=this._past.slice(0,r)),s!==-1&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const n of this._past)e.push(n.actual);for(const n of this._future)t.push(n.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 n=this._past.length-1;n>=0;n--)if(this._past[n]===e){t.has(this.strResource)?this._past[n]=t.get(this.strResource):this._past.splice(n,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let n=this._future.length-1;n>=0;n--)if(this._future[n]===e){t.has(this.strResource)?this._future[n]=t.get(this.strResource):this._future.splice(n,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 E9{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,n=this.editStacks.length;tt.sourceOrder)&&(t=s,n=o)}return[t,n]}canUndo(e){if(e instanceof Fh){const[,n]=this._findClosestUndoElementWithSource(e.id);return!!n}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){en(e);for(const n of t.strResources)this.removeElements(n);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,n,o,r){const s=this._acquireLocks(n);let a;try{a=t()}catch(l){return s(),o.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),o.dispose(),r()),l=>(s(),o.dispose(),this._onError(l,e))):(s(),o.dispose(),r())}_invokeWorkspacePrepare(e){return k2(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo=="undefined")return _e.None;const t=e.actual.prepareUndoRedo();return typeof t=="undefined"?_e.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo=="undefined")return t(_e.None);const n=e.actual.prepareUndoRedo();return n?Hq(n)?t(n):n.then(o=>t(o)):t(_e.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||m1e);return new E9(t)}_tryToSplitAndUndo(e,t,n,o){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.warn(o),new N2(this._undo(e,0,!0));for(const r of t.strResources)this.removeElements(r);return this._notificationService.warn(o),new N2}_checkWorkspaceUndo(e,t,n,o){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,C({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(o&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,C({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 r=[];for(const a of n.editStacks)a.getClosestPastElement()!==t&&r.push(a.resourceLabel);if(r.length>0)return this._tryToSplitAndUndo(e,t,null,C({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,r.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,C({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,s.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,C({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,n){const o=this._getAffectedEditStacks(t),r=this._checkWorkspaceUndo(e,t,o,!1);return r?r.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,o,n)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const n=t.getClosestPastElement();if(!!n){if(n===e){const o=t.getSecondClosestPastElement();if(o&&o.groupId===e.groupId)return!0}if(n.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,n,o){return k2(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:So.Info,message:C("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:C({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",n.editStacks.length),run:()=>a.All},{label:C({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,n,!1);if(c)return c.returnValue;o=!0}let r;try{r=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,n,!0);if(s)return r.dispose(),s.returnValue;for(const a of n.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,r,()=>this._continueUndoInGroup(t.groupId,o))})}_resourceUndo(e,t,n){if(!t.isValid){e.flushAllElements();return}if(e.locked){const o=C({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(o);return}return this._invokeResourcePrepare(t,o=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new E9([e]),o,()=>this._continueUndoInGroup(t.groupId,n))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestPastElement();!s||s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,n=o)}return[t,n]}_continueUndoInGroup(e,t){if(!e)return;const[,n]=this._findClosestUndoElementInGroup(e);if(n)return this._undo(n,0,t)}undo(e){if(e instanceof Fh){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,n){if(!this._editStacks.has(e))return;const o=this._editStacks.get(e),r=o.getClosestPastElement();if(!r)return;if(r.groupId){const[a,l]=this._findClosestUndoElementInGroup(r.groupId);if(r!==a&&l)return this._undo(l,t,n)}if((r.sourceId!==t||r.confirmBeforeUndo)&&!n)return this._confirmAndContinueUndo(e,t,r);try{return r.type===1?this._workspaceUndo(e,r,n):this._resourceUndo(o,r,n)}finally{}}_confirmAndContinueUndo(e,t,n){return k2(this,void 0,void 0,function*(){if(!!(yield this._dialogService.confirm({message:C("confirmDifferentSource","Would you like to undo '{0}'?",n.label),primaryButton:C({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:C("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestFutureElement();!s||s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,C({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,r.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,C({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,s.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,C({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 n=this._getAffectedEditStacks(t),o=this._checkWorkspaceRedo(e,t,n,!1);return o?o.returnValue:this._executeWorkspaceRedo(e,t,n)}_executeWorkspaceRedo(e,t,n){return k2(this,void 0,void 0,function*(){let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const r=this._checkWorkspaceRedo(e,t,n,!0);if(r)return o.dispose(),r.returnValue;for(const s of n.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),n,o,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=C({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(n);return}return this._invokeResourcePrepare(t,n=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new E9([e]),n,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestFutureElement();!s||s.groupId===e&&(!t||s.groupOrderoX(i,t))}function lct(i){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.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},i=i.with({fragment:""})),{selection:e,uri:i}}var cct=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const qc=yn("ILanguageFeatureDebounceService");var DP;(function(i){const e=new WeakMap;let t=0;function n(o){let r=e.get(o);return r===void 0&&(r=++t,e.set(o,r)),r}i.of=n})(DP||(DP={}));class dct{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class uct{constructor(e,t,n,o,r,s){this._logService=e,this._name=t,this._registry=n,this._default=o,this._min=r,this._max=s,this._cache=new Qv(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,n)=>d5(DP.of(n),t),0)}get(e){const t=this._key(e),n=this._cache.get(t);return n?Za(n.value,this._min,this._max):this.default()}update(e,t){const n=this._key(e);let o=this._cache.get(n);o||(o=new act(6),this._cache.set(n,o));const r=Za(o.update(t),this._min,this._max);return oX(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${r}ms`),r}_overall(){const e=new v1e;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Za(e,this._min,this._max)}}let $H=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,n){var o,r,s;const a=(o=n==null?void 0:n.min)!==null&&o!==void 0?o:50,l=(r=n==null?void 0:n.max)!==null&&r!==void 0?r:Math.pow(a,2),c=(s=n==null?void 0:n.key)!==null&&s!==void 0?s:void 0,d=`${DP.of(e)},${a}${c?","+c:""}`;let u=this._data.get(d);return u||(this._isDev?u=new uct(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),u=new dct(a*1.5)),this._data.set(d,u)),u}_overallAverage(){const e=new v1e;for(const t of this._data.values())e.update(t.default());return e.value}};$H=cct([zse(0,nc),zse(1,iX)],$H);Mn(qc,$H,1);class DE{static create(e,t){return new DE(e,new kP(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 V(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,n,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber,[o,r,s]=this._tokens.split(t,e.startColumn-1,n,e.endColumn-1);return[new DE(this._startLineNumber,o),new DE(this._startLineNumber+s,r)]}applyEdit(e,t){const[n,o,r]=Tv(t);this.acceptEdit(e,n,o,r,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,n,o,r){this._acceptDeleteRange(e),this._acceptInsertText(new ae(e.startLineNumber,e.startColumn),t,n,o,r),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;if(n<0){const r=n-t;this._startLineNumber-=r;return}const o=this._tokens.getMaxDeltaLine();if(!(t>=o+1)){if(t<0&&n>=o+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const r=-t;this._startLineNumber-=r,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,n,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,n,e.endColumn-1)}}_acceptInsertText(e,t,n,o,r){if(t===0&&n===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,n,o,r)}}class kP{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let n=0;ne)n=o-1;else{let s=o;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=o;for(;ae||h===e&&g>=t)&&(he||g===e&&v>=t){if(gr?p-=r-n:p=n;else if(f===t&&g===n)if(f===o&&p>r)p-=r-n;else{d=!0;continue}else if(fr)f=t,g=n,p=g+(p-r);else{d=!0;continue}else if(f>o){if(l===0&&!d){c=a;break}f-=l}else if(f===o&&g>=r)e&&f===0&&(g+=e,p+=e),f-=l,g-=r-n,p-=r-n;else throw new Error("Not possible!");const m=4*c;s[m]=f,s[m+1]=g,s[m+2]=p,s[m+3]=v,c++}this._tokenCount=c}acceptInsertText(e,t,n,o,r,s){const a=n===0&&o===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let d=0;d=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},D9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let zH=class{constructor(e,t,n,o){this._legend=e,this._themeService=t,this._languageService=n,this._logService=o,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new vg}getMetadata(e,t,n){const o=this._languageService.languageIdCodec.encodeLanguageId(n),r=this._hashTable.get(e,t,o);let s;if(r)s=r.metadata,this._logService.getLevel()===ns.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${is.getForeground(s)}, fontStyle ${is.getFontStyle(s).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()===ns.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,n);typeof d=="undefined"?s=2147483647:(s=0,typeof d.italic!="undefined"&&(s|=(d.italic?1:0)<<11|1),typeof d.bold!="undefined"&&(s|=(d.bold?2:0)<<11|2),typeof d.underline!="undefined"&&(s|=(d.underline?4:0)<<11|4),typeof d.strikethrough!="undefined"&&(s|=(d.strikethrough?8:0)<<11|8),d.foreground&&(s|=d.foreground<<15|16),s===0&&(s=2147483647))}else this._logService.getLevel()===ns.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,o,s),this._logService.getLevel()===ns.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${is.getForeground(s)}, fontStyle ${is.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,n,o,r){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${o} is outside the previous data (length ${r}).`))}};zH=hct([D9(1,vr),D9(2,Ki),D9(3,nc)],zH);function _1e(i,e,t){const n=i.data,o=i.data.length/5|0,r=Math.max(Math.ceil(o/1024),400),s=[];let a=0,l=1,c=0;for(;ad&&n[5*_]===0;)_--;if(_-1===d){let y=u;for(;y+1D)e.warnOverlappingSemanticTokens(L,D+1);else{const A=e.getMetadata(k,R,t);A!==2147483647&&(g===0&&(g=L),h[f]=L-g,h[f+1]=D,h[f+2]=I,h[f+3]=A,f+=4,p=L,v=I)}l=L,c=D,a++}f!==h.length&&(h=h.subarray(0,f));const m=DE.create(g,h);s.push(m)}return s}class fct{constructor(e,t,n,o){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=n,this.metadata=o,this.next=null}}class vg{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=vg._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const r=this._elements;this._currentLengthIndex++,this._currentLength=vg._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},k9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let UH=class extends _e{constructor(e,t,n){super(),this._themeService=e,this._logService=t,this._languageService=n,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 zH(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};UH=gct([k9(0,vr),k9(1,nc),k9(2,Ki)],UH);Mn(k5,UH,1);var jse=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const R2="**",Kse="/",mM="[/\\\\]",vM="[^/\\\\]",pct=/\//g;function qse(i,e){switch(i){case 0:return"";case 1:return`${vM}*?`;default:return`(?:${mM}|${vM}+${mM}${e?`|${mM}${vM}+`:""})*?`}}function Gse(i,e){if(!i)return[];const t=[];let n=!1,o=!1,r="";for(const s of i){switch(s){case e:if(!n&&!o){t.push(r),r="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}r+=s}return r&&t.push(r),t}function b1e(i){if(!i)return"";let e="";const t=Gse(i,Kse);if(t.every(n=>n===R2))e=".*";else{let n=!1;t.forEach((o,r)=>{if(o===R2){if(n)return;e+=qse(2,r===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const d of o){if(d!=="}"&&s){a+=d;continue}if(l&&(d!=="]"||!c)){let u;d==="-"?u=d:(d==="^"||d==="!")&&!c?u="^":d===Kse?u="":u=Xl(d),c+=u;continue}switch(d){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{e+=`(?:${Gse(a,",").map(f=>b1e(f)).join("|")})`,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=vM;continue;case"*":e+=qse(1);continue;default:e+=Xl(d)}}rrX(a,e)).filter(a=>a!==df),i),n=t.length;if(!n)return df;if(n===1)return t[0];const o=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);r&&(o.allBasenames=r.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function Qse(i,e,t){const n=Bu===Go.sep,o=n?i:i.replace(pct,Bu),r=Bu+o,s=Go.sep+i;let a;return t?a=function(l,c){return typeof l=="string"&&(l===o||l.endsWith(r)||!n&&(l===i||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===o||!n&&l===i)?e:null},a.allPaths=[(t?"*/":"./")+i],a}function Lct(i){try{const e=new RegExp(`^${b1e(i)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?i:null}}catch{return df}}function Ect(i,e,t){return!i||typeof e!="string"?!1:C1e(i)(e,void 0,t)}function C1e(i,e={}){if(!i)return Yse;if(typeof i=="string"||Dct(i)){const t=rX(i,e);if(t===df)return Yse;const n=function(o,r){return!!t(o,r)};return t.allBasenames&&(n.allBasenames=t.allBasenames),t.allPaths&&(n.allPaths=t.allPaths),n}return kct(i,e)}function Dct(i){const e=i;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function kct(i,e){const t=y1e(Object.getOwnPropertyNames(i).map(a=>Ict(a,i[a],e)).filter(a=>a!==df)),n=t.length;if(!n)return df;if(!t.some(a=>!!a.requiresSiblings)){if(n===1)return t[0];const a=function(d,u){let h;for(let f=0,g=t.length;fjse(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 o=function(a,l,c){let d,u;for(let h=0,f=t.length;hjse(this,void 0,void 0,function*(){for(const h of u){const f=yield h;if(typeof f=="string")return f}return null}))():null},r=t.find(a=>!!a.allBasenames);r&&(o.allBasenames=r.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function Ict(i,e,t){if(e===!1)return df;const n=rX(i,t);if(n===df)return df;if(typeof e=="boolean")return n;if(e){const o=e.when;if(typeof o=="string"){const r=(s,a,l,c)=>{if(!c||!n(s,a))return null;const d=o.replace("$(basename)",()=>l),u=c(d);return ZV(u)?u.then(h=>h?i:null):u?i:null};return r.requiresSiblings=!0,r}}return n}function y1e(i,e){const t=i.filter(a=>!!a.basenames);if(t.length<2)return i;const n=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let o;if(e){o=[];for(let a=0,l=n.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const r=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=n.indexOf(l);return c!==-1?o[c]:null};r.basenames=n,r.patterns=o,r.allBasenames=n;const s=i.filter(a=>!a.basenames);return s.push(r),s}function w1e(i,e,t,n,o,r){if(Array.isArray(i)){let s=0;for(const a of i){const l=w1e(a,e,t,n,o,r);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof i=="string")return n?i==="*"?5:i===t?10:0:0;if(i){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=i;if(!n&&!c)return 0;d&&o&&(e=o);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(s)if(s===t)u=10;else if(s==="*")u=Math.max(u,5);else return 0;if(d)if(d===r)u=10;else if(d==="*"&&r!==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:A_e(a.base)}),h===e.fsPath||Ect(h,e.fsPath))u=10;else return 0}return u}else return 0}}function S1e(i){return typeof i=="string"?!1:Array.isArray(i)?i.every(S1e):!!i.exclusive}class Jse{constructor(e,t,n,o){this.uri=e,this.languageId=t,this.notebookUri=n,this.notebookType=o}equals(e){var t,n;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())===((n=e.notebookUri)===null||n===void 0?void 0:n.toString())}}class fo{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new le,this.onDidChange=this._onDidChange.event}register(e,t){let n={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(n),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),zt(()=>{if(n){const o=this._entries.indexOf(n);o>=0&&(this._entries.splice(o,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const n of this._entries)n._score>0&&t.push(n.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,n=>t.push(n.provider)),t}orderedGroups(e){const t=[];let n,o;return this._orderedForEach(e,r=>{n&&o===r._score?n.push(r.provider):(o=r._score,n=[r.provider],t.push(n))}),t}_orderedForEach(e,t){this._updateScores(e);for(const n of this._entries)n._score>0&&t(n)}_updateScores(e){var t,n;const o=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),r=o?new Jse(e.uri,e.getLanguageId(),o.uri,o.type):new Jse(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((n=this._lastCandidate)===null||n===void 0)&&n.equals(r))){this._lastCandidate=r;for(const s of this._entries)if(s._score=w1e(s.selector,r.uri,r.languageId,Cet(e),r.notebookUri,r.notebookType),S1e(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(fo._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:NL(e.selector)&&!NL(t.selector)?1:!NL(e.selector)&&NL(t.selector)?-1:e._timet._time?-1:0}}function NL(i){return typeof i=="string"?!1:Array.isArray(i)?i.some(NL):Boolean(i.isBuiltin)}class Tct{constructor(){this.referenceProvider=new fo(this._score.bind(this)),this.renameProvider=new fo(this._score.bind(this)),this.codeActionProvider=new fo(this._score.bind(this)),this.definitionProvider=new fo(this._score.bind(this)),this.typeDefinitionProvider=new fo(this._score.bind(this)),this.declarationProvider=new fo(this._score.bind(this)),this.implementationProvider=new fo(this._score.bind(this)),this.documentSymbolProvider=new fo(this._score.bind(this)),this.inlayHintsProvider=new fo(this._score.bind(this)),this.colorProvider=new fo(this._score.bind(this)),this.codeLensProvider=new fo(this._score.bind(this)),this.documentFormattingEditProvider=new fo(this._score.bind(this)),this.documentRangeFormattingEditProvider=new fo(this._score.bind(this)),this.onTypeFormattingEditProvider=new fo(this._score.bind(this)),this.signatureHelpProvider=new fo(this._score.bind(this)),this.hoverProvider=new fo(this._score.bind(this)),this.documentHighlightProvider=new fo(this._score.bind(this)),this.selectionRangeProvider=new fo(this._score.bind(this)),this.foldingRangeProvider=new fo(this._score.bind(this)),this.linkProvider=new fo(this._score.bind(this)),this.inlineCompletionsProvider=new fo(this._score.bind(this)),this.completionProvider=new fo(this._score.bind(this)),this.linkedEditingRangeProvider=new fo(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new fo(this._score.bind(this)),this.documentSemanticTokensProvider=new fo(this._score.bind(this)),this.documentOnDropEditProvider=new fo(this._score.bind(this)),this.documentPasteEditProvider=new fo(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Mn(pt,Tct,1);const oT=yn("IWorkspaceEditService");class sX{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Gg.is(t))return Gg.lift(t);if(My.is(t))return My.lift(t);throw new Error("Unsupported edit")})}}class Gg extends sX{static is(e){return e instanceof Gg?!0:ia(e)&&Rt.isUri(e.resource)&&ia(e.textEdit)}static lift(e){return e instanceof Gg?e:new Gg(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,n=void 0,o){super(o),this.resource=e,this.textEdit=t,this.versionId=n}}class My extends sX{static is(e){return e instanceof My?!0:ia(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof My?e:new My(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,n={},o){super(o),this.oldResource=e,this.newResource=t,this.options=n}}const As={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},I5=Object.freeze({id:"editor",order:5,type:"object",title:C("editorConfigurationTitle","Editor"),scope:5}),IP=Object.assign(Object.assign({},I5),{properties:{"editor.tabSize":{type:"number",default:vs.tabSize,minimum:1,markdownDescription:C("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:C("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:vs.insertSpaces,markdownDescription:C("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:vs.detectIndentation,markdownDescription:C("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:vs.trimAutoWhitespace,description:C("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:vs.largeFileOptimizations,description:C("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:C("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[C("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),C("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),C("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:C("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[C("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),C("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),C("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:C("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:C("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:C("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:C("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:C("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:C("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:C("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:C("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:C("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:C("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:As.maxComputationTime,description:C("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:As.maxFileSize,description:C("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:As.renderSideBySide,description:C("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:As.renderSideBySideInlineBreakpoint,description:C("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:As.useInlineViewWhenSpaceIsLimited,description:C("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:As.renderMarginRevertIcon,description:C("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:As.ignoreTrimWhitespace,description:C("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:As.renderIndicators,description:C("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:As.diffCodeLens,description:C("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:As.diffWordWrap,markdownEnumDescriptions:[C("wordWrap.off","Lines will never wrap."),C("wordWrap.on","Lines will wrap at the viewport width."),C("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:As.diffAlgorithm,markdownEnumDescriptions:[C("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),C("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:As.hideUnchangedRegions.enabled,markdownDescription:C("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:As.hideUnchangedRegions.revealLineCount,markdownDescription:C("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:As.hideUnchangedRegions.minimumLineCount,markdownDescription:C("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:As.hideUnchangedRegions.contextLineCount,markdownDescription:C("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:As.experimental.showMoves,markdownDescription:C("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:As.experimental.showEmptyDecorations,description:C("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function Nct(i){return typeof i.type!="undefined"||typeof i.anyOf!="undefined"}for(const i of IC){const e=i.schema;if(typeof e!="undefined")if(Nct(e))IP.properties[`editor.${i.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(IP.properties[t]=e[t])}let M2=null;function x1e(){return M2===null&&(M2=Object.create(null),Object.keys(IP.properties).forEach(i=>{M2[i]=!0})),M2}function Rct(i){return x1e()[`editor.${i}`]||!1}function Mct(i){return x1e()[`diffEditor.${i}`]||!1}const Act=no.as(ch.Configuration);Act.registerConfiguration(IP);class Gi{static insert(e,t){return{range:new V(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 T9(i){return Object.isFrozen(i)?i:bXe(i)}class ps{constructor(e={},t=[],n=[],o){this._contents=e,this._keys=t,this._overrides=n,this.raw=o,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(n=>{if(n instanceof ps)return n;const o=new Pct("");return o.parseRaw(n),o.configurationModel});this._rawConfiguration=t.reduce((n,o)=>o===n?o:n.merge(o),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?Hoe(this.contents,e):this.contents}inspect(e,t){const n=this.rawConfiguration.getValue(e),o=t?this.rawConfiguration.getOverrideValue(e,t):void 0,r=t?this.rawConfiguration.override(t).getValue(e):n;return{value:n,override:o,merged:r}}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?Hoe(n,e):n: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,n;const o=gg(this.contents),r=gg(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((n=l.raw)===null||n===void 0)&&n.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(o,l.contents);for(const c of l.overrides){const[d]=r.filter(u=>Lo(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=bv(d.keys)):r.push(gg(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new ps(o,s,r,a.every(l=>l instanceof ps)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const n={};for(const o of bv([...Object.keys(this.contents),...Object.keys(t)])){let r=this.contents[o];const s=t[o];s&&(typeof r=="object"&&typeof s=="object"?(r=gg(r),this.mergeContents(r,s)):r=s),n[o]=r}return new ps(n,this.keys,this.overrides)}mergeContents(e,t){for(const n of Object.keys(t)){if(n in e&&ia(e[n])&&ia(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=gg(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null;const o=r=>{r&&(n?this.mergeContents(n,r):n=gg(r))};for(const r of this.overrides)r.identifiers.length===1&&r.identifiers[0]===e?t=r.contents:r.identifiers.includes(e)&&o(r.contents);return o(t),n}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),PJe(this.contents,e),Ev.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>Lo(n.identifiers,QA(e))),1))}updateValue(e,t,n){A0e(this.contents,e,t,o=>console.error(o)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),Ev.test(e)&&this.overrides.push({identifiers:QA(e),keys:Object.keys(this.contents[e]),contents:eH(this.contents[e],o=>console.error(o))})}}class Pct{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new ps}parseRaw(e,t){this._raw=e;const{contents:n,keys:o,overrides:r,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new ps(n,o,r,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const n=no.as(ch.Configuration).getConfigurationProperties(),o=this.filter(e,n,!0,t);e=o.raw;const r=eH(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:r,keys:s,overrides:a,restricted:o.restricted,hasExcludedProperties:o.hasExcludedProperties}}filter(e,t,n,o){var r,s,a;let l=!1;if(!(o!=null&&o.scopes)&&!(o!=null&&o.skipRestricted)&&!(!((r=o==null?void 0:o.exclude)===null||r===void 0)&&r.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},d=[];for(const u in e)if(Ev.test(u)&&n){const h=this.filter(e[u],t,!1,o);c[u]=h.raw,l=l||h.hasExcludedProperties,d.push(...h.restricted)}else{const h=t[u],f=h?typeof h.scope!="undefined"?h.scope:3:void 0;h!=null&&h.restricted&&d.push(u),!(!((s=o.exclude)===null||s===void 0)&&s.includes(u))&&(((a=o.include)===null||a===void 0?void 0:a.includes(u))||(f===void 0||o.scopes===void 0||o.scopes.includes(f))&&!(o.skipRestricted&&(h==null?void 0:h.restricted)))?c[u]=e[u]:l=!0}return{raw:c,restricted:d,hasExcludedProperties:l}}toOverrides(e,t){const n=[];for(const o of Object.keys(e))if(Ev.test(o)){const r={};for(const s in e[o])r[s]=e[o][s];n.push({identifiers:QA(o),keys:Object.keys(r),contents:eH(r,t)})}return n}}class Oct{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=o,this.defaultConfiguration=r,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=u,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}inspect(e,t,n){const o=e.inspect(t,n);return{get value(){return T9(o.value)},get override(){return T9(o.override)},get merged(){return T9(o.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 T5{constructor(e,t,n,o,r=new ps,s=new ps,a=new _s,l=new ps,c=new _s){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=o,this._remoteUserConfiguration=r,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new _s,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let o;n.resource?(o=this._memoryConfigurationByResource.get(n.resource),o||(o=new ps,this._memoryConfigurationByResource.set(n.resource,o))):o=this._memoryConfiguration,t===void 0?o.removeValue(e):o.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const o=this.getConsolidatedConfigurationModel(e,t,n),r=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of o.overrides)for(const c of l.identifiers)o.getOverrideValue(e,c)!==void 0&&a.add(c);return new Oct(e,t,o.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,n?this._workspaceConfiguration:void 0,r||void 0,s)}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,n){let o=this.getConsolidatedConfigurationModelForResource(t,n);return t.overrideIdentifier&&(o=o.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(o=o.merge(this._policyConfiguration)),o}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const o=t.getFolder(e);o&&(n=this.getFolderConsolidatedConfiguration(o.uri)||n);const r=this._memoryConfigurationByResource.get(e);r&&(n=n.merge(r))}return n}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 n=this.getWorkspaceConsolidatedConfiguration(),o=this._folderConfigurations.get(e);o?(t=n.merge(o),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.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:n,overrides:o,keys:r}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:o,keys:r}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.policy),o=this.parseConfigurationModel(e.application),r=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Rt.revive(c[0]),this.parseConfigurationModel(c[1])),l),new _s);return new T5(t,n,o,r,new ps,s,a,new ps,new _s)}static parseConfigurationModel(e){return new ps(e.contents,e.keys,e.overrides)}}class Fct{constructor(e,t,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=o,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const s of r)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=T5.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var n;const o=this._marker+e,r=this._affectsConfigStr.indexOf(o);if(r<0)return!1;const s=r+o.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(n=this.previous)===null||n===void 0?void 0:n.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!ql(l,c)}return!0}}const TP={kind:0},Bct={kind:1};function Wct(i,e,t){return{kind:2,commandId:i,commandArgs:e,isBubble:t}}class kE{constructor(e,t,n){var o;this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const r of e){const s=r.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=kE.handleRemovals([].concat(e).concat(t));for(let r=0,s=this._keybindings.length;r=0;o--){const r=n[o];if(r.command===t.command)continue;let s=!0;for(let a=1;a=0;o--){const r=n[o];if(t.contextMatchesRules(r.when))return r}return n[n.length-1]}resolve(e,t,n){const o=[...t,n];this._log(`| Resolving ${o}`);const r=this._map.get(o[0]);if(r===void 0)return this._log("\\ No keybinding entries."),TP;let s=null;if(o.length<2)s=r;else{s=[];for(let l=0,c=r.length;ld.chords.length)continue;let u=!0;for(let h=1;h=0;n--){const o=t[n];if(!!kE._contextMatchesRules(e,o.when))return o}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function eae(i){return i?`${i.serialize()}`:"no when condition"}function tae(i){return i.extensionId?i.isBuiltinExtension?`built-in extension ${i.extensionId}`:`user extension ${i.extensionId}`:i.isDefault?"built-in":"user"}const Vct=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class Hct extends _e{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:st.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,o,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=o,this._logService=r,this._onDidUpdateKeybindings=this._register(new le),this._currentChords=[],this._currentChordChecker=new UI,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=UC.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new zd,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(!!n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),TP;const[o]=n.getDispatchChords();if(o===null)return this._log("\\ Keyboard event cannot be dispatched"),TP;const r=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(r,s,o)}_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 Vq("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(C("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:o})=>o).join(", ");this._currentChordStatusMessage=this._notificationService.status(C("next.chord","({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),gE.enabled&&gE.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],gE.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[o]=n.getSingleModifierDispatchChords();if(o)return this._ignoreSingleModifiers.has(o)?(this._log(`+ Ignoring single modifier ${o} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=UC.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=UC.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${o}.`),this._currentSingleModifier=o,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):o===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${o} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[r]=n.getChords();return this._ignoreSingleModifiers=new UC(r),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){var o;let r=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(n){const[u]=e.getSingleModifierDispatchChords();s=u,a=u?[u]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:u})=>u);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),r;const l=this._contextKeyService.getContext(t),c=e.getLabel(),d=this._getResolver().resolve(l,a,s);switch(d.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(C("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}return r}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),r=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),r;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${d.commandId} ]`),d.commandId===null||d.commandId===""){if(this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(C("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}}else this.inChordMode&&this._leaveChordMode(),d.isBubble||(r=!0),this._log(`+ Invoking command ${d.commandId}.`),typeof d.commandArgs=="undefined"?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)),Vct.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding",detail:(o=e.getUserSettingsLabel())!==null&&o!==void 0?o:void 0});return r}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class UC{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}}}UC.EMPTY=new UC(null);class nae{constructor(e,t,n,o,r,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?jH(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=jH(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=o,this.isDefault=r,this.extensionId=s,this.isBuiltinExtension=a}}function jH(i){const e=[];for(let t=0,n=i.length;tthis._getLabel(e))}getAriaLabel(){return $ct.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:zct.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return Uct.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 GZe(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 fk extends Kct{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"\u2190";case 16:return"\u2191";case 17:return"\u2192";case 18:return"\u2193"}return xg.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":xg.toString(e.keyCode)}_getElectronAccelerator(e){return xg.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=xg.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return fk.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+=xg.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=Kq[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 cp)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new cp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=jH(e.chords.map(o=>this._toKeyCodeChord(o)));return n.length>0?[new fk(n,t)]:[]}}const Rw=yn("labelService"),L1e=yn("progressService");Object.freeze({total(){},worked(){},done(){}});class Xg{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)})}}Xg.None=Object.freeze({report(){}});const t_=yn("editorProgressService");class qct{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 n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Ay(new Yct(e,t))}static forStrings(){return new Ay(new qct)}static forConfigKeys(){return new Ay(new Gct)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let o;this._root||(this._root=new A2,this._root.segment=n.value());const r=[];for(o=this._root;;){const a=n.cmp(o.segment);if(a>0)o.left||(o.left=new A2,o.left.segment=n.value()),r.push([-1,o]),o=o.left;else if(a<0)o.right||(o.right=new A2,o.right.segment=n.value()),r.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new A2,o.mid.segment=n.value()),r.push([0,o]),o=o.mid;else break}const s=o.value;o.value=t,o.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=r[a][0],u=r[a+1][0];if(d===1&&u===1)r[a][1]=l.rotateLeft();else if(d===-1&&u===-1)r[a][1]=l.rotateRight();else if(d===1&&u===-1)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(d===-1&&u===1)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return s}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 n=this._root;for(;n;){const o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}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 n;const o=this._iter.reset(e),r=[];let s=this._root;for(;s;){const a=o.cmp(s.segment);if(a>0)r.push([-1,s]),s=s.left;else if(a<0)r.push([1,s]),s=s.right;else if(o.hasNext())o.next(),r.push([0,s]),s=s.mid;else break}if(!!s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const a=this._min(s.right);if(a.key){const{key:l,value:c,segment:d}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=d}}else{const a=(n=s.left)!==null&&n!==void 0?n:s.right;if(r.length>0){const[l,c]=r[r.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=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),r[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),r[a][1]=l.rotateRight()),a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let n=this._root,o;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),o=n.value||o,n=n.mid;else break}return n&&n.value||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let o=this._root;for(;o;){const r=n.cmp(o.segment);if(r>0)o=o.left;else if(r<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):t?o.value:void 0}}forEach(e){for(const[t,n]of this)e(n,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 rb=yn("contextService");function KH(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Rt.isUri(e.uri)}function Zct(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&!KH(i)&&!tdt(i)}const Qct={id:"ext-dev"},Jct={id:"empty-window"};function edt(i,e){if(typeof i=="string"||typeof i=="undefined")return typeof i=="string"?{id:qm(i)}:e?Qct:Jct;const t=i;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 tdt(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Rt.isUri(e.configPath)}class ndt{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 qH="code-workspace";C("codeWorkspace","Code Workspace");const E1e="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function idt(i){return i.id===E1e}var GH;(function(i){i.inspectTokensAction=C("inspectTokens","Developer: Inspect Tokens")})(GH||(GH={}));var NP;(function(i){i.gotoLineActionLabel=C("gotoLineActionLabel","Go to Line/Column...")})(NP||(NP={}));var XH;(function(i){i.helpQuickAccessActionLabel=C("helpQuickAccess","Show all Quick Access Providers")})(XH||(XH={}));var RP;(function(i){i.quickCommandActionLabel=C("quickCommandActionLabel","Command Palette"),i.quickCommandHelp=C("quickCommandActionHelp","Show And Run Commands")})(RP||(RP={}));var gk;(function(i){i.quickOutlineActionLabel=C("quickOutlineActionLabel","Go to Symbol..."),i.quickOutlineByCategoryActionLabel=C("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(gk||(gk={}));var MP;(function(i){i.editorViewAccessibleLabel=C("editorViewAccessibleLabel","Editor content"),i.accessibilityHelpMessage=C("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(MP||(MP={}));var YH;(function(i){i.toggleHighContrast=C("toggleHighContrast","Toggle High Contrast Theme")})(YH||(YH={}));var ZH;(function(i){i.bulkEditServiceSummary=C("bulkEditServiceSummary","Made {0} edits in {1} files")})(ZH||(ZH={}));const D1e=yn("workspaceTrustManagementService"),bp=yn("contextViewService"),Kd=yn("contextMenuService");var fs;(function(i){function e(r,s){if(r.start>=s.end||s.start>=r.end)return{start:0,end:0};const a=Math.max(r.start,s.start),l=Math.min(r.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}i.intersect=e;function t(r){return r.end-r.start<=0}i.isEmpty=t;function n(r,s){return!t(e(r,s))}i.intersects=n;function o(r,s){const a=[],l={start:r.start,end:Math.min(s.start,r.end)},c={start:Math.max(s.end,r.start),end:r.end};return t(l)||a.push(l),t(c)||a.push(c),a}i.relativeComplement=o})(fs||(fs={}));function odt(i){const e=i;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var km;(function(i){i[i.AVOID=0]="AVOID",i[i.ALIGN=1]="ALIGN"})(km||(km={}));function jC(i,e,t){const n=t.mode===km.ALIGN?t.offset:t.offset+t.size,o=t.mode===km.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=i-n?n:e<=o?o-e:Math.max(i-e,0):e<=o?o-e:e<=i-n?n:0}class Mw extends _e{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=_e.None,this.toDisposeOnSetContainer=_e.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=He(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Js(this.view),this.setContainer(e,t),this._register(zt(()=>this.setContainer(null,1)))}setContainer(e,t){var n;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(n=this.shadowRootHostElement)===null||n===void 0||n.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=He(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const r=document.createElement("style");r.textContent=rdt,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(He("slot"))}else this.container.appendChild(this.view);const o=new Be;Mw.BUBBLE_UP_EVENTS.forEach(r=>{o.add(No(this.container,r,s=>{this.onDOMEvent(s,!1)}))}),Mw.BUBBLE_DOWN_EVENTS.forEach(r=>{o.add(No(this.container,r,s=>{this.onDOMEvent(s,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,n;this.isVisible()&&this.hide(),Ur(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",nl(this.view),this.toDisposeOnClean=e.render(this.view)||_e.None,this.delegate=e,this.doLayout(),(n=(t=this.delegate).focus)===null||n===void 0||n.call(t)}getViewElement(){return this.view}layout(){if(!!this.isVisible()){if(this.delegate.canRelayout===!1&&!(Ku&&rG.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(aG(e)){const u=Yo(e),h=VQe(e);t={top:u.top*h,left:u.left*h,width:u.width*h,height:u.height*h}}else odt(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 n=Ea(this.view),o=h0(this.view),r=this.delegate.anchorPosition||0,s=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:r===0?0:1},h={offset:t.left,size:t.width,position:s===0?0:1,mode:km.ALIGN};l=jC(window.innerHeight,o,u)+window.pageYOffset,fs.intersects({start:l,end:l+o},{start:u.offset,end:u.offset+u.size})&&(h.mode=km.AVOID),c=jC(window.innerWidth,n,h)}else{const u={offset:t.left,size:t.width,position:s===0?0:1},h={offset:t.top,size:t.height,position:r===0?0:1,mode:km.ALIGN};c=jC(window.innerWidth,n,u),fs.intersects({start:c,end:c+n},{start:u.offset,end:u.offset+u.size})&&(h.mode=km.AVOID),l=jC(window.innerHeight,o,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(r===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Yo(this.container);this.view.style.top=`${l-(this.useFixedPosition?Yo(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Yo(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(),Js(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!rs(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Mw.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Mw.BUBBLE_DOWN_EVENTS=["click"];const rdt=` +`&&(n=2),this._modelData.model.getValue(n,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 n=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),n&&this.hasModel()&&this.focus();const r={oldModelUrl:o?o.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(r),this._postDetachModelCleanup(o),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const n in t)this._removeDecorationType(e+"-"+n)}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,n,o){const r=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,o)}getTopForLineNumber(e,t=!1){return this._modelData?O_._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?O_._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,n,o=!1){const r=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,o)}getBottomForLineNumber(e,t=!1){return this._modelData?O_._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var n;(n=this._modelData)===null||n===void 0||n.viewModel.setHiddenAreas(e.map(o=>V.lift(o)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return or.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(!!this._modelData){if(!ae.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,n,o){if(!this._modelData)return;if(!V.isIRange(e))throw new Error("Invalid arguments");const r=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(r);this._modelData.viewModel.revealRange("api",n,s,t,o)}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,n){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new V(e,1,e,1),t,!1,n)}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,n,o){if(!ae.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new V(e.lineNumber,e.column,e.lineNumber,e.column),t,n,o)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const n=gt.isISelection(e),o=V.isIRange(e);if(!n&&!o)throw new Error("Invalid arguments");if(n)this._setSelectionImpl(e,t);else if(o){const r={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(r,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const n=new gt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,o){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new V(e,1,t,1),n,!1,o)}revealRange(e,t=0,n=!1,o=!0){this._revealRange(e,n?1:0,o,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,n,o){if(!V.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(V.lift(e),t,n,o)}setSelections(e,t="api",n=0){if(!!this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let o=0,r=e.length;o0&&this._modelData.viewModel.restoreCursorState(n):this._modelData.viewModel.restoreCursorState([n]),this._contributions.restoreViewState(t.contributionsState||{});const o=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(o)}}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,n){switch(n=n||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const r=n;this._type(e,r.text||"");return}case"replacePreviousChar":{const r=n;this._compositionType(e,r.text||"",r.replaceCharCnt||0,0,0);return}case"compositionType":{const r=n;this._compositionType(e,r.text||"",r.replacePrevCharCnt||0,r.replaceNextCharCnt||0,r.positionDelta||0);return}case"paste":{const r=n;this._paste(e,r.text||"",r.pasteOnNewLine||!1,r.multicursorText||null,r.mode||null);return}case"cut":this._cut(e);return}const o=this.getAction(t);if(o){Promise.resolve(o.run(n)).then(void 0,en);return}!this._modelData||this._triggerEditorCommand(e,t,n)||this._triggerCommand(t,n)}_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,n,o,r){!this._modelData||this._modelData.viewModel.compositionType(t,n,o,r,e)}_paste(e,t,n,o,r){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,n,o,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new V(a.lineNumber,a.column,l.lineNumber,l.column),languageId:r})}_cut(e){!this._modelData||this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){const o=by.getEditorCommand(t);return o?(n=n||{},n.source=e,this._instantiationService.invokeFunction(r=>{Promise.resolve(o.runEditorCommand(r,this,n)).then(void 0,en)}),!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,n){if(!this._modelData||this._configuration.options.get(90))return!1;let o;return n?Array.isArray(n)?o=()=>n:o=n:o=()=>null,this._modelData.viewModel.executeEdits(e,t,o),!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 Ylt(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,FA(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,FA(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 n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(n)}}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 n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(n)}}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 n=this._glyphMarginWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(n)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(n)}}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),n=this._configuration.options,o=n.get(143),r=O_._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft();return{top:r,left:s,height:n.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){ss(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 n=e.onBeforeAttached(),o=new Nlt(this._id,this._configuration,e,iX.create(),nX.create(this._configuration.options),a=>Bc(a),this.languageConfigurationService,this._themeService,n);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(o.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=C("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(k5.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:C("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",r,s,a,l)},type:r=>{this._type("keyboard",r)},compositionType:(r,s,a,l)=>{this._compositionType("keyboard",r,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(r,s,a,l)=>{const c={text:r,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:r=>{const s={text:r};this._commandService.executeCommand("type",s)},compositionType:(r,s,a,l)=>{if(a||l){const c={text:r,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:r,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const n=new w5(e.coordinatesConverter);return n.onKeyDown=r=>this._onKeyDown.fire(r),n.onKeyUp=r=>this._onKeyUp.fire(r),n.onContextMenu=r=>this._onContextMenu.fire(r),n.onMouseMove=r=>this._onMouseMove.fire(r),n.onMouseLeave=r=>this._onMouseLeave.fire(r),n.onMouseDown=r=>this._onMouseDown.fire(r),n.onMouseUp=r=>this._onMouseUp.fire(r),n.onMouseDrag=r=>this._onMouseDrag.fire(r),n.onMouseDrop=r=>this._onMouseDrop.fire(r),n.onMouseDropCanceled=r=>this._onMouseDropCanceled.fire(r),n.onMouseWheel=r=>this._onMouseWheel.fire(r),[new LH(t,this._configuration,this._themeService.getColorTheme(),e,n,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 V(e.lineNumber,e.column,e.lineNumber,e.column),options:O_.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};Nw.dropIntoEditorDecorationOptions=Jt.register({description:"workbench-dnd-target",className:"dnd-target"});Nw=O_=zlt([Qf(3,$t),Qf(4,Jn),Qf(5,_o),Qf(6,Ut),Qf(7,vr),Qf(8,Ao),Qf(9,bp),Qf(10,Ti),Qf(11,pt)],Nw);class Bse extends _e{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new le(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new le(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 Ms extends le{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class qlt extends _e{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Q.editorSimpleInput.bindTo(t),this._editorFocus=Q.focus.bindTo(t),this._textInputFocus=Q.textInputFocus.bindTo(t),this._editorTextFocus=Q.editorTextFocus.bindTo(t),this._tabMovesFocus=Q.tabMovesFocus.bindTo(t),this._editorReadonly=Q.readOnly.bindTo(t),this._inDiffEditor=Q.inDiffEditor.bindTo(t),this._editorColumnSelection=Q.columnSelection.bindTo(t),this._hasMultipleSelections=Q.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Q.hasNonEmptySelection.bindTo(t),this._canUndo=Q.canUndo.bindTo(t),this._canRedo=Q.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(Sw.onDidChangeTabFocus(n=>this._tabMovesFocus.set(n))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Sw.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(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class Glt extends _e{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=Q.languageId.bindTo(t),this._hasCompletionItemProvider=Q.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Q.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Q.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Q.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Q.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Q.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Q.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Q.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Q.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Q.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Q.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Q.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Q.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=Q.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Q.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Q.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Q.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Q.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=Q.isInWalkThroughSnippet.bindTo(t);const o=()=>this._update();this._register(e.onDidChangeModel(o)),this._register(e.onDidChangeModelLanguage(o)),this._register(n.completionProvider.onDidChange(o)),this._register(n.codeActionProvider.onDidChange(o)),this._register(n.codeLensProvider.onDidChange(o)),this._register(n.definitionProvider.onDidChange(o)),this._register(n.declarationProvider.onDidChange(o)),this._register(n.implementationProvider.onDidChange(o)),this._register(n.typeDefinitionProvider.onDidChange(o)),this._register(n.hoverProvider.onDidChange(o)),this._register(n.documentHighlightProvider.onDidChange(o)),this._register(n.documentSymbolProvider.onDidChange(o)),this._register(n.referenceProvider.onDidChange(o)),this._register(n.renameProvider.onDidChange(o)),this._register(n.documentFormattingEditProvider.onDidChange(o)),this._register(n.documentRangeFormattingEditProvider.onDidChange(o)),this._register(n.signatureHelpProvider.onDidChange(o)),this._register(n.inlayHintsProvider.onDidChange(o)),o()}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===hn.walkThroughSnippet)})}}class Xlt extends _e{constructor(e){super(),this._onChange=this._register(new le),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(pf(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 Ylt{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,n){return this._editor.onDidChangeModelDecorations(o=>{this._isChangingDecorations||e.call(t,o)},n)}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 n of this._decorationIds){const o=e.getDecorationRange(n);o&&t.push(o)}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 Zlt=encodeURIComponent("");function E9(i){return Zlt+encodeURIComponent(i.toString())+Qlt}const Jlt=encodeURIComponent('');function tct(i){return Jlt+encodeURIComponent(i.toString())+ect}jd((i,e)=>{const t=i.getColor(Yh);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${E9(t)}") repeat-x bottom left; }`);const n=i.getColor($l);n&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${E9(n)}") repeat-x bottom left; }`);const o=i.getColor(Ma);o&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${E9(o)}") repeat-x bottom left; }`);const r=i.getColor(Lnt);r&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${tct(r)}") no-repeat bottom left; }`);const s=i.getColor(Fot);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var nct=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ict=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},oct=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let VH=class extends _e{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new le),this._onCodeEditorAdd=this._register(new le),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new le),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new le),this._onDiffEditorAdd=this._register(new le),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new le),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new oa,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 n of t){if(n.hasTextFocus())return n;n.hasWidgetFocus()&&(e=n)}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(n=>n.removeDecorationsByType(e))))}setModelProperty(e,t,n){const o=e.toString();let r;this._modelProperties.has(o)?r=this._modelProperties.get(o):(r=new Map,this._modelProperties.set(o,r)),r.set(t,n)}getModelProperty(e,t){const n=e.toString();if(this._modelProperties.has(n))return this._modelProperties.get(n).get(t)}openCodeEditor(e,t,n){return oct(this,void 0,void 0,function*(){for(const o of this._codeEditorOpenHandlers){const r=yield o(e,t,n);if(r!==null)return r}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return zt(t)}};VH=nct([ict(0,vr)],VH);var rct=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Wse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},sct=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let LP=class extends VH{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((n,o,r)=>sct(this,void 0,void 0,function*(){return o?this.doOpenEditor(o,n):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 r=t.resource.scheme;if(r===hn.http||r===hn.https)return b0e(t.resource.toString()),e}return null}const o=t.options?t.options.selection:null;if(o)if(typeof o.endLineNumber=="number"&&typeof o.endColumn=="number")e.setSelection(o),e.revealRangeInCenter(o,1);else{const r={lineNumber:o.startLineNumber,column:o.startColumn};e.setPosition(r),e.revealPositionInCenter(r,1)}return e}findModel(e,t){const n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n}};LP=rct([Wse(0,Ut),Wse(1,vr)],LP);Mn(Jn,LP,0);const LS=yn("layoutService");var h1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},f1e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let EP=class{get dimension(){return this._dimension||(this._dimension=bS(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=st.None,this.offset={top:0,quickPickTop:0}}};EP=h1e([f1e(0,Jn)],EP);let HH=class extends EP{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};HH=h1e([f1e(1,Jn)],HH);Mn(LS,EP,1);const iT=yn("dialogService");var act=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},k2=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function I2(i){return i.scheme===hn.file?i.fsPath:i.path}let g1e=0;class T2{constructor(e,t,n,o,r,s,a){this.id=++g1e,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=o,this.groupOrder=r,this.sourceId=s,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Hse{constructor(e,t){this.resourceLabel=e,this.reason=t}}class $se{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,o]of this.elements)(o.reason===0?e:t).push(o.resourceLabel);const n=[];return e.length>0&&n.push(C({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&&n.push(C({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.join(` +`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class lct{constructor(e,t,n,o,r,s,a){this.id=++g1e,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=n,this.groupId=o,this.groupOrder=r,this.sourceId=s,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,n){this.removedResources||(this.removedResources=new $se),this.removedResources.has(t)||this.removedResources.set(t,new Hse(e,n))}setValid(e,t,n){n?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new $se),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Hse(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class p1e{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` +`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const n of this._past)t(n.actual)&&this._setElementValidFlag(n,e);for(const n of this._future)t(n.actual)&&this._setElementValidFlag(n,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 n=0,o=this._past.length;n=0;n--)t.push(this._future[n].id);return new a1e(e,t)}restoreSnapshot(e){const t=e.elements.length;let n=!0,o=0,r=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[o])&&(n=!1,r=0),!n&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let a=this._future.length-1;a>=0;a--,o++){const l=this._future[a];n&&(o>=t||l.id!==e.elements[o])&&(n=!1,s=a),!n&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}r!==-1&&(this._past=this._past.slice(0,r)),s!==-1&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const n of this._past)e.push(n.actual);for(const n of this._future)t.push(n.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 n=this._past.length-1;n>=0;n--)if(this._past[n]===e){t.has(this.strResource)?this._past[n]=t.get(this.strResource):this._past.splice(n,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let n=this._future.length-1;n>=0;n--)if(this._future[n]===e){t.has(this.strResource)?this._future[n]=t.get(this.strResource):this._future.splice(n,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 D9{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,n=this.editStacks.length;tt.sourceOrder)&&(t=s,n=o)}return[t,n]}canUndo(e){if(e instanceof Fh){const[,n]=this._findClosestUndoElementWithSource(e.id);return!!n}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){en(e);for(const n of t.strResources)this.removeElements(n);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,n,o,r){const s=this._acquireLocks(n);let a;try{a=t()}catch(l){return s(),o.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),o.dispose(),r()),l=>(s(),o.dispose(),this._onError(l,e))):(s(),o.dispose(),r())}_invokeWorkspacePrepare(e){return k2(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo=="undefined")return _e.None;const t=e.actual.prepareUndoRedo();return typeof t=="undefined"?_e.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo=="undefined")return t(_e.None);const n=e.actual.prepareUndoRedo();return n?$q(n)?t(n):n.then(o=>t(o)):t(_e.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||m1e);return new D9(t)}_tryToSplitAndUndo(e,t,n,o){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.warn(o),new N2(this._undo(e,0,!0));for(const r of t.strResources)this.removeElements(r);return this._notificationService.warn(o),new N2}_checkWorkspaceUndo(e,t,n,o){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,C({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(o&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,C({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 r=[];for(const a of n.editStacks)a.getClosestPastElement()!==t&&r.push(a.resourceLabel);if(r.length>0)return this._tryToSplitAndUndo(e,t,null,C({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,r.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,C({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,s.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,C({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,n){const o=this._getAffectedEditStacks(t),r=this._checkWorkspaceUndo(e,t,o,!1);return r?r.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,o,n)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const n=t.getClosestPastElement();if(!!n){if(n===e){const o=t.getSecondClosestPastElement();if(o&&o.groupId===e.groupId)return!0}if(n.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,n,o){return k2(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:So.Info,message:C("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:C({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",n.editStacks.length),run:()=>a.All},{label:C({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,n,!1);if(c)return c.returnValue;o=!0}let r;try{r=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,n,!0);if(s)return r.dispose(),s.returnValue;for(const a of n.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,r,()=>this._continueUndoInGroup(t.groupId,o))})}_resourceUndo(e,t,n){if(!t.isValid){e.flushAllElements();return}if(e.locked){const o=C({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(o);return}return this._invokeResourcePrepare(t,o=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new D9([e]),o,()=>this._continueUndoInGroup(t.groupId,n))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestPastElement();!s||s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,n=o)}return[t,n]}_continueUndoInGroup(e,t){if(!e)return;const[,n]=this._findClosestUndoElementInGroup(e);if(n)return this._undo(n,0,t)}undo(e){if(e instanceof Fh){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,n){if(!this._editStacks.has(e))return;const o=this._editStacks.get(e),r=o.getClosestPastElement();if(!r)return;if(r.groupId){const[a,l]=this._findClosestUndoElementInGroup(r.groupId);if(r!==a&&l)return this._undo(l,t,n)}if((r.sourceId!==t||r.confirmBeforeUndo)&&!n)return this._confirmAndContinueUndo(e,t,r);try{return r.type===1?this._workspaceUndo(e,r,n):this._resourceUndo(o,r,n)}finally{}}_confirmAndContinueUndo(e,t,n){return k2(this,void 0,void 0,function*(){if(!!(yield this._dialogService.confirm({message:C("confirmDifferentSource","Would you like to undo '{0}'?",n.label),primaryButton:C({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:C("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestFutureElement();!s||s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,C({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,r.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,C({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,s.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,C({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 n=this._getAffectedEditStacks(t),o=this._checkWorkspaceRedo(e,t,n,!1);return o?o.returnValue:this._executeWorkspaceRedo(e,t,n)}_executeWorkspaceRedo(e,t,n){return k2(this,void 0,void 0,function*(){let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const r=this._checkWorkspaceRedo(e,t,n,!0);if(r)return o.dispose(),r.returnValue;for(const s of n.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),n,o,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=C({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(n);return}return this._invokeResourcePrepare(t,n=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new D9([e]),n,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestFutureElement();!s||s.groupId===e&&(!t||s.groupOrderrX(i,t))}function dct(i){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.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},i=i.with({fragment:""})),{selection:e,uri:i}}var uct=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Use=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const qc=yn("ILanguageFeatureDebounceService");var DP;(function(i){const e=new WeakMap;let t=0;function n(o){let r=e.get(o);return r===void 0&&(r=++t,e.set(o,r)),r}i.of=n})(DP||(DP={}));class hct{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class fct{constructor(e,t,n,o,r,s){this._logService=e,this._name=t,this._registry=n,this._default=o,this._min=r,this._max=s,this._cache=new Qv(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,n)=>u5(DP.of(n),t),0)}get(e){const t=this._key(e),n=this._cache.get(t);return n?Za(n.value,this._min,this._max):this.default()}update(e,t){const n=this._key(e);let o=this._cache.get(n);o||(o=new cct(6),this._cache.set(n,o));const r=Za(o.update(t),this._min,this._max);return rX(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${r}ms`),r}_overall(){const e=new v1e;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Za(e,this._min,this._max)}}let zH=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,n){var o,r,s;const a=(o=n==null?void 0:n.min)!==null&&o!==void 0?o:50,l=(r=n==null?void 0:n.max)!==null&&r!==void 0?r:Math.pow(a,2),c=(s=n==null?void 0:n.key)!==null&&s!==void 0?s:void 0,d=`${DP.of(e)},${a}${c?","+c:""}`;let u=this._data.get(d);return u||(this._isDev?u=new fct(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),u=new hct(a*1.5)),this._data.set(d,u)),u}_overallAverage(){const e=new v1e;for(const t of this._data.values())e.update(t.default());return e.value}};zH=uct([Use(0,nc),Use(1,oX)],zH);Mn(qc,zH,1);class DE{static create(e,t){return new DE(e,new kP(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 V(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,n,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber,[o,r,s]=this._tokens.split(t,e.startColumn-1,n,e.endColumn-1);return[new DE(this._startLineNumber,o),new DE(this._startLineNumber+s,r)]}applyEdit(e,t){const[n,o,r]=Tv(t);this.acceptEdit(e,n,o,r,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,n,o,r){this._acceptDeleteRange(e),this._acceptInsertText(new ae(e.startLineNumber,e.startColumn),t,n,o,r),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;if(n<0){const r=n-t;this._startLineNumber-=r;return}const o=this._tokens.getMaxDeltaLine();if(!(t>=o+1)){if(t<0&&n>=o+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const r=-t;this._startLineNumber-=r,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,n,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,n,e.endColumn-1)}}_acceptInsertText(e,t,n,o,r){if(t===0&&n===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,n,o,r)}}class kP{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let n=0;ne)n=o-1;else{let s=o;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=o;for(;ae||h===e&&g>=t)&&(he||g===e&&v>=t){if(gr?p-=r-n:p=n;else if(f===t&&g===n)if(f===o&&p>r)p-=r-n;else{d=!0;continue}else if(fr)f=t,g=n,p=g+(p-r);else{d=!0;continue}else if(f>o){if(l===0&&!d){c=a;break}f-=l}else if(f===o&&g>=r)e&&f===0&&(g+=e,p+=e),f-=l,g-=r-n,p-=r-n;else throw new Error("Not possible!");const m=4*c;s[m]=f,s[m+1]=g,s[m+2]=p,s[m+3]=v,c++}this._tokenCount=c}acceptInsertText(e,t,n,o,r,s){const a=n===0&&o===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let d=0;d=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},k9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let UH=class{constructor(e,t,n,o){this._legend=e,this._themeService=t,this._languageService=n,this._logService=o,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new vg}getMetadata(e,t,n){const o=this._languageService.languageIdCodec.encodeLanguageId(n),r=this._hashTable.get(e,t,o);let s;if(r)s=r.metadata,this._logService.getLevel()===ns.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${is.getForeground(s)}, fontStyle ${is.getFontStyle(s).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()===ns.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,n);typeof d=="undefined"?s=2147483647:(s=0,typeof d.italic!="undefined"&&(s|=(d.italic?1:0)<<11|1),typeof d.bold!="undefined"&&(s|=(d.bold?2:0)<<11|2),typeof d.underline!="undefined"&&(s|=(d.underline?4:0)<<11|4),typeof d.strikethrough!="undefined"&&(s|=(d.strikethrough?8:0)<<11|8),d.foreground&&(s|=d.foreground<<15|16),s===0&&(s=2147483647))}else this._logService.getLevel()===ns.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,o,s),this._logService.getLevel()===ns.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${is.getForeground(s)}, fontStyle ${is.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,n,o,r){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${o} is outside the previous data (length ${r}).`))}};UH=gct([k9(1,vr),k9(2,Ki),k9(3,nc)],UH);function _1e(i,e,t){const n=i.data,o=i.data.length/5|0,r=Math.max(Math.ceil(o/1024),400),s=[];let a=0,l=1,c=0;for(;ad&&n[5*_]===0;)_--;if(_-1===d){let y=u;for(;y+1D)e.warnOverlappingSemanticTokens(L,D+1);else{const A=e.getMetadata(k,R,t);A!==2147483647&&(g===0&&(g=L),h[f]=L-g,h[f+1]=D,h[f+2]=I,h[f+3]=A,f+=4,p=L,v=I)}l=L,c=D,a++}f!==h.length&&(h=h.subarray(0,f));const m=DE.create(g,h);s.push(m)}return s}class pct{constructor(e,t,n,o){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=n,this.metadata=o,this.next=null}}class vg{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=vg._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const r=this._elements;this._currentLengthIndex++,this._currentLength=vg._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},I9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let jH=class extends _e{constructor(e,t,n){super(),this._themeService=e,this._logService=t,this._languageService=n,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 UH(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};jH=mct([I9(0,vr),I9(1,nc),I9(2,Ki)],jH);Mn(I5,jH,1);var Kse=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const R2="**",qse="/",mM="[/\\\\]",vM="[^/\\\\]",vct=/\//g;function Gse(i,e){switch(i){case 0:return"";case 1:return`${vM}*?`;default:return`(?:${mM}|${vM}+${mM}${e?`|${mM}${vM}+`:""})*?`}}function Xse(i,e){if(!i)return[];const t=[];let n=!1,o=!1,r="";for(const s of i){switch(s){case e:if(!n&&!o){t.push(r),r="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}r+=s}return r&&t.push(r),t}function b1e(i){if(!i)return"";let e="";const t=Xse(i,qse);if(t.every(n=>n===R2))e=".*";else{let n=!1;t.forEach((o,r)=>{if(o===R2){if(n)return;e+=Gse(2,r===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const d of o){if(d!=="}"&&s){a+=d;continue}if(l&&(d!=="]"||!c)){let u;d==="-"?u=d:(d==="^"||d==="!")&&!c?u="^":d===qse?u="":u=Xl(d),c+=u;continue}switch(d){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{e+=`(?:${Xse(a,",").map(f=>b1e(f)).join("|")})`,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=vM;continue;case"*":e+=Gse(1);continue;default:e+=Xl(d)}}rsX(a,e)).filter(a=>a!==df),i),n=t.length;if(!n)return df;if(n===1)return t[0];const o=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);r&&(o.allBasenames=r.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function Jse(i,e,t){const n=Bu===Go.sep,o=n?i:i.replace(vct,Bu),r=Bu+o,s=Go.sep+i;let a;return t?a=function(l,c){return typeof l=="string"&&(l===o||l.endsWith(r)||!n&&(l===i||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===o||!n&&l===i)?e:null},a.allPaths=[(t?"*/":"./")+i],a}function Dct(i){try{const e=new RegExp(`^${b1e(i)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?i:null}}catch{return df}}function kct(i,e,t){return!i||typeof e!="string"?!1:C1e(i)(e,void 0,t)}function C1e(i,e={}){if(!i)return Zse;if(typeof i=="string"||Ict(i)){const t=sX(i,e);if(t===df)return Zse;const n=function(o,r){return!!t(o,r)};return t.allBasenames&&(n.allBasenames=t.allBasenames),t.allPaths&&(n.allPaths=t.allPaths),n}return Tct(i,e)}function Ict(i){const e=i;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Tct(i,e){const t=y1e(Object.getOwnPropertyNames(i).map(a=>Nct(a,i[a],e)).filter(a=>a!==df)),n=t.length;if(!n)return df;if(!t.some(a=>!!a.requiresSiblings)){if(n===1)return t[0];const a=function(d,u){let h;for(let f=0,g=t.length;fKse(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 o=function(a,l,c){let d,u;for(let h=0,f=t.length;hKse(this,void 0,void 0,function*(){for(const h of u){const f=yield h;if(typeof f=="string")return f}return null}))():null},r=t.find(a=>!!a.allBasenames);r&&(o.allBasenames=r.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function Nct(i,e,t){if(e===!1)return df;const n=sX(i,t);if(n===df)return df;if(typeof e=="boolean")return n;if(e){const o=e.when;if(typeof o=="string"){const r=(s,a,l,c)=>{if(!c||!n(s,a))return null;const d=o.replace("$(basename)",()=>l),u=c(d);return QV(u)?u.then(h=>h?i:null):u?i:null};return r.requiresSiblings=!0,r}}return n}function y1e(i,e){const t=i.filter(a=>!!a.basenames);if(t.length<2)return i;const n=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let o;if(e){o=[];for(let a=0,l=n.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const r=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=n.indexOf(l);return c!==-1?o[c]:null};r.basenames=n,r.patterns=o,r.allBasenames=n;const s=i.filter(a=>!a.basenames);return s.push(r),s}function w1e(i,e,t,n,o,r){if(Array.isArray(i)){let s=0;for(const a of i){const l=w1e(a,e,t,n,o,r);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof i=="string")return n?i==="*"?5:i===t?10:0:0;if(i){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=i;if(!n&&!c)return 0;d&&o&&(e=o);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(s)if(s===t)u=10;else if(s==="*")u=Math.max(u,5);else return 0;if(d)if(d===r)u=10;else if(d==="*"&&r!==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:A_e(a.base)}),h===e.fsPath||kct(h,e.fsPath))u=10;else return 0}return u}else return 0}}function S1e(i){return typeof i=="string"?!1:Array.isArray(i)?i.every(S1e):!!i.exclusive}class eae{constructor(e,t,n,o){this.uri=e,this.languageId=t,this.notebookUri=n,this.notebookType=o}equals(e){var t,n;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())===((n=e.notebookUri)===null||n===void 0?void 0:n.toString())}}class fo{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new le,this.onDidChange=this._onDidChange.event}register(e,t){let n={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(n),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),zt(()=>{if(n){const o=this._entries.indexOf(n);o>=0&&(this._entries.splice(o,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const n of this._entries)n._score>0&&t.push(n.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,n=>t.push(n.provider)),t}orderedGroups(e){const t=[];let n,o;return this._orderedForEach(e,r=>{n&&o===r._score?n.push(r.provider):(o=r._score,n=[r.provider],t.push(n))}),t}_orderedForEach(e,t){this._updateScores(e);for(const n of this._entries)n._score>0&&t(n)}_updateScores(e){var t,n;const o=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),r=o?new eae(e.uri,e.getLanguageId(),o.uri,o.type):new eae(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((n=this._lastCandidate)===null||n===void 0)&&n.equals(r))){this._lastCandidate=r;for(const s of this._entries)if(s._score=w1e(s.selector,r.uri,r.languageId,wet(e),r.notebookUri,r.notebookType),S1e(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(fo._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:NL(e.selector)&&!NL(t.selector)?1:!NL(e.selector)&&NL(t.selector)?-1:e._timet._time?-1:0}}function NL(i){return typeof i=="string"?!1:Array.isArray(i)?i.some(NL):Boolean(i.isBuiltin)}class Rct{constructor(){this.referenceProvider=new fo(this._score.bind(this)),this.renameProvider=new fo(this._score.bind(this)),this.codeActionProvider=new fo(this._score.bind(this)),this.definitionProvider=new fo(this._score.bind(this)),this.typeDefinitionProvider=new fo(this._score.bind(this)),this.declarationProvider=new fo(this._score.bind(this)),this.implementationProvider=new fo(this._score.bind(this)),this.documentSymbolProvider=new fo(this._score.bind(this)),this.inlayHintsProvider=new fo(this._score.bind(this)),this.colorProvider=new fo(this._score.bind(this)),this.codeLensProvider=new fo(this._score.bind(this)),this.documentFormattingEditProvider=new fo(this._score.bind(this)),this.documentRangeFormattingEditProvider=new fo(this._score.bind(this)),this.onTypeFormattingEditProvider=new fo(this._score.bind(this)),this.signatureHelpProvider=new fo(this._score.bind(this)),this.hoverProvider=new fo(this._score.bind(this)),this.documentHighlightProvider=new fo(this._score.bind(this)),this.selectionRangeProvider=new fo(this._score.bind(this)),this.foldingRangeProvider=new fo(this._score.bind(this)),this.linkProvider=new fo(this._score.bind(this)),this.inlineCompletionsProvider=new fo(this._score.bind(this)),this.completionProvider=new fo(this._score.bind(this)),this.linkedEditingRangeProvider=new fo(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new fo(this._score.bind(this)),this.documentSemanticTokensProvider=new fo(this._score.bind(this)),this.documentOnDropEditProvider=new fo(this._score.bind(this)),this.documentPasteEditProvider=new fo(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Mn(pt,Rct,1);const oT=yn("IWorkspaceEditService");class aX{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Gg.is(t))return Gg.lift(t);if(My.is(t))return My.lift(t);throw new Error("Unsupported edit")})}}class Gg extends aX{static is(e){return e instanceof Gg?!0:ia(e)&&Rt.isUri(e.resource)&&ia(e.textEdit)}static lift(e){return e instanceof Gg?e:new Gg(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,n=void 0,o){super(o),this.resource=e,this.textEdit=t,this.versionId=n}}class My extends aX{static is(e){return e instanceof My?!0:ia(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof My?e:new My(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,n={},o){super(o),this.oldResource=e,this.newResource=t,this.options=n}}const As={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},T5=Object.freeze({id:"editor",order:5,type:"object",title:C("editorConfigurationTitle","Editor"),scope:5}),IP=Object.assign(Object.assign({},T5),{properties:{"editor.tabSize":{type:"number",default:vs.tabSize,minimum:1,markdownDescription:C("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:C("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:vs.insertSpaces,markdownDescription:C("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:vs.detectIndentation,markdownDescription:C("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:vs.trimAutoWhitespace,description:C("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:vs.largeFileOptimizations,description:C("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:C("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[C("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),C("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),C("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:C("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[C("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),C("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),C("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:C("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:C("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:C("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:C("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:C("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:C("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:C("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:C("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:C("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:C("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:As.maxComputationTime,description:C("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:As.maxFileSize,description:C("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:As.renderSideBySide,description:C("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:As.renderSideBySideInlineBreakpoint,description:C("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:As.useInlineViewWhenSpaceIsLimited,description:C("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:As.renderMarginRevertIcon,description:C("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:As.ignoreTrimWhitespace,description:C("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:As.renderIndicators,description:C("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:As.diffCodeLens,description:C("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:As.diffWordWrap,markdownEnumDescriptions:[C("wordWrap.off","Lines will never wrap."),C("wordWrap.on","Lines will wrap at the viewport width."),C("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:As.diffAlgorithm,markdownEnumDescriptions:[C("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),C("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:As.hideUnchangedRegions.enabled,markdownDescription:C("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:As.hideUnchangedRegions.revealLineCount,markdownDescription:C("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:As.hideUnchangedRegions.minimumLineCount,markdownDescription:C("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:As.hideUnchangedRegions.contextLineCount,markdownDescription:C("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:As.experimental.showMoves,markdownDescription:C("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:As.experimental.showEmptyDecorations,description:C("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function Mct(i){return typeof i.type!="undefined"||typeof i.anyOf!="undefined"}for(const i of IC){const e=i.schema;if(typeof e!="undefined")if(Mct(e))IP.properties[`editor.${i.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(IP.properties[t]=e[t])}let M2=null;function x1e(){return M2===null&&(M2=Object.create(null),Object.keys(IP.properties).forEach(i=>{M2[i]=!0})),M2}function Act(i){return x1e()[`editor.${i}`]||!1}function Pct(i){return x1e()[`diffEditor.${i}`]||!1}const Oct=no.as(ch.Configuration);Oct.registerConfiguration(IP);class Gi{static insert(e,t){return{range:new V(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 N9(i){return Object.isFrozen(i)?i:yXe(i)}class ps{constructor(e={},t=[],n=[],o){this._contents=e,this._keys=t,this._overrides=n,this.raw=o,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(n=>{if(n instanceof ps)return n;const o=new Fct("");return o.parseRaw(n),o.configurationModel});this._rawConfiguration=t.reduce((n,o)=>o===n?o:n.merge(o),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?$oe(this.contents,e):this.contents}inspect(e,t){const n=this.rawConfiguration.getValue(e),o=t?this.rawConfiguration.getOverrideValue(e,t):void 0,r=t?this.rawConfiguration.override(t).getValue(e):n;return{value:n,override:o,merged:r}}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?$oe(n,e):n: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,n;const o=gg(this.contents),r=gg(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((n=l.raw)===null||n===void 0)&&n.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(o,l.contents);for(const c of l.overrides){const[d]=r.filter(u=>Lo(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=bv(d.keys)):r.push(gg(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new ps(o,s,r,a.every(l=>l instanceof ps)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const n={};for(const o of bv([...Object.keys(this.contents),...Object.keys(t)])){let r=this.contents[o];const s=t[o];s&&(typeof r=="object"&&typeof s=="object"?(r=gg(r),this.mergeContents(r,s)):r=s),n[o]=r}return new ps(n,this.keys,this.overrides)}mergeContents(e,t){for(const n of Object.keys(t)){if(n in e&&ia(e[n])&&ia(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=gg(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null;const o=r=>{r&&(n?this.mergeContents(n,r):n=gg(r))};for(const r of this.overrides)r.identifiers.length===1&&r.identifiers[0]===e?t=r.contents:r.identifiers.includes(e)&&o(r.contents);return o(t),n}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),FJe(this.contents,e),Ev.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>Lo(n.identifiers,QA(e))),1))}updateValue(e,t,n){A0e(this.contents,e,t,o=>console.error(o)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),Ev.test(e)&&this.overrides.push({identifiers:QA(e),keys:Object.keys(this.contents[e]),contents:tH(this.contents[e],o=>console.error(o))})}}class Fct{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new ps}parseRaw(e,t){this._raw=e;const{contents:n,keys:o,overrides:r,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new ps(n,o,r,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const n=no.as(ch.Configuration).getConfigurationProperties(),o=this.filter(e,n,!0,t);e=o.raw;const r=tH(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:r,keys:s,overrides:a,restricted:o.restricted,hasExcludedProperties:o.hasExcludedProperties}}filter(e,t,n,o){var r,s,a;let l=!1;if(!(o!=null&&o.scopes)&&!(o!=null&&o.skipRestricted)&&!(!((r=o==null?void 0:o.exclude)===null||r===void 0)&&r.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},d=[];for(const u in e)if(Ev.test(u)&&n){const h=this.filter(e[u],t,!1,o);c[u]=h.raw,l=l||h.hasExcludedProperties,d.push(...h.restricted)}else{const h=t[u],f=h?typeof h.scope!="undefined"?h.scope:3:void 0;h!=null&&h.restricted&&d.push(u),!(!((s=o.exclude)===null||s===void 0)&&s.includes(u))&&(((a=o.include)===null||a===void 0?void 0:a.includes(u))||(f===void 0||o.scopes===void 0||o.scopes.includes(f))&&!(o.skipRestricted&&(h==null?void 0:h.restricted)))?c[u]=e[u]:l=!0}return{raw:c,restricted:d,hasExcludedProperties:l}}toOverrides(e,t){const n=[];for(const o of Object.keys(e))if(Ev.test(o)){const r={};for(const s in e[o])r[s]=e[o][s];n.push({identifiers:QA(o),keys:Object.keys(r),contents:tH(r,t)})}return n}}class Bct{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=o,this.defaultConfiguration=r,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=u,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}inspect(e,t,n){const o=e.inspect(t,n);return{get value(){return N9(o.value)},get override(){return N9(o.override)},get merged(){return N9(o.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 N5{constructor(e,t,n,o,r=new ps,s=new ps,a=new _s,l=new ps,c=new _s){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=o,this._remoteUserConfiguration=r,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new _s,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let o;n.resource?(o=this._memoryConfigurationByResource.get(n.resource),o||(o=new ps,this._memoryConfigurationByResource.set(n.resource,o))):o=this._memoryConfiguration,t===void 0?o.removeValue(e):o.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const o=this.getConsolidatedConfigurationModel(e,t,n),r=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of o.overrides)for(const c of l.identifiers)o.getOverrideValue(e,c)!==void 0&&a.add(c);return new Bct(e,t,o.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,n?this._workspaceConfiguration:void 0,r||void 0,s)}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,n){let o=this.getConsolidatedConfigurationModelForResource(t,n);return t.overrideIdentifier&&(o=o.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(o=o.merge(this._policyConfiguration)),o}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const o=t.getFolder(e);o&&(n=this.getFolderConsolidatedConfiguration(o.uri)||n);const r=this._memoryConfigurationByResource.get(e);r&&(n=n.merge(r))}return n}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 n=this.getWorkspaceConsolidatedConfiguration(),o=this._folderConfigurations.get(e);o?(t=n.merge(o),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.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:n,overrides:o,keys:r}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:o,keys:r}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.policy),o=this.parseConfigurationModel(e.application),r=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Rt.revive(c[0]),this.parseConfigurationModel(c[1])),l),new _s);return new N5(t,n,o,r,new ps,s,a,new ps,new _s)}static parseConfigurationModel(e){return new ps(e.contents,e.keys,e.overrides)}}class Wct{constructor(e,t,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=o,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const s of r)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=N5.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var n;const o=this._marker+e,r=this._affectsConfigStr.indexOf(o);if(r<0)return!1;const s=r+o.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(n=this.previous)===null||n===void 0?void 0:n.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!ql(l,c)}return!0}}const TP={kind:0},Vct={kind:1};function Hct(i,e,t){return{kind:2,commandId:i,commandArgs:e,isBubble:t}}class kE{constructor(e,t,n){var o;this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const r of e){const s=r.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=kE.handleRemovals([].concat(e).concat(t));for(let r=0,s=this._keybindings.length;r=0;o--){const r=n[o];if(r.command===t.command)continue;let s=!0;for(let a=1;a=0;o--){const r=n[o];if(t.contextMatchesRules(r.when))return r}return n[n.length-1]}resolve(e,t,n){const o=[...t,n];this._log(`| Resolving ${o}`);const r=this._map.get(o[0]);if(r===void 0)return this._log("\\ No keybinding entries."),TP;let s=null;if(o.length<2)s=r;else{s=[];for(let l=0,c=r.length;ld.chords.length)continue;let u=!0;for(let h=1;h=0;n--){const o=t[n];if(!!kE._contextMatchesRules(e,o.when))return o}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function tae(i){return i?`${i.serialize()}`:"no when condition"}function nae(i){return i.extensionId?i.isBuiltinExtension?`built-in extension ${i.extensionId}`:`user extension ${i.extensionId}`:i.isDefault?"built-in":"user"}const $ct=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class zct extends _e{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:st.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,o,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=o,this._logService=r,this._onDidUpdateKeybindings=this._register(new le),this._currentChords=[],this._currentChordChecker=new UI,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=UC.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new zd,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(!!n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),TP;const[o]=n.getDispatchChords();if(o===null)return this._log("\\ Keyboard event cannot be dispatched"),TP;const r=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(r,s,o)}_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 Hq("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(C("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:o})=>o).join(", ");this._currentChordStatusMessage=this._notificationService.status(C("next.chord","({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),gE.enabled&&gE.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],gE.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[o]=n.getSingleModifierDispatchChords();if(o)return this._ignoreSingleModifiers.has(o)?(this._log(`+ Ignoring single modifier ${o} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=UC.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=UC.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${o}.`),this._currentSingleModifier=o,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):o===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${o} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[r]=n.getChords();return this._ignoreSingleModifiers=new UC(r),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){var o;let r=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(n){const[u]=e.getSingleModifierDispatchChords();s=u,a=u?[u]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:u})=>u);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),r;const l=this._contextKeyService.getContext(t),c=e.getLabel(),d=this._getResolver().resolve(l,a,s);switch(d.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(C("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}return r}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),r=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),r;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${d.commandId} ]`),d.commandId===null||d.commandId===""){if(this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(C("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}}else this.inChordMode&&this._leaveChordMode(),d.isBubble||(r=!0),this._log(`+ Invoking command ${d.commandId}.`),typeof d.commandArgs=="undefined"?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)),$ct.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding",detail:(o=e.getUserSettingsLabel())!==null&&o!==void 0?o:void 0});return r}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class UC{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}}}UC.EMPTY=new UC(null);class iae{constructor(e,t,n,o,r,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?KH(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=KH(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=o,this.isDefault=r,this.extensionId=s,this.isBuiltinExtension=a}}function KH(i){const e=[];for(let t=0,n=i.length;tthis._getLabel(e))}getAriaLabel(){return Uct.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:jct.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return Kct.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 YZe(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 fk extends Gct{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"\u2190";case 16:return"\u2191";case 17:return"\u2192";case 18:return"\u2193"}return xg.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":xg.toString(e.keyCode)}_getElectronAccelerator(e){return xg.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=xg.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return fk.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+=xg.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=qq[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 dp)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new dp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=KH(e.chords.map(o=>this._toKeyCodeChord(o)));return n.length>0?[new fk(n,t)]:[]}}const Rw=yn("labelService"),L1e=yn("progressService");Object.freeze({total(){},worked(){},done(){}});class Xg{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)})}}Xg.None=Object.freeze({report(){}});const t_=yn("editorProgressService");class Xct{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 n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Ay(new Qct(e,t))}static forStrings(){return new Ay(new Xct)}static forConfigKeys(){return new Ay(new Yct)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let o;this._root||(this._root=new A2,this._root.segment=n.value());const r=[];for(o=this._root;;){const a=n.cmp(o.segment);if(a>0)o.left||(o.left=new A2,o.left.segment=n.value()),r.push([-1,o]),o=o.left;else if(a<0)o.right||(o.right=new A2,o.right.segment=n.value()),r.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new A2,o.mid.segment=n.value()),r.push([0,o]),o=o.mid;else break}const s=o.value;o.value=t,o.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=r[a][0],u=r[a+1][0];if(d===1&&u===1)r[a][1]=l.rotateLeft();else if(d===-1&&u===-1)r[a][1]=l.rotateRight();else if(d===1&&u===-1)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(d===-1&&u===1)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return s}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 n=this._root;for(;n;){const o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}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 n;const o=this._iter.reset(e),r=[];let s=this._root;for(;s;){const a=o.cmp(s.segment);if(a>0)r.push([-1,s]),s=s.left;else if(a<0)r.push([1,s]),s=s.right;else if(o.hasNext())o.next(),r.push([0,s]),s=s.mid;else break}if(!!s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const a=this._min(s.right);if(a.key){const{key:l,value:c,segment:d}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=d}}else{const a=(n=s.left)!==null&&n!==void 0?n:s.right;if(r.length>0){const[l,c]=r[r.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=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),r[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),r[a][1]=l.rotateRight()),a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let n=this._root,o;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),o=n.value||o,n=n.mid;else break}return n&&n.value||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let o=this._root;for(;o;){const r=n.cmp(o.segment);if(r>0)o=o.left;else if(r<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):t?o.value:void 0}}forEach(e){for(const[t,n]of this)e(n,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 rb=yn("contextService");function qH(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Rt.isUri(e.uri)}function Jct(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&!qH(i)&&!idt(i)}const edt={id:"ext-dev"},tdt={id:"empty-window"};function ndt(i,e){if(typeof i=="string"||typeof i=="undefined")return typeof i=="string"?{id:Gm(i)}:e?edt:tdt;const t=i;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 idt(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Rt.isUri(e.configPath)}class odt{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 GH="code-workspace";C("codeWorkspace","Code Workspace");const E1e="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function rdt(i){return i.id===E1e}var XH;(function(i){i.inspectTokensAction=C("inspectTokens","Developer: Inspect Tokens")})(XH||(XH={}));var NP;(function(i){i.gotoLineActionLabel=C("gotoLineActionLabel","Go to Line/Column...")})(NP||(NP={}));var YH;(function(i){i.helpQuickAccessActionLabel=C("helpQuickAccess","Show all Quick Access Providers")})(YH||(YH={}));var RP;(function(i){i.quickCommandActionLabel=C("quickCommandActionLabel","Command Palette"),i.quickCommandHelp=C("quickCommandActionHelp","Show And Run Commands")})(RP||(RP={}));var gk;(function(i){i.quickOutlineActionLabel=C("quickOutlineActionLabel","Go to Symbol..."),i.quickOutlineByCategoryActionLabel=C("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(gk||(gk={}));var MP;(function(i){i.editorViewAccessibleLabel=C("editorViewAccessibleLabel","Editor content"),i.accessibilityHelpMessage=C("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(MP||(MP={}));var ZH;(function(i){i.toggleHighContrast=C("toggleHighContrast","Toggle High Contrast Theme")})(ZH||(ZH={}));var QH;(function(i){i.bulkEditServiceSummary=C("bulkEditServiceSummary","Made {0} edits in {1} files")})(QH||(QH={}));const D1e=yn("workspaceTrustManagementService"),Cp=yn("contextViewService"),Kd=yn("contextMenuService");var fs;(function(i){function e(r,s){if(r.start>=s.end||s.start>=r.end)return{start:0,end:0};const a=Math.max(r.start,s.start),l=Math.min(r.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}i.intersect=e;function t(r){return r.end-r.start<=0}i.isEmpty=t;function n(r,s){return!t(e(r,s))}i.intersects=n;function o(r,s){const a=[],l={start:r.start,end:Math.min(s.start,r.end)},c={start:Math.max(s.end,r.start),end:r.end};return t(l)||a.push(l),t(c)||a.push(c),a}i.relativeComplement=o})(fs||(fs={}));function sdt(i){const e=i;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Im;(function(i){i[i.AVOID=0]="AVOID",i[i.ALIGN=1]="ALIGN"})(Im||(Im={}));function jC(i,e,t){const n=t.mode===Im.ALIGN?t.offset:t.offset+t.size,o=t.mode===Im.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=i-n?n:e<=o?o-e:Math.max(i-e,0):e<=o?o-e:e<=i-n?n:0}class Mw extends _e{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=_e.None,this.toDisposeOnSetContainer=_e.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=He(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Js(this.view),this.setContainer(e,t),this._register(zt(()=>this.setContainer(null,1)))}setContainer(e,t){var n;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(n=this.shadowRootHostElement)===null||n===void 0||n.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=He(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const r=document.createElement("style");r.textContent=adt,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(He("slot"))}else this.container.appendChild(this.view);const o=new Be;Mw.BUBBLE_UP_EVENTS.forEach(r=>{o.add(No(this.container,r,s=>{this.onDOMEvent(s,!1)}))}),Mw.BUBBLE_DOWN_EVENTS.forEach(r=>{o.add(No(this.container,r,s=>{this.onDOMEvent(s,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,n;this.isVisible()&&this.hide(),Ur(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",nl(this.view),this.toDisposeOnClean=e.render(this.view)||_e.None,this.delegate=e,this.doLayout(),(n=(t=this.delegate).focus)===null||n===void 0||n.call(t)}getViewElement(){return this.view}layout(){if(!!this.isVisible()){if(this.delegate.canRelayout===!1&&!(Ku&&sG.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(lG(e)){const u=Yo(e),h=$Qe(e);t={top:u.top*h,left:u.left*h,width:u.width*h,height:u.height*h}}else sdt(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 n=Ea(this.view),o=h0(this.view),r=this.delegate.anchorPosition||0,s=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:r===0?0:1},h={offset:t.left,size:t.width,position:s===0?0:1,mode:Im.ALIGN};l=jC(window.innerHeight,o,u)+window.pageYOffset,fs.intersects({start:l,end:l+o},{start:u.offset,end:u.offset+u.size})&&(h.mode=Im.AVOID),c=jC(window.innerWidth,n,h)}else{const u={offset:t.left,size:t.width,position:s===0?0:1},h={offset:t.top,size:t.height,position:r===0?0:1,mode:Im.ALIGN};c=jC(window.innerWidth,n,u),fs.intersects({start:c,end:c+n},{start:u.offset,end:u.offset+u.size})&&(h.mode=Im.AVOID),l=jC(window.innerHeight,o,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(r===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Yo(this.container);this.view.style.top=`${l-(this.useFixedPosition?Yo(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Yo(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(),Js(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!rs(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Mw.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Mw.BUBBLE_DOWN_EVENTS=["click"];const adt=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -517,12 +517,12 @@ Received: '{1}'.`,e,Mh.getLexeme(t)),r=t.offset,s=Mh.getLexeme(t);return this._p :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } -`;var sdt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},adt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let QH=class extends _e{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=_e.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Mw(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,n){t?(t!==this.container||this.shadowRoot!==n)&&(this.container=t,this.setContainer(t,n?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=n,this.contextView.show(e);const o=zt(()=>{this.currentViewDisposable===o&&this.hideContextView()});return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};QH=sdt([adt(0,LS)],QH);let Aw=[],lX=[],k1e=[];function P2(i,e=!1){ldt(i,!1,e)}function ldt(i,e,t){const n=cdt(i,e);Aw.push(n),n.userConfigured?k1e.push(n):lX.push(n),t&&!n.userConfigured&&Aw.forEach(o=>{o.mime===n.mime||o.userConfigured||(n.extension&&o.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&o.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&o.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&o.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function cdt(i,e){return{id:i.id,mime:i.mime,filename:i.filename,extension:i.extension,filepattern:i.filepattern,firstline:i.firstline,userConfigured:e,filenameLowercase:i.filename?i.filename.toLowerCase():void 0,extensionLowercase:i.extension?i.extension.toLowerCase():void 0,filepatternLowercase:i.filepattern?C1e(i.filepattern.toLowerCase()):void 0,filepatternOnPath:i.filepattern?i.filepattern.indexOf(Go.sep)>=0:!1}}function ddt(){Aw=Aw.filter(i=>i.userConfigured),lX=[]}function udt(i,e){return hdt(i,e).map(t=>t.id)}function hdt(i,e){let t;if(i)switch(i.scheme){case hn.file:t=i.fsPath;break;case hn.data:{t=Nv.parseMetaData(i).get(Nv.META_DATA_LABEL);break}case hn.vscodeNotebookCell:t=void 0;break;default:t=i.path}if(!t)return[{id:"unknown",mime:xo.unknown}];t=t.toLowerCase();const n=qm(t),o=iae(t,n,k1e);if(o)return[o,{id:Gl,mime:xo.text}];const r=iae(t,n,lX);if(r)return[r,{id:Gl,mime:xo.text}];if(e){const s=fdt(e);if(s)return[s,{id:Gl,mime:xo.text}]}return[{id:"unknown",mime:xo.unknown}]}function iae(i,e,t){var n;let o,r,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){o=l;break}if(l.filepattern&&(!r||l.filepattern.length>r.filepattern.length)){const c=l.filepatternOnPath?i:e;!((n=l.filepatternLowercase)===null||n===void 0)&&n.call(l,c)&&(r=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(o)return o;if(r)return r;if(s)return s}function fdt(i){if(eG(i)&&(i=i.substr(1)),i.length>0)for(let e=Aw.length-1;e>=0;e--){const t=Aw[e];if(!t.firstline)continue;const n=i.match(t.firstline);if(n&&n.length>0)return t}}const O2=Object.prototype.hasOwnProperty,oae="vs.editor.nullLanguage";class gdt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(oae,0),this._register(Gl,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]||oae}}class pk extends _e{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,pk.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new gdt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Cw.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){pk.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},ddt();const e=[].concat(Cw.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 n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(o=>{this._lowercaseNameMap[o.toLowerCase()]=n.identifier}),n.mimetypes.forEach(o=>{this._mimeTypesMap[o]=n.identifier})}),no.as(ch.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;O2.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let o=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),o=t.mimetypes[0]),o||(o=`text/x-${n}`,e.mimetypes.push(o)),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)P2({id:n,mime:o,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)P2({id:n,mime:o,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)P2({id:n,mime:o,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);gZe(l)||P2({id:n,mime:o,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let r=null;if(typeof t.aliases!="undefined"&&Array.isArray(t.aliases)&&(t.aliases.length===0?r=[null]:r=t.aliases),r!==null)for(const a of r)!a||a.length===0||e.aliases.push(a);const s=r!==null&&r.length>0;if(!(s&&r[0]===null)){const a=(s?r[0]:null)||n;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?O2.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return O2.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&O2.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:udt(e,t)}}pk.instanceCount=0;class mk extends _e{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new le),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new le),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new le({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,mk.instanceCount++,this._registry=this._register(new pk(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){mk.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 n=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return d_e(n,null)}createById(e){return new rae(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new rae(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Gl),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),oo.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}mk.instanceCount=0;class rae{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 le({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 vk={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:xo.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function cX(...i){return function(e,t){for(let n=0,o=i.length;n0?[{start:0,end:e.length}]:[]:null}function T1e(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t===-1?null:[{start:t,end:t+i.length}]}function N1e(i,e){return JH(i.toLowerCase(),e.toLowerCase(),0,0)}function JH(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]===e[n]){let o=null;return(o=JH(i,e,t+1,n+1))?hX({start:n,end:n+1},o):null}return JH(i,e,t,n+1)}function dX(i){return 97<=i&&i<=122}function R5(i){return 65<=i&&i<=90}function uX(i){return 48<=i&&i<=57}function R1e(i){return i===32||i===9||i===10||i===13}const M1e=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(i=>M1e.add(i.charCodeAt(0)));function AP(i){return R1e(i)||M1e.has(i)}function pdt(i,e){return i===e||AP(i)&&AP(e)}function A1e(i){return dX(i)||R5(i)||uX(i)}function hX(i,e){return e.length===0?e=[i]:i.end===e[0].start?e[0].start=i.start:e.unshift(i),e}function P1e(i,e){for(let t=e;t0&&!A1e(i.charCodeAt(t-1)))return t}return i.length}function e$(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]!==e[n].toLowerCase())return null;{let o=null,r=n+1;for(o=e$(i,e,t+1,n+1);!o&&(r=P1e(e,r)).6}function _dt(i){const{upperPercent:e,lowerPercent:t,alphaPercent:n,numericPercent:o}=i;return t>.2&&e<.8&&n>.6&&o<.2}function bdt(i){let e=0,t=0,n=0,o=0;for(let r=0;r60)return null;const t=mdt(e);if(!_dt(t)){if(!vdt(t))return null;e=e.toLowerCase()}let n=null,o=0;for(i=i.toLowerCase();o0&&AP(i.charCodeAt(t-1)))return t;return i.length}const ydt=cX(_k,O1e,T1e),wdt=cX(_k,O1e,N1e),sae=new Qv(1e4);function aae(i,e,t=!1){if(typeof i!="string"||typeof e!="string")return null;let n=sae.get(i);n||(n=new RegExp(hZe(i),"i"),sae.set(i,n));const o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:t?wdt(i,e):ydt(i,e)}function Sdt(i,e){const t=sb(i,i.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?rT(t):null}function xdt(i,e,t,n,o,r){const s=Math.min(13,i.length);for(;t1;n--){const o=i[n]+t,r=e[e.length-1];r&&r.end===o?r.end=o+1:e.push({start:o,end:o+1})}return e}const Im=128;function fX(){const i=[],e=[];for(let t=0;t<=Im;t++)e[t]=0;for(let t=0;t<=Im;t++)i.push(e.slice(0));return i}function B1e(i){const e=[];for(let t=0;t<=i;t++)e[t]=0;return e}const W1e=B1e(2*Im),n$=B1e(2*Im),Jf=fX(),b_=fX(),F2=fX();function B2(i,e){if(e<0||e>=i.length)return!1;const t=i.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!!Jq(t)}}function lae(i,e){if(e<0||e>=i.length)return!1;switch(i.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function _M(i,e,t){return e[i]!==t[i]}function Ldt(i,e,t,n,o,r,s=!1){for(;eIm?Im:i.length,l=n.length>Im?Im:n.length;if(t>=a||r>=l||a-t>l-r||!Ldt(e,t,a,o,r,l,!0))return;Edt(a,l,t,r,e,o);let c=1,d=1,u=t,h=r;const f=[!1];for(c=1,u=t;u_,k=I?b_[c][d-1]+(Jf[c][d-1]>0?-5:0):0,R=h>_+1&&Jf[c][d-1]>0,A=R?b_[c][d-2]+(Jf[c][d-2]>0?-5:0):0;if(R&&(!I||A>=k)&&(!D||A>=E))b_[c][d]=A,F2[c][d]=3,Jf[c][d]=0;else if(I&&(!D||k>=E))b_[c][d]=k,F2[c][d]=2,Jf[c][d]=0;else if(D)b_[c][d]=E,F2[c][d]=1,Jf[c][d]=Jf[c-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,d--;const g=[b_[c][d],r];let p=0,v=0;for(;c>=1;){let _=d;do{const y=F2[c][_];if(y===3)_=_-2;else if(y===2)_=_-1;else break}while(_>=1);p>1&&e[t+c-1]===o[r+d-1]&&!_M(_+r-1,n,o)&&p+1>Jf[c][_]&&(_=d),_===d?p++:p=1,v||(v=_),c--,d=_-1,g.push(d)}l===a&&s.boostFullMatch&&(g[0]+=2);const m=v-a;return g[0]-=m,g}function Edt(i,e,t,n,o,r){let s=i-1,a=e-1;for(;s>=t&&a>=n;)o[s]===r[a]&&(n$[s]=a,s--),a--}function Ddt(i,e,t,n,o,r,s,a,l,c,d){if(e[t]!==r[s])return Number.MIN_SAFE_INTEGER;let u=1,h=!1;return s===t-n?u=i[t]===o[s]?7:5:_M(s,o,r)&&(s===0||!_M(s-1,o,r))?(u=i[t]===o[s]?7:5,h=!0):B2(r,s)&&(s===0||!B2(r,s-1))?u=5:(B2(r,s-1)||lae(r,s-1))&&(u=5,h=!0),u>1&&t===n&&(d[0]=!0),h||(h=_M(s,o,r)||B2(r,s-1)||lae(r,s-1)),t===n?s>l&&(u-=h?3:5):c?u+=h?2:0:u+=h?0:1,s+1===a&&(u-=h?3:5),u}function kdt(i,e,t,n,o,r,s){return Idt(i,e,t,n,o,r,!0,s)}function Idt(i,e,t,n,o,r,s,a){let l=sb(i,e,t,n,o,r,a);if(l&&!s)return l;if(i.length>=3){const c=Math.min(7,i.length-1);for(let d=t+1;dl[0])&&(l=h))}}}return l}function Tdt(i,e){if(e+1>=i.length)return;const t=i[e],n=i[e+1];if(t!==n)return i.slice(0,e)+n+t+i.slice(e+2)}const Ndt="$(",gX=new RegExp(`\\$\\(${Mt.iconNameExpression}(?:${Mt.iconModifierExpression})?\\)`,"g"),Rdt=new RegExp(`(\\\\)?${gX.source}`,"g");function Mdt(i){return i.replace(Rdt,(e,t)=>t?e:`\\${e}`)}const Adt=new RegExp(`\\\\${gX.source}`,"g");function Pdt(i){return i.replace(Adt,e=>`\\${e}`)}const Odt=new RegExp(`(\\s)?(\\\\)?${gX.source}(\\s)?`,"g");function pX(i){return i.indexOf(Ndt)===-1?i:i.replace(Odt,(e,t,n,o)=>n?e:t||o||"")}function Fdt(i){return i?i.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const N9=new RegExp(`\\$\\(${Mt.iconNameCharacter}+\\)`,"g");function RL(i){N9.lastIndex=0;let e="";const t=[];let n=0;for(;;){const o=N9.lastIndex,r=N9.exec(i),s=i.substring(o,r==null?void 0:r.index);if(s.length>0){e+=s;for(let a=0;a" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`;var ldt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},cdt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let JH=class extends _e{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=_e.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Mw(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,n){t?(t!==this.container||this.shadowRoot!==n)&&(this.container=t,this.setContainer(t,n?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=n,this.contextView.show(e);const o=zt(()=>{this.currentViewDisposable===o&&this.hideContextView()});return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};JH=ldt([cdt(0,LS)],JH);let Aw=[],cX=[],k1e=[];function P2(i,e=!1){ddt(i,!1,e)}function ddt(i,e,t){const n=udt(i,e);Aw.push(n),n.userConfigured?k1e.push(n):cX.push(n),t&&!n.userConfigured&&Aw.forEach(o=>{o.mime===n.mime||o.userConfigured||(n.extension&&o.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&o.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&o.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&o.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function udt(i,e){return{id:i.id,mime:i.mime,filename:i.filename,extension:i.extension,filepattern:i.filepattern,firstline:i.firstline,userConfigured:e,filenameLowercase:i.filename?i.filename.toLowerCase():void 0,extensionLowercase:i.extension?i.extension.toLowerCase():void 0,filepatternLowercase:i.filepattern?C1e(i.filepattern.toLowerCase()):void 0,filepatternOnPath:i.filepattern?i.filepattern.indexOf(Go.sep)>=0:!1}}function hdt(){Aw=Aw.filter(i=>i.userConfigured),cX=[]}function fdt(i,e){return gdt(i,e).map(t=>t.id)}function gdt(i,e){let t;if(i)switch(i.scheme){case hn.file:t=i.fsPath;break;case hn.data:{t=Nv.parseMetaData(i).get(Nv.META_DATA_LABEL);break}case hn.vscodeNotebookCell:t=void 0;break;default:t=i.path}if(!t)return[{id:"unknown",mime:xo.unknown}];t=t.toLowerCase();const n=Gm(t),o=oae(t,n,k1e);if(o)return[o,{id:Gl,mime:xo.text}];const r=oae(t,n,cX);if(r)return[r,{id:Gl,mime:xo.text}];if(e){const s=pdt(e);if(s)return[s,{id:Gl,mime:xo.text}]}return[{id:"unknown",mime:xo.unknown}]}function oae(i,e,t){var n;let o,r,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){o=l;break}if(l.filepattern&&(!r||l.filepattern.length>r.filepattern.length)){const c=l.filepatternOnPath?i:e;!((n=l.filepatternLowercase)===null||n===void 0)&&n.call(l,c)&&(r=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(o)return o;if(r)return r;if(s)return s}function pdt(i){if(tG(i)&&(i=i.substr(1)),i.length>0)for(let e=Aw.length-1;e>=0;e--){const t=Aw[e];if(!t.firstline)continue;const n=i.match(t.firstline);if(n&&n.length>0)return t}}const O2=Object.prototype.hasOwnProperty,rae="vs.editor.nullLanguage";class mdt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(rae,0),this._register(Gl,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]||rae}}class pk extends _e{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,pk.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new mdt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Cw.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){pk.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},hdt();const e=[].concat(Cw.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 n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(o=>{this._lowercaseNameMap[o.toLowerCase()]=n.identifier}),n.mimetypes.forEach(o=>{this._mimeTypesMap[o]=n.identifier})}),no.as(ch.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;O2.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let o=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),o=t.mimetypes[0]),o||(o=`text/x-${n}`,e.mimetypes.push(o)),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)P2({id:n,mime:o,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)P2({id:n,mime:o,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)P2({id:n,mime:o,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);mZe(l)||P2({id:n,mime:o,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let r=null;if(typeof t.aliases!="undefined"&&Array.isArray(t.aliases)&&(t.aliases.length===0?r=[null]:r=t.aliases),r!==null)for(const a of r)!a||a.length===0||e.aliases.push(a);const s=r!==null&&r.length>0;if(!(s&&r[0]===null)){const a=(s?r[0]:null)||n;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?O2.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return O2.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&O2.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:fdt(e,t)}}pk.instanceCount=0;class mk extends _e{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new le),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new le),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new le({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,mk.instanceCount++,this._registry=this._register(new pk(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){mk.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 n=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return d_e(n,null)}createById(e){return new sae(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new sae(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Gl),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),oo.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}mk.instanceCount=0;class sae{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 le({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 vk={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:xo.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function dX(...i){return function(e,t){for(let n=0,o=i.length;n0?[{start:0,end:e.length}]:[]:null}function T1e(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t===-1?null:[{start:t,end:t+i.length}]}function N1e(i,e){return e$(i.toLowerCase(),e.toLowerCase(),0,0)}function e$(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]===e[n]){let o=null;return(o=e$(i,e,t+1,n+1))?fX({start:n,end:n+1},o):null}return e$(i,e,t,n+1)}function uX(i){return 97<=i&&i<=122}function M5(i){return 65<=i&&i<=90}function hX(i){return 48<=i&&i<=57}function R1e(i){return i===32||i===9||i===10||i===13}const M1e=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(i=>M1e.add(i.charCodeAt(0)));function AP(i){return R1e(i)||M1e.has(i)}function vdt(i,e){return i===e||AP(i)&&AP(e)}function A1e(i){return uX(i)||M5(i)||hX(i)}function fX(i,e){return e.length===0?e=[i]:i.end===e[0].start?e[0].start=i.start:e.unshift(i),e}function P1e(i,e){for(let t=e;t0&&!A1e(i.charCodeAt(t-1)))return t}return i.length}function t$(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]!==e[n].toLowerCase())return null;{let o=null,r=n+1;for(o=t$(i,e,t+1,n+1);!o&&(r=P1e(e,r)).6}function Cdt(i){const{upperPercent:e,lowerPercent:t,alphaPercent:n,numericPercent:o}=i;return t>.2&&e<.8&&n>.6&&o<.2}function ydt(i){let e=0,t=0,n=0,o=0;for(let r=0;r60)return null;const t=_dt(e);if(!Cdt(t)){if(!bdt(t))return null;e=e.toLowerCase()}let n=null,o=0;for(i=i.toLowerCase();o0&&AP(i.charCodeAt(t-1)))return t;return i.length}const Sdt=dX(_k,O1e,T1e),xdt=dX(_k,O1e,N1e),aae=new Qv(1e4);function lae(i,e,t=!1){if(typeof i!="string"||typeof e!="string")return null;let n=aae.get(i);n||(n=new RegExp(gZe(i),"i"),aae.set(i,n));const o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:t?xdt(i,e):Sdt(i,e)}function Ldt(i,e){const t=sb(i,i.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?rT(t):null}function Edt(i,e,t,n,o,r){const s=Math.min(13,i.length);for(;t1;n--){const o=i[n]+t,r=e[e.length-1];r&&r.end===o?r.end=o+1:e.push({start:o,end:o+1})}return e}const Tm=128;function gX(){const i=[],e=[];for(let t=0;t<=Tm;t++)e[t]=0;for(let t=0;t<=Tm;t++)i.push(e.slice(0));return i}function B1e(i){const e=[];for(let t=0;t<=i;t++)e[t]=0;return e}const W1e=B1e(2*Tm),i$=B1e(2*Tm),Jf=gX(),b_=gX(),F2=gX();function B2(i,e){if(e<0||e>=i.length)return!1;const t=i.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!!eG(t)}}function cae(i,e){if(e<0||e>=i.length)return!1;switch(i.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function _M(i,e,t){return e[i]!==t[i]}function Ddt(i,e,t,n,o,r,s=!1){for(;eTm?Tm:i.length,l=n.length>Tm?Tm:n.length;if(t>=a||r>=l||a-t>l-r||!Ddt(e,t,a,o,r,l,!0))return;kdt(a,l,t,r,e,o);let c=1,d=1,u=t,h=r;const f=[!1];for(c=1,u=t;u_,k=I?b_[c][d-1]+(Jf[c][d-1]>0?-5:0):0,R=h>_+1&&Jf[c][d-1]>0,A=R?b_[c][d-2]+(Jf[c][d-2]>0?-5:0):0;if(R&&(!I||A>=k)&&(!D||A>=E))b_[c][d]=A,F2[c][d]=3,Jf[c][d]=0;else if(I&&(!D||k>=E))b_[c][d]=k,F2[c][d]=2,Jf[c][d]=0;else if(D)b_[c][d]=E,F2[c][d]=1,Jf[c][d]=Jf[c-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,d--;const g=[b_[c][d],r];let p=0,v=0;for(;c>=1;){let _=d;do{const y=F2[c][_];if(y===3)_=_-2;else if(y===2)_=_-1;else break}while(_>=1);p>1&&e[t+c-1]===o[r+d-1]&&!_M(_+r-1,n,o)&&p+1>Jf[c][_]&&(_=d),_===d?p++:p=1,v||(v=_),c--,d=_-1,g.push(d)}l===a&&s.boostFullMatch&&(g[0]+=2);const m=v-a;return g[0]-=m,g}function kdt(i,e,t,n,o,r){let s=i-1,a=e-1;for(;s>=t&&a>=n;)o[s]===r[a]&&(i$[s]=a,s--),a--}function Idt(i,e,t,n,o,r,s,a,l,c,d){if(e[t]!==r[s])return Number.MIN_SAFE_INTEGER;let u=1,h=!1;return s===t-n?u=i[t]===o[s]?7:5:_M(s,o,r)&&(s===0||!_M(s-1,o,r))?(u=i[t]===o[s]?7:5,h=!0):B2(r,s)&&(s===0||!B2(r,s-1))?u=5:(B2(r,s-1)||cae(r,s-1))&&(u=5,h=!0),u>1&&t===n&&(d[0]=!0),h||(h=_M(s,o,r)||B2(r,s-1)||cae(r,s-1)),t===n?s>l&&(u-=h?3:5):c?u+=h?2:0:u+=h?0:1,s+1===a&&(u-=h?3:5),u}function Tdt(i,e,t,n,o,r,s){return Ndt(i,e,t,n,o,r,!0,s)}function Ndt(i,e,t,n,o,r,s,a){let l=sb(i,e,t,n,o,r,a);if(l&&!s)return l;if(i.length>=3){const c=Math.min(7,i.length-1);for(let d=t+1;dl[0])&&(l=h))}}}return l}function Rdt(i,e){if(e+1>=i.length)return;const t=i[e],n=i[e+1];if(t!==n)return i.slice(0,e)+n+t+i.slice(e+2)}const Mdt="$(",pX=new RegExp(`\\$\\(${Mt.iconNameExpression}(?:${Mt.iconModifierExpression})?\\)`,"g"),Adt=new RegExp(`(\\\\)?${pX.source}`,"g");function Pdt(i){return i.replace(Adt,(e,t)=>t?e:`\\${e}`)}const Odt=new RegExp(`\\\\${pX.source}`,"g");function Fdt(i){return i.replace(Odt,e=>`\\${e}`)}const Bdt=new RegExp(`(\\s)?(\\\\)?${pX.source}(\\s)?`,"g");function mX(i){return i.indexOf(Mdt)===-1?i:i.replace(Bdt,(e,t,n,o)=>n?e:t||o||"")}function Wdt(i){return i?i.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const R9=new RegExp(`\\$\\(${Mt.iconNameCharacter}+\\)`,"g");function RL(i){R9.lastIndex=0;let e="";const t=[];let n=0;for(;;){const o=R9.lastIndex,r=R9.exec(i),s=i.substring(o,r==null?void 0:r.index);if(s.length>0){e+=s;for(let a=0;a" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=` -`,this.value+=t,this.value+="\n```\n",this}appendLink(e,t,n){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,t){const n=new RegExp(Xl(t),"g");return e.replace(n,(o,r)=>e.charAt(r-1)!=="\\"?`\\${o}`:o)}}function Pw(i){return Qm(i)?!i.value:Array.isArray(i)?i.every(Pw):!0}function Qm(i){return i instanceof os?!0:i&&typeof i=="object"?typeof i.value=="string"&&(typeof i.isTrusted=="boolean"||typeof i.isTrusted=="object"||i.isTrusted===void 0)&&(typeof i.supportThemeIcons=="boolean"||i.supportThemeIcons===void 0):!1}function Bdt(i,e){return i===e?!0:!i||!e?!1:i.value===e.value&&i.isTrusted===e.isTrusted&&i.supportThemeIcons===e.supportThemeIcons&&i.supportHtml===e.supportHtml&&(i.baseUri===e.baseUri||!!i.baseUri&&!!e.baseUri&&$G(Rt.from(i.baseUri),Rt.from(e.baseUri)))}function Wdt(i){return i.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function W2(i){return i.replace(/"/g,""")}function M9(i){return i&&i.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Vdt(i){const e=[],t=i.split("|").map(o=>o.trim());i=t[0];const n=t[1];if(n){const o=/height=(\d+)/.exec(n),r=/width=(\d+)/.exec(n),s=o?o[1]:"",a=r?r[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(s));l&&e.push(`width="${a}"`),c&&e.push(`height="${s}"`)}return{href:i,dimensions:e}}var i$=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Hdt(i,e){la(e)?i.title=pX(e):e!=null&&e.markdownNotSupportedFallback?i.title=e.markdownNotSupportedFallback:i.removeAttribute("title")}class $dt{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}update(e,t,n){var o;return i$(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let r;if(e===void 0||la(e)||e instanceof HTMLElement)r=e;else if(!ID(e.markdown))r=(o=e.markdown)!==null&&o!==void 0?o:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(C("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Ro;const s=this._cancellationTokenSource.token;if(r=yield e.markdown(s),r===void 0&&(r=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(r,t,n)})}show(e,t,n){const o=this._hoverWidget;if(this.hasContent(e)){const r=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!o},n);this._hoverWidget=this.hoverDelegate.showHover(r,t)}o==null||o.dispose()}hasContent(e){return e?Qm(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 V1e(i,e,t,n){let o,r;const s=(u,h)=>{var f;const g=r!==void 0;u&&(r==null||r.dispose(),r=void 0),h&&(o==null||o.dispose(),o=void 0),g&&((f=i.onDidHideHover)===null||f===void 0||f.call(i))},a=(u,h,f)=>new zd(()=>i$(this,void 0,void 0,function*(){(!r||r.isDisposed)&&(r=new $dt(i,f||e,u>0),yield r.update(t,h,n))}),u),l=()=>{if(o)return;const u=new Be,h=p=>s(!1,p.fromElement===e);u.add(ke(e,et.MOUSE_LEAVE,h,!0));const f=()=>s(!0,!0);u.add(ke(e,et.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(i.placement===void 0||i.placement==="mouse"){const p=v=>{g.x=v.x+10,v.target instanceof HTMLElement&&v.target.classList.contains("action-label")&&s(!0,!0)};u.add(ke(e,et.MOUSE_MOVE,p,!0))}u.add(a(i.delay,!1,g)),o=u},c=ke(e,et.MOUSE_OVER,l,!0);return{show:u=>{s(!1,!0),a(0,u)},hide:()=>{s(!0,!0)},update:(u,h)=>i$(this,void 0,void 0,function*(){t=u,yield r==null?void 0:r.update(t,void 0,h)}),dispose:()=>{c.dispose(),s(!0,!0)}}}function zdt(i,e={}){const t=mX(e);return t.textContent=i,t}function Udt(i,e={}){const t=mX(e);return H1e(t,Kdt(i,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function mX(i){const e=i.inline?"span":"div",t=document.createElement(e);return i.className&&(t.className=i.className),t}class jdt{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 H1e(i,e,t,n){let o;if(e.type===2)o=document.createTextNode(e.content||"");else if(e.type===3)o=document.createElement("b");else if(e.type===4)o=document.createElement("i");else if(e.type===7&&n)o=document.createElement("code");else if(e.type===5&&t){const r=document.createElement("a");t.disposables.add(No(r,"click",s=>{t.callback(String(e.index),s)})),o=r}else e.type===8?o=document.createElement("br"):e.type===1&&(o=i);o&&i!==o&&i.appendChild(o),o&&Array.isArray(e.children)&&e.children.forEach(r=>{H1e(o,r,t,n)})}function Kdt(i,e){const t={type:1,children:[]};let n=0,o=t;const r=[],s=new jdt(i);for(;!s.eos();){let a=s.next();const l=a==="\\"&&o$(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&qdt(a,e)&&a===s.peek()){s.advance(),o.type===2&&(o=r.pop());const c=o$(a,e);if(o.type===c||o.type===5&&c===6)o=r.pop();else{const d={type:c,children:[]};c===5&&(d.index=n,n++),o.children.push(d),r.push(o),o=d}}else if(a===` -`)o.type===2&&(o=r.pop()),o.children.push({type:8});else if(o.type!==2){const c={type:2,content:a};o.children.push(c),r.push(o),o=c}else o.content+=a}return o.type===2&&(o=r.pop()),t}function qdt(i,e){return o$(i,e)!==0}function o$(i,e){switch(i){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const Gdt=new RegExp(`(\\\\)?\\$\\((${Mt.iconNameExpression}(?:${Mt.iconModifierExpression})?)\\)`,"g");function Jm(i){const e=new Array;let t,n=0,o=0;for(;(t=Gdt.exec(i))!==null;){o=t.index||0,nre.length)&&(ie=re.length);for(var se=0,U=new Array(ie);se=re.length?{done:!0}:{done:!1,value:re[U++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +`,this.value+=t,this.value+="\n```\n",this}appendLink(e,t,n){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,t){const n=new RegExp(Xl(t),"g");return e.replace(n,(o,r)=>e.charAt(r-1)!=="\\"?`\\${o}`:o)}}function Pw(i){return Jm(i)?!i.value:Array.isArray(i)?i.every(Pw):!0}function Jm(i){return i instanceof os?!0:i&&typeof i=="object"?typeof i.value=="string"&&(typeof i.isTrusted=="boolean"||typeof i.isTrusted=="object"||i.isTrusted===void 0)&&(typeof i.supportThemeIcons=="boolean"||i.supportThemeIcons===void 0):!1}function Vdt(i,e){return i===e?!0:!i||!e?!1:i.value===e.value&&i.isTrusted===e.isTrusted&&i.supportThemeIcons===e.supportThemeIcons&&i.supportHtml===e.supportHtml&&(i.baseUri===e.baseUri||!!i.baseUri&&!!e.baseUri&&zG(Rt.from(i.baseUri),Rt.from(e.baseUri)))}function Hdt(i){return i.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function W2(i){return i.replace(/"/g,""")}function A9(i){return i&&i.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function $dt(i){const e=[],t=i.split("|").map(o=>o.trim());i=t[0];const n=t[1];if(n){const o=/height=(\d+)/.exec(n),r=/width=(\d+)/.exec(n),s=o?o[1]:"",a=r?r[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(s));l&&e.push(`width="${a}"`),c&&e.push(`height="${s}"`)}return{href:i,dimensions:e}}var o$=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function zdt(i,e){la(e)?i.title=mX(e):e!=null&&e.markdownNotSupportedFallback?i.title=e.markdownNotSupportedFallback:i.removeAttribute("title")}class Udt{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}update(e,t,n){var o;return o$(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let r;if(e===void 0||la(e)||e instanceof HTMLElement)r=e;else if(!ID(e.markdown))r=(o=e.markdown)!==null&&o!==void 0?o:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(C("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Ro;const s=this._cancellationTokenSource.token;if(r=yield e.markdown(s),r===void 0&&(r=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(r,t,n)})}show(e,t,n){const o=this._hoverWidget;if(this.hasContent(e)){const r=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!o},n);this._hoverWidget=this.hoverDelegate.showHover(r,t)}o==null||o.dispose()}hasContent(e){return e?Jm(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 V1e(i,e,t,n){let o,r;const s=(u,h)=>{var f;const g=r!==void 0;u&&(r==null||r.dispose(),r=void 0),h&&(o==null||o.dispose(),o=void 0),g&&((f=i.onDidHideHover)===null||f===void 0||f.call(i))},a=(u,h,f)=>new zd(()=>o$(this,void 0,void 0,function*(){(!r||r.isDisposed)&&(r=new Udt(i,f||e,u>0),yield r.update(t,h,n))}),u),l=()=>{if(o)return;const u=new Be,h=p=>s(!1,p.fromElement===e);u.add(ke(e,et.MOUSE_LEAVE,h,!0));const f=()=>s(!0,!0);u.add(ke(e,et.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(i.placement===void 0||i.placement==="mouse"){const p=v=>{g.x=v.x+10,v.target instanceof HTMLElement&&v.target.classList.contains("action-label")&&s(!0,!0)};u.add(ke(e,et.MOUSE_MOVE,p,!0))}u.add(a(i.delay,!1,g)),o=u},c=ke(e,et.MOUSE_OVER,l,!0);return{show:u=>{s(!1,!0),a(0,u)},hide:()=>{s(!0,!0)},update:(u,h)=>o$(this,void 0,void 0,function*(){t=u,yield r==null?void 0:r.update(t,void 0,h)}),dispose:()=>{c.dispose(),s(!0,!0)}}}function jdt(i,e={}){const t=vX(e);return t.textContent=i,t}function Kdt(i,e={}){const t=vX(e);return H1e(t,Gdt(i,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function vX(i){const e=i.inline?"span":"div",t=document.createElement(e);return i.className&&(t.className=i.className),t}class qdt{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 H1e(i,e,t,n){let o;if(e.type===2)o=document.createTextNode(e.content||"");else if(e.type===3)o=document.createElement("b");else if(e.type===4)o=document.createElement("i");else if(e.type===7&&n)o=document.createElement("code");else if(e.type===5&&t){const r=document.createElement("a");t.disposables.add(No(r,"click",s=>{t.callback(String(e.index),s)})),o=r}else e.type===8?o=document.createElement("br"):e.type===1&&(o=i);o&&i!==o&&i.appendChild(o),o&&Array.isArray(e.children)&&e.children.forEach(r=>{H1e(o,r,t,n)})}function Gdt(i,e){const t={type:1,children:[]};let n=0,o=t;const r=[],s=new qdt(i);for(;!s.eos();){let a=s.next();const l=a==="\\"&&r$(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&Xdt(a,e)&&a===s.peek()){s.advance(),o.type===2&&(o=r.pop());const c=r$(a,e);if(o.type===c||o.type===5&&c===6)o=r.pop();else{const d={type:c,children:[]};c===5&&(d.index=n,n++),o.children.push(d),r.push(o),o=d}}else if(a===` +`)o.type===2&&(o=r.pop()),o.children.push({type:8});else if(o.type!==2){const c={type:2,content:a};o.children.push(c),r.push(o),o=c}else o.content+=a}return o.type===2&&(o=r.pop()),t}function Xdt(i,e){return r$(i,e)!==0}function r$(i,e){switch(i){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const Ydt=new RegExp(`(\\\\)?\\$\\((${Mt.iconNameExpression}(?:${Mt.iconModifierExpression})?)\\)`,"g");function ev(i){const e=new Array;let t,n=0,o=0;for(;(t=Ydt.exec(i))!==null;){o=t.index||0,nre.length)&&(ie=re.length);for(var se=0,U=new Array(ie);se=re.length?{done:!0}:{done:!1,value:re[U++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(re){e.defaults=re}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(ie){return f[ie]};function p(re,ie){if(ie){if(c.test(re))return re.replace(d,g)}else if(u.test(re))return re.replace(h,g);return re}var v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function m(re){return re.replace(v,function(ie,se){return se=se.toLowerCase(),se==="colon"?":":se.charAt(0)==="#"?se.charAt(1)==="x"?String.fromCharCode(parseInt(se.substring(2),16)):String.fromCharCode(+se.substring(1)):""})}var _=/(^|[^\[])\^/g;function y(re,ie){re=typeof re=="string"?re:re.source,ie=ie||"";var se={replace:function(Y,oe){return oe=oe.source||oe,oe=oe.replace(_,"$1"),re=re.replace(Y,oe),se},getRegex:function(){return new RegExp(re,ie)}};return se}var w=/[^\w:]/g,L=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(re,ie,se){if(re){var U;try{U=decodeURIComponent(m(se)).replace(w,"").toLowerCase()}catch{return null}if(U.indexOf("javascript:")===0||U.indexOf("vbscript:")===0||U.indexOf("data:")===0)return null}ie&&!L.test(se)&&(se=A(ie,se));try{se=encodeURI(se).replace(/%25/g,"%")}catch{return null}return se}var E={},I=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,R=/^([^:]+:\/*[^/]*)[\s\S]*$/;function A(re,ie){E[" "+re]||(I.test(re)?E[" "+re]=re+"/":E[" "+re]=H(re,"/",!0)),re=E[" "+re];var se=re.indexOf(":")===-1;return ie.substring(0,2)==="//"?se?ie:re.replace(k,"$1")+ie:ie.charAt(0)==="/"?se?ie:re.replace(R,"$1")+ie:re+ie}var P={exec:function(){}};function N(re){for(var ie=1,se,U;ie=0&&ye[Te]==="\\";)Le=!Le;return Le?"|":" |"}),U=se.split(/ \|/),Y=0;if(U[0].trim()||U.shift(),U.length>0&&!U[U.length-1].trim()&&U.pop(),U.length>ie)U.splice(ie);else for(;U.length1;)ie&1&&(se+=re),ie>>=1,re+=re;return se+re}function z(re,ie,se,U){var Y=ie.href,oe=ie.title?p(ie.title):null,te=re[1].replace(/\\([\[\]])/g,"$1");if(re[0].charAt(0)!=="!"){U.state.inLink=!0;var ye={type:"link",raw:se,href:Y,title:oe,text:te,tokens:U.inlineTokens(te)};return U.state.inLink=!1,ye}return{type:"image",raw:se,href:Y,title:oe,text:p(te)}}function K(re,ie){var se=re.match(/^(\s+)(?:```)/);if(se===null)return ie;var U=se[1];return ie.split(` `).map(function(Y){var oe=Y.match(/^\s+/);if(oe===null)return Y;var te=oe[0];return te.length>=U.length?Y.slice(U.length):Y}).join(` `)}var j=function(){function re(se){this.options=se||e.defaults}var ie=re.prototype;return ie.space=function(U){var Y=this.rules.block.newline.exec(U);if(Y&&Y[0].length>0)return{type:"space",raw:Y[0]}},ie.code=function(U){var Y=this.rules.block.code.exec(U);if(Y){var oe=Y[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:Y[0],codeBlockStyle:"indented",text:this.options.pedantic?oe:H(oe,` @@ -570,16 +570,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)},ie.strong=function(U){return""+U+""},ie.em=function(U){return""+U+""},ie.codespan=function(U){return""+U+""},ie.br=function(){return this.options.xhtml?"
":"
"},ie.del=function(U){return""+U+""},ie.link=function(U,Y,oe){if(U=D(this.options.sanitize,this.options.baseUrl,U),U===null)return oe;var te='",te},ie.image=function(U,Y,oe){if(U=D(this.options.sanitize,this.options.baseUrl,U),U===null)return oe;var te=''+oe+'":">",te},ie.text=function(U){return U},re}(),Se=function(){function re(){}var ie=re.prototype;return ie.strong=function(U){return U},ie.em=function(U){return U},ie.codespan=function(U){return U},ie.del=function(U){return U},ie.html=function(U){return U},ie.text=function(U){return U},ie.link=function(U,Y,oe){return""+oe},ie.image=function(U,Y,oe){return""+oe},ie.br=function(){return""},re}(),Fe=function(){function re(){this.seen={}}var ie=re.prototype;return ie.serialize=function(U){return U.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ie.getNextSafeSlug=function(U,Y){var oe=U,te=0;if(this.seen.hasOwnProperty(oe)){te=this.seen[U];do te++,oe=U+"-"+te;while(this.seen.hasOwnProperty(oe))}return Y||(this.seen[U]=te,this.seen[oe]=0),oe},ie.slug=function(U,Y){Y===void 0&&(Y={});var oe=this.serialize(U);return this.getNextSafeSlug(oe,Y.dryrun)},re}(),De=function(){function re(se){this.options=se||e.defaults,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Fe}re.parse=function(U,Y){var oe=new re(Y);return oe.parse(U)},re.parseInline=function(U,Y){var oe=new re(Y);return oe.parseInline(U)};var ie=re.prototype;return ie.parse=function(U,Y){Y===void 0&&(Y=!0);var oe="",te,ye,Le,Te,We,je,mt,Dt,At,Je,Lt,Ot,Vn,Et,tn,di,cn,Gn,bn,Pt=U.length;for(te=0;te0&&tn.tokens[0].type==="paragraph"?(tn.tokens[0].text=Gn+" "+tn.tokens[0].text,tn.tokens[0].tokens&&tn.tokens[0].tokens.length>0&&tn.tokens[0].tokens[0].type==="text"&&(tn.tokens[0].tokens[0].text=Gn+" "+tn.tokens[0].tokens[0].text)):tn.tokens.unshift({type:"text",text:Gn}):Et+=Gn),Et+=this.parse(tn.tokens,Vn),At+=this.renderer.listitem(Et,cn,di);oe+=this.renderer.list(At,Lt,Ot);continue}case"html":{oe+=this.renderer.html(Je.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(Je.tokens));continue}case"text":{for(At=Je.tokens?this.parseInline(Je.tokens):Je.text;te+1An error occurred:

"+p(Te.message+"",!0)+"
";throw Te}try{var Le=pe.lex(re,ie);if(ie.walkTokens){if(ie.async)return Promise.all(ce.walkTokens(Le,ie.walkTokens)).then(function(){return De.parse(Le,ie)}).catch(ye);ce.walkTokens(Le,ie.walkTokens)}return De.parse(Le,ie)}catch(Te){ye(Te)}}ce.options=ce.setOptions=function(re){return N(ce.defaults,re),l(ce.defaults),ce},ce.getDefaults=a,ce.defaults=e.defaults,ce.use=function(){for(var re=arguments.length,ie=new Array(re),se=0;seAn error occurred:

"+p(U.message+"",!0)+"
";throw U}},ce.Parser=De,ce.parser=De.parse,ce.Renderer=be,ce.TextRenderer=Se,ce.Lexer=pe,ce.lexer=pe.lex,ce.Tokenizer=j,ce.Slugger=Fe,ce.parse=ce;var Pe=ce.options,Oe=ce.setOptions,xe=ce.use,Ee=ce.walkTokens,tt=ce.parseInline,nt=ce,Qe=De.parse,Ge=pe.lex;e.Lexer=pe,e.Parser=De,e.Renderer=be,e.Slugger=Fe,e.TextRenderer=Se,e.Tokenizer=j,e.getDefaults=a,e.lexer=Ge,e.marked=ce,e.options=Pe,e.parse=nt,e.parseInline=tt,e.parser=Qe,e.setOptions=Oe,e.use=xe,e.walkTokens=Ee,Object.defineProperty(e,"__esModule",{value:!0})})})();ma.Lexer||exports.Lexer;ma.Parser||exports.Parser;ma.Renderer||exports.Renderer;ma.Slugger||exports.Slugger;ma.TextRenderer||exports.TextRenderer;ma.Tokenizer||exports.Tokenizer;ma.getDefaults||exports.getDefaults;ma.lexer||exports.lexer;var Bh=ma.marked||exports.marked;ma.options||exports.options;ma.parse||exports.parse;ma.parseInline||exports.parseInline;ma.parser||exports.parser;ma.setOptions||exports.setOptions;ma.use||exports.use;ma.walkTokens||exports.walkTokens;function Xdt(i){return JSON.stringify(i,Ydt)}function a$(i){let e=JSON.parse(i);return e=l$(e),e}function Ydt(i,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function l$(i,e=0){if(!i||e>200)return i;if(typeof i=="object"){switch(i.$mid){case 1:return Rt.revive(i);case 2:return new RegExp(i.source,i.flags);case 17:return new Date(i.source)}if(i instanceof s5||i instanceof Uint8Array)return i;if(Array.isArray(i))for(let t=0;t{let n=[],o=[];return i&&({href:i,dimensions:n}=Vdt(i),o.push(`src="${W2(i)}"`)),t&&o.push(`alt="${W2(t)}"`),e&&o.push(`title="${W2(e)}"`),n.length&&(o=o.concat(n)),""},paragraph:i=>`

${i}

`,link:(i,e,t)=>typeof i!="string"?"":(i===t&&(t=M9(t)),e=typeof e=="string"?W2(M9(e)):"",i=M9(i),i=i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
${t}`)});function A5(i,e={},t={}){var n,o;const r=new Be;let s=!1;const a=mX(e),l=function(m){let _;try{_=a$(decodeURIComponent(m))}catch{}return _?(_=p_e(_,y=>{if(i.uris&&i.uris[y])return Rt.revive(i.uris[y])}),encodeURIComponent(JSON.stringify(_))):m},c=function(m,_){const y=i.uris&&i.uris[m];let w=Rt.revive(y);return _?m.startsWith(hn.data+":")?m:(w||(w=Rt.parse(m)),h0e.uriToBrowserUri(w).toString(!0)):!w||Rt.parse(m).toString()===w.toString()?m:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},d=new Bh.Renderer;d.image=A9.image,d.link=A9.link,d.paragraph=A9.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(m,_)=>{const y=s$.nextId(),w=e.codeBlockRendererSync(cae(_),m);return h.push([y,w]),`
${UA(m)}
`}:e.codeBlockRenderer&&(d.code=(m,_)=>{const y=s$.nextId(),w=e.codeBlockRenderer(cae(_),m);return u.push(w.then(L=>[y,L])),`
${UA(m)}
`}),e.actionHandler){const m=function(w){let L=w.target;if(!(L.tagName!=="A"&&(L=L.parentElement,!L||L.tagName!=="A")))try{let D=L.dataset.href;D&&(i.baseUri&&(D=P9(Rt.from(i.baseUri),D)),e.actionHandler.callback(D,w))}catch(D){en(D)}finally{w.preventDefault()}},_=e.actionHandler.disposables.add(new xn(a,"click")),y=e.actionHandler.disposables.add(new xn(a,"auxclick"));e.actionHandler.disposables.add(st.any(_.event,y.event)(w=>{const L=new kc(w);!L.leftButton&&!L.middleButton||m(L)})),e.actionHandler.disposables.add(ke(a,"keydown",w=>{const L=new Pi(w);!L.equals(10)&&!L.equals(3)||m(L)}))}i.supportHtml||(t.sanitizer=m=>(i.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=d;let f=(n=i.value)!==null&&n!==void 0?n:"";f.length>1e5&&(f=`${f.substr(0,1e5)}\u2026`),i.supportThemeIcons&&(f=Pdt(f));let g;if(e.fillInIncompleteTokens){const m=Object.assign(Object.assign({},Bh.defaults),t),_=Bh.lexer(f,m),y=out(_);g=Bh.parser(y,m)}else g=Bh.parse(f,t);i.supportThemeIcons&&(g=Jm(g).map(_=>typeof _=="string"?_:_.outerHTML).join(""));const v=new DOMParser().parseFromString(c$(i,g),"text/html");if(v.body.querySelectorAll("img").forEach(m=>{const _=m.getAttribute("src");if(_){let y=_;try{i.baseUri&&(y=P9(Rt.from(i.baseUri),y))}catch{}m.src=c(y,!0)}}),v.body.querySelectorAll("a").forEach(m=>{const _=m.getAttribute("href");if(m.setAttribute("href",""),!_||/^data:|javascript:/i.test(_)||/^command:/i.test(_)&&!i.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(_))m.replaceWith(...m.childNodes);else{let y=c(_,!1);i.baseUri&&(y=P9(Rt.from(i.baseUri),_)),m.dataset.href=y}}),a.innerHTML=c$(i,v.body.innerHTML),u.length>0)Promise.all(u).then(m=>{var _,y;if(s)return;const w=new Map(m),L=a.querySelectorAll("div[data-code]");for(const D of L){const E=w.get((_=D.dataset.code)!==null&&_!==void 0?_:"");E&&jr(D,E)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const m=new Map(h),_=a.querySelectorAll("div[data-code]");for(const y of _){const w=m.get((o=y.dataset.code)!==null&&o!==void 0?o:"");w&&jr(y,w)}}if(e.asyncRenderCallback)for(const m of a.getElementsByTagName("img")){const _=r.add(ke(m,"load",()=>{_.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,r.dispose()}}}function cae(i){if(!i)return"";const e=i.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:i}function P9(i,e){return/^\w[\w\d+.-]*:/.test(e)?e:i.path.endsWith("/")?ase(i,e).toString():ase(x5(i),e).toString()}function c$(i,e){const{config:t,allowedSchemes:n}=Qdt(i);c0e("uponSanitizeAttribute",(r,s)=>{if(s.attrName==="style"||s.attrName==="class"){if(r.tagName==="SPAN"){if(s.attrName==="style"){s.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(s.attrValue);return}else if(s.attrName==="class"){s.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(s.attrValue);return}}s.keepAttr=!1;return}});const o=YQe(n);try{return l0e(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{d0e("uponSanitizeAttribute"),o.dispose()}}const Zdt=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function Qdt(i){const e=[hn.http,hn.https,hn.mailto,hn.data,hn.file,hn.vscodeFileResource,hn.vscodeRemote,hn.vscodeRemoteResource];return i.isTrusted&&e.push(hn.command),{config:{ALLOWED_TAGS:[...ZQe],ALLOWED_ATTR:Zdt,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function Jdt(i){return typeof i=="string"?i:eut(i)}function eut(i){var e;let t=(e=i.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}\u2026`);const n=Bh.parse(t,{renderer:nut.value}).replace(/&(#\d+|[a-zA-Z]+);/g,o=>{var r;return(r=tut.get(o))!==null&&r!==void 0?r:o});return c$({isTrusted:!1},n).toString()}const tut=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),nut=new ah(()=>{const i=new Bh.Renderer;return i.code=e=>e,i.blockquote=e=>e,i.html=e=>"",i.heading=(e,t,n)=>e+` +Please report this to https://github.com/markedjs/marked.`,ie.silent)return"

An error occurred:

"+p(U.message+"",!0)+"
";throw U}},ce.Parser=De,ce.parser=De.parse,ce.Renderer=be,ce.TextRenderer=Se,ce.Lexer=pe,ce.lexer=pe.lex,ce.Tokenizer=j,ce.Slugger=Fe,ce.parse=ce;var Pe=ce.options,Oe=ce.setOptions,xe=ce.use,Ee=ce.walkTokens,tt=ce.parseInline,nt=ce,Qe=De.parse,Ge=pe.lex;e.Lexer=pe,e.Parser=De,e.Renderer=be,e.Slugger=Fe,e.TextRenderer=Se,e.Tokenizer=j,e.getDefaults=a,e.lexer=Ge,e.marked=ce,e.options=Pe,e.parse=nt,e.parseInline=tt,e.parser=Qe,e.setOptions=Oe,e.use=xe,e.walkTokens=Ee,Object.defineProperty(e,"__esModule",{value:!0})})})();ma.Lexer||exports.Lexer;ma.Parser||exports.Parser;ma.Renderer||exports.Renderer;ma.Slugger||exports.Slugger;ma.TextRenderer||exports.TextRenderer;ma.Tokenizer||exports.Tokenizer;ma.getDefaults||exports.getDefaults;ma.lexer||exports.lexer;var Bh=ma.marked||exports.marked;ma.options||exports.options;ma.parse||exports.parse;ma.parseInline||exports.parseInline;ma.parser||exports.parser;ma.setOptions||exports.setOptions;ma.use||exports.use;ma.walkTokens||exports.walkTokens;function Zdt(i){return JSON.stringify(i,Qdt)}function l$(i){let e=JSON.parse(i);return e=c$(e),e}function Qdt(i,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function c$(i,e=0){if(!i||e>200)return i;if(typeof i=="object"){switch(i.$mid){case 1:return Rt.revive(i);case 2:return new RegExp(i.source,i.flags);case 17:return new Date(i.source)}if(i instanceof a5||i instanceof Uint8Array)return i;if(Array.isArray(i))for(let t=0;t{let n=[],o=[];return i&&({href:i,dimensions:n}=$dt(i),o.push(`src="${W2(i)}"`)),t&&o.push(`alt="${W2(t)}"`),e&&o.push(`title="${W2(e)}"`),n.length&&(o=o.concat(n)),""},paragraph:i=>`

${i}

`,link:(i,e,t)=>typeof i!="string"?"":(i===t&&(t=A9(t)),e=typeof e=="string"?W2(A9(e)):"",i=A9(i),i=i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`${t}`)});function P5(i,e={},t={}){var n,o;const r=new Be;let s=!1;const a=vX(e),l=function(m){let _;try{_=l$(decodeURIComponent(m))}catch{}return _?(_=p_e(_,y=>{if(i.uris&&i.uris[y])return Rt.revive(i.uris[y])}),encodeURIComponent(JSON.stringify(_))):m},c=function(m,_){const y=i.uris&&i.uris[m];let w=Rt.revive(y);return _?m.startsWith(hn.data+":")?m:(w||(w=Rt.parse(m)),h0e.uriToBrowserUri(w).toString(!0)):!w||Rt.parse(m).toString()===w.toString()?m:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},d=new Bh.Renderer;d.image=P9.image,d.link=P9.link,d.paragraph=P9.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(m,_)=>{const y=a$.nextId(),w=e.codeBlockRendererSync(dae(_),m);return h.push([y,w]),`
${UA(m)}
`}:e.codeBlockRenderer&&(d.code=(m,_)=>{const y=a$.nextId(),w=e.codeBlockRenderer(dae(_),m);return u.push(w.then(L=>[y,L])),`
${UA(m)}
`}),e.actionHandler){const m=function(w){let L=w.target;if(!(L.tagName!=="A"&&(L=L.parentElement,!L||L.tagName!=="A")))try{let D=L.dataset.href;D&&(i.baseUri&&(D=O9(Rt.from(i.baseUri),D)),e.actionHandler.callback(D,w))}catch(D){en(D)}finally{w.preventDefault()}},_=e.actionHandler.disposables.add(new xn(a,"click")),y=e.actionHandler.disposables.add(new xn(a,"auxclick"));e.actionHandler.disposables.add(st.any(_.event,y.event)(w=>{const L=new kc(w);!L.leftButton&&!L.middleButton||m(L)})),e.actionHandler.disposables.add(ke(a,"keydown",w=>{const L=new Pi(w);!L.equals(10)&&!L.equals(3)||m(L)}))}i.supportHtml||(t.sanitizer=m=>(i.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=d;let f=(n=i.value)!==null&&n!==void 0?n:"";f.length>1e5&&(f=`${f.substr(0,1e5)}\u2026`),i.supportThemeIcons&&(f=Fdt(f));let g;if(e.fillInIncompleteTokens){const m=Object.assign(Object.assign({},Bh.defaults),t),_=Bh.lexer(f,m),y=sut(_);g=Bh.parser(y,m)}else g=Bh.parse(f,t);i.supportThemeIcons&&(g=ev(g).map(_=>typeof _=="string"?_:_.outerHTML).join(""));const v=new DOMParser().parseFromString(d$(i,g),"text/html");if(v.body.querySelectorAll("img").forEach(m=>{const _=m.getAttribute("src");if(_){let y=_;try{i.baseUri&&(y=O9(Rt.from(i.baseUri),y))}catch{}m.src=c(y,!0)}}),v.body.querySelectorAll("a").forEach(m=>{const _=m.getAttribute("href");if(m.setAttribute("href",""),!_||/^data:|javascript:/i.test(_)||/^command:/i.test(_)&&!i.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(_))m.replaceWith(...m.childNodes);else{let y=c(_,!1);i.baseUri&&(y=O9(Rt.from(i.baseUri),_)),m.dataset.href=y}}),a.innerHTML=d$(i,v.body.innerHTML),u.length>0)Promise.all(u).then(m=>{var _,y;if(s)return;const w=new Map(m),L=a.querySelectorAll("div[data-code]");for(const D of L){const E=w.get((_=D.dataset.code)!==null&&_!==void 0?_:"");E&&jr(D,E)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const m=new Map(h),_=a.querySelectorAll("div[data-code]");for(const y of _){const w=m.get((o=y.dataset.code)!==null&&o!==void 0?o:"");w&&jr(y,w)}}if(e.asyncRenderCallback)for(const m of a.getElementsByTagName("img")){const _=r.add(ke(m,"load",()=>{_.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,r.dispose()}}}function dae(i){if(!i)return"";const e=i.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:i}function O9(i,e){return/^\w[\w\d+.-]*:/.test(e)?e:i.path.endsWith("/")?lse(i,e).toString():lse(L5(i),e).toString()}function d$(i,e){const{config:t,allowedSchemes:n}=eut(i);c0e("uponSanitizeAttribute",(r,s)=>{if(s.attrName==="style"||s.attrName==="class"){if(r.tagName==="SPAN"){if(s.attrName==="style"){s.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(s.attrValue);return}else if(s.attrName==="class"){s.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(s.attrValue);return}}s.keepAttr=!1;return}});const o=QQe(n);try{return l0e(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{d0e("uponSanitizeAttribute"),o.dispose()}}const Jdt=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function eut(i){const e=[hn.http,hn.https,hn.mailto,hn.data,hn.file,hn.vscodeFileResource,hn.vscodeRemote,hn.vscodeRemoteResource];return i.isTrusted&&e.push(hn.command),{config:{ALLOWED_TAGS:[...JQe],ALLOWED_ATTR:Jdt,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function tut(i){return typeof i=="string"?i:nut(i)}function nut(i){var e;let t=(e=i.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}\u2026`);const n=Bh.parse(t,{renderer:out.value}).replace(/&(#\d+|[a-zA-Z]+);/g,o=>{var r;return(r=iut.get(o))!==null&&r!==void 0?r:o});return d$({isTrusted:!1},n).toString()}const iut=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),out=new ah(()=>{const i=new Bh.Renderer;return i.code=e=>e,i.blockquote=e=>e,i.html=e=>"",i.heading=(e,t,n)=>e+` `,i.hr=()=>"",i.list=(e,t)=>e,i.listitem=e=>e+` `,i.paragraph=e=>e+` `,i.table=(e,t)=>e+t+` `,i.tablerow=e=>e,i.tablecell=(e,t)=>e+" ",i.strong=e=>e,i.em=e=>e,i.codespan=e=>e,i.br=()=>` -`,i.del=e=>e,i.image=(e,t,n)=>"",i.text=e=>e,i.link=(e,t,n)=>n,i});function _X(i){let e="";return i.forEach(t=>{e+=t.raw}),e}function iut(i){for(const e of i.tokens)if(e.type==="text"){const t=e.raw.split(` -`),n=t[t.length-1];if(n.includes("`"))return sut(i);if(n.includes("**"))return uut(i);if(n.match(/\*\w/))return aut(i);if(n.match(/(^|\s)__\w/))return hut(i);if(n.match(/(^|\s)_\w/))return lut(i);if(n.match(/(^|\s)\[.*\]\(\w*/))return cut(i);if(n.match(/(^|\s)\[\w/))return dut(i)}}function out(i){let e,t;for(e=0;ee,i.image=(e,t,n)=>"",i.text=e=>e,i.link=(e,t,n)=>n,i});function bX(i){let e="";return i.forEach(t=>{e+=t.raw}),e}function rut(i){for(const e of i.tokens)if(e.type==="text"){const t=e.raw.split(` +`),n=t[t.length-1];if(n.includes("`"))return lut(i);if(n.includes("**"))return fut(i);if(n.match(/\*\w/))return cut(i);if(n.match(/(^|\s)__\w/))return gut(i);if(n.match(/(^|\s)_\w/))return dut(i);if(n.match(/(^|\s)\[.*\]\(\w*/))return uut(i);if(n.match(/(^|\s)\[\w/))return hut(i)}}function sut(i){let e,t;for(e=0;e0){const r=o?t.slice(0,-1).join(` `):e,s=!!r.match(/\|\s*$/),a=r+(s?"":"|")+` -|${" --- |".repeat(n)}`;return Bh.lexer(a)}}class gut{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(o=>o.splice(e,t,n))}}class X1 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function dae(i,e){const t=[];for(const n of e){if(i.start>=n.range.end)continue;if(i.ende.concat(t),[]))}class uae{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,n=[]){const o=n.length-t,r=dae({start:0,end:e},this.groups),s=dae({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:d$(l.range,o),size:l.size})),a=n.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=mut(r,a,s),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 n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var Cp=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};const C_={CurrentDragAndDropData:void 0},vh={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(i){return[i]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class sT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class but{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Cut{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;to,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,n)=>n+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 Gc{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:H6(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,n,o=vh){var r,s,a,l,c,d,u,h,f,g,p,v,m;if(this.virtualDelegate=t,this.domId=`list_id_${++Gc.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Wd(50),this.splicing=!1,this.dragOverAnimationStopDisposable=_e.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=_e.None,this.onDragLeaveTimeout=_e.None,this.disposables=new Be,this._onDidChangeContentHeight=new le,this._onDidChangeContentWidth=new le,this._horizontalScrolling=!1,o.horizontalScrolling&&o.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new uae((r=o.paddingTop)!==null&&r!==void 0?r:0);for(const y of n)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new _ut(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 o.mouseSupport=="boolean"?o.mouseSupport:!0),this._horizontalScrolling=(s=o.horizontalScrolling)!==null&&s!==void 0?s:vh.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof o.paddingBottom=="undefined"?0:o.paddingBottom,this.accessibilityProvider=new wut(o.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=o.transformOptimization)!==null&&a!==void 0?a:vh.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Ei.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new ZI({forceIntegerValues:!0,smoothScrollDuration:(l=o.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>Bc(y)})),this.scrollableElement=this.disposables.add(new MG(this.rowsContainer,{alwaysConsumeMouseWheel:(c=o.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:vh.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=o.verticalScrollMode)!==null&&d!==void 0?d:vh.verticalScrollMode,useShadows:(u=o.useShadows)!==null&&u!==void 0?u:vh.useShadows,mouseWheelScrollSensitivity:o.mouseWheelScrollSensitivity,fastScrollSensitivity:o.fastScrollSensitivity,scrollByPage:o.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ke(this.rowsContainer,Di.Change,y=>this.onTouchChange(y))),this.disposables.add(ke(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(ke(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(ke(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(ke(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(ke(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=o.setRowLineHeight)!==null&&h!==void 0?h:vh.setRowLineHeight,this.setRowHeight=(f=o.setRowHeight)!==null&&f!==void 0?f:vh.setRowHeight,this.supportDynamicHeights=(g=o.supportDynamicHeights)!==null&&g!==void 0?g:vh.supportDynamicHeights,this.dnd=(p=o.dnd)!==null&&p!==void 0?p:this.disposables.add(vh.dnd),this.layout((v=o.initialSize)===null||v===void 0?void 0:v.height,(m=o.initialSize)===null||m===void 0?void 0:m.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 n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(n,Math.max(0,this.lastRenderTop+o),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r={start:e,end:e+t},s=fs.intersect(o,r),a=new Map;for(let D=s.end-1;D>=s.start;D--){const E=this.items[D];if(E.dragStartDisposable.dispose(),E.checkedDisposable.dispose(),E.row){let I=a.get(E.templateId);I||(I=[],a.set(E.templateId,I));const k=this.renderers.get(E.templateId);k&&k.disposeElement&&k.disposeElement(E.element,D,E.row.templateData,E.size),I.push(E.row)}E.row=null}const l={start:e+t,end:this.items.length},c=fs.intersect(l,o),d=fs.relativeComplement(l,o),u=n.map(D=>({id:String(this.itemId++),element:D,templateId:this.virtualDelegate.getTemplateId(D),size:this.virtualDelegate.getHeight(D),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(D),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:_e.None,checkedDisposable:_e.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new uae(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=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=d$(c,f),v=fs.intersect(g,p);for(let D=v.start;Dd$(D,f)),w=[{start:e,end:e+n.length},..._].map(D=>fs.intersect(g,D)),L=this.getNextToLastElement(w);for(const D of w)for(let E=D.start;ED.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Bc(()=>{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!="undefined"&&(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),n=this.rangeMap.positionAt(e.start+1);return n!==-1&&(n-t)/2+t{for(const u of c)for(let h=u.start;ho.row.domNode.setAttribute("aria-checked",String(!!u));d(a.value),o.checkedDisposable=a.onDidChange(d)}(r||!o.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(o.row.domNode,t):this.rowsContainer.appendChild(o.row.domNode)),this.updateItemInDOM(o,e);const l=this.renderers.get(o.templateId);if(!l)throw new Error(`No renderer found for template id ${o.templateId}`);l==null||l.renderElement(o.element,e,o.row.templateData,o.size);const c=this.dnd.getDragURI(o.element);o.dragStartDisposable.dispose(),o.row.domNode.draggable=!!c,c&&(o.dragStartDisposable=ke(o.row.domNode,"dragstart",d=>this.onDragStart(o.element,c,d))),this.horizontalScrolling&&(this.measureItemWidth(o),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=H6(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.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 st.map(this.disposables.add(new xn(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return st.map(this.disposables.add(new xn(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return st.filter(st.map(this.disposables.add(new xn(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return st.map(this.disposables.add(new xn(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return st.map(this.disposables.add(new xn(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return st.map(this.disposables.add(new xn(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return st.any(st.map(this.disposables.add(new xn(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),st.map(this.disposables.add(new xn(this.domNode,Di.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return st.map(this.disposables.add(new xn(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return st.map(this.disposables.add(new xn(this.rowsContainer,Di.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}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,n){var o,r;if(!n.dataTransfer)return;const s=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(vk.TEXT,t),n.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,n)),typeof a=="undefined"&&(a=String(s.length));const l=He(".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),n.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>d.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new sT(s),C_.CurrentDragAndDropData=new but(s),(r=(o=this.dnd).onDragStart)===null||r===void 0||r.call(o,this.currentDragData,n)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),C_.CurrentDragAndDropData&&C_.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(C_.CurrentDragAndDropData)this.currentDragData=C_.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new Cut}const n=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof n=="boolean"?n:n.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof n!="boolean"&&n.effect===0?"copy":"move";let o;if(typeof n!="boolean"&&n.feedback?o=n.feedback:typeof e.index=="undefined"?o=[-1]:o=[e.index],o=bv(o).filter(r=>r>=-1&&rr-s),o=o[0]===-1?[-1]:o,yut(this.currentDragFeedback,o))return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=zt(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const r of o){const s=this.items[r];s.dropTarget=!0,(t=s.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=zt(()=>{var r;for(const s of o){const a=this.items[s];a.dropTarget=!1,(r=a.row)===null||r===void 0||r.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Lv(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((n=(t=this.dnd).onDragLeave)===null||n===void 0||n.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,C_.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,n;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,C_.CurrentDragAndDropData=void 0,(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=_e.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=g0e(this.domNode).top;this.dragOverAnimationDisposable=XQe(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Lv(()=>{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,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;n instanceof HTMLElement&&n!==this.rowsContainer&&t.contains(n);){const o=n.getAttribute("data-index");if(o){const r=Number(o);if(!isNaN(r))return r}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){const o=this.getRenderRange(e,t);let r,s;e===this.elementTop(o.start)?(r=o.start,s=0):o.end-o.start>1&&(r=o.start+1,s=this.elementTop(r)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},hae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Sut{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const o=this.renderedElements.findIndex(r=>r.templateData===n);if(o>=0){const r=this.renderedElements[o];this.trait.unrender(n),r.index=t}else{const r={index:t,templateData:n};this.renderedElements.push(r)}this.trait.renderIndex(t,n)}splice(e,t,n){const o=[];for(const r of this.renderedElements)r.index=e+t&&o.push({index:r.index+n-t,templateData:r.templateData});this.renderedElements=o}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex(n=>n.templateData===e);t<0||this.renderedElements.splice(t,1)}}class PP{get name(){return this._trait}get renderer(){return new Sut(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new le,this.onChange=this._onChange.event}splice(e,t,n){var o;t=Math.max(0,Math.min(t,this.length-e));const r=n.length-t,s=e+t,a=[];let l=0;for(;l=s;)a.push(this.sortedIndexes[l++]+r);const c=this.length+r;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const d=(o=this.sortedIndexes.find(u=>u>=e))!==null&&o!==void 0?o:c-1;a.push(Math.min(d,c-1))}this.renderer.splice(e,t,n.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(gae),t)}_set(e,t,n){const o=this.indexes,r=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=u$(r,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:n}),o}get(){return this.indexes}contains(e){return ED(this.sortedIndexes,e,gae)>=0}dispose(){si(this._onChange)}}Kb([Mo],PP.prototype,"renderer",null);class xut extends PP{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 O9{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,new Array(n.length).fill(!1));const o=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(o.length===0)return this.trait.splice(e,t,new Array(n.length).fill(!1));const r=new Set(o),s=n.map(a=>r.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function ev(i){return i.tagName==="INPUT"||i.tagName==="TEXTAREA"}function KC(i){return i.classList.contains("monaco-editor")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:KC(i.parentElement)}function $1e(i){return i.tagName==="A"&&i.classList.contains("monaco-button")||i.tagName==="DIV"&&i.classList.contains("monaco-button-dropdown")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:$1e(i.parentElement)}class z1e{get onKeyDown(){return st.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,e=>e.filter(t=>!ev(t.target)).map(t=>new Pi(t)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new Be,this.multipleSelectionDisposables=new Be,this.multipleSelectionSupport=n.multipleSelectionSupport,this.disposables.add(this.onKeyDown(o=>{switch(o.keyCode){case 3:return this.onEnter(o);case 16:return this.onUpArrow(o);case 18:return this.onDownArrow(o);case 11:return this.onPageUpArrow(o);case 12:return this.onPageDownArrow(o);case 9:return this.onEscape(o);case 31:this.multipleSelectionSupport&&(Nn?o.metaKey:o.ctrlKey)&&this.onCtrlA(o)}}))}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(Gs(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()}}Kb([Mo],z1e.prototype,"onKeyDown",null);var Wh;(function(i){i[i.Automatic=0]="Automatic",i[i.Trigger=1]="Trigger"})(Wh||(Wh={}));var qC;(function(i){i[i.Idle=0]="Idle",i[i.Typing=1]="Typing"})(qC||(qC={}));const Lut=new class{mightProducePrintableCharacter(i){return i.ctrlKey||i.metaKey||i.altKey?!1:i.keyCode>=31&&i.keyCode<=56||i.keyCode>=21&&i.keyCode<=30||i.keyCode>=98&&i.keyCode<=107||i.keyCode>=85&&i.keyCode<=95}};class Eut{constructor(e,t,n,o,r){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=o,this.delegate=r,this.enabled=!1,this.state=qC.Idle,this.mode=Wh.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Be,this.disposables=new Be,this.updateOptions(e.options)}updateOptions(e){var t,n;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(n=e.typeNavigationMode)!==null&&n!==void 0?n:Wh.Automatic}enable(){if(this.enabled)return;let e=!1;const t=st.chain(this.enabledDisposables.add(new xn(this.view.domNode,"keydown")).event,r=>r.filter(s=>!ev(s.target)).filter(()=>this.mode===Wh.Automatic||this.triggered).map(s=>new Pi(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>un.stop(s,!0)).map(s=>s.browserEvent.key)),n=st.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);st.reduce(st.any(t,n),(r,s)=>s===null?null:(r||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>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 n=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));n&&Cs(n)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=qC.Idle,this.triggered=!1;return}const t=this.list.getFocus(),n=t.length>0?t[0]:0,o=this.state===qC.Idle?1:0;this.state=qC.Typing;for(let r=0;r1&&c.length===1){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l=="undefined"||_k(e,l)){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Dut{constructor(e,t){this.list=e,this.view=t,this.disposables=new Be;const n=st.chain(this.disposables.add(new xn(t.domNode,"keydown")).event,r=>r.filter(s=>!ev(s.target)).map(s=>new Pi(s)));st.chain(n,r=>r.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.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 n=this.view.domElement(t[0]);if(!n)return;const o=n.querySelector("[tabIndex]");if(!o||!(o instanceof HTMLElement)||o.tabIndex===-1)return;const r=window.getComputedStyle(o);r.visibility==="hidden"||r.display==="none"||(e.preventDefault(),e.stopPropagation(),o.focus())}dispose(){this.disposables.dispose()}}function U1e(i){return Nn?i.browserEvent.metaKey:i.browserEvent.ctrlKey}function j1e(i){return i.browserEvent.shiftKey}function kut(i){return i instanceof MouseEvent&&i.button===2}const fae={isSelectionSingleChangeEvent:U1e,isSelectionRangeChangeEvent:j1e};class K1e{constructor(e){this.list=e,this.disposables=new Be,this._onPointer=new le,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||fae),this.mouseSupport=typeof e.options.mouseSupport=="undefined"||!!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(Ei.addTarget(e.getHTMLElement()))),st.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||fae))}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){KC(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(ev(e.browserEvent.target)||KC(e.browserEvent.target))return;const t=typeof e.index=="undefined"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||ev(e.browserEvent.target)||KC(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t=="undefined"){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),kut(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(ev(e.browserEvent.target)||KC(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 n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof n=="undefined"){const d=this.list.getFocus()[0];n=d!=null?d:t,this.list.setAnchor(n)}const o=Math.min(n,t),r=Math.max(n,t),s=Gs(o,r+1),a=this.list.getSelection(),l=Nut(u$(a,[n]),n);if(l.length===0)return;const c=u$(s,Rut(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const o=this.list.getSelection(),r=o.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),o.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}}class q1e{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,n;const o=this.selectorSuffix&&`.${this.selectorSuffix}`,r=[];e.listBackground&&r.push(`.monaco-list${o} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(r.push(`.monaco-list${o}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),r.push(`.monaco-list${o}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(r.push(`.monaco-list${o}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),r.push(`.monaco-list${o}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&r.push(` +|${" --- |".repeat(n)}`;return Bh.lexer(a)}}class mut{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(o=>o.splice(e,t,n))}}class X1 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function uae(i,e){const t=[];for(const n of e){if(i.start>=n.range.end)continue;if(i.ende.concat(t),[]))}class hae{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,n=[]){const o=n.length-t,r=uae({start:0,end:e},this.groups),s=uae({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:u$(l.range,o),size:l.size})),a=n.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=_ut(r,a,s),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 n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var yp=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};const C_={CurrentDragAndDropData:void 0},vh={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(i){return[i]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class sT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class yut{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class wut{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;to,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,n)=>n+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 Gc{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:$6(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,n,o=vh){var r,s,a,l,c,d,u,h,f,g,p,v,m;if(this.virtualDelegate=t,this.domId=`list_id_${++Gc.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Wd(50),this.splicing=!1,this.dragOverAnimationStopDisposable=_e.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=_e.None,this.onDragLeaveTimeout=_e.None,this.disposables=new Be,this._onDidChangeContentHeight=new le,this._onDidChangeContentWidth=new le,this._horizontalScrolling=!1,o.horizontalScrolling&&o.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new hae((r=o.paddingTop)!==null&&r!==void 0?r:0);for(const y of n)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new Cut(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 o.mouseSupport=="boolean"?o.mouseSupport:!0),this._horizontalScrolling=(s=o.horizontalScrolling)!==null&&s!==void 0?s:vh.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof o.paddingBottom=="undefined"?0:o.paddingBottom,this.accessibilityProvider=new xut(o.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=o.transformOptimization)!==null&&a!==void 0?a:vh.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Ei.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new ZI({forceIntegerValues:!0,smoothScrollDuration:(l=o.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>Bc(y)})),this.scrollableElement=this.disposables.add(new AG(this.rowsContainer,{alwaysConsumeMouseWheel:(c=o.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:vh.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=o.verticalScrollMode)!==null&&d!==void 0?d:vh.verticalScrollMode,useShadows:(u=o.useShadows)!==null&&u!==void 0?u:vh.useShadows,mouseWheelScrollSensitivity:o.mouseWheelScrollSensitivity,fastScrollSensitivity:o.fastScrollSensitivity,scrollByPage:o.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ke(this.rowsContainer,Di.Change,y=>this.onTouchChange(y))),this.disposables.add(ke(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(ke(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(ke(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(ke(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(ke(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=o.setRowLineHeight)!==null&&h!==void 0?h:vh.setRowLineHeight,this.setRowHeight=(f=o.setRowHeight)!==null&&f!==void 0?f:vh.setRowHeight,this.supportDynamicHeights=(g=o.supportDynamicHeights)!==null&&g!==void 0?g:vh.supportDynamicHeights,this.dnd=(p=o.dnd)!==null&&p!==void 0?p:this.disposables.add(vh.dnd),this.layout((v=o.initialSize)===null||v===void 0?void 0:v.height,(m=o.initialSize)===null||m===void 0?void 0:m.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 n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(n,Math.max(0,this.lastRenderTop+o),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r={start:e,end:e+t},s=fs.intersect(o,r),a=new Map;for(let D=s.end-1;D>=s.start;D--){const E=this.items[D];if(E.dragStartDisposable.dispose(),E.checkedDisposable.dispose(),E.row){let I=a.get(E.templateId);I||(I=[],a.set(E.templateId,I));const k=this.renderers.get(E.templateId);k&&k.disposeElement&&k.disposeElement(E.element,D,E.row.templateData,E.size),I.push(E.row)}E.row=null}const l={start:e+t,end:this.items.length},c=fs.intersect(l,o),d=fs.relativeComplement(l,o),u=n.map(D=>({id:String(this.itemId++),element:D,templateId:this.virtualDelegate.getTemplateId(D),size:this.virtualDelegate.getHeight(D),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(D),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:_e.None,checkedDisposable:_e.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new hae(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=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=u$(c,f),v=fs.intersect(g,p);for(let D=v.start;Du$(D,f)),w=[{start:e,end:e+n.length},..._].map(D=>fs.intersect(g,D)),L=this.getNextToLastElement(w);for(const D of w)for(let E=D.start;ED.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Bc(()=>{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!="undefined"&&(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),n=this.rangeMap.positionAt(e.start+1);return n!==-1&&(n-t)/2+t{for(const u of c)for(let h=u.start;ho.row.domNode.setAttribute("aria-checked",String(!!u));d(a.value),o.checkedDisposable=a.onDidChange(d)}(r||!o.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(o.row.domNode,t):this.rowsContainer.appendChild(o.row.domNode)),this.updateItemInDOM(o,e);const l=this.renderers.get(o.templateId);if(!l)throw new Error(`No renderer found for template id ${o.templateId}`);l==null||l.renderElement(o.element,e,o.row.templateData,o.size);const c=this.dnd.getDragURI(o.element);o.dragStartDisposable.dispose(),o.row.domNode.draggable=!!c,c&&(o.dragStartDisposable=ke(o.row.domNode,"dragstart",d=>this.onDragStart(o.element,c,d))),this.horizontalScrolling&&(this.measureItemWidth(o),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=$6(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.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 st.map(this.disposables.add(new xn(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return st.map(this.disposables.add(new xn(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return st.filter(st.map(this.disposables.add(new xn(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return st.map(this.disposables.add(new xn(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return st.map(this.disposables.add(new xn(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return st.map(this.disposables.add(new xn(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return st.any(st.map(this.disposables.add(new xn(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),st.map(this.disposables.add(new xn(this.domNode,Di.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return st.map(this.disposables.add(new xn(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return st.map(this.disposables.add(new xn(this.rowsContainer,Di.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}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,n){var o,r;if(!n.dataTransfer)return;const s=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(vk.TEXT,t),n.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,n)),typeof a=="undefined"&&(a=String(s.length));const l=He(".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),n.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>d.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new sT(s),C_.CurrentDragAndDropData=new yut(s),(r=(o=this.dnd).onDragStart)===null||r===void 0||r.call(o,this.currentDragData,n)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),C_.CurrentDragAndDropData&&C_.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(C_.CurrentDragAndDropData)this.currentDragData=C_.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new wut}const n=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof n=="boolean"?n:n.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof n!="boolean"&&n.effect===0?"copy":"move";let o;if(typeof n!="boolean"&&n.feedback?o=n.feedback:typeof e.index=="undefined"?o=[-1]:o=[e.index],o=bv(o).filter(r=>r>=-1&&rr-s),o=o[0]===-1?[-1]:o,Sut(this.currentDragFeedback,o))return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=zt(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const r of o){const s=this.items[r];s.dropTarget=!0,(t=s.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=zt(()=>{var r;for(const s of o){const a=this.items[s];a.dropTarget=!1,(r=a.row)===null||r===void 0||r.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Lv(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((n=(t=this.dnd).onDragLeave)===null||n===void 0||n.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,C_.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,n;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,C_.CurrentDragAndDropData=void 0,(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=_e.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=g0e(this.domNode).top;this.dragOverAnimationDisposable=ZQe(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Lv(()=>{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,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;n instanceof HTMLElement&&n!==this.rowsContainer&&t.contains(n);){const o=n.getAttribute("data-index");if(o){const r=Number(o);if(!isNaN(r))return r}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){const o=this.getRenderRange(e,t);let r,s;e===this.elementTop(o.start)?(r=o.start,s=0):o.end-o.start>1&&(r=o.start+1,s=this.elementTop(r)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Lut{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const o=this.renderedElements.findIndex(r=>r.templateData===n);if(o>=0){const r=this.renderedElements[o];this.trait.unrender(n),r.index=t}else{const r={index:t,templateData:n};this.renderedElements.push(r)}this.trait.renderIndex(t,n)}splice(e,t,n){const o=[];for(const r of this.renderedElements)r.index=e+t&&o.push({index:r.index+n-t,templateData:r.templateData});this.renderedElements=o}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex(n=>n.templateData===e);t<0||this.renderedElements.splice(t,1)}}class PP{get name(){return this._trait}get renderer(){return new Lut(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new le,this.onChange=this._onChange.event}splice(e,t,n){var o;t=Math.max(0,Math.min(t,this.length-e));const r=n.length-t,s=e+t,a=[];let l=0;for(;l=s;)a.push(this.sortedIndexes[l++]+r);const c=this.length+r;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const d=(o=this.sortedIndexes.find(u=>u>=e))!==null&&o!==void 0?o:c-1;a.push(Math.min(d,c-1))}this.renderer.splice(e,t,n.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(pae),t)}_set(e,t,n){const o=this.indexes,r=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=h$(r,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:n}),o}get(){return this.indexes}contains(e){return ED(this.sortedIndexes,e,pae)>=0}dispose(){si(this._onChange)}}Kb([Mo],PP.prototype,"renderer",null);class Eut extends PP{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 F9{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,new Array(n.length).fill(!1));const o=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(o.length===0)return this.trait.splice(e,t,new Array(n.length).fill(!1));const r=new Set(o),s=n.map(a=>r.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function tv(i){return i.tagName==="INPUT"||i.tagName==="TEXTAREA"}function KC(i){return i.classList.contains("monaco-editor")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:KC(i.parentElement)}function $1e(i){return i.tagName==="A"&&i.classList.contains("monaco-button")||i.tagName==="DIV"&&i.classList.contains("monaco-button-dropdown")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:$1e(i.parentElement)}class z1e{get onKeyDown(){return st.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,e=>e.filter(t=>!tv(t.target)).map(t=>new Pi(t)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new Be,this.multipleSelectionDisposables=new Be,this.multipleSelectionSupport=n.multipleSelectionSupport,this.disposables.add(this.onKeyDown(o=>{switch(o.keyCode){case 3:return this.onEnter(o);case 16:return this.onUpArrow(o);case 18:return this.onDownArrow(o);case 11:return this.onPageUpArrow(o);case 12:return this.onPageDownArrow(o);case 9:return this.onEscape(o);case 31:this.multipleSelectionSupport&&(Nn?o.metaKey:o.ctrlKey)&&this.onCtrlA(o)}}))}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(Gs(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()}}Kb([Mo],z1e.prototype,"onKeyDown",null);var Wh;(function(i){i[i.Automatic=0]="Automatic",i[i.Trigger=1]="Trigger"})(Wh||(Wh={}));var qC;(function(i){i[i.Idle=0]="Idle",i[i.Typing=1]="Typing"})(qC||(qC={}));const Dut=new class{mightProducePrintableCharacter(i){return i.ctrlKey||i.metaKey||i.altKey?!1:i.keyCode>=31&&i.keyCode<=56||i.keyCode>=21&&i.keyCode<=30||i.keyCode>=98&&i.keyCode<=107||i.keyCode>=85&&i.keyCode<=95}};class kut{constructor(e,t,n,o,r){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=o,this.delegate=r,this.enabled=!1,this.state=qC.Idle,this.mode=Wh.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Be,this.disposables=new Be,this.updateOptions(e.options)}updateOptions(e){var t,n;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(n=e.typeNavigationMode)!==null&&n!==void 0?n:Wh.Automatic}enable(){if(this.enabled)return;let e=!1;const t=st.chain(this.enabledDisposables.add(new xn(this.view.domNode,"keydown")).event,r=>r.filter(s=>!tv(s.target)).filter(()=>this.mode===Wh.Automatic||this.triggered).map(s=>new Pi(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>un.stop(s,!0)).map(s=>s.browserEvent.key)),n=st.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);st.reduce(st.any(t,n),(r,s)=>s===null?null:(r||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>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 n=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));n&&Cs(n)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=qC.Idle,this.triggered=!1;return}const t=this.list.getFocus(),n=t.length>0?t[0]:0,o=this.state===qC.Idle?1:0;this.state=qC.Typing;for(let r=0;r1&&c.length===1){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l=="undefined"||_k(e,l)){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Iut{constructor(e,t){this.list=e,this.view=t,this.disposables=new Be;const n=st.chain(this.disposables.add(new xn(t.domNode,"keydown")).event,r=>r.filter(s=>!tv(s.target)).map(s=>new Pi(s)));st.chain(n,r=>r.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.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 n=this.view.domElement(t[0]);if(!n)return;const o=n.querySelector("[tabIndex]");if(!o||!(o instanceof HTMLElement)||o.tabIndex===-1)return;const r=window.getComputedStyle(o);r.visibility==="hidden"||r.display==="none"||(e.preventDefault(),e.stopPropagation(),o.focus())}dispose(){this.disposables.dispose()}}function U1e(i){return Nn?i.browserEvent.metaKey:i.browserEvent.ctrlKey}function j1e(i){return i.browserEvent.shiftKey}function Tut(i){return i instanceof MouseEvent&&i.button===2}const gae={isSelectionSingleChangeEvent:U1e,isSelectionRangeChangeEvent:j1e};class K1e{constructor(e){this.list=e,this.disposables=new Be,this._onPointer=new le,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||gae),this.mouseSupport=typeof e.options.mouseSupport=="undefined"||!!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(Ei.addTarget(e.getHTMLElement()))),st.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||gae))}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){KC(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(tv(e.browserEvent.target)||KC(e.browserEvent.target))return;const t=typeof e.index=="undefined"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||tv(e.browserEvent.target)||KC(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t=="undefined"){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),Tut(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(tv(e.browserEvent.target)||KC(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 n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof n=="undefined"){const d=this.list.getFocus()[0];n=d!=null?d:t,this.list.setAnchor(n)}const o=Math.min(n,t),r=Math.max(n,t),s=Gs(o,r+1),a=this.list.getSelection(),l=Mut(h$(a,[n]),n);if(l.length===0)return;const c=h$(s,Aut(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const o=this.list.getSelection(),r=o.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),o.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}}class q1e{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,n;const o=this.selectorSuffix&&`.${this.selectorSuffix}`,r=[];e.listBackground&&r.push(`.monaco-list${o} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(r.push(`.monaco-list${o}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),r.push(`.monaco-list${o}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(r.push(`.monaco-list${o}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),r.push(`.monaco-list${o}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&r.push(` .monaco-drag-image, .monaco-list${o}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&r.push(` @@ -612,17 +612,17 @@ Please report this to https://github.com/markedjs/marked.`,ie.silent)return"

A background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=r.join(` -`)}}const Iut={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:ve.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:ve.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:ve.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},Tut={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Nut(i,e){const t=i.indexOf(e);if(t===-1)return[];const n=[];let o=t-1;for(;o>=0&&i[o]===e-(t-o);)n.push(i[o--]);for(n.reverse(),o=t;o=i.length)t.push(e[o++]);else if(o>=e.length)t.push(i[n++]);else if(i[n]===e[o]){t.push(i[n]),n++,o++;continue}else i[n]=i.length)t.push(e[o++]);else if(o>=e.length)t.push(i[n++]);else if(i[n]===e[o]){n++,o++;continue}else i[n]i-e;class Mut{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,n,o){let r=0;for(const s of this.renderers)s.renderElement(e,t,n[r++],o)}disposeElement(e,t,n,o){var r;let s=0;for(const a of this.renderers)(r=a.disposeElement)===null||r===void 0||r.call(a,e,t,n[s],o),s+=1}disposeTemplate(e){let t=0;for(const n of this.renderers)n.disposeTemplate(e[t++])}}class Aut{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,n){const o=this.accessibilityProvider.getAriaLabel(e);o?n.setAttribute("aria-label",o):n.removeAttribute("aria-label");const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?n.setAttribute("aria-level",`${r}`):n.removeAttribute("aria-level")}disposeTemplate(e){}}class Put{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 n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,e,t)}onDragOver(e,t,n,o){return this.dnd.onDragOver(e,t,n,o)}onDragLeave(e,t,n,o){var r,s;(s=(r=this.dnd).onDragLeave)===null||s===void 0||s.call(r,e,t,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}drop(e,t,n,o){this.dnd.drop(e,t,n,o)}dispose(){this.dnd.dispose()}}class qd{get onDidChangeFocus(){return st.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return st.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=st.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,r=>r.map(s=>new Pi(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>un.stop(s,!0)).filter(()=>!1)),n=st.chain(this.disposables.add(new xn(this.view.domNode,"keyup")).event,r=>r.forEach(()=>e=!1).map(s=>new Pi(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>un.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l!="undefined"?this.view.element(l):void 0,d=typeof l!="undefined"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:s}})),o=st.chain(this.view.onContextMenu,r=>r.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new kc(l),browserEvent:l})));return st.any(t,n,o)}get onKeyDown(){return this.disposables.add(new xn(this.view.domNode,"keydown")).event}get onDidFocus(){return st.signal(this.disposables.add(new xn(this.view.domNode,"focus",!0)).event)}constructor(e,t,n,o,r=Tut){var s,a,l,c;this.user=e,this._options=r,this.focus=new PP("focused"),this.anchor=new PP("anchor"),this.eventBufferer=new Uq,this._ariaLabel="",this.disposables=new Be,this._onDidDispose=new le,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new xut(d!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=r.accessibilityProvider,this.accessibilityProvider&&(u.push(new Aut(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),o=o.map(f=>new Mut(f.templateId,[...u,f]));const h=Object.assign(Object.assign({},r),{dnd:r.dnd&&new Put(this,r.dnd)});if(this.view=this.createListView(t,n,o,h),this.view.domNode.setAttribute("role",d),r.styleController)this.styleController=r.styleController(this.view.domId);else{const f=Wc(this.view.domNode);this.styleController=new q1e(f,this.view.domId)}if(this.spliceable=new gut([new O9(this.focus,this.view,r.identityProvider),new O9(this.selection,this.view,r.identityProvider),new O9(this.anchor,this.view,r.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 Dut(this,this.view)),(typeof r.keyboardSupport!="boolean"||r.keyboardSupport)&&(this.keyboardController=new z1e(this,this.view,r),this.disposables.add(this.keyboardController)),r.keyboardNavigationLabelProvider){const f=r.keyboardNavigationDelegate||Lut;this.typeNavigationController=new Eut(this,this.view,r.keyboardNavigationLabelProvider,(c=r.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(r),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,n,o){return new Gc(e,t,n,o)}createMouseController(e){return new K1e(this)}updateOptions(e={}){var t,n;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),(n=this.keyboardController)===null||n===void 0||n.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new X1(this.user,`Invalid start index: ${e}`);if(t<0)throw new X1(this.user,`Invalid delete count: ${t}`);t===0&&n.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,n))}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 n of e)if(n<0||n>=this.length)throw new X1(this.user,`Invalid index ${n}`);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=="undefined"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new X1(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return d_e(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e=="undefined"?void 0:this.element(e)}setFocus(e,t){for(const n of e)if(n<0||n>=this.length)throw new X1(this.user,`Invalid index ${n}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,o){if(this.length===0)return;const r=this.focus.get(),s=this.findNextIndex(r.length>0?r[0]+e:0,t,o);s>-1&&this.setFocus([s],n)}focusPrevious(e=1,t=!1,n,o){if(this.length===0)return;const r=this.focus.get(),s=this.findPreviousIndex(r.length>0?r[0]-e:0,t,o);s>-1&&this.setFocus([s],n)}focusNextPage(e,t){return hae(this,void 0,void 0,function*(){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=n===0?0:n-1;const o=this.getFocus()[0];if(o!==n&&(o===void 0||n>o)){const r=this.findPreviousIndex(n,!1,t);r>-1&&o!==r?this.setFocus([r],e):this.setFocus([n],e)}else{const r=this.view.getScrollTop();let s=r+this.view.renderHeight;n>o&&(s-=this.view.elementHeight(n)),this.view.setScrollTop(s),this.view.getScrollTop()!==r&&(this.setFocus([]),yield xv(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return hae(this,void 0,void 0,function*(){let n;const o=this.view.getScrollTop();o===0?n=this.view.indexAt(o):n=this.view.indexAfter(o-1);const r=this.getFocus()[0];if(r!==n&&(r===void 0||r>=n)){const s=this.findNextIndex(n,!1,t);s>-1&&r!==s?this.setFocus([s],e):this.setFocus([n],e)}else{const s=o;this.view.setScrollTop(o-this.view.renderHeight),this.view.getScrollTop()!==s&&(this.setFocus([]),yield xv(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(this.length===0)return;const o=this.findNextIndex(e,!1,n);o>-1&&this.setFocus([o],t)}findNextIndex(e,t=!1,n){for(let o=0;o=this.length&&!t)return-1;if(e=e%this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let o=0;othis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new X1(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(Cv(t)){const s=r-this.view.renderHeight;this.view.setScrollTop(s*Za(t,0,1)+o)}else{const s=o+r,a=n+this.view.renderHeight;o=a||(o=a&&r>=this.view.renderHeight?this.view.setScrollTop(o):s>=a&&this.view.setScrollTop(s-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(n=>this.view.element(n)),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 n;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(n=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",n||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()}}Kb([Mo],qd.prototype,"onDidChangeFocus",null);Kb([Mo],qd.prototype,"onDidChangeSelection",null);Kb([Mo],qd.prototype,"onContextMenu",null);Kb([Mo],qd.prototype,"onKeyDown",null);Kb([Mo],qd.prototype,"onDidFocus",null);const _0=He,G1e="selectOption.entry.template";class Out{get templateId(){return G1e}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Ae(e,_0(".option-text")),t.detail=Ae(e,_0(".option-detail")),t.decoratorRight=Ae(e,_0(".option-decorator-right")),t}renderElement(e,t,n){const o=n,r=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;o.text.textContent=r,o.detail.textContent=s||"",o.decoratorRight.innerText=a||"",l?o.root.classList.add("option-disabled"):o.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Vh extends _e{constructor(e,t,n,o,r){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=o,this.selectBoxOptions=r||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Vh.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 le,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(n),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return G1e}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=He(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Ae(this.selectDropDownContainer,_0(".select-box-details-pane"));const t=Ae(this.selectDropDownContainer,_0(".select-box-dropdown-container-width-control")),n=Ae(t,_0(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Ae(n,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Wc(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ke(this.selectDropDownContainer,et.DRAG_START,o=>{un.stop(o,!0)}))}registerListeners(){this._register(No(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(ke(this.selectElement,et.CLICK,t=>{un.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ke(this.selectElement,et.MOUSE_DOWN,t=>{un.stop(t)}));let e;this._register(ke(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ke(this.selectElement,"touchend",t=>{un.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ke(this.selectElement,et.KEY_DOWN,t=>{const n=new Pi(t);let o=!1;Nn?(n.keyCode===18||n.keyCode===16||n.keyCode===10||n.keyCode===3)&&(o=!0):(n.keyCode===18&&n.altKey||n.keyCode===16&&n.altKey||n.keyCode===10||n.keyCode===3)&&(o=!0),o&&(this.showSelectDropDown(),un.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Lo(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((n,o)=>{this.selectElement.add(this.createOption(n.text,o,n.isDisabled)),typeof n.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,!!this.options[this.selected]&&!!this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` -`)}styleSelectElement(){var e,t,n;const o=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(n=this.styles.selectBorder)!==null&&n!==void 0?n:"";this.selectElement.style.backgroundColor=o,this.selectElement.style.color=r,this.selectElement.style.borderColor=s}styleList(){var e,t;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=I0(this.styles.selectListBackground,n);this.selectDropDownListContainer.style.backgroundColor=o,this.selectionDetailsPane.style.backgroundColor=o;const r=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=r,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,n){const o=document.createElement("option");return o.value=e,o.text=e,o.disabled=!!n,o}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,n)=>{this.updateDetail(n),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=Yo(this.selectElement),n=getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),s=t.top-Vh.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+o+u,f=Math.floor((r-o-u)/this.getHeight()),g=Math.floor((s-o-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.topr&&(d=f*this.getHeight())}else h>s&&(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+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+o+"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 n=0,o=0;this.options.forEach((r,s)=>{const a=r.detail?r.detail.length:0,l=r.decoratorRight?r.decoratorRight.length:0,c=r.text.length+a+l;c>o&&(n=s,o=c)}),e.textContent=this.options[n].text+(this.options[n].decoratorRight?this.options[n].decoratorRight+" ":""),t=Ea(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Ae(e,_0(".select-box-dropdown-list-container")),this.listRenderer=new Out,this.selectList=new qd("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:o=>{let r=o.text;return o.detail&&(r+=`. ${o.detail}`),o.decoratorRight&&(r+=`. ${o.decoratorRight}`),o.description&&(r+=`. ${o.description}`),r},getWidgetAriaLabel:()=>C({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Nn?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new xn(this.selectDropDownListContainer,"keydown")),n=st.chain(t.event,o=>o.filter(()=>this.selectList.length>0).map(r=>new Pi(r)));this._register(st.chain(n,o=>o.filter(r=>r.keyCode===3))(this.onEnter,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===2))(this.onEnter,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===9))(this.onEscape,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===16))(this.onUpArrow,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===18))(this.onDownArrow,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===12))(this.onPageDown,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===11))(this.onPageUp,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===14))(this.onHome,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===13))(this.onEnd,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode>=21&&r.keyCode<=56||r.keyCode>=85&&r.keyCode<=113))(this.onCharacter,this)),this._register(ke(this.selectList.getHTMLElement(),et.POINTER_UP,o=>this.onPointerUp(o))),this._register(this.selectList.onMouseOver(o=>typeof o.index!="undefined"&&this.selectList.setFocus([o.index]))),this._register(this.selectList.onDidChangeFocus(o=>this.onListFocus(o))),this._register(ke(this.selectDropDownContainer,et.FOCUS_OUT,o=>{!this._isVisible||rs(o.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;un.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const n=t.closest(".monaco-list-row");if(!n)return;const o=Number(n.getAttribute("data-index")),r=n.classList.contains("option-disabled");o>=0&&o{for(let s=0;sthis.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&&(un.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){un.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){un.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){un.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=xg.toString(e.keyCode);let n=-1;for(let o=0;o{this._register(ke(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(No(this.selectElement,"click",e=>{un.stop(e,!0)})),this._register(No(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(No(this.selectElement,"keydown",e=>{let t=!1;Nn?(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||!Lo(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((n,o)=>{this.selectElement.add(this.createOption(n.text,o,n.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(o)}))}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 vw)),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(Ei.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,Fc&&this._register(ke(e,et.DRAG_START,o=>{var r;return(r=o.dataTransfer)===null||r===void 0?void 0:r.setData(vk.TEXT,this._action.label)}))),this._register(ke(t,Di.Tap,o=>this.onClick(o,!0))),this._register(ke(t,et.MOUSE_DOWN,o=>{n||un.stop(o,!0),this._action.enabled&&o.button===0&&t.classList.add("active")})),Nn&&this._register(ke(t,et.CONTEXT_MENU,o=>{o.button===0&&o.ctrlKey===!0&&this.onClick(o)})),this._register(ke(t,et.CLICK,o=>{un.stop(o,!0),this.options&&this.options.isMenu||this.onClick(o)})),this._register(ke(t,et.DBLCLICK,o=>{un.stop(o,!0)})),[et.MOUSE_UP,et.MOUSE_OUT].forEach(o=>{this._register(ke(t,o,r=>{un.stop(r),t.classList.remove("active")}))})}onClick(e,t=!1){var n;un.stop(e,!0);const o=Al(this._context)?!((n=this.options)===null||n===void 0)&&n.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,o)}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=V1e(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 Ow extends wu{constructor(e,t,n){super(e,t,n),this.options=n,this.options.icon=n.icon!==void 0?n.icon:!1,this.options.label=n.label!==void 0?n.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=Ae(this.element,He("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(Ae(this.element,He("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===kr.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=C({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 Wut extends wu{constructor(e,t,n,o,r,s,a){super(e,t),this.selectBox=new But(n,o,r,s,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 Vut extends vw{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Ae(e,He(".monaco-dropdown")),this._label=Ae(this._element,He(".dropdown-label"));let n=t.labelRenderer;n||(n=r=>(r.textContent=t.label||"",null));for(const r of[et.CLICK,et.MOUSE_DOWN,Di.Tap])this._register(ke(this.element,r,s=>un.stop(s,!0)));for(const r of[et.MOUSE_DOWN,Di.Tap])this._register(ke(this._label,r,s=>{s instanceof MouseEvent&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(ke(this._label,et.KEY_UP,r=>{const s=new Pi(r);(s.equals(3)||s.equals(10))&&(un.stop(r,!0),this.visible?this.hide():this.show())}));const o=n(this._label);o&&this._register(o),this._register(Ei.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 Hut extends Vut{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 OP extends wu{constructor(e,t,n,o=Object.create(null)){super(null,e,o),this.actionItem=null,this._onDidChangeVisibility=this._register(new le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=o,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=r=>{this.element=Ae(r,He("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),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},n=Array.isArray(this.menuActionsOrProvider),o={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:n?this.menuActionsOrProvider:void 0,actionProvider:n?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Hut(e,o)),this._register(this.dropdownMenu.onDidChangeVisibility(r=>{var s;(s=this.element)===null||s===void 0||s.setAttribute("aria-expanded",`${r}`),this._onDidChangeVisibility.fire(r)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const r=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return r.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 n=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",n),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",n)}}function $ut(i){return i?i.condition!==void 0:!1}var ML=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Py;(function(i){i[i.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",i[i.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(Py||(Py={}));var GC;(function(i){i[i.None=0]="None",i[i.Initialized=1]="Initialized",i[i.Closed=2]="Closed"})(GC||(GC={}));class Oy extends _e{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Y0),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=GC.None,this.cache=new Map,this.flushDelayer=this._register(new E0e(Oy.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,n;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((o,r)=>this.acceptExternal(r,o)),(n=e.deleted)===null||n===void 0||n.forEach(o=>this.acceptExternal(o,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===GC.Closed)return;let n=!1;Al(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const n=this.cache.get(e);return Al(n)?t:n}getBoolean(e,t){const n=this.get(e);return Al(n)?t:n==="true"}getNumber(e,t){const n=this.get(e);return Al(n)?t:parseInt(n,10)}set(e,t,n=!1){return ML(this,void 0,void 0,function*(){if(this.state===GC.Closed)return;if(Al(t))return this.delete(e,n);const o=ia(t)||Array.isArray(t)?Xdt(t):String(t);if(this.cache.get(e)!==o)return this.cache.set(e,o),this.pendingInserts.set(e,o),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()})}delete(e,t=!1){return ML(this,void 0,void 0,function*(){if(!(this.state===GC.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 ML(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 ML(this,void 0,void 0,function*(){return this.options.hint===Py.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}Oy.DEFAULT_FLUSH_DELAY=100;class F9{constructor(){this.onDidChangeItemsExternal=st.None,this.items=new Map}updateItems(e){var t,n;return ML(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((o,r)=>this.items.set(r,o)),(n=e.delete)===null||n===void 0||n.forEach(o=>this.items.delete(o))})}}const bM="__$__targetStorageMarker",Gd=yn("storageService");var FP;(function(i){i[i.NONE=0]="NONE",i[i.SHUTDOWN=1]="SHUTDOWN"})(FP||(FP={}));function zut(i){const e=i.get(bM);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class P5 extends _e{constructor(e={flushInterval:P5.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Y0),this._onDidChangeTarget=this._register(new Y0),this._onWillSaveState=this._register(new le),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,n){return st.filter(this._onDidChangeValue.event,o=>o.scope===e&&(t===void 0||o.key===t),n)}emitDidChangeValue(e,t){const{key:n,external:o}=t;if(n===bM){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:n,target:this.getKeyTargets(e)[n],external:o})}get(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.get(e,n)}getBoolean(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getBoolean(e,n)}getNumber(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getNumber(e,n)}store(e,t,n,o,r=!1){if(Al(t)){this.remove(e,n,r);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,n,o),(s=this.getStorage(n))===null||s===void 0||s.set(e,t,r)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,t,void 0),(o=this.getStorage(t))===null||o===void 0||o.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,o=!1){var r,s;const a=this.getKeyTargets(t);typeof n=="number"?a[e]!==n&&(a[e]=n,(r=this.getStorage(t))===null||r===void 0||r.set(bM,JSON.stringify(a),o)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(bM,JSON.stringify(a),o))}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?zut(t):Object.create(null)}}P5.DEFAULT_FLUSH_INTERVAL=60*1e3;class Uut extends P5{constructor(){super(),this.applicationStorage=this._register(new Oy(new F9,{hint:Py.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Oy(new F9,{hint:Py.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Oy(new F9,{hint:Py.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 jut(i,e){const t=Object.assign({},e);for(const n in i){const o=i[n];t[n]=o!==void 0?ct(o):void 0}return t}const Kut={keybindingLabelBackground:ct(knt),keybindingLabelForeground:ct(Int),keybindingLabelBorder:ct(Tnt),keybindingLabelBottomBorder:ct(Nnt),keybindingLabelShadow:ct(Gh)},qut={buttonForeground:ct(CL),buttonSeparator:ct(gnt),buttonBackground:ct(yL),buttonHoverBackground:ct(pnt),buttonSecondaryForeground:ct(vnt),buttonSecondaryBackground:ct(gH),buttonSecondaryHoverBackground:ct(_nt),buttonBorder:ct(mnt)},Gut={progressBarBackground:ct(ynt)},BP={inputActiveOptionBorder:ct(xG),inputActiveOptionForeground:ct(LG),inputActiveOptionBackground:ct(f0)};ct(dit),ct(hit),ct(uit);ct(po),ct(Zh),ct(Gh),ct(Ln),ct(kit),ct(Iit),ct(Tit),ct(int);const WP={inputBackground:ct(obe),inputForeground:ct(rbe),inputBorder:ct(sbe),inputValidationInfoBorder:ct(snt),inputValidationInfoBackground:ct(ont),inputValidationInfoForeground:ct(rnt),inputValidationWarningBorder:ct(cnt),inputValidationWarningBackground:ct(ant),inputValidationWarningForeground:ct(lnt),inputValidationErrorBorder:ct(hnt),inputValidationErrorBackground:ct(dnt),inputValidationErrorForeground:ct(unt)},Xut={listFilterWidgetBackground:ct(iit),listFilterWidgetOutline:ct(oit),listFilterWidgetNoMatchesOutline:ct(rit),listFilterWidgetShadow:ct(sit),inputBoxStyles:WP,toggleStyles:BP},X1e={badgeBackground:ct(dM),badgeForeground:ct(bnt),badgeBorder:ct(Ln)};ct(yit),ct(Cit),ct(Ire),ct(Ire),ct(wit);const qb={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ct(qnt),listFocusForeground:ct(Gnt),listFocusOutline:ct(Xnt),listActiveSelectionBackground:ct(Wg),listActiveSelectionForeground:ct(ef),listActiveSelectionIconForeground:ct(LL),listFocusAndSelectionOutline:ct(Ynt),listFocusAndSelectionBackground:ct(Wg),listFocusAndSelectionForeground:ct(ef),listInactiveSelectionBackground:ct(Znt),listInactiveSelectionIconForeground:ct(Jnt),listInactiveSelectionForeground:ct(Qnt),listInactiveFocusBackground:ct(eit),listInactiveFocusOutline:ct(tit),listHoverBackground:ct(cbe),listHoverForeground:ct(dbe),listDropBackground:ct(nit),listSelectionOutline:ct(Wi),listHoverOutline:ct(Wi),treeIndentGuidesStroke:ct(EL),treeInactiveIndentGuidesStroke:ct(ait),tableColumnsBorder:ct(lit),tableOddRowsBackgroundColor:ct(cit)};function ES(i){return jut(i,qb)}const Yut={selectBackground:ct(Xh),selectListBackground:ct(fnt),selectForeground:ct(Og),decoratorRightForeground:ct(abe),selectBorder:ct(PC),focusBorder:ct(Hl),listFocusBackground:ct(p0),listInactiveSelectionIconForeground:ct(OC),listFocusForeground:ct(g0),listFocusOutline:ent(Wi,ve.transparent.toString()),listHoverBackground:ct(cbe),listHoverForeground:ct(dbe),listHoverOutline:ct(Wi),selectListBorder:ct(Qh),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},Zut={shadowColor:ct(Gh),borderColor:ct(fit),foregroundColor:ct(git),backgroundColor:ct(pit),selectionForegroundColor:ct(mit),selectionBackgroundColor:ct(vit),selectionBorderColor:ct(_it),separatorColor:ct(bit),scrollbarShadow:ct(Cnt),scrollbarSliderBackground:ct(wL),scrollbarSliderHoverBackground:ct(SL),scrollbarSliderActiveBackground:ct(xL)};var O5=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Na=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Y1e=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Qut(i,e,t,n){const o=i.getActions(e),r=Mg.getInstance(),s=r.keyStatus.altKey||(ls||xs)&&r.keyStatus.shiftKey;Q1e(o,t,s,n?a=>a===n:a=>a==="navigation")}function Z1e(i,e,t,n,o,r){const s=i.getActions(e);Q1e(s,t,!1,typeof n=="string"?l=>l===n:n,o,r)}function Q1e(i,e,t,n=s=>s==="navigation",o=()=>!1,r=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of i){let u;n(c)?(u=s,u.length>0&&r&&u.push(new kr)):(u=a,u.length>0&&u.push(new kr));for(let h of d){t&&(h=h instanceof Fd&&h.alt?h.alt:h);const f=u.push(h);h instanceof _w&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:d,index:u}of l){const h=n(c)?s:a,f=d.actions;o(d,c,h.length)&&h.splice(u,1,...f)}}let ab=class extends Ow{constructor(e,t,n,o,r,s,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=n,this._notificationService=o,this._contextKeyService=r,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Kr),this._altKey=Mg.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return Y1e(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 n=()=>{var o;const r=!!(!((o=this._menuItemAction.alt)===null||o===void 0)&&o.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);r!==this._wantsAltCommand&&(this._wantsAltCommand=r,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(n)),this._register(ke(e,"mouseleave",o=>{t=!1,n()})),this._register(ke(e,"mouseenter",o=>{t=!0,n()})),n()}}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),n=t&&t.getLabel(),o=this._commandAction.tooltip||this._commandAction.label;let r=n?C("titleAndKb","{0} ({1})",o,n):o;if(!this._wantsAltCommand&&((e=this._menuItemAction.alt)===null||e===void 0?void 0:e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?C("titleAndKb","{0} ({1})",s,l):s;r=C("titleAndKbAndAlt",`{0} -[{1}] {2}`,r,aX.modifierLabels[Vl].altKey,c)}return r}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:n}=this;if(!t||!n)return;const o=this._commandAction.checked&&$ut(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(!!o)if(Mt.isThemeIcon(o)){const r=Mt.asClassNameArray(o);n.classList.add(...r),this._itemClassDispose.value=zt(()=>{n.classList.remove(...r)})}else{const r=Ew(this._themeService.getColorTheme().type)?Sv(o.dark):Sv(o.light),s=He("span");s.style.webkitMask=s.style.mask=`${r} no-repeat 50% 50%`,s.style.background="var(--vscode-icon-foreground)",s.style.display="inline-block",s.style.width="100%",s.style.height="100%",n.appendChild(s),n.classList.add("icon"),this._itemClassDispose.value=Td(zt(()=>{n.classList.remove("icon"),jr(n)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};ab=O5([Na(2,xi),Na(3,Ao),Na(4,Ut),Na(5,vr),Na(6,Kd),Na(7,_p)],ab);let h$=class extends OP{constructor(e,t,n,o,r){var s,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Mt.isThemeIcon(e.item.icon)?Mt.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:d=>n.lookupKeybinding(d.id)});super(e,{getActions:()=>e.actions},o,c),this._keybindingService=n,this._contextMenuService=o,this._themeService=r}render(e){super.render(e),fi(this.element),e.classList.add("menu-entry");const t=this._action,{icon:n}=t.item;if(n&&!Mt.isThemeIcon(n)){this.element.classList.add("icon");const o=()=>{this.element&&(this.element.style.backgroundImage=Ew(this._themeService.getColorTheme().type)?Sv(n.dark):Sv(n.light))};o(),this._register(this._themeService.onDidColorThemeChange(()=>{o()}))}}};h$=O5([Na(2,xi),Na(3,Kd),Na(4,vr)],h$);let f$=class extends wu{constructor(e,t,n,o,r,s,a,l){var c,d,u;super(null,e),this._keybindingService=n,this._notificationService=o,this._contextMenuService=r,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(ab,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 vw});this._dropdown=new OP(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof Fd&&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(ab,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends vw{runAction(n,o){return Y1e(this,void 0,void 0,function*(){yield n.run(void 0)})}},this._container&&this._defaultAction.render(v0e(this._container,He(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let n;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const o=this._keybindingService.lookupKeybinding(e.id);o&&(n=`(${o.getLabel()})`)}return n}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=He(".action-container");this._defaultAction.render(Ae(this._container,t)),this._register(ke(t,et.KEY_DOWN,o=>{const r=new Pi(o);r.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),r.stopPropagation())}));const n=He(".dropdown-action-container");this._dropdown.render(Ae(this._container,n)),this._register(ke(n,et.KEY_DOWN,o=>{var r;const s=new Pi(o);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(r=this._defaultAction.element)===null||r===void 0||r.focus(),s.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()}};f$=O5([Na(2,xi),Na(3,Ao),Na(4,Kd),Na(5,If),Na(6,$t),Na(7,Gd)],f$);let g$=class extends Wut{constructor(e,t){super(null,e,e.actions.map(n=>({text:n.id===kr.ID?"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500":n.label,isDisabled:!n.enabled})),0,t,Yut,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=ct(PC)}runAction(e,t){const n=this.action.actions[t];n&&this.actionRunner.run(n)}};g$=O5([Na(1,bp)],g$);function Jut(i,e,t){return e instanceof Fd?i.createInstance(ab,e,t):e instanceof BD?e.item.isSelection?i.createInstance(g$,e):e.item.rememberDefaultAction?i.createInstance(f$,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):i.createInstance(h$,e,t):void 0}var eht=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class zc extends _e{constructor(e,t={}){var n,o,r,s,a,l;super(),this._actionRunnerDisposables=this._register(new Be),this.viewItemDisposables=this._register(new $q),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new le({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new le),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new le),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(n=t.context)!==null&&n!==void 0?n:null,this._orientation=(o=this.options.orientation)!==null&&o!==void 0?o:0,this._triggerKeys={keyDown:(s=(r=this.options.triggerKeys)===null||r===void 0?void 0:r.keyDown)!==null&&s!==void 0?s:!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 vw,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(ke(this.domNode,et.KEY_DOWN,u=>{const h=new Pi(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 wu&&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(ke(this.domNode,et.KEY_UP,u=>{const h=new Pi(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(pf(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Nd()===this.domNode||!rs(Nd(),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(n=>n instanceof wu&&n.isEnabled());t instanceof wu&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof wu&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(n=>{t=t||e.equals(n)}),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 n=0;n{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(r,l)),a||(a=new Ow(this.context,r,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ke(s,et.CONTEXT_MENU,c=>{un.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof wu&&this.viewItems.length===0&&a.setFocusable(!0),o===null||o<0||o>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[o]),this.viewItems.splice(o,0,a),o++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=si(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ur(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,n;if(e===void 0?t=!0:typeof e=="number"?n=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem=="undefined"){const o=this.viewItems.findIndex(r=>r.isEnabled());this.focusedItem=o===-1?void 0:o,this.updateFocus(void 0,void 0,!0)}else n!==void 0&&(this.focusedItem=n),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=="undefined")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===kr.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem=="undefined")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===kr.ID));return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var o;typeof this.focusedItem=="undefined"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((o=this.viewItems[this.previouslyFocusedItem])===null||o===void 0||o.blur());const r=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(r){let s=!0;ID(r.focus)||(s=!1),this.options.focusOnlyEnabledItems&&ID(r.isEnabled)&&!r.isEnabled()&&(s=!1),r.action.id===kr.ID&&(s=!1),s?(n||this.previouslyFocusedItem!==this.focusedItem)&&(r.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem=="undefined")return;const t=this.viewItems[this.focusedItem];if(t instanceof wu){const n=t._context===null||t._context===void 0?e:t._context;this.run(t._action,n)}}run(e,t){return eht(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=si(this.viewItems),this.getContainer().remove(),super.dispose()}}const p$=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,B9=/(&)?(&)([^\s&])/g;var VP;(function(i){i[i.Right=0]="Right",i[i.Left=1]="Left"})(VP||(VP={}));class Fy extends zc{constructor(e,t,n,o){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const r=document.createElement("div");r.classList.add("monaco-menu"),r.setAttribute("role","presentation"),super(r,{orientation:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,n,s),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Nn||xs?[10]:[]],keyDown:!0}}),this.menuStyles=o,this.menuElement=r,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Be),this.initializeOrUpdateStyleSheet(e,o),this._register(Ei.addTarget(r)),ke(r,et.KEY_DOWN,l=>{new Pi(l).equals(2)&&l.preventDefault()}),n.enableMnemonics&&this.menuDisposables.add(ke(r,et.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){un.stop(l,!0);const d=this.mnemonics.get(c);if(d.length===1&&(d[0]instanceof pae&&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)}}})),xs&&this._register(ke(r,et.KEY_DOWN,l=>{const c=new Pi(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),un.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),un.stop(l,!0))})),this._register(ke(this.domNode,et.MOUSE_OUT,l=>{const c=l.relatedTarget;rs(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(ke(this.actionsList,et.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!rs(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(Ei.addTarget(this.actionsList)),this._register(ke(this.actionsList,Di.Tap,l=>{let c=l.initialTarget;if(!(!c||!rs(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 s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new QI(r,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,o),this._register(ke(r,Di.Change,l=>{un.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(ke(a,et.MOUSE_UP,l=>{l.preventDefault()})),r.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=n.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof mae)).forEach((l,c,d)=>{l.updatePositionInSet(c+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(XA(e)?this.styleSheet=Wc(e):(Fy.globalStyleSheet||(Fy.globalStyleSheet=Wc()),this.styleSheet=Fy.globalStyleSheet)),this.styleSheet.textContent=nht(t,XA(e))}styleScrollElement(e,t){var n,o;const r=(n=t.foregroundColor)!==null&&n!==void 0?n:"",s=(o=t.backgroundColor)!==null&&o!==void 0?o:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=r,e.style.backgroundColor=s,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(ke(this.element,et.MOUSE_UP,r=>{if(un.stop(r,!0),Fc){if(new kc(r).rightButton)return;this.onClick(r)}else setTimeout(()=>{this.onClick(r)},0)})),this._register(ke(this.element,et.CONTEXT_MENU,r=>{un.stop(r,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Ae(this.element,He("a.action-menu-item")),this._action.id===kr.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Ae(this.item,He("span.menu-item-check"+Mt.asCSSSelector(Xe.menuSelection))),this.check.setAttribute("role","none"),this.label=Ae(this.item,He("span.action-label")),this.options.label&&this.options.keybinding&&(Ae(this.item,He("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(!!this.label&&this.options.label){Ur(this.label);let t=pX(this.action.label);if(t){const n=tht(t);this.options.enableMnemonics||(t=n),this.label.setAttribute("aria-label",n.replace(/&&/g,"&"));const o=p$.exec(t);if(o){t=UA(t),B9.lastIndex=0;let r=B9.exec(t);for(;r&&r[1];)r=B9.exec(t);const s=a=>a.replace(/&&/g,"&");r?this.label.append(VI(s(t.substr(0,r.index))," "),He("u",{"aria-hidden":"true"},r[3]),z_e(s(t.substr(r.index+r[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(o[1]?o[1]:o[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,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,o=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",r=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t!=null?t:"",this.item.style.backgroundColor=n!=null?n:"",this.item.style.outline=o,this.item.style.outlineOffset=r),this.check&&(this.check.style.color=t!=null?t:"")}}class pae extends J1e{constructor(e,t,n,o,r){super(e,e,o,r),this.submenuActions=t,this.parentData=n,this.submenuOptions=o,this.mysubmenu=null,this.submenuDisposables=this._register(new Be),this.mouseOver=!1,this.expandDirection=o&&o.expandDirection!==void 0?o.expandDirection:VP.Right,this.showScheduler=new bi(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new bi(()=>{this.element&&!rs(Nd(),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=Ae(this.item,He("span.submenu-indicator"+Mt.asCSSSelector(Xe.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ke(this.element,et.KEY_UP,t=>{const n=new Pi(t);(n.equals(17)||n.equals(3))&&(un.stop(t,!0),this.createSubmenu(!0))})),this._register(ke(this.element,et.KEY_DOWN,t=>{const n=new Pi(t);Nd()===this.item&&(n.equals(17)||n.equals(3))&&un.stop(t,!0)})),this._register(ke(this.element,et.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ke(this.element,et.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ke(this.element,et.FOCUS_OUT,t=>{this.element&&!rs(Nd(),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){un.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,n,o){const r={top:0,left:0};return r.left=jC(e.width,t.width,{position:o===VP.Right?0:1,offset:n.left,size:n.width}),r.left>=n.left&&r.left{new Pi(c).equals(15)&&(un.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ke(this.submenuContainer,et.KEY_DOWN,c=>{new Pi(c).equals(15)&&un.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 mae extends Ow{constructor(e,t,n,o){super(e,t,n),this.menuStyles=o}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function tht(i){const e=p$,t=e.exec(i);if(!t)return i;const n=!t[1];return i.replace(e,n?"$2$3":"").trim()}function vae(i){const e=W_e()[i.id];return`.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`}function nht(i,e){let t=` +`)}}const Nut={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:ve.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:ve.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:ve.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},Rut={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Mut(i,e){const t=i.indexOf(e);if(t===-1)return[];const n=[];let o=t-1;for(;o>=0&&i[o]===e-(t-o);)n.push(i[o--]);for(n.reverse(),o=t;o=i.length)t.push(e[o++]);else if(o>=e.length)t.push(i[n++]);else if(i[n]===e[o]){t.push(i[n]),n++,o++;continue}else i[n]=i.length)t.push(e[o++]);else if(o>=e.length)t.push(i[n++]);else if(i[n]===e[o]){n++,o++;continue}else i[n]i-e;class Put{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,n,o){let r=0;for(const s of this.renderers)s.renderElement(e,t,n[r++],o)}disposeElement(e,t,n,o){var r;let s=0;for(const a of this.renderers)(r=a.disposeElement)===null||r===void 0||r.call(a,e,t,n[s],o),s+=1}disposeTemplate(e){let t=0;for(const n of this.renderers)n.disposeTemplate(e[t++])}}class Out{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,n){const o=this.accessibilityProvider.getAriaLabel(e);o?n.setAttribute("aria-label",o):n.removeAttribute("aria-label");const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?n.setAttribute("aria-level",`${r}`):n.removeAttribute("aria-level")}disposeTemplate(e){}}class Fut{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 n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,e,t)}onDragOver(e,t,n,o){return this.dnd.onDragOver(e,t,n,o)}onDragLeave(e,t,n,o){var r,s;(s=(r=this.dnd).onDragLeave)===null||s===void 0||s.call(r,e,t,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}drop(e,t,n,o){this.dnd.drop(e,t,n,o)}dispose(){this.dnd.dispose()}}class qd{get onDidChangeFocus(){return st.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return st.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=st.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,r=>r.map(s=>new Pi(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>un.stop(s,!0)).filter(()=>!1)),n=st.chain(this.disposables.add(new xn(this.view.domNode,"keyup")).event,r=>r.forEach(()=>e=!1).map(s=>new Pi(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>un.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l!="undefined"?this.view.element(l):void 0,d=typeof l!="undefined"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:s}})),o=st.chain(this.view.onContextMenu,r=>r.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new kc(l),browserEvent:l})));return st.any(t,n,o)}get onKeyDown(){return this.disposables.add(new xn(this.view.domNode,"keydown")).event}get onDidFocus(){return st.signal(this.disposables.add(new xn(this.view.domNode,"focus",!0)).event)}constructor(e,t,n,o,r=Rut){var s,a,l,c;this.user=e,this._options=r,this.focus=new PP("focused"),this.anchor=new PP("anchor"),this.eventBufferer=new jq,this._ariaLabel="",this.disposables=new Be,this._onDidDispose=new le,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new Eut(d!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=r.accessibilityProvider,this.accessibilityProvider&&(u.push(new Out(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),o=o.map(f=>new Put(f.templateId,[...u,f]));const h=Object.assign(Object.assign({},r),{dnd:r.dnd&&new Fut(this,r.dnd)});if(this.view=this.createListView(t,n,o,h),this.view.domNode.setAttribute("role",d),r.styleController)this.styleController=r.styleController(this.view.domId);else{const f=Wc(this.view.domNode);this.styleController=new q1e(f,this.view.domId)}if(this.spliceable=new mut([new F9(this.focus,this.view,r.identityProvider),new F9(this.selection,this.view,r.identityProvider),new F9(this.anchor,this.view,r.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 Iut(this,this.view)),(typeof r.keyboardSupport!="boolean"||r.keyboardSupport)&&(this.keyboardController=new z1e(this,this.view,r),this.disposables.add(this.keyboardController)),r.keyboardNavigationLabelProvider){const f=r.keyboardNavigationDelegate||Dut;this.typeNavigationController=new kut(this,this.view,r.keyboardNavigationLabelProvider,(c=r.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(r),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,n,o){return new Gc(e,t,n,o)}createMouseController(e){return new K1e(this)}updateOptions(e={}){var t,n;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),(n=this.keyboardController)===null||n===void 0||n.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new X1(this.user,`Invalid start index: ${e}`);if(t<0)throw new X1(this.user,`Invalid delete count: ${t}`);t===0&&n.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,n))}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 n of e)if(n<0||n>=this.length)throw new X1(this.user,`Invalid index ${n}`);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=="undefined"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new X1(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return d_e(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e=="undefined"?void 0:this.element(e)}setFocus(e,t){for(const n of e)if(n<0||n>=this.length)throw new X1(this.user,`Invalid index ${n}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,o){if(this.length===0)return;const r=this.focus.get(),s=this.findNextIndex(r.length>0?r[0]+e:0,t,o);s>-1&&this.setFocus([s],n)}focusPrevious(e=1,t=!1,n,o){if(this.length===0)return;const r=this.focus.get(),s=this.findPreviousIndex(r.length>0?r[0]-e:0,t,o);s>-1&&this.setFocus([s],n)}focusNextPage(e,t){return fae(this,void 0,void 0,function*(){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=n===0?0:n-1;const o=this.getFocus()[0];if(o!==n&&(o===void 0||n>o)){const r=this.findPreviousIndex(n,!1,t);r>-1&&o!==r?this.setFocus([r],e):this.setFocus([n],e)}else{const r=this.view.getScrollTop();let s=r+this.view.renderHeight;n>o&&(s-=this.view.elementHeight(n)),this.view.setScrollTop(s),this.view.getScrollTop()!==r&&(this.setFocus([]),yield xv(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return fae(this,void 0,void 0,function*(){let n;const o=this.view.getScrollTop();o===0?n=this.view.indexAt(o):n=this.view.indexAfter(o-1);const r=this.getFocus()[0];if(r!==n&&(r===void 0||r>=n)){const s=this.findNextIndex(n,!1,t);s>-1&&r!==s?this.setFocus([s],e):this.setFocus([n],e)}else{const s=o;this.view.setScrollTop(o-this.view.renderHeight),this.view.getScrollTop()!==s&&(this.setFocus([]),yield xv(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(this.length===0)return;const o=this.findNextIndex(e,!1,n);o>-1&&this.setFocus([o],t)}findNextIndex(e,t=!1,n){for(let o=0;o=this.length&&!t)return-1;if(e=e%this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let o=0;othis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new X1(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(Cv(t)){const s=r-this.view.renderHeight;this.view.setScrollTop(s*Za(t,0,1)+o)}else{const s=o+r,a=n+this.view.renderHeight;o=a||(o=a&&r>=this.view.renderHeight?this.view.setScrollTop(o):s>=a&&this.view.setScrollTop(s-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(n=>this.view.element(n)),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 n;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(n=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",n||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()}}Kb([Mo],qd.prototype,"onDidChangeFocus",null);Kb([Mo],qd.prototype,"onDidChangeSelection",null);Kb([Mo],qd.prototype,"onContextMenu",null);Kb([Mo],qd.prototype,"onKeyDown",null);Kb([Mo],qd.prototype,"onDidFocus",null);const _0=He,G1e="selectOption.entry.template";class But{get templateId(){return G1e}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Ae(e,_0(".option-text")),t.detail=Ae(e,_0(".option-detail")),t.decoratorRight=Ae(e,_0(".option-decorator-right")),t}renderElement(e,t,n){const o=n,r=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;o.text.textContent=r,o.detail.textContent=s||"",o.decoratorRight.innerText=a||"",l?o.root.classList.add("option-disabled"):o.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Vh extends _e{constructor(e,t,n,o,r){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=o,this.selectBoxOptions=r||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Vh.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 le,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(n),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return G1e}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=He(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Ae(this.selectDropDownContainer,_0(".select-box-details-pane"));const t=Ae(this.selectDropDownContainer,_0(".select-box-dropdown-container-width-control")),n=Ae(t,_0(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Ae(n,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Wc(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ke(this.selectDropDownContainer,et.DRAG_START,o=>{un.stop(o,!0)}))}registerListeners(){this._register(No(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(ke(this.selectElement,et.CLICK,t=>{un.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ke(this.selectElement,et.MOUSE_DOWN,t=>{un.stop(t)}));let e;this._register(ke(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ke(this.selectElement,"touchend",t=>{un.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ke(this.selectElement,et.KEY_DOWN,t=>{const n=new Pi(t);let o=!1;Nn?(n.keyCode===18||n.keyCode===16||n.keyCode===10||n.keyCode===3)&&(o=!0):(n.keyCode===18&&n.altKey||n.keyCode===16&&n.altKey||n.keyCode===10||n.keyCode===3)&&(o=!0),o&&(this.showSelectDropDown(),un.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Lo(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((n,o)=>{this.selectElement.add(this.createOption(n.text,o,n.isDisabled)),typeof n.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,!!this.options[this.selected]&&!!this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){var e,t,n;const o=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(n=this.styles.selectBorder)!==null&&n!==void 0?n:"";this.selectElement.style.backgroundColor=o,this.selectElement.style.color=r,this.selectElement.style.borderColor=s}styleList(){var e,t;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=I0(this.styles.selectListBackground,n);this.selectDropDownListContainer.style.backgroundColor=o,this.selectionDetailsPane.style.backgroundColor=o;const r=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=r,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,n){const o=document.createElement("option");return o.value=e,o.text=e,o.disabled=!!n,o}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,n)=>{this.updateDetail(n),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=Yo(this.selectElement),n=getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),s=t.top-Vh.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+o+u,f=Math.floor((r-o-u)/this.getHeight()),g=Math.floor((s-o-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.topr&&(d=f*this.getHeight())}else h>s&&(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+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+o+"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 n=0,o=0;this.options.forEach((r,s)=>{const a=r.detail?r.detail.length:0,l=r.decoratorRight?r.decoratorRight.length:0,c=r.text.length+a+l;c>o&&(n=s,o=c)}),e.textContent=this.options[n].text+(this.options[n].decoratorRight?this.options[n].decoratorRight+" ":""),t=Ea(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Ae(e,_0(".select-box-dropdown-list-container")),this.listRenderer=new But,this.selectList=new qd("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:o=>{let r=o.text;return o.detail&&(r+=`. ${o.detail}`),o.decoratorRight&&(r+=`. ${o.decoratorRight}`),o.description&&(r+=`. ${o.description}`),r},getWidgetAriaLabel:()=>C({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Nn?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new xn(this.selectDropDownListContainer,"keydown")),n=st.chain(t.event,o=>o.filter(()=>this.selectList.length>0).map(r=>new Pi(r)));this._register(st.chain(n,o=>o.filter(r=>r.keyCode===3))(this.onEnter,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===2))(this.onEnter,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===9))(this.onEscape,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===16))(this.onUpArrow,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===18))(this.onDownArrow,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===12))(this.onPageDown,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===11))(this.onPageUp,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===14))(this.onHome,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===13))(this.onEnd,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode>=21&&r.keyCode<=56||r.keyCode>=85&&r.keyCode<=113))(this.onCharacter,this)),this._register(ke(this.selectList.getHTMLElement(),et.POINTER_UP,o=>this.onPointerUp(o))),this._register(this.selectList.onMouseOver(o=>typeof o.index!="undefined"&&this.selectList.setFocus([o.index]))),this._register(this.selectList.onDidChangeFocus(o=>this.onListFocus(o))),this._register(ke(this.selectDropDownContainer,et.FOCUS_OUT,o=>{!this._isVisible||rs(o.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;un.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const n=t.closest(".monaco-list-row");if(!n)return;const o=Number(n.getAttribute("data-index")),r=n.classList.contains("option-disabled");o>=0&&o{for(let s=0;sthis.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&&(un.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){un.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){un.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){un.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=xg.toString(e.keyCode);let n=-1;for(let o=0;o{this._register(ke(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(No(this.selectElement,"click",e=>{un.stop(e,!0)})),this._register(No(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(No(this.selectElement,"keydown",e=>{let t=!1;Nn?(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||!Lo(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((n,o)=>{this.selectElement.add(this.createOption(n.text,o,n.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(o)}))}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 vw)),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(Ei.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,Fc&&this._register(ke(e,et.DRAG_START,o=>{var r;return(r=o.dataTransfer)===null||r===void 0?void 0:r.setData(vk.TEXT,this._action.label)}))),this._register(ke(t,Di.Tap,o=>this.onClick(o,!0))),this._register(ke(t,et.MOUSE_DOWN,o=>{n||un.stop(o,!0),this._action.enabled&&o.button===0&&t.classList.add("active")})),Nn&&this._register(ke(t,et.CONTEXT_MENU,o=>{o.button===0&&o.ctrlKey===!0&&this.onClick(o)})),this._register(ke(t,et.CLICK,o=>{un.stop(o,!0),this.options&&this.options.isMenu||this.onClick(o)})),this._register(ke(t,et.DBLCLICK,o=>{un.stop(o,!0)})),[et.MOUSE_UP,et.MOUSE_OUT].forEach(o=>{this._register(ke(t,o,r=>{un.stop(r),t.classList.remove("active")}))})}onClick(e,t=!1){var n;un.stop(e,!0);const o=Al(this._context)?!((n=this.options)===null||n===void 0)&&n.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,o)}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=V1e(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 Ow extends wu{constructor(e,t,n){super(e,t,n),this.options=n,this.options.icon=n.icon!==void 0?n.icon:!1,this.options.label=n.label!==void 0?n.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=Ae(this.element,He("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(Ae(this.element,He("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===kr.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=C({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 Hut extends wu{constructor(e,t,n,o,r,s,a){super(e,t),this.selectBox=new Vut(n,o,r,s,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 $ut extends vw{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Ae(e,He(".monaco-dropdown")),this._label=Ae(this._element,He(".dropdown-label"));let n=t.labelRenderer;n||(n=r=>(r.textContent=t.label||"",null));for(const r of[et.CLICK,et.MOUSE_DOWN,Di.Tap])this._register(ke(this.element,r,s=>un.stop(s,!0)));for(const r of[et.MOUSE_DOWN,Di.Tap])this._register(ke(this._label,r,s=>{s instanceof MouseEvent&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(ke(this._label,et.KEY_UP,r=>{const s=new Pi(r);(s.equals(3)||s.equals(10))&&(un.stop(r,!0),this.visible?this.hide():this.show())}));const o=n(this._label);o&&this._register(o),this._register(Ei.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 zut extends $ut{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 OP extends wu{constructor(e,t,n,o=Object.create(null)){super(null,e,o),this.actionItem=null,this._onDidChangeVisibility=this._register(new le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=o,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=r=>{this.element=Ae(r,He("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),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},n=Array.isArray(this.menuActionsOrProvider),o={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:n?this.menuActionsOrProvider:void 0,actionProvider:n?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new zut(e,o)),this._register(this.dropdownMenu.onDidChangeVisibility(r=>{var s;(s=this.element)===null||s===void 0||s.setAttribute("aria-expanded",`${r}`),this._onDidChangeVisibility.fire(r)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const r=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return r.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 n=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",n),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",n)}}function Uut(i){return i?i.condition!==void 0:!1}var ML=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Py;(function(i){i[i.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",i[i.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(Py||(Py={}));var GC;(function(i){i[i.None=0]="None",i[i.Initialized=1]="Initialized",i[i.Closed=2]="Closed"})(GC||(GC={}));class Oy extends _e{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Y0),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=GC.None,this.cache=new Map,this.flushDelayer=this._register(new E0e(Oy.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,n;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((o,r)=>this.acceptExternal(r,o)),(n=e.deleted)===null||n===void 0||n.forEach(o=>this.acceptExternal(o,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===GC.Closed)return;let n=!1;Al(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const n=this.cache.get(e);return Al(n)?t:n}getBoolean(e,t){const n=this.get(e);return Al(n)?t:n==="true"}getNumber(e,t){const n=this.get(e);return Al(n)?t:parseInt(n,10)}set(e,t,n=!1){return ML(this,void 0,void 0,function*(){if(this.state===GC.Closed)return;if(Al(t))return this.delete(e,n);const o=ia(t)||Array.isArray(t)?Zdt(t):String(t);if(this.cache.get(e)!==o)return this.cache.set(e,o),this.pendingInserts.set(e,o),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()})}delete(e,t=!1){return ML(this,void 0,void 0,function*(){if(!(this.state===GC.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 ML(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 ML(this,void 0,void 0,function*(){return this.options.hint===Py.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}Oy.DEFAULT_FLUSH_DELAY=100;class B9{constructor(){this.onDidChangeItemsExternal=st.None,this.items=new Map}updateItems(e){var t,n;return ML(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((o,r)=>this.items.set(r,o)),(n=e.delete)===null||n===void 0||n.forEach(o=>this.items.delete(o))})}}const bM="__$__targetStorageMarker",Gd=yn("storageService");var FP;(function(i){i[i.NONE=0]="NONE",i[i.SHUTDOWN=1]="SHUTDOWN"})(FP||(FP={}));function jut(i){const e=i.get(bM);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class O5 extends _e{constructor(e={flushInterval:O5.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Y0),this._onDidChangeTarget=this._register(new Y0),this._onWillSaveState=this._register(new le),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,n){return st.filter(this._onDidChangeValue.event,o=>o.scope===e&&(t===void 0||o.key===t),n)}emitDidChangeValue(e,t){const{key:n,external:o}=t;if(n===bM){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:n,target:this.getKeyTargets(e)[n],external:o})}get(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.get(e,n)}getBoolean(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getBoolean(e,n)}getNumber(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getNumber(e,n)}store(e,t,n,o,r=!1){if(Al(t)){this.remove(e,n,r);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,n,o),(s=this.getStorage(n))===null||s===void 0||s.set(e,t,r)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,t,void 0),(o=this.getStorage(t))===null||o===void 0||o.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,o=!1){var r,s;const a=this.getKeyTargets(t);typeof n=="number"?a[e]!==n&&(a[e]=n,(r=this.getStorage(t))===null||r===void 0||r.set(bM,JSON.stringify(a),o)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(bM,JSON.stringify(a),o))}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?jut(t):Object.create(null)}}O5.DEFAULT_FLUSH_INTERVAL=60*1e3;class Kut extends O5{constructor(){super(),this.applicationStorage=this._register(new Oy(new B9,{hint:Py.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Oy(new B9,{hint:Py.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Oy(new B9,{hint:Py.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 qut(i,e){const t=Object.assign({},e);for(const n in i){const o=i[n];t[n]=o!==void 0?ct(o):void 0}return t}const Gut={keybindingLabelBackground:ct(Tnt),keybindingLabelForeground:ct(Nnt),keybindingLabelBorder:ct(Rnt),keybindingLabelBottomBorder:ct(Mnt),keybindingLabelShadow:ct(Gh)},Xut={buttonForeground:ct(CL),buttonSeparator:ct(mnt),buttonBackground:ct(yL),buttonHoverBackground:ct(vnt),buttonSecondaryForeground:ct(bnt),buttonSecondaryBackground:ct(pH),buttonSecondaryHoverBackground:ct(Cnt),buttonBorder:ct(_nt)},Yut={progressBarBackground:ct(Snt)},BP={inputActiveOptionBorder:ct(LG),inputActiveOptionForeground:ct(EG),inputActiveOptionBackground:ct(f0)};ct(hit),ct(git),ct(fit);ct(po),ct(Zh),ct(Gh),ct(Ln),ct(Tit),ct(Nit),ct(Rit),ct(rnt);const WP={inputBackground:ct(obe),inputForeground:ct(rbe),inputBorder:ct(sbe),inputValidationInfoBorder:ct(lnt),inputValidationInfoBackground:ct(snt),inputValidationInfoForeground:ct(ant),inputValidationWarningBorder:ct(unt),inputValidationWarningBackground:ct(cnt),inputValidationWarningForeground:ct(dnt),inputValidationErrorBorder:ct(gnt),inputValidationErrorBackground:ct(hnt),inputValidationErrorForeground:ct(fnt)},Zut={listFilterWidgetBackground:ct(rit),listFilterWidgetOutline:ct(sit),listFilterWidgetNoMatchesOutline:ct(ait),listFilterWidgetShadow:ct(lit),inputBoxStyles:WP,toggleStyles:BP},X1e={badgeBackground:ct(dM),badgeForeground:ct(ynt),badgeBorder:ct(Ln)};ct(Sit),ct(wit),ct(Tre),ct(Tre),ct(xit);const qb={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ct(Xnt),listFocusForeground:ct(Ynt),listFocusOutline:ct(Znt),listActiveSelectionBackground:ct(Wg),listActiveSelectionForeground:ct(ef),listActiveSelectionIconForeground:ct(LL),listFocusAndSelectionOutline:ct(Qnt),listFocusAndSelectionBackground:ct(Wg),listFocusAndSelectionForeground:ct(ef),listInactiveSelectionBackground:ct(Jnt),listInactiveSelectionIconForeground:ct(tit),listInactiveSelectionForeground:ct(eit),listInactiveFocusBackground:ct(nit),listInactiveFocusOutline:ct(iit),listHoverBackground:ct(cbe),listHoverForeground:ct(dbe),listDropBackground:ct(oit),listSelectionOutline:ct(Wi),listHoverOutline:ct(Wi),treeIndentGuidesStroke:ct(EL),treeInactiveIndentGuidesStroke:ct(cit),tableColumnsBorder:ct(dit),tableOddRowsBackgroundColor:ct(uit)};function ES(i){return qut(i,qb)}const Qut={selectBackground:ct(Xh),selectListBackground:ct(pnt),selectForeground:ct(Og),decoratorRightForeground:ct(abe),selectBorder:ct(PC),focusBorder:ct(Hl),listFocusBackground:ct(p0),listInactiveSelectionIconForeground:ct(OC),listFocusForeground:ct(g0),listFocusOutline:nnt(Wi,ve.transparent.toString()),listHoverBackground:ct(cbe),listHoverForeground:ct(dbe),listHoverOutline:ct(Wi),selectListBorder:ct(Qh),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},Jut={shadowColor:ct(Gh),borderColor:ct(pit),foregroundColor:ct(mit),backgroundColor:ct(vit),selectionForegroundColor:ct(_it),selectionBackgroundColor:ct(bit),selectionBorderColor:ct(Cit),separatorColor:ct(yit),scrollbarShadow:ct(wnt),scrollbarSliderBackground:ct(wL),scrollbarSliderHoverBackground:ct(SL),scrollbarSliderActiveBackground:ct(xL)};var F5=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Na=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Y1e=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function eht(i,e,t,n){const o=i.getActions(e),r=Mg.getInstance(),s=r.keyStatus.altKey||(ls||xs)&&r.keyStatus.shiftKey;Q1e(o,t,s,n?a=>a===n:a=>a==="navigation")}function Z1e(i,e,t,n,o,r){const s=i.getActions(e);Q1e(s,t,!1,typeof n=="string"?l=>l===n:n,o,r)}function Q1e(i,e,t,n=s=>s==="navigation",o=()=>!1,r=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of i){let u;n(c)?(u=s,u.length>0&&r&&u.push(new kr)):(u=a,u.length>0&&u.push(new kr));for(let h of d){t&&(h=h instanceof Fd&&h.alt?h.alt:h);const f=u.push(h);h instanceof _w&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:d,index:u}of l){const h=n(c)?s:a,f=d.actions;o(d,c,h.length)&&h.splice(u,1,...f)}}let ab=class extends Ow{constructor(e,t,n,o,r,s,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=n,this._notificationService=o,this._contextKeyService=r,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Kr),this._altKey=Mg.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return Y1e(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 n=()=>{var o;const r=!!(!((o=this._menuItemAction.alt)===null||o===void 0)&&o.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);r!==this._wantsAltCommand&&(this._wantsAltCommand=r,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(n)),this._register(ke(e,"mouseleave",o=>{t=!1,n()})),this._register(ke(e,"mouseenter",o=>{t=!0,n()})),n()}}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),n=t&&t.getLabel(),o=this._commandAction.tooltip||this._commandAction.label;let r=n?C("titleAndKb","{0} ({1})",o,n):o;if(!this._wantsAltCommand&&((e=this._menuItemAction.alt)===null||e===void 0?void 0:e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?C("titleAndKb","{0} ({1})",s,l):s;r=C("titleAndKbAndAlt",`{0} +[{1}] {2}`,r,lX.modifierLabels[Vl].altKey,c)}return r}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:n}=this;if(!t||!n)return;const o=this._commandAction.checked&&Uut(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(!!o)if(Mt.isThemeIcon(o)){const r=Mt.asClassNameArray(o);n.classList.add(...r),this._itemClassDispose.value=zt(()=>{n.classList.remove(...r)})}else{const r=Ew(this._themeService.getColorTheme().type)?Sv(o.dark):Sv(o.light),s=He("span");s.style.webkitMask=s.style.mask=`${r} no-repeat 50% 50%`,s.style.background="var(--vscode-icon-foreground)",s.style.display="inline-block",s.style.width="100%",s.style.height="100%",n.appendChild(s),n.classList.add("icon"),this._itemClassDispose.value=Td(zt(()=>{n.classList.remove("icon"),jr(n)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};ab=F5([Na(2,xi),Na(3,Ao),Na(4,Ut),Na(5,vr),Na(6,Kd),Na(7,bp)],ab);let f$=class extends OP{constructor(e,t,n,o,r){var s,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Mt.isThemeIcon(e.item.icon)?Mt.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:d=>n.lookupKeybinding(d.id)});super(e,{getActions:()=>e.actions},o,c),this._keybindingService=n,this._contextMenuService=o,this._themeService=r}render(e){super.render(e),fi(this.element),e.classList.add("menu-entry");const t=this._action,{icon:n}=t.item;if(n&&!Mt.isThemeIcon(n)){this.element.classList.add("icon");const o=()=>{this.element&&(this.element.style.backgroundImage=Ew(this._themeService.getColorTheme().type)?Sv(n.dark):Sv(n.light))};o(),this._register(this._themeService.onDidColorThemeChange(()=>{o()}))}}};f$=F5([Na(2,xi),Na(3,Kd),Na(4,vr)],f$);let g$=class extends wu{constructor(e,t,n,o,r,s,a,l){var c,d,u;super(null,e),this._keybindingService=n,this._notificationService=o,this._contextMenuService=r,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(ab,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 vw});this._dropdown=new OP(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof Fd&&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(ab,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends vw{runAction(n,o){return Y1e(this,void 0,void 0,function*(){yield n.run(void 0)})}},this._container&&this._defaultAction.render(v0e(this._container,He(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let n;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const o=this._keybindingService.lookupKeybinding(e.id);o&&(n=`(${o.getLabel()})`)}return n}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=He(".action-container");this._defaultAction.render(Ae(this._container,t)),this._register(ke(t,et.KEY_DOWN,o=>{const r=new Pi(o);r.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),r.stopPropagation())}));const n=He(".dropdown-action-container");this._dropdown.render(Ae(this._container,n)),this._register(ke(n,et.KEY_DOWN,o=>{var r;const s=new Pi(o);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(r=this._defaultAction.element)===null||r===void 0||r.focus(),s.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()}};g$=F5([Na(2,xi),Na(3,Ao),Na(4,Kd),Na(5,If),Na(6,$t),Na(7,Gd)],g$);let p$=class extends Hut{constructor(e,t){super(null,e,e.actions.map(n=>({text:n.id===kr.ID?"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500":n.label,isDisabled:!n.enabled})),0,t,Qut,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=ct(PC)}runAction(e,t){const n=this.action.actions[t];n&&this.actionRunner.run(n)}};p$=F5([Na(1,Cp)],p$);function tht(i,e,t){return e instanceof Fd?i.createInstance(ab,e,t):e instanceof BD?e.item.isSelection?i.createInstance(p$,e):e.item.rememberDefaultAction?i.createInstance(g$,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):i.createInstance(f$,e,t):void 0}var nht=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class zc extends _e{constructor(e,t={}){var n,o,r,s,a,l;super(),this._actionRunnerDisposables=this._register(new Be),this.viewItemDisposables=this._register(new zq),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new le({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new le),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new le),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(n=t.context)!==null&&n!==void 0?n:null,this._orientation=(o=this.options.orientation)!==null&&o!==void 0?o:0,this._triggerKeys={keyDown:(s=(r=this.options.triggerKeys)===null||r===void 0?void 0:r.keyDown)!==null&&s!==void 0?s:!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 vw,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(ke(this.domNode,et.KEY_DOWN,u=>{const h=new Pi(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 wu&&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(ke(this.domNode,et.KEY_UP,u=>{const h=new Pi(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(pf(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Nd()===this.domNode||!rs(Nd(),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(n=>n instanceof wu&&n.isEnabled());t instanceof wu&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof wu&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(n=>{t=t||e.equals(n)}),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 n=0;n{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(r,l)),a||(a=new Ow(this.context,r,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ke(s,et.CONTEXT_MENU,c=>{un.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof wu&&this.viewItems.length===0&&a.setFocusable(!0),o===null||o<0||o>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[o]),this.viewItems.splice(o,0,a),o++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=si(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ur(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,n;if(e===void 0?t=!0:typeof e=="number"?n=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem=="undefined"){const o=this.viewItems.findIndex(r=>r.isEnabled());this.focusedItem=o===-1?void 0:o,this.updateFocus(void 0,void 0,!0)}else n!==void 0&&(this.focusedItem=n),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=="undefined")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===kr.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem=="undefined")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===kr.ID));return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var o;typeof this.focusedItem=="undefined"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((o=this.viewItems[this.previouslyFocusedItem])===null||o===void 0||o.blur());const r=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(r){let s=!0;ID(r.focus)||(s=!1),this.options.focusOnlyEnabledItems&&ID(r.isEnabled)&&!r.isEnabled()&&(s=!1),r.action.id===kr.ID&&(s=!1),s?(n||this.previouslyFocusedItem!==this.focusedItem)&&(r.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem=="undefined")return;const t=this.viewItems[this.focusedItem];if(t instanceof wu){const n=t._context===null||t._context===void 0?e:t._context;this.run(t._action,n)}}run(e,t){return nht(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=si(this.viewItems),this.getContainer().remove(),super.dispose()}}const m$=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,W9=/(&)?(&)([^\s&])/g;var VP;(function(i){i[i.Right=0]="Right",i[i.Left=1]="Left"})(VP||(VP={}));class Fy extends zc{constructor(e,t,n,o){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const r=document.createElement("div");r.classList.add("monaco-menu"),r.setAttribute("role","presentation"),super(r,{orientation:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,n,s),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Nn||xs?[10]:[]],keyDown:!0}}),this.menuStyles=o,this.menuElement=r,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Be),this.initializeOrUpdateStyleSheet(e,o),this._register(Ei.addTarget(r)),ke(r,et.KEY_DOWN,l=>{new Pi(l).equals(2)&&l.preventDefault()}),n.enableMnemonics&&this.menuDisposables.add(ke(r,et.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){un.stop(l,!0);const d=this.mnemonics.get(c);if(d.length===1&&(d[0]instanceof mae&&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)}}})),xs&&this._register(ke(r,et.KEY_DOWN,l=>{const c=new Pi(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),un.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),un.stop(l,!0))})),this._register(ke(this.domNode,et.MOUSE_OUT,l=>{const c=l.relatedTarget;rs(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(ke(this.actionsList,et.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!rs(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(Ei.addTarget(this.actionsList)),this._register(ke(this.actionsList,Di.Tap,l=>{let c=l.initialTarget;if(!(!c||!rs(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 s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new QI(r,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,o),this._register(ke(r,Di.Change,l=>{un.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(ke(a,et.MOUSE_UP,l=>{l.preventDefault()})),r.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=n.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof vae)).forEach((l,c,d)=>{l.updatePositionInSet(c+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(XA(e)?this.styleSheet=Wc(e):(Fy.globalStyleSheet||(Fy.globalStyleSheet=Wc()),this.styleSheet=Fy.globalStyleSheet)),this.styleSheet.textContent=oht(t,XA(e))}styleScrollElement(e,t){var n,o;const r=(n=t.foregroundColor)!==null&&n!==void 0?n:"",s=(o=t.backgroundColor)!==null&&o!==void 0?o:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=r,e.style.backgroundColor=s,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(ke(this.element,et.MOUSE_UP,r=>{if(un.stop(r,!0),Fc){if(new kc(r).rightButton)return;this.onClick(r)}else setTimeout(()=>{this.onClick(r)},0)})),this._register(ke(this.element,et.CONTEXT_MENU,r=>{un.stop(r,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Ae(this.element,He("a.action-menu-item")),this._action.id===kr.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Ae(this.item,He("span.menu-item-check"+Mt.asCSSSelector(Xe.menuSelection))),this.check.setAttribute("role","none"),this.label=Ae(this.item,He("span.action-label")),this.options.label&&this.options.keybinding&&(Ae(this.item,He("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(!!this.label&&this.options.label){Ur(this.label);let t=mX(this.action.label);if(t){const n=iht(t);this.options.enableMnemonics||(t=n),this.label.setAttribute("aria-label",n.replace(/&&/g,"&"));const o=m$.exec(t);if(o){t=UA(t),W9.lastIndex=0;let r=W9.exec(t);for(;r&&r[1];)r=W9.exec(t);const s=a=>a.replace(/&&/g,"&");r?this.label.append(VI(s(t.substr(0,r.index))," "),He("u",{"aria-hidden":"true"},r[3]),z_e(s(t.substr(r.index+r[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(o[1]?o[1]:o[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,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,o=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",r=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t!=null?t:"",this.item.style.backgroundColor=n!=null?n:"",this.item.style.outline=o,this.item.style.outlineOffset=r),this.check&&(this.check.style.color=t!=null?t:"")}}class mae extends J1e{constructor(e,t,n,o,r){super(e,e,o,r),this.submenuActions=t,this.parentData=n,this.submenuOptions=o,this.mysubmenu=null,this.submenuDisposables=this._register(new Be),this.mouseOver=!1,this.expandDirection=o&&o.expandDirection!==void 0?o.expandDirection:VP.Right,this.showScheduler=new bi(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new bi(()=>{this.element&&!rs(Nd(),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=Ae(this.item,He("span.submenu-indicator"+Mt.asCSSSelector(Xe.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ke(this.element,et.KEY_UP,t=>{const n=new Pi(t);(n.equals(17)||n.equals(3))&&(un.stop(t,!0),this.createSubmenu(!0))})),this._register(ke(this.element,et.KEY_DOWN,t=>{const n=new Pi(t);Nd()===this.item&&(n.equals(17)||n.equals(3))&&un.stop(t,!0)})),this._register(ke(this.element,et.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ke(this.element,et.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ke(this.element,et.FOCUS_OUT,t=>{this.element&&!rs(Nd(),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){un.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,n,o){const r={top:0,left:0};return r.left=jC(e.width,t.width,{position:o===VP.Right?0:1,offset:n.left,size:n.width}),r.left>=n.left&&r.left{new Pi(c).equals(15)&&(un.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ke(this.submenuContainer,et.KEY_DOWN,c=>{new Pi(c).equals(15)&&un.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 vae extends Ow{constructor(e,t,n,o){super(e,t,n),this.menuStyles=o}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function iht(i){const e=m$,t=e.exec(i);if(!t)return i;const n=!t[1];return i.replace(e,n?"$2$3":"").trim()}function _ae(i){const e=W_e()[i.id];return`.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`}function oht(i,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } -${vae(Xe.menuSelection)} -${vae(Xe.menuSubmenu)} +${_ae(Xe.menuSelection)} +${_ae(Xe.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; @@ -982,78 +982,78 @@ ${vae(Xe.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${s}; } - `)}return t}class iht{constructor(e,t,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,this.keybindingService=o,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 n;const o=aG(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:r=>{var s;this.lastContainer=r;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(r.className+=" "+a),this.options.blockMouse&&(this.block=r.appendChild(He(".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",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=ke(this.block,et.MOUSE_DOWN,d=>d.stopPropagation()));const l=new Be,c=e.actionRunner||new vw;return c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),n=new Fy(r,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},Zut),n.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),n.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(ke(window,et.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(ke(window,et.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const u=new kc(d);let h=u.target;if(!u.rightButton){for(;h;){if(h===r)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),Td(l,n)},focus:()=>{n==null||n.focus(!!e.autoSelectFirstItem)},onHide:r=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!r),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,!!this.lastContainer&&(Nd()===this.lastContainer||rs(Nd(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},o,!!o)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!sh(e.error)&&this.notificationService.error(e.error)}}var oht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Y1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let m$=class extends _e{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new iht(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,n,o,r,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=n,this.keybindingService=o,this.menuService=r,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new le),this._onDidHideContextMenu=this._store.add(new le)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=v$.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var n;(n=e.onHide)===null||n===void 0||n.call(e,t),this._onDidHideContextMenu.fire()}})),Mg.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};m$=oht([Y1(0,tc),Y1(1,Ao),Y1(2,bp),Y1(3,xi),Y1(4,If),Y1(5,Ut)],m$);var v$;(function(i){function e(n){return n&&n.menuId instanceof Z}function t(n,o,r){if(!e(n))return n;const{menuId:s,menuActionOptions:a,contextKeyService:l}=n;return Object.assign(Object.assign({},n),{getActions:()=>{const c=[];if(s){const d=o.createMenu(s,l!=null?l:r);Qut(d,a,c),d.dispose()}return n.getActions?kr.join(n.getActions(),c):c}})}i.transform=t})(v$||(v$={}));var HP;(function(i){i[i.API=0]="API",i[i.USER=1]="USER"})(HP||(HP={}));var bX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},$P=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},G_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let _$=class{constructor(e){this._commandService=e}open(e,t){return G_(this,void 0,void 0,function*(){if(!oX(e,hn.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Rt.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let n=[];try{n=a$(decodeURIComponent(e.query))}catch{try{n=a$(e.query)}catch{}}return Array.isArray(n)||(n=[n]),yield this._commandService.executeCommand(e.path,...n),!0})}};_$=bX([$P(0,_o)],_$);let b$=class{constructor(e){this._editorService=e}open(e,t){return G_(this,void 0,void 0,function*(){typeof e=="string"&&(e=Rt.parse(e));const{selection:n,uri:o}=lct(e);return e=o,e.scheme===hn.file&&(e=Ust(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:n,source:t!=null&&t.fromUserGesture?HP.USER:HP.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};b$=bX([$P(0,Jn)],b$);let C$=class{constructor(e,t){this._openers=new oa,this._validators=new oa,this._resolvers=new oa,this._resolvedUriTargets=new _s(n=>n.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new oa,this._defaultExternalOpener={openExternal:n=>G_(this,void 0,void 0,function*(){return $se(n,hn.http,hn.https)?b0e(n):window.location.href=n,!0})},this._openers.push({open:(n,o)=>G_(this,void 0,void 0,function*(){return(o==null?void 0:o.openExternal)||$se(n,hn.mailto,hn.http,hn.https,hn.vsls)?(yield this._doOpenExternal(n,o),!0):!1})}),this._openers.push(new _$(t)),this._openers.push(new b$(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var n;return G_(this,void 0,void 0,function*(){const o=typeof e=="string"?Rt.parse(e):e,r=(n=this._resolvedUriTargets.get(o))!==null&&n!==void 0?n:e;for(const s of this._validators)if(!(yield s.shouldOpen(r,t)))return!1;for(const s of this._openers)if(yield s.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return G_(this,void 0,void 0,function*(){for(const n of this._resolvers)try{const o=yield n.resolveExternalUri(e,t);if(o)return this._resolvedUriTargets.has(o.resolved)||this._resolvedUriTargets.set(o.resolved,e),o}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return G_(this,void 0,void 0,function*(){const n=typeof e=="string"?Rt.parse(e):e;let o;try{o=(yield this.resolveExternalUri(n,t)).resolved}catch{o=n}let r;if(typeof e=="string"&&n.toString()===o.toString()?r=e:r=encodeURI(o.toString(!0)),t!=null&&t.allowContributedOpeners){const s=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(r,{sourceUri:n,preferredOpenerId:s},_n.None))return!0}return this._defaultExternalOpener.openExternal(r,{sourceUri:n},_n.None)})}dispose(){this._validators.clear()}};C$=bX([$P(0,Jn),$P(1,_o)],C$);const Xd=yn("editorWorkerService");var ao;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(ao||(ao={}));(function(i){function e(s,a){return a-s}i.compare=e;const t=Object.create(null);t[i.Error]=C("sev.error","Error"),t[i.Warning]=C("sev.warning","Warning"),t[i.Info]=C("sev.info","Info");function n(s){return t[s]||""}i.toString=n;function o(s){switch(s){case So.Error:return i.Error;case So.Warning:return i.Warning;case So.Info:return i.Info;case So.Ignore:return i.Hint}}i.fromSeverity=o;function r(s){switch(s){case i.Error:return So.Error;case i.Warning:return So.Warning;case i.Info:return So.Info;case i.Hint:return So.Ignore}}i.toSeverity=r})(ao||(ao={}));var zP;(function(i){const e="";function t(o){return n(o,!0)}i.makeKey=t;function n(o,r){const s=[e];return o.source?s.push(o.source.replace("\xA6","\\\xA6")):s.push(e),o.code?typeof o.code=="string"?s.push(o.code.replace("\xA6","\\\xA6")):s.push(o.code.value.replace("\xA6","\\\xA6")):s.push(e),o.severity!==void 0&&o.severity!==null?s.push(ao.toString(o.severity)):s.push(e),o.message&&r?s.push(o.message.replace("\xA6","\\\xA6")):s.push(e),o.startLineNumber!==void 0&&o.startLineNumber!==null?s.push(o.startLineNumber.toString()):s.push(e),o.startColumn!==void 0&&o.startColumn!==null?s.push(o.startColumn.toString()):s.push(e),o.endLineNumber!==void 0&&o.endLineNumber!==null?s.push(o.endLineNumber.toString()):s.push(e),o.endColumn!==void 0&&o.endColumn!==null?s.push(o.endColumn.toString()):s.push(e),s.push(e),s.join("\xA6")}i.makeKeyOptionalMessage=n})(zP||(zP={}));const Rf=yn("markerService");function rht(i,e){const t=[],n=[];for(const o of i)e.has(o)||t.push(o);for(const o of e)i.has(o)||n.push(o);return{removed:t,added:n}}function sht(i,e){const t=new Set;for(const n of e)i.has(n)&&t.add(n);return t}var aht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_ae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let y$=class extends _e{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new le),this._markerDecorations=new _s,e.getModels().forEach(n=>this._onModelAdded(n)),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 n=this._markerDecorations.get(e);return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const n=this._markerDecorations.get(t);n&&this._updateDecorations(n)})}_onModelAdded(e){const t=new lht(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const n=this._markerDecorations.get(e.uri);n&&(n.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===hn.inMemory||e.uri.scheme===hn.internal||e.uri.scheme===hn.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(o=>o.owner).forEach(o=>this._markerService.remove(o,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};y$=aht([_ae(0,Yi),_ae(1,Rf)],y$);class lht extends _e{constructor(e){super(),this.model=e,this._map=new jet,this._register(zt(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:n}=rht(new Set(this._map.keys()),new Set(e));if(t.length===0&&n.length===0)return!1;const o=n.map(a=>this._map.get(a)),r=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(o,r);for(const a of n)this._map.delete(a);for(let a=0;a=o)return n;const r=e.getWordAtPosition(n.getStartPosition());r&&(n=new V(n.startLineNumber,r.startColumn,n.endLineNumber,r.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&n.startLineNumber===n.endLineNumber){const o=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);o=0:!1}}var cht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},hC;function y_(i){return i.toString()}class dht{constructor(e,t,n){this.model=e,this._modelEventListeners=new Be,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(o=>n(e,o)))}dispose(){this._modelEventListeners.dispose()}}const uht=xs||Nn?1:2;class hht{constructor(e,t,n,o,r,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=n,this.sharesUndoRedoStack=o,this.heapSize=r,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let UP=hC=class extends _e{constructor(e,t,n,o,r){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=n,this._languageService=o,this._languageConfigurationService=r,this._onModelAdded=this._register(new le),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new le),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new le),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var n;let o=vs.tabSize;if(e.editor&&typeof e.editor.tabSize!="undefined"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(o=f),o<1&&(o=1)}let r="tabSize";if(e.editor&&typeof e.editor.indentSize!="undefined"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(r=Math.max(f,1))}let s=vs.insertSpaces;e.editor&&typeof e.editor.insertSpaces!="undefined"&&(s=e.editor.insertSpaces==="false"?!1:Boolean(e.editor.insertSpaces));let a=uht;const l=e.eol;l===`\r + `)}return t}class rht{constructor(e,t,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,this.keybindingService=o,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 n;const o=lG(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:r=>{var s;this.lastContainer=r;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(r.className+=" "+a),this.options.blockMouse&&(this.block=r.appendChild(He(".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",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=ke(this.block,et.MOUSE_DOWN,d=>d.stopPropagation()));const l=new Be,c=e.actionRunner||new vw;return c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),n=new Fy(r,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},Jut),n.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),n.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(ke(window,et.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(ke(window,et.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const u=new kc(d);let h=u.target;if(!u.rightButton){for(;h;){if(h===r)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),Td(l,n)},focus:()=>{n==null||n.focus(!!e.autoSelectFirstItem)},onHide:r=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!r),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,!!this.lastContainer&&(Nd()===this.lastContainer||rs(Nd(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},o,!!o)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!sh(e.error)&&this.notificationService.error(e.error)}}var sht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Y1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let v$=class extends _e{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new rht(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,n,o,r,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=n,this.keybindingService=o,this.menuService=r,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new le),this._onDidHideContextMenu=this._store.add(new le)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=_$.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var n;(n=e.onHide)===null||n===void 0||n.call(e,t),this._onDidHideContextMenu.fire()}})),Mg.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};v$=sht([Y1(0,tc),Y1(1,Ao),Y1(2,Cp),Y1(3,xi),Y1(4,If),Y1(5,Ut)],v$);var _$;(function(i){function e(n){return n&&n.menuId instanceof Z}function t(n,o,r){if(!e(n))return n;const{menuId:s,menuActionOptions:a,contextKeyService:l}=n;return Object.assign(Object.assign({},n),{getActions:()=>{const c=[];if(s){const d=o.createMenu(s,l!=null?l:r);eht(d,a,c),d.dispose()}return n.getActions?kr.join(n.getActions(),c):c}})}i.transform=t})(_$||(_$={}));var HP;(function(i){i[i.API=0]="API",i[i.USER=1]="USER"})(HP||(HP={}));var CX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},$P=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},G_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let b$=class{constructor(e){this._commandService=e}open(e,t){return G_(this,void 0,void 0,function*(){if(!rX(e,hn.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Rt.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let n=[];try{n=l$(decodeURIComponent(e.query))}catch{try{n=l$(e.query)}catch{}}return Array.isArray(n)||(n=[n]),yield this._commandService.executeCommand(e.path,...n),!0})}};b$=CX([$P(0,_o)],b$);let C$=class{constructor(e){this._editorService=e}open(e,t){return G_(this,void 0,void 0,function*(){typeof e=="string"&&(e=Rt.parse(e));const{selection:n,uri:o}=dct(e);return e=o,e.scheme===hn.file&&(e=Kst(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:n,source:t!=null&&t.fromUserGesture?HP.USER:HP.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};C$=CX([$P(0,Jn)],C$);let y$=class{constructor(e,t){this._openers=new oa,this._validators=new oa,this._resolvers=new oa,this._resolvedUriTargets=new _s(n=>n.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new oa,this._defaultExternalOpener={openExternal:n=>G_(this,void 0,void 0,function*(){return zse(n,hn.http,hn.https)?b0e(n):window.location.href=n,!0})},this._openers.push({open:(n,o)=>G_(this,void 0,void 0,function*(){return(o==null?void 0:o.openExternal)||zse(n,hn.mailto,hn.http,hn.https,hn.vsls)?(yield this._doOpenExternal(n,o),!0):!1})}),this._openers.push(new b$(t)),this._openers.push(new C$(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var n;return G_(this,void 0,void 0,function*(){const o=typeof e=="string"?Rt.parse(e):e,r=(n=this._resolvedUriTargets.get(o))!==null&&n!==void 0?n:e;for(const s of this._validators)if(!(yield s.shouldOpen(r,t)))return!1;for(const s of this._openers)if(yield s.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return G_(this,void 0,void 0,function*(){for(const n of this._resolvers)try{const o=yield n.resolveExternalUri(e,t);if(o)return this._resolvedUriTargets.has(o.resolved)||this._resolvedUriTargets.set(o.resolved,e),o}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return G_(this,void 0,void 0,function*(){const n=typeof e=="string"?Rt.parse(e):e;let o;try{o=(yield this.resolveExternalUri(n,t)).resolved}catch{o=n}let r;if(typeof e=="string"&&n.toString()===o.toString()?r=e:r=encodeURI(o.toString(!0)),t!=null&&t.allowContributedOpeners){const s=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(r,{sourceUri:n,preferredOpenerId:s},_n.None))return!0}return this._defaultExternalOpener.openExternal(r,{sourceUri:n},_n.None)})}dispose(){this._validators.clear()}};y$=CX([$P(0,Jn),$P(1,_o)],y$);const Xd=yn("editorWorkerService");var ao;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(ao||(ao={}));(function(i){function e(s,a){return a-s}i.compare=e;const t=Object.create(null);t[i.Error]=C("sev.error","Error"),t[i.Warning]=C("sev.warning","Warning"),t[i.Info]=C("sev.info","Info");function n(s){return t[s]||""}i.toString=n;function o(s){switch(s){case So.Error:return i.Error;case So.Warning:return i.Warning;case So.Info:return i.Info;case So.Ignore:return i.Hint}}i.fromSeverity=o;function r(s){switch(s){case i.Error:return So.Error;case i.Warning:return So.Warning;case i.Info:return So.Info;case i.Hint:return So.Ignore}}i.toSeverity=r})(ao||(ao={}));var zP;(function(i){const e="";function t(o){return n(o,!0)}i.makeKey=t;function n(o,r){const s=[e];return o.source?s.push(o.source.replace("\xA6","\\\xA6")):s.push(e),o.code?typeof o.code=="string"?s.push(o.code.replace("\xA6","\\\xA6")):s.push(o.code.value.replace("\xA6","\\\xA6")):s.push(e),o.severity!==void 0&&o.severity!==null?s.push(ao.toString(o.severity)):s.push(e),o.message&&r?s.push(o.message.replace("\xA6","\\\xA6")):s.push(e),o.startLineNumber!==void 0&&o.startLineNumber!==null?s.push(o.startLineNumber.toString()):s.push(e),o.startColumn!==void 0&&o.startColumn!==null?s.push(o.startColumn.toString()):s.push(e),o.endLineNumber!==void 0&&o.endLineNumber!==null?s.push(o.endLineNumber.toString()):s.push(e),o.endColumn!==void 0&&o.endColumn!==null?s.push(o.endColumn.toString()):s.push(e),s.push(e),s.join("\xA6")}i.makeKeyOptionalMessage=n})(zP||(zP={}));const Rf=yn("markerService");function aht(i,e){const t=[],n=[];for(const o of i)e.has(o)||t.push(o);for(const o of e)i.has(o)||n.push(o);return{removed:t,added:n}}function lht(i,e){const t=new Set;for(const n of e)i.has(n)&&t.add(n);return t}var cht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},bae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let w$=class extends _e{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new le),this._markerDecorations=new _s,e.getModels().forEach(n=>this._onModelAdded(n)),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 n=this._markerDecorations.get(e);return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const n=this._markerDecorations.get(t);n&&this._updateDecorations(n)})}_onModelAdded(e){const t=new dht(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const n=this._markerDecorations.get(e.uri);n&&(n.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===hn.inMemory||e.uri.scheme===hn.internal||e.uri.scheme===hn.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(o=>o.owner).forEach(o=>this._markerService.remove(o,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};w$=cht([bae(0,Yi),bae(1,Rf)],w$);class dht extends _e{constructor(e){super(),this.model=e,this._map=new qet,this._register(zt(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:n}=aht(new Set(this._map.keys()),new Set(e));if(t.length===0&&n.length===0)return!1;const o=n.map(a=>this._map.get(a)),r=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(o,r);for(const a of n)this._map.delete(a);for(let a=0;a=o)return n;const r=e.getWordAtPosition(n.getStartPosition());r&&(n=new V(n.startLineNumber,r.startColumn,n.endLineNumber,r.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&n.startLineNumber===n.endLineNumber){const o=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);o=0:!1}}var uht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},hC;function y_(i){return i.toString()}class hht{constructor(e,t,n){this.model=e,this._modelEventListeners=new Be,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(o=>n(e,o)))}dispose(){this._modelEventListeners.dispose()}}const fht=xs||Nn?1:2;class ght{constructor(e,t,n,o,r,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=n,this.sharesUndoRedoStack=o,this.heapSize=r,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let UP=hC=class extends _e{constructor(e,t,n,o,r){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=n,this._languageService=o,this._languageConfigurationService=r,this._onModelAdded=this._register(new le),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new le),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new le),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var n;let o=vs.tabSize;if(e.editor&&typeof e.editor.tabSize!="undefined"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(o=f),o<1&&(o=1)}let r="tabSize";if(e.editor&&typeof e.editor.indentSize!="undefined"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(r=Math.max(f,1))}let s=vs.insertSpaces;e.editor&&typeof e.editor.insertSpaces!="undefined"&&(s=e.editor.insertSpaces==="false"?!1:Boolean(e.editor.insertSpaces));let a=fht;const l=e.eol;l===`\r `?a=2:l===` `&&(a=1);let c=vs.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace!="undefined"&&(c=e.editor.trimAutoWhitespace==="false"?!1:Boolean(e.editor.trimAutoWhitespace));let d=vs.detectIndentation;e.editor&&typeof e.editor.detectIndentation!="undefined"&&(d=e.editor.detectIndentation==="false"?!1:Boolean(e.editor.detectIndentation));let u=vs.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations!="undefined"&&(u=e.editor.largeFileOptimizations==="false"?!1:Boolean(e.editor.largeFileOptimizations));let h=vs.bracketPairColorizationOptions;return((n=e.editor)===null||n===void 0?void 0:n.bracketPairColorization)&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:o,indentSize:r,insertSpaces:s,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:u,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const n=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return n&&typeof n=="string"&&n!=="auto"?n:Vl===3||Vl===2?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,n){const o=typeof e=="string"?e:e.languageId;let r=this._modelCreationOptionsByLanguageAndResource[o+t];if(!r){const s=this._configurationService.getValue("editor",{overrideIdentifier:o,resource:t}),a=this._getEOL(t,o);r=hC._readModelOptions({editor:s,eol:a},n),this._modelCreationOptionsByLanguageAndResource[o+t]=r}return r}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let o=0,r=n.length;oe){const t=[];for(this._disposedModels.forEach(n=>{n.sharesUndoRedoStack||t.push(n)}),t.sort((n,o)=>n.time-o.time);t.length>0&&this._disposedModelsHeapSize>e;){const n=t.shift();this._removeDisposedModel(n.uri),n.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(n.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,o){const r=this.getCreationOptions(t,n,o),s=new bf(e,t,r,n,this._undoRedoService,this._languageService,this._languageConfigurationService);if(n&&this._disposedModels.has(y_(n))){const c=this._removeDisposedModel(n),d=this._undoRedoService.getElements(n),u=this._getSHA1Computer(),h=u.canComputeSHA1(s)?u.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of d.past)mg(f)&&f.matchesResource(n)&&f.setModel(s);for(const f of d.future)mg(f)&&f.matchesResource(n)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(n,!0,f=>mg(f)&&f.matchesResource(n)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=y_(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new dht(s,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,n,o=!1){let r;return t?r=this._createModelData(e,t,n,o):r=this._createModelData(e,Gl,n,o),this._onModelAdded.fire(r.model),r.model}getModels(){const e=[],t=Object.keys(this._models);for(let n=0,o=t.length;n0||c.future.length>0){for(const d of c.past)mg(d)&&d.matchesResource(e.uri)&&(r=!0,s+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)mg(d)&&d.matchesResource(e.uri)&&(r=!0,s+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=hC.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(r)if(!o&&(s>a||!l.canComputeSHA1(e))){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>mg(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new hht(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!o){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const n=t.oldLanguage,o=e.getLanguageId(),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(o,e.uri,e.isForSimpleWidget);hC._setModelOptionsForModel(e,s,r),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new F5}};UP.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;UP=hC=cht([jx(0,En),jx(1,X0e),jx(2,L5),jx(3,Ki),jx(4,Ti)],UP);class F5{canComputeSHA1(e){return e.getValueLength()<=F5.MAX_MODEL_SIZE}computeSHA1(e){const t=new u5,n=e.createSnapshot();let o;for(;o=n.read();)t.update(o);return t.digest()}}F5.MAX_MODEL_SIZE=10*1024*1024;class fht{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:_e.None}}renderElement(e,t,n,o){var r;if((r=n.disposable)===null||r===void 0||r.dispose(),!n.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,n.data,o);const a=new Ro,l=s.resolve(e,a.token);n.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,n.data),l.then(c=>this.renderer.renderElement(c,e,n.data,o))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class ght{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 pht(i,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new ght(i,e.accessibilityProvider)})}class mht{constructor(e,t,n,o,r={}){const s=()=>this.model,a=o.map(l=>new fht(l,s));this.list=new qd(e,t,n,a,pht(s,r))}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 st.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onPointer(){return st.map(this.list.onPointer,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onDidChangeSelection(){return st.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:n})=>({elements:e.map(o=>this._model.get(o)),indexes:t,browserEvent:n}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Gs(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 DS=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};const vht=!1;var jP;(function(i){i.North="north",i.South="south",i.East="east",i.West="west"})(jP||(jP={}));let _ht=4;const bht=new le;let Cht=300;const yht=new le;class CX{constructor(){this.disposables=new Be}get onPointerMove(){return this.disposables.add(new xn(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new xn(window,"mouseup")).event}dispose(){this.disposables.dispose()}}DS([Mo],CX.prototype,"onPointerMove",null);DS([Mo],CX.prototype,"onPointerUp",null);class yX{get onPointerMove(){return this.disposables.add(new xn(this.el,Di.Change)).event}get onPointerUp(){return this.disposables.add(new xn(this.el,Di.End)).event}constructor(e){this.el=e,this.disposables=new Be}dispose(){this.disposables.dispose()}}DS([Mo],yX.prototype,"onPointerMove",null);DS([Mo],yX.prototype,"onPointerUp",null);class KP{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}DS([Mo],KP.prototype,"onPointerMove",null);DS([Mo],KP.prototype,"onPointerUp",null);const bae="pointer-events-disabled";class gs extends _e{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=n=>{this.orthogonalStartDragHandleDisposables.clear(),n!==0&&(this._orthogonalStartDragHandle=Ae(this.el,He(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(zt(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseenter")).event(()=>gs.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseleave")).event(()=>gs.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=n=>{this.orthogonalEndDragHandleDisposables.clear(),n!==0&&(this._orthogonalEndDragHandle=Ae(this.el,He(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(zt(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseenter")).event(()=>gs.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseleave")).event(()=>gs.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,n){super(),this.hoverDelay=Cht,this.hoverDelayer=this._register(new Wd(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new le),this._onDidStart=this._register(new le),this._onDidChange=this._register(new le),this._onDidReset=this._register(new le),this._onDidEnd=this._register(new le),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=Ae(e,He(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),Nn&&this.el.classList.add("mac");const o=this._register(new xn(this.el,"mousedown")).event;this._register(o(u=>this.onPointerStart(u,new CX),this));const r=this._register(new xn(this.el,"dblclick")).event;this._register(r(this.onPointerDoublePress,this));const s=this._register(new xn(this.el,"mouseenter")).event;this._register(s(()=>gs.onMouseEnter(this)));const a=this._register(new xn(this.el,"mouseleave")).event;this._register(a(()=>gs.onMouseLeave(this))),this._register(Ei.addTarget(this.el));const l=this._register(new xn(this.el,Di.Start)).event;this._register(l(u=>this.onPointerStart(u,new yX(this.el)),this));const c=this._register(new xn(this.el,Di.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 n.size=="number"?(this.size=n.size,n.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=_ht,this._register(bht.event(u=>{this.size=u,this.layout()}))),this._register(yht.event(u=>this.hoverDelay=u)),this.layoutProvider=t,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.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",vht),this.layout()}onPointerStart(e,t){un.stop(e);let n=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(n=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new KP(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new KP(t))),!this.state)return;const o=document.getElementsByTagName("iframe");for(const g of o)g.classList.add(bae);const r=e.pageX,s=e.pageY,a=e.altKey,l={startX:r,currentX:r,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=Wc(this.el),d=()=>{let g="";n?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Nn?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Nn?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},u=new Be;d(),n||this.onDidEnablementChange.event(d,null,u);const h=g=>{un.stop(g,!1);const p={startX:r,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{un.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),u.dispose();for(const p of o)p.classList.remove(bae)};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&&gs.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&gs.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){gs.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 n=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!n||!(n instanceof HTMLElement))&&n.classList.contains("orthogonal-drag-handle"))return n.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const wht={separatorBorder:ve.transparent};class eCe{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize=="undefined"}setVisible(e,t){var n,o;e!==this.visible&&(e?(this.size=Za(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),(o=(n=this.view).setVisible)===null||o===void 0||o.call(n,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,n,o){this.container=e,this.view=t,this.disposable=o,this._cachedVisibleSize=void 0,typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class Sht extends eCe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class xht extends eCe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var dg;(function(i){i[i.Idle=0]="Idle",i[i.Busy=1]="Busy"})(dg||(dg={}));var qP;(function(i){i.Distribute={type:"distribute"};function e(o){return{type:"split",index:o}}i.Split=e;function t(o){return{type:"auto",index:o}}i.Auto=t;function n(o){return{type:"invisible",cachedVisibleSize:o}}i.Invisible=n})(qP||(qP={}));class tCe extends _e{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 n,o,r,s,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=dg.Idle,this._onDidSashChange=this._register(new le),this._onDidSashReset=this._register(new le),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(n=t.orientation)!==null&&n!==void 0?n:0,this.inverseAltBehavior=(o=t.inverseAltBehavior)!==null&&o!==void 0?o:!1,this.proportionalLayout=(r=t.proportionalLayout)!==null&&r!==void 0?r:!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=Ae(this.el,He(".sash-container")),this.viewContainer=He(".split-view-container"),this.scrollable=this._register(new ZI({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:Bc})),this.scrollableElement=this._register(new MG(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new xn(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)})),Ae(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||wht),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{const u=il(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,n=this.viewItems.length,o){this.doAddView(e,t,n,o)}layout(e,t){const n=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let o=0;for(let r=0;rthis.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-n,void 0,r,s)}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:n}){for(const a of this.viewItems)a.enabled=!1;const o=this.sashItems.findIndex(a=>a.sash===e),r=Td(ke(document.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),ke(document.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(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(o===this.sashItems.length-1){const p=this.viewItems[o];d=(p.minimumSize-p.size)/2,u=(p.maximumSize-p.size)/2}else{const p=this.viewItems[o+1];d=(p.size-p.maximumSize)/2,u=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=Gs(o,-1),p=Gs(o+1,this.viewItems.length),v=g.reduce((I,k)=>I+(this.viewItems[k].minimumSize-c[k]),0),m=g.reduce((I,k)=>I+(this.viewItems[k].viewMaximumSize-c[k]),0),_=p.length===0?Number.POSITIVE_INFINITY:p.reduce((I,k)=>I+(c[k]-this.viewItems[k].minimumSize),0),y=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((I,k)=>I+(c[k]-this.viewItems[k].viewMaximumSize),0),w=Math.max(v,y),L=Math.min(_,m),D=this.findFirstSnapIndex(g),E=this.findFirstSnapIndex(p);if(typeof D=="number"){const I=this.viewItems[D],k=Math.floor(I.viewMinimumSize/2);h={index:D,limitDelta:I.visible?w-k:w+k,size:I.size}}if(typeof E=="number"){const I=this.viewItems[E],k=Math.floor(I.viewMinimumSize/2);f={index:E,limitDelta:I.visible?L+k:L-k,size:I.size}}}this.sashDragState={start:a,current:a,index:o,sizes:c,minDelta:d,maxDelta:u,alt:l,snapBefore:h,snapAfter:f,disposable:r}};s(t,n)}onSashChange({current:e}){const{index:t,start:n,sizes:o,alt:r,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-n,u=this.resize(t,d,o,void 0,void 0,s,a,l,c);if(r){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,p=this.viewItems[g],v=p.size-p.maximumSize,m=p.size-p.minimumSize,_=h?t-1:t+1;this.resize(_,-u,f,void 0,void 0,v,m)}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 n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Za(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(this.state!==dg.Idle)throw new Error("Cant modify splitview");if(this.state=dg.Busy,e<0||e>=this.viewItems.length)return;const n=Gs(this.viewItems.length).filter(a=>a!==e),o=[...n.filter(a=>this.viewItems[a].priority===1),e],r=n.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=Za(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(o,r),this.state=dg.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 n=Math.floor(t/e.length);for(const a of e)a.size=Za(n,a.minimumSize,a.maximumSize);const o=Gs(this.viewItems.length),r=o.filter(a=>this.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);this.relayout(r,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,o){if(this.state!==dg.Idle)throw new Error("Cant modify splitview");this.state=dg.Busy;const r=He(".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(r):this.viewContainer.insertBefore(r,this.viewContainer.children.item(n));const s=e.onDidChange(h=>this.onViewChange(d,h)),a=zt(()=>this.viewContainer.removeChild(r)),l=Td(s,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 Sht(r,e,c,l):new xht(r,e,c,l);if(this.viewItems.splice(n,0,d),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new gs(this.sashContainer,{getHorizontalSashTop:I=>this.getSashPosition(I),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new gs(this.sashContainer,{getVerticalSashLeft:I=>this.getSashPosition(I),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?I=>({sash:f,start:I.startY,current:I.currentY,alt:I.altKey}):I=>({sash:f,start:I.startX,current:I.currentX,alt:I.altKey}),v=st.map(f.onDidStart,g)(this.onSashStart,this),_=st.map(f.onDidChange,g)(this.onSashChange,this),w=st.map(f.onDidEnd,()=>this.sashItems.findIndex(I=>I.sash===f))(this.onSashEnd,this),L=f.onDidReset(()=>{const I=this.sashItems.findIndex(N=>N.sash===f),k=Gs(I,-1),R=Gs(I+1,this.viewItems.length),A=this.findFirstSnapIndex(k),P=this.findFirstSnapIndex(R);typeof A=="number"&&!this.viewItems[A].visible||typeof P=="number"&&!this.viewItems[P].visible||this._onDidSashReset.fire(I)}),D=Td(v,_,w,L,f),E={sash:f,disposable:D};this.sashItems.splice(n-1,0,E)}r.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),o||this.relayout([n],u),this.state=dg.Idle,!o&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const n=this.viewItems.reduce((o,r)=>o+r.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map(d=>d.size),o,r,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=Gs(e,-1),u=Gs(e+1,this.viewItems.length);if(r)for(const E of r)D6(d,E),D6(u,E);if(o)for(const E of o)e2(d,E),e2(u,E);const h=d.map(E=>this.viewItems[E]),f=d.map(E=>n[E]),g=u.map(E=>this.viewItems[E]),p=u.map(E=>n[E]),v=d.reduce((E,I)=>E+(this.viewItems[I].minimumSize-n[I]),0),m=d.reduce((E,I)=>E+(this.viewItems[I].maximumSize-n[I]),0),_=u.length===0?Number.POSITIVE_INFINITY:u.reduce((E,I)=>E+(n[I]-this.viewItems[I].minimumSize),0),y=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((E,I)=>E+(n[I]-this.viewItems[I].maximumSize),0),w=Math.max(v,y,s),L=Math.min(_,m,a);let D=!1;if(l){const E=this.viewItems[l.index],I=t>=l.limitDelta;D=I!==E.visible,E.setVisible(I,l.size)}if(!D&&c){const E=this.viewItems[c.index],I=ta+l.size,0);let n=this.size-t;const o=Gs(this.viewItems.length-1,-1),r=o.filter(a=>this.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);for(const a of s)D6(o,a);for(const a of r)e2(o,a);typeof e=="number"&&e2(o,e);for(let a=0;n!==0&&at+n.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 n=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),o=[...this.viewItems].reverse();e=!1;const r=o.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=o.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:_&&t[l]&&(a0)return;if(!n.visible&&n.snap)return t}}areViewsDistributed(){let e,t;for(const n of this.viewItems)if(e=e===void 0?n.size:Math.min(e,n.size),t=t===void 0?n.size:Math.max(t,n.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),si(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class aT{constructor(e,t,n){this.columns=e,this.getColumnSize=n,this.templateId=aT.TemplateId,this.renderedTemplates=new Set;const o=new Map(t.map(r=>[r.templateId,r]));this.renderers=[];for(const r of e){const s=o.get(r.templateId);if(!s)throw new Error(`Table cell renderer for template id ${r.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=Ae(e,He(".monaco-table-tr")),n=[],o=[];for(let s=0;snew Eht(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 tCe(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const c=new aT(o,r,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new qd(e,this.domNode,Lht(n),[c],s)),st.any(...a.map(d=>d.onDidLayout))(([d,u])=>c.layoutColumn(d,u),null,this.disposables),this.splitview.onDidSashReset(d=>{const u=o.reduce((f,g)=>f+g.weight,0),h=o[d].weight/u*this.cachedWidth;this.splitview.resizeView(d,h)},null,this.disposables),this.styleElement=Wc(this.domNode),this.style(Iut)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,n){const o=typeof e=="string"?e:e.languageId;let r=this._modelCreationOptionsByLanguageAndResource[o+t];if(!r){const s=this._configurationService.getValue("editor",{overrideIdentifier:o,resource:t}),a=this._getEOL(t,o);r=hC._readModelOptions({editor:s,eol:a},n),this._modelCreationOptionsByLanguageAndResource[o+t]=r}return r}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let o=0,r=n.length;oe){const t=[];for(this._disposedModels.forEach(n=>{n.sharesUndoRedoStack||t.push(n)}),t.sort((n,o)=>n.time-o.time);t.length>0&&this._disposedModelsHeapSize>e;){const n=t.shift();this._removeDisposedModel(n.uri),n.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(n.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,o){const r=this.getCreationOptions(t,n,o),s=new bf(e,t,r,n,this._undoRedoService,this._languageService,this._languageConfigurationService);if(n&&this._disposedModels.has(y_(n))){const c=this._removeDisposedModel(n),d=this._undoRedoService.getElements(n),u=this._getSHA1Computer(),h=u.canComputeSHA1(s)?u.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of d.past)mg(f)&&f.matchesResource(n)&&f.setModel(s);for(const f of d.future)mg(f)&&f.matchesResource(n)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(n,!0,f=>mg(f)&&f.matchesResource(n)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=y_(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new hht(s,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,n,o=!1){let r;return t?r=this._createModelData(e,t,n,o):r=this._createModelData(e,Gl,n,o),this._onModelAdded.fire(r.model),r.model}getModels(){const e=[],t=Object.keys(this._models);for(let n=0,o=t.length;n0||c.future.length>0){for(const d of c.past)mg(d)&&d.matchesResource(e.uri)&&(r=!0,s+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)mg(d)&&d.matchesResource(e.uri)&&(r=!0,s+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=hC.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(r)if(!o&&(s>a||!l.canComputeSHA1(e))){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>mg(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new ght(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!o){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const n=t.oldLanguage,o=e.getLanguageId(),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(o,e.uri,e.isForSimpleWidget);hC._setModelOptionsForModel(e,s,r),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new B5}};UP.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;UP=hC=uht([jx(0,En),jx(1,X0e),jx(2,E5),jx(3,Ki),jx(4,Ti)],UP);class B5{canComputeSHA1(e){return e.getValueLength()<=B5.MAX_MODEL_SIZE}computeSHA1(e){const t=new h5,n=e.createSnapshot();let o;for(;o=n.read();)t.update(o);return t.digest()}}B5.MAX_MODEL_SIZE=10*1024*1024;class pht{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:_e.None}}renderElement(e,t,n,o){var r;if((r=n.disposable)===null||r===void 0||r.dispose(),!n.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,n.data,o);const a=new Ro,l=s.resolve(e,a.token);n.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,n.data),l.then(c=>this.renderer.renderElement(c,e,n.data,o))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class mht{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 vht(i,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new mht(i,e.accessibilityProvider)})}class _ht{constructor(e,t,n,o,r={}){const s=()=>this.model,a=o.map(l=>new pht(l,s));this.list=new qd(e,t,n,a,vht(s,r))}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 st.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onPointer(){return st.map(this.list.onPointer,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onDidChangeSelection(){return st.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:n})=>({elements:e.map(o=>this._model.get(o)),indexes:t,browserEvent:n}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Gs(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 DS=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};const bht=!1;var jP;(function(i){i.North="north",i.South="south",i.East="east",i.West="west"})(jP||(jP={}));let Cht=4;const yht=new le;let wht=300;const Sht=new le;class yX{constructor(){this.disposables=new Be}get onPointerMove(){return this.disposables.add(new xn(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new xn(window,"mouseup")).event}dispose(){this.disposables.dispose()}}DS([Mo],yX.prototype,"onPointerMove",null);DS([Mo],yX.prototype,"onPointerUp",null);class wX{get onPointerMove(){return this.disposables.add(new xn(this.el,Di.Change)).event}get onPointerUp(){return this.disposables.add(new xn(this.el,Di.End)).event}constructor(e){this.el=e,this.disposables=new Be}dispose(){this.disposables.dispose()}}DS([Mo],wX.prototype,"onPointerMove",null);DS([Mo],wX.prototype,"onPointerUp",null);class KP{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}DS([Mo],KP.prototype,"onPointerMove",null);DS([Mo],KP.prototype,"onPointerUp",null);const Cae="pointer-events-disabled";class gs extends _e{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=n=>{this.orthogonalStartDragHandleDisposables.clear(),n!==0&&(this._orthogonalStartDragHandle=Ae(this.el,He(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(zt(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseenter")).event(()=>gs.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseleave")).event(()=>gs.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=n=>{this.orthogonalEndDragHandleDisposables.clear(),n!==0&&(this._orthogonalEndDragHandle=Ae(this.el,He(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(zt(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseenter")).event(()=>gs.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseleave")).event(()=>gs.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,n){super(),this.hoverDelay=wht,this.hoverDelayer=this._register(new Wd(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new le),this._onDidStart=this._register(new le),this._onDidChange=this._register(new le),this._onDidReset=this._register(new le),this._onDidEnd=this._register(new le),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=Ae(e,He(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),Nn&&this.el.classList.add("mac");const o=this._register(new xn(this.el,"mousedown")).event;this._register(o(u=>this.onPointerStart(u,new yX),this));const r=this._register(new xn(this.el,"dblclick")).event;this._register(r(this.onPointerDoublePress,this));const s=this._register(new xn(this.el,"mouseenter")).event;this._register(s(()=>gs.onMouseEnter(this)));const a=this._register(new xn(this.el,"mouseleave")).event;this._register(a(()=>gs.onMouseLeave(this))),this._register(Ei.addTarget(this.el));const l=this._register(new xn(this.el,Di.Start)).event;this._register(l(u=>this.onPointerStart(u,new wX(this.el)),this));const c=this._register(new xn(this.el,Di.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 n.size=="number"?(this.size=n.size,n.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=Cht,this._register(yht.event(u=>{this.size=u,this.layout()}))),this._register(Sht.event(u=>this.hoverDelay=u)),this.layoutProvider=t,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.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",bht),this.layout()}onPointerStart(e,t){un.stop(e);let n=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(n=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new KP(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new KP(t))),!this.state)return;const o=document.getElementsByTagName("iframe");for(const g of o)g.classList.add(Cae);const r=e.pageX,s=e.pageY,a=e.altKey,l={startX:r,currentX:r,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=Wc(this.el),d=()=>{let g="";n?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Nn?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Nn?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},u=new Be;d(),n||this.onDidEnablementChange.event(d,null,u);const h=g=>{un.stop(g,!1);const p={startX:r,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{un.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),u.dispose();for(const p of o)p.classList.remove(Cae)};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&&gs.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&gs.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){gs.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 n=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!n||!(n instanceof HTMLElement))&&n.classList.contains("orthogonal-drag-handle"))return n.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const xht={separatorBorder:ve.transparent};class eCe{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize=="undefined"}setVisible(e,t){var n,o;e!==this.visible&&(e?(this.size=Za(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),(o=(n=this.view).setVisible)===null||o===void 0||o.call(n,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,n,o){this.container=e,this.view=t,this.disposable=o,this._cachedVisibleSize=void 0,typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class Lht extends eCe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Eht extends eCe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var dg;(function(i){i[i.Idle=0]="Idle",i[i.Busy=1]="Busy"})(dg||(dg={}));var qP;(function(i){i.Distribute={type:"distribute"};function e(o){return{type:"split",index:o}}i.Split=e;function t(o){return{type:"auto",index:o}}i.Auto=t;function n(o){return{type:"invisible",cachedVisibleSize:o}}i.Invisible=n})(qP||(qP={}));class tCe extends _e{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 n,o,r,s,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=dg.Idle,this._onDidSashChange=this._register(new le),this._onDidSashReset=this._register(new le),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(n=t.orientation)!==null&&n!==void 0?n:0,this.inverseAltBehavior=(o=t.inverseAltBehavior)!==null&&o!==void 0?o:!1,this.proportionalLayout=(r=t.proportionalLayout)!==null&&r!==void 0?r:!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=Ae(this.el,He(".sash-container")),this.viewContainer=He(".split-view-container"),this.scrollable=this._register(new ZI({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:Bc})),this.scrollableElement=this._register(new AG(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new xn(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)})),Ae(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||xht),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{const u=il(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,n=this.viewItems.length,o){this.doAddView(e,t,n,o)}layout(e,t){const n=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let o=0;for(let r=0;rthis.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-n,void 0,r,s)}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:n}){for(const a of this.viewItems)a.enabled=!1;const o=this.sashItems.findIndex(a=>a.sash===e),r=Td(ke(document.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),ke(document.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(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(o===this.sashItems.length-1){const p=this.viewItems[o];d=(p.minimumSize-p.size)/2,u=(p.maximumSize-p.size)/2}else{const p=this.viewItems[o+1];d=(p.size-p.maximumSize)/2,u=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=Gs(o,-1),p=Gs(o+1,this.viewItems.length),v=g.reduce((I,k)=>I+(this.viewItems[k].minimumSize-c[k]),0),m=g.reduce((I,k)=>I+(this.viewItems[k].viewMaximumSize-c[k]),0),_=p.length===0?Number.POSITIVE_INFINITY:p.reduce((I,k)=>I+(c[k]-this.viewItems[k].minimumSize),0),y=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((I,k)=>I+(c[k]-this.viewItems[k].viewMaximumSize),0),w=Math.max(v,y),L=Math.min(_,m),D=this.findFirstSnapIndex(g),E=this.findFirstSnapIndex(p);if(typeof D=="number"){const I=this.viewItems[D],k=Math.floor(I.viewMinimumSize/2);h={index:D,limitDelta:I.visible?w-k:w+k,size:I.size}}if(typeof E=="number"){const I=this.viewItems[E],k=Math.floor(I.viewMinimumSize/2);f={index:E,limitDelta:I.visible?L+k:L-k,size:I.size}}}this.sashDragState={start:a,current:a,index:o,sizes:c,minDelta:d,maxDelta:u,alt:l,snapBefore:h,snapAfter:f,disposable:r}};s(t,n)}onSashChange({current:e}){const{index:t,start:n,sizes:o,alt:r,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-n,u=this.resize(t,d,o,void 0,void 0,s,a,l,c);if(r){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,p=this.viewItems[g],v=p.size-p.maximumSize,m=p.size-p.minimumSize,_=h?t-1:t+1;this.resize(_,-u,f,void 0,void 0,v,m)}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 n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Za(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(this.state!==dg.Idle)throw new Error("Cant modify splitview");if(this.state=dg.Busy,e<0||e>=this.viewItems.length)return;const n=Gs(this.viewItems.length).filter(a=>a!==e),o=[...n.filter(a=>this.viewItems[a].priority===1),e],r=n.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=Za(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(o,r),this.state=dg.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 n=Math.floor(t/e.length);for(const a of e)a.size=Za(n,a.minimumSize,a.maximumSize);const o=Gs(this.viewItems.length),r=o.filter(a=>this.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);this.relayout(r,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,o){if(this.state!==dg.Idle)throw new Error("Cant modify splitview");this.state=dg.Busy;const r=He(".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(r):this.viewContainer.insertBefore(r,this.viewContainer.children.item(n));const s=e.onDidChange(h=>this.onViewChange(d,h)),a=zt(()=>this.viewContainer.removeChild(r)),l=Td(s,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 Lht(r,e,c,l):new Eht(r,e,c,l);if(this.viewItems.splice(n,0,d),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new gs(this.sashContainer,{getHorizontalSashTop:I=>this.getSashPosition(I),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new gs(this.sashContainer,{getVerticalSashLeft:I=>this.getSashPosition(I),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?I=>({sash:f,start:I.startY,current:I.currentY,alt:I.altKey}):I=>({sash:f,start:I.startX,current:I.currentX,alt:I.altKey}),v=st.map(f.onDidStart,g)(this.onSashStart,this),_=st.map(f.onDidChange,g)(this.onSashChange,this),w=st.map(f.onDidEnd,()=>this.sashItems.findIndex(I=>I.sash===f))(this.onSashEnd,this),L=f.onDidReset(()=>{const I=this.sashItems.findIndex(N=>N.sash===f),k=Gs(I,-1),R=Gs(I+1,this.viewItems.length),A=this.findFirstSnapIndex(k),P=this.findFirstSnapIndex(R);typeof A=="number"&&!this.viewItems[A].visible||typeof P=="number"&&!this.viewItems[P].visible||this._onDidSashReset.fire(I)}),D=Td(v,_,w,L,f),E={sash:f,disposable:D};this.sashItems.splice(n-1,0,E)}r.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),o||this.relayout([n],u),this.state=dg.Idle,!o&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const n=this.viewItems.reduce((o,r)=>o+r.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map(d=>d.size),o,r,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=Gs(e,-1),u=Gs(e+1,this.viewItems.length);if(r)for(const E of r)k6(d,E),k6(u,E);if(o)for(const E of o)e2(d,E),e2(u,E);const h=d.map(E=>this.viewItems[E]),f=d.map(E=>n[E]),g=u.map(E=>this.viewItems[E]),p=u.map(E=>n[E]),v=d.reduce((E,I)=>E+(this.viewItems[I].minimumSize-n[I]),0),m=d.reduce((E,I)=>E+(this.viewItems[I].maximumSize-n[I]),0),_=u.length===0?Number.POSITIVE_INFINITY:u.reduce((E,I)=>E+(n[I]-this.viewItems[I].minimumSize),0),y=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((E,I)=>E+(n[I]-this.viewItems[I].maximumSize),0),w=Math.max(v,y,s),L=Math.min(_,m,a);let D=!1;if(l){const E=this.viewItems[l.index],I=t>=l.limitDelta;D=I!==E.visible,E.setVisible(I,l.size)}if(!D&&c){const E=this.viewItems[c.index],I=ta+l.size,0);let n=this.size-t;const o=Gs(this.viewItems.length-1,-1),r=o.filter(a=>this.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);for(const a of s)k6(o,a);for(const a of r)e2(o,a);typeof e=="number"&&e2(o,e);for(let a=0;n!==0&&at+n.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 n=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),o=[...this.viewItems].reverse();e=!1;const r=o.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=o.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:_&&t[l]&&(a0)return;if(!n.visible&&n.snap)return t}}areViewsDistributed(){let e,t;for(const n of this.viewItems)if(e=e===void 0?n.size:Math.min(e,n.size),t=t===void 0?n.size:Math.max(t,n.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),si(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class aT{constructor(e,t,n){this.columns=e,this.getColumnSize=n,this.templateId=aT.TemplateId,this.renderedTemplates=new Set;const o=new Map(t.map(r=>[r.templateId,r]));this.renderers=[];for(const r of e){const s=o.get(r.templateId);if(!s)throw new Error(`Table cell renderer for template id ${r.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=Ae(e,He(".monaco-table-tr")),n=[],o=[];for(let s=0;snew kht(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 tCe(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const c=new aT(o,r,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new qd(e,this.domNode,Dht(n),[c],s)),st.any(...a.map(d=>d.onDidLayout))(([d,u])=>c.layoutColumn(d,u),null,this.disposables),this.splitview.onDidSashReset(d=>{const u=o.reduce((f,g)=>f+g.weight,0),h=o[d].weight/u*this.cachedWidth;this.splitview.resizeView(d,h)},null,this.disposables),this.styleElement=Wc(this.domNode),this.style(Nut)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(` -`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}B5.InstanceCount=0;class kS extends Ud{constructor(e){super(),this._onChange=this._register(new le),this.onChange=this._onChange.event,this._onKeyDown=this._register(new le),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(...Mt.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,n=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}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 Dht=C("caseDescription","Match Case"),kht=C("wordsDescription","Match Whole Word"),Iht=C("regexDescription","Use Regular Expression");class nCe extends kS{constructor(e){super({icon:Xe.caseSensitive,title:Dht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class iCe extends kS{constructor(e){super({icon:Xe.wholeWord,title:kht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class oCe extends kS{constructor(e){super({icon:Xe.regex,title:Iht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Tht{constructor(e,t=0,n=e.length,o=t-1){this.items=e,this.start=t,this.end=n,this.index=o}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 Nht{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 Tht(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 Kx=He;class Rht extends Ud{constructor(e,t,n){var o;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new le),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(o=this.options.tooltip)!==null&&o!==void 0?o:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Ae(e,Kx(".monaco-inputbox.idle"));const r=this.options.flexibleHeight?"textarea":"input",s=Ae(this.element,Kx(".ibwrapper"));if(this.input=Ae(s,Kx(r+".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=Ae(s,Kx("div.mirror")),this.mirror.innerText="\xA0",this.scrollableElement=new bbe(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Ae(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new xn(document,"selectionchange")),l=st.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===s});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 zc(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:h0(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){if(this.state==="open"&&ql(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 n=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${I0(n.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=Ea(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:o=>{var r,s;if(!this.message)return null;e=Ae(o,Kx(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?Udt(this.message.content,a):zdt(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(r=c.background)!==null&&r!==void 0?r:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",Ae(e,l),null},onHide:()=>{this.state="closed"},layout:t});let n;this.message.type===3?n=C("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?n=C("alertWarningMessage","Warning: {0}",this.message.content):n=C("alertInfoMessage","Info: {0}",this.message.content),Cs(n),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,n=e.charCodeAt(e.length-1)===10?" ":"";(e+n).replace(/\u000c/g,"")?this.mirror.textContent=e+n:this.mirror.innerText="\xA0",this.layout()}applyStyles(){var e,t,n;const o=this.options.inputBoxStyles,r=(e=o.inputBackground)!==null&&e!==void 0?e:"",s=(t=o.inputForeground)!==null&&t!==void 0?t:"",a=(n=o.inputBorder)!==null&&n!==void 0?n:"";this.element.style.backgroundColor=r,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${I0(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=h0(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,n=t.selectionStart,o=t.selectionEnd,r=t.value;n!==null&&o!==null&&(this.value=r.substr(0,n)+e+r.substr(o),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}}class rCe extends Rht{constructor(e,t,n){const o=C({key:"history.inputbox.hint",comment:["Text will be prefixed with \u21C5 plus a single space, then used as a hint where input field keeps history"]},"for history"),r=` or \u21C5 ${o}`,s=` (\u21C5 ${o})`;super(e,t,n),this._onDidFocus=this._register(new le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event,this.history=new Nht(n.history,100);const a=()=>{if(n.showHistoryHint&&n.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?r:s,c=this.placeholder+l;n.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 n.showPlaceholderOnFocus?this.placeholder=d:this.setPlaceHolder(d),!0}else return!1};l(s)||l(r)})}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:"",kv(this.value?this.value:C("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,kv(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 Mht=C("defaultLabel","input");class sCe extends Ud{constructor(e,t,n){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Kr),this.additionalToggles=[],this._onDidOptionChange=this._register(new le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new le),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new le),this._onKeyUp=this._register(new le),this._onCaseSensitiveKeyDown=this._register(new le),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new le),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||Mht,this.showCommonFindToggles=!!n.showCommonFindToggles;const o=n.appendCaseSensitiveLabel||"",r=n.appendWholeWordsLabel||"",s=n.appendRegexLabel||"",a=n.history||[],l=!!n.flexibleHeight,c=!!n.flexibleWidth,d=n.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new rCe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:n.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d,inputBoxStyles:n.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new oCe(Object.assign({appendTitle:s,isChecked:!1},n.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 iCe(Object.assign({appendTitle:r,isChecked:!1},n.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new nCe(Object.assign({appendTitle:o,isChecked:!1},n.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(),un.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(n==null?void 0:n.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(ke(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(ke(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,n;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(),(n=this.caseSensitive)===null||n===void 0||n.enable();for(const o of this.additionalToggles)o.enable()}disable(){var e,t,n;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(),(n=this.caseSensitive)===null||n===void 0||n.disable();for(const o of this.additionalToggles)o.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(n=>{this._onDidOptionChange.fire(n),!n&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,n,o,r,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((n=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&n!==void 0?n:0)+((r=(o=this.wholeWords)===null||o===void 0?void 0:o.width())!==null&&r!==void 0?r:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.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 xh;(function(i){i[i.Expanded=0]="Expanded",i[i.Collapsed=1]="Collapsed",i[i.PreserveOrExpanded=2]="PreserveOrExpanded",i[i.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(xh||(xh={}));var b0;(function(i){i[i.Unknown=0]="Unknown",i[i.Twistie=1]="Twistie",i[i.Element=2]="Element",i[i.Filter=3]="Filter"})(b0||(b0={}));class Ol extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class wX{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 SX(i){return typeof i=="object"&&"visibility"in i&&"data"in i}function bk(i){switch(i){case!0:return 1;case!1:return 0;default:return i}}function W9(i){return typeof i.collapsible=="boolean"}class Aht{constructor(e,t,n,o={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Uq,this._onDidChangeCollapseState=new le,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new le,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new le,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Wd(L0e),this.collapseByDefault=typeof o.collapseByDefault=="undefined"?!1:o.collapseByDefault,this.filter=o.filter,this.autoExpandSingleChildren=typeof o.autoExpandSingleChildren=="undefined"?!1:o.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=vn.empty(),o={}){if(e.length===0)throw new Ol(this.user,"Invalid tree location");o.diffIdentityProvider?this.spliceSmart(o.diffIdentityProvider,e,t,n,o):this.spliceSimple(e,t,n,o)}spliceSmart(e,t,n,o,r,s){var a;o===void 0&&(o=vn.empty()),s===void 0&&(s=(a=r.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,n,o,r);const c=[...o],d=t[t.length-1],u=new Ah({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,d),...c,...l.children.slice(d+n)].map(v=>e.getId(v.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,n,c,r);const h=t.slice(0,-1),f=(v,m,_)=>{if(s>0)for(let y=0;y<_;y++)v--,m--,this.spliceSmart(e,[...h,v,0],Number.MAX_SAFE_INTEGER,c[m].children,r,s-1)};let g=Math.min(l.children.length,d+n),p=c.length;for(const v of u.changes.sort((m,_)=>_.originalStart-m.originalStart))f(g,p,g-(v.originalStart+v.originalLength)),g=v.originalStart,p=v.modifiedStart-d,this.spliceSimple([...h,g],v.originalLength,vn.slice(c,p,p+v.modifiedLength),r);f(g,p,g)}spliceSimple(e,t,n=vn.empty(),{onDidCreateNode:o,onDidDeleteNode:r,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=vn.map(n,E=>this.createTreeNode(E,a,a.visible?1:0,c,u,o)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let E=f;E>=0&&Es.getId(E.element).toString())):a.lastDiffIds=a.children.map(E=>s.getId(E.element).toString()):a.lastDiffIds=void 0;let w=0;for(const E of y)E.visible&&w++;if(w!==0)for(let E=f+v.length;EI+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,_-E),this.list.splice(l,E,u)}if(y.length>0&&r){const E=I=>{r(I),I.children.forEach(E)};y.forEach(E)}this._onDidSplice.fire({insertedNodes:v,deletedNodes:y});const L=a.children.length>0;g!==L&&this.setCollapsible(e.slice(0,-1),L);let D=a;for(;D;){if(D.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}D=D.parent}}rerender(e){if(e.length===0)throw new Ol(this.user,"Invalid tree location");const{node:t,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e);t.visible&&o&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:n,revealed:o}=this.getTreeNodeWithListIndex(e);return n&&o?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const n=this.getTreeNode(e);typeof t=="undefined"&&(t=!n.collapsible);const o={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){const o=this.getTreeNode(e);typeof t=="undefined"&&(t=!o.collapsed);const r={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}_setCollapseState(e,t){const{node:n,listIndex:o,revealed:r}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(n,o,r,t);if(n!==this.root&&this.autoExpandSingleChildren&&s&&!W9(t)&&n.collapsible&&!n.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 s}_setListNodeCollapseState(e,t,n,o){const r=this._setNodeCollapseState(e,o,!1);if(!n||!e.visible||!r)return r;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),r}_setNodeCollapseState(e,t,n){let o;if(e===this.root?o=!1:(W9(t)?(o=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(o=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):o=!1,o&&this._onDidChangeCollapseState.fire({node:e,deep:n})),!W9(t)&&t.recursive)for(const r of e.children)o=this._setNodeCollapseState(r,t,!0)||o;return o}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,n,o,r,s){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!="undefined",collapsed:typeof e.collapsed=="undefined"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,n);a.visibility=l,o&&r.push(a);const c=e.children||vn.empty(),d=o&&l!==0&&!a.collapsed;let u=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,d,r,s);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,o&&r.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,o=!0){let r;if(e!==this.root){if(r=this._filterNode(e,t),r===0)return e.visible=!1,e.renderNodeCount=0,!1;o&&n.push(e)}const s=n.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||r!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,r,n,o&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=r===2?a:r===1,e.visibility=r),e.visible?e.collapsed||(e.renderNodeCount+=n.length-s):(e.renderNodeCount=0,o&&n.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 n=this.filter?this.filter.filter(e.element,t):1;return typeof n=="boolean"?(e.filterData=void 0,n?1:0):SX(n)?(e.filterData=n.data,bk(n.visibility)):(e.filterData=void 0,bk(n))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[n,...o]=e;return n<0||n>t.children.length?!1:this.hasTreeNode(o,t.children[n])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[n,...o]=e;if(n<0||n>t.children.length)throw new Ol(this.user,"Invalid tree location");return this.getTreeNode(o,t.children[n])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:n,revealed:o,visible:r}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new Ol(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:n,revealed:o,visible:r&&a.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,o=!0,r=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new Ol(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function V9(i){return i instanceof sT?new Pht(i):i}class Oht{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=_e.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(n=>n.element),t)}onDragStart(e,t){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,V9(e),t)}onDragOver(e,t,n,o,r=!0){const s=this.dnd.onDragOver(V9(e),t&&t.element,n,o),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t=="undefined")return s;if(a&&typeof s!="boolean"&&s.autoExpand&&(this.autoExpandDisposable=Lv(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof s=="boolean"||!s.accept||typeof s.bubble=="undefined"||s.feedback){if(!r){const h=typeof s=="boolean"?s:s.accept,f=typeof s=="boolean"?void 0:s.effect;return{accept:h,effect:f,feedback:[n]}}return s}if(s.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),p=h.getNode(g),v=g&&h.getListIndex(g);return this.onDragOver(e,p,v,o,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),d=l.getListIndex(c),u=l.getListRenderCount(c);return Object.assign(Object.assign({},s),{feedback:Gs(d,d+u)})}drop(e,t,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(V9(e),t&&t.element,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Fht(i,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Oht(i,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 n=i(),o=n.getNodeLocation(t),r=n.getParentNodeLocation(o);return n.getNode(r).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 xX{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 n,o;(o=(n=this.delegate).setDynamicHeight)===null||o===void 0||o.call(n,e.element,t)}}var Ck;(function(i){i.None="none",i.OnHover="onHover",i.Always="always"})(Ck||(Ck={}));class Bht{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Be,this.onDidChange=st.forEach(e,n=>this._elements=n,this.disposables)}dispose(){this.disposables.dispose()}}class yk{constructor(e,t,n,o,r,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=o,this.renderedIndentGuides=r,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=yk.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=_e.None,this.disposables=new Be,this.templateId=e.templateId,this.updateOptions(s),st.map(n,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!="undefined"){const t=Za(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[n,o]of this.renderedNodes)this.renderTreeElement(n,o)}}if(typeof e.renderIndentGuides!="undefined"){const t=e.renderIndentGuides!==Ck.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[n,o]of this.renderedNodes)this._renderIndentGuides(n,o);if(this.indentGuidesDisposable.dispose(),t){const n=new Be;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,n),this.indentGuidesDisposable=n,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements!="undefined"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Ae(e,He(".monaco-tl-row")),n=Ae(t,He(".monaco-tl-indent")),o=Ae(t,He(".monaco-tl-twistie")),r=Ae(t,He(".monaco-tl-contents")),s=this.renderer.renderTemplate(r);return{container:e,indent:n,twistie:o,indentGuidesDisposable:_e.None,templateData:s}}renderElement(e,t,n,o){this.renderedNodes.set(e,n),this.renderedElements.set(e.element,e),this.renderTreeElement(e,n),this.renderer.renderElement(e,t,n.templateData,o)}disposeElement(e,t,n,o){var r,s;n.indentGuidesDisposable.dispose(),(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,e,t,n.templateData,o),typeof o=="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 n=yk.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${n}px`,t.indent.style.width=`${n+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Mt.asClassNameArray(Xe.treeItemExpanded));let o=!1;this.renderer.renderTwistie&&(o=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(o||t.twistie.classList.add(...Mt.asClassNameArray(Xe.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(Ur(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new Be,o=this.modelProvider();for(;;){const r=o.getNodeLocation(e),s=o.getParentNodeLocation(r);if(!s)break;const a=o.getNode(s),l=He(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),n.add(zt(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,n=this.modelProvider();e.forEach(o=>{const r=n.getNodeLocation(o);try{const s=n.getParentNodeLocation(r);o.collapsible&&o.children.length>0&&!o.collapsed?t.add(o):s&&t.add(n.getNode(s))}catch{}}),this.activeIndentNodes.forEach(o=>{t.has(o)||this.renderedIndentGuides.forEach(o,r=>r.classList.remove("active"))}),t.forEach(o=>{this.activeIndentNodes.has(o)||this.renderedIndentGuides.forEach(o,r=>r.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),si(this.disposables)}}yk.DefaultIndent=8;class Wht{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,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 n=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?n=s?1:0:SX(s)?n=bk(s.visibility):n=s,n===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:$u.Default,visibility:n};const o=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),r=Array.isArray(o)?o:[o];for(const s of r){const a=s&&s.toString();if(typeof a=="undefined")return{data:$u.Default,visibility:n};let l;if(this.tree.findMatchType===lb.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=sb(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,r.length===1?{data:l,visibility:n}:{data:{label:a,score:l},visibility:n}}return this.tree.findMode===tf.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:$u.Default,visibility:n}}reset(){this._totalCount=0,this._matchCount=0}dispose(){si(this.disposables)}}var tf;(function(i){i[i.Highlight=0]="Highlight",i[i.Filter=1]="Filter"})(tf||(tf={}));var lb;(function(i){i[i.Fuzzy=0]="Fuzzy",i[i.Contiguous=1]="Contiguous"})(lb||(lb={}));class Vht{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,n,o,r,s={}){var a,l;this.tree=e,this.view=n,this.filter=o,this.contextViewProvider=r,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new le,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new le,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new le,this._onDidChangeOpenState=new le,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Be,this.disposables=new Be,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:tf.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:lb.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,n,o;const r=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&r?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:C("not found","No elements found.")}):(n=this.widget)===null||n===void 0||n.showMessage({type:2}):(o=this.widget)===null||o===void 0||o.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===tf.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!$u.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 Cae(i){let e=b0.Unknown;return $6(i.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=b0.Twistie:$6(i.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=b0.Element:$6(i.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=b0.Filter),{browserEvent:i.browserEvent,element:i.element?i.element.element:null,target:e}}function CM(i,e){e(i),i.children.forEach(t=>CM(t,e))}class H9{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 le,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Lo(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const o=this;this._onDidChange.fire({get elements(){return o.get()},browserEvent:n})}}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=>CM(d,c)),this.set([...l.values()]);return}const n=new Set,o=l=>n.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>CM(l,o));const r=new Map,s=l=>r.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>CM(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!n.has(c))a.push(l);else{const u=r.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 Hht extends K1e{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if($1e(e.browserEvent.target)||ev(e.browserEvent.target)||KC(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 n=e.browserEvent.target,o=n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let r=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,r&&!o&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const s=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([s]),this.tree.toggleCollapsed(s,a),r&&o){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 $ht extends qd{constructor(e,t,n,o,r,s,a,l){super(e,t,n,o,l),this.focusTrait=r,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new Hht(this,e.tree)}splice(e,t,n=[]){if(super.splice(e,t,n),n.length===0)return;const o=[],r=[];let s;n.forEach((a,l)=>{this.focusTrait.has(a)&&o.push(e+l),this.selectionTrait.has(a)&&r.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),o.length>0&&super.setFocus(bv([...super.getFocus(),...o])),r.length>0&&super.setSelection(bv([...super.getSelection(),...r])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map(o=>this.element(o)),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||this.selectionTrait.set(e.map(o=>this.element(o)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e=="undefined"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class aCe{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 st.filter(st.map(this.view.onMouseDblClick,Cae),e=>e.target!==b0.Filter)}get onPointer(){return st.map(this.view.onPointer,Cae)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return st.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:tf.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:lb.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick=="undefined"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick=="undefined"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,n,o,r={}){var s;this._user=e,this._options=r,this.eventBufferer=new Uq,this.onDidChangeFindOpenState=st.None,this.disposables=new Be,this._onWillRefilter=new le,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new le;const a=new xX(n),l=new uoe,c=new uoe,d=this.disposables.add(new Bht(c.event)),u=new fG;this.renderers=o.map(v=>new yk(v,()=>this.model,l.event,d,u,r));for(const v of this.renderers)this.disposables.add(v);let h;r.keyboardNavigationLabelProvider&&(h=new Wht(this,r.keyboardNavigationLabelProvider,r.filter),r=Object.assign(Object.assign({},r),{filter:h}),this.disposables.add(h)),this.focus=new H9(()=>this.view.getFocusedElements()[0],r.identityProvider),this.selection=new H9(()=>this.view.getSelectedElements()[0],r.identityProvider),this.anchor=new H9(()=>this.view.getAnchorElement(),r.identityProvider),this.view=new $ht(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},Fht(()=>this.model,r)),{tree:this})),this.model=this.createModel(e,this.view,r),l.input=this.model.onDidChangeCollapseState;const f=st.forEach(this.model.onDidSplice,v=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(v),this.selection.onDidModelSplice(v)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new le),p=this.disposables.add(new Wd(0));if(this.disposables.add(st.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{p.trigger(()=>{const v=new Set;for(const m of this.focus.getNodes())v.add(m);for(const m of this.selection.getNodes())v.add(m);g.fire([...v.values()])})})),c.input=g.event,r.keyboardSupport!==!1){const v=st.chain(this.view.onKeyDown,m=>m.filter(_=>!ev(_.target)).map(_=>new Pi(_)));st.chain(v,m=>m.filter(_=>_.keyCode===15))(this.onLeftArrow,this,this.disposables),st.chain(v,m=>m.filter(_=>_.keyCode===17))(this.onRightArrow,this,this.disposables),st.chain(v,m=>m.filter(_=>_.keyCode===10))(this.onSpace,this,this.disposables)}if(((s=r.findWidgetEnabled)!==null&&s!==void 0?s:!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider){const v=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new Vht(this,this.model,this.view,h,r.contextViewProvider,v),this.focusNavigationFilter=m=>this.findController.shouldAllowFocus(m),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=st.None,this.onDidChangeFindMatchType=st.None;this.styleElement=Wc(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Ck.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const n of this.renderers)n.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===Ck.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 n;this.view.layout(e,t),Cv(t)&&((n=this.findController)===null||n===void 0||n.layout(t))}style(e){const t=`.${this.view.domId}`,n=[];e.treeIndentGuidesStroke&&(n.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),n.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=n.join(` -`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const n=e.map(r=>this.model.getNode(r));this.selection.set(n,t);const o=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setSelection(o,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const n=e.map(r=>this.model.getNode(r));this.focus.set(n,t);const o=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setFocus(o,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const n=this.model.getListIndex(e);n!==-1&&this.view.reveal(n,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],o=this.model.getNodeLocation(n);if(!this.model.setCollapsed(o,!0)){const s=this.model.getParentNodeLocation(o);if(!s)return;const a=this.model.getListIndex(s);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 n=t[0],o=this.model.getNodeLocation(n);if(!this.model.setCollapsed(o,!1)){if(!n.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+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 n=t[0],o=this.model.getNodeLocation(n),r=e.browserEvent.altKey;this.model.setCollapsed(o,void 0,r)}dispose(){si(this.disposables),this.view.dispose()}}class LX{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Aht(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(o,r){return n.sorter.compare(o.element,r.element)}}),this.identityProvider=n.identityProvider}setChildren(e,t=vn.empty(),n={}){const o=this.getElementLocation(e);this._setChildren(o,this.preserveCollapseState(t),n)}_setChildren(e,t=vn.empty(),n){const o=new Set,r=new Set,s=l=>{var c;if(l.element===null)return;const d=l;if(o.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();r.add(u),this.nodesByIdentity.set(u,d)}(c=n.onDidCreateNode)===null||c===void 0||c.call(n,d)},a=l=>{var c;if(l.element===null)return;const d=l;if(o.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();r.has(u)||this.nodesByIdentity.delete(u)}(c=n.onDidDeleteNode)===null||c===void 0||c.call(n,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},n),{onDidCreateNode:s,onDidDeleteNode:a}))}preserveCollapseState(e=vn.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),vn.map(e,t=>{let n=this.nodes.get(t.element);if(!n&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();n=this.nodesByIdentity.get(s)}if(!n){let s;return typeof t.collapsed=="undefined"?s=void 0:t.collapsed===xh.Collapsed||t.collapsed===xh.PreserveOrCollapsed?s=!0:t.collapsed===xh.Expanded||t.collapsed===xh.PreserveOrExpanded?s=!1:s=Boolean(t.collapsed),Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:s})}const o=typeof t.collapsible=="boolean"?t.collapsible:n.collapsible;let r;return typeof t.collapsed=="undefined"||t.collapsed===xh.PreserveOrCollapsed||t.collapsed===xh.PreserveOrExpanded?r=n.collapsed:t.collapsed===xh.Collapsed?r=!0:t.collapsed===xh.Expanded?r=!1:r=Boolean(t.collapsed),Object.assign(Object.assign({},t),{collapsible:o,collapsed:r,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 n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const o=this.getElementLocation(e);return this.model.setCollapsed(o,t,n)}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 Ol(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Ol(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Ol(this.user,`Tree element not found: ${e}`);const n=this.model.getNodeLocation(t),o=this.model.getParentNodeLocation(n);return this.model.getNode(o).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Ol(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function yM(i){const e=[i.element],t=i.incompressible||!1;return{element:{elements:e,incompressible:t},children:vn.map(vn.from(i.children),yM),collapsible:i.collapsible,collapsed:i.collapsed}}function wM(i){const e=[i.element],t=i.incompressible||!1;let n,o;for(;[o,n]=vn.consume(vn.from(i.children),2),!(o.length!==1||o[0].incompressible);)i=o[0],e.push(i.element);return{element:{elements:e,incompressible:t},children:vn.map(vn.concat(o,n),wM),collapsible:i.collapsible,collapsed:i.collapsed}}function w$(i,e=0){let t;return ew$(n,0)),e===0&&i.element.incompressible?{element:i.element.elements[e],children:t,incompressible:!0,collapsible:i.collapsible,collapsed:i.collapsed}:{element:i.element.elements[e],children:t,collapsible:i.collapsible,collapsed:i.collapsed}}function yae(i){return w$(i,0)}function lCe(i,e,t){return i.element===e?Object.assign(Object.assign({},i),{children:t}):Object.assign(Object.assign({},i),{children:vn.map(vn.from(i.children),n=>lCe(n,e,t))})}const zht=i=>({getId(e){return e.elements.map(t=>i.getId(t).toString()).join("\0")}});class Uht{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new LX(e,t,n),this.enabled=typeof n.compressionEnabled=="undefined"?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(e,t=vn.empty(),n){const o=n.diffIdentityProvider&&zht(n.diffIdentityProvider);if(e===null){const g=vn.map(t,this.enabled?wM:yM);this._setChildren(null,g,{diffIdentityProvider:o,diffDepth:1/0});return}const r=this.nodes.get(e);if(!r)throw new Ol(this.user,"Unknown compressed tree node");const s=this.model.getNode(r),a=this.model.getParentNodeLocation(r),l=this.model.getNode(a),c=yae(s),d=lCe(c,e,t),u=(this.enabled?wM:yM)(d),h=n.diffIdentityProvider?(g,p)=>n.diffIdentityProvider.getId(g)===n.diffIdentityProvider.getId(p):void 0;if(Lo(u.element.elements,s.element.elements,h)){this._setChildren(r,u.children||vn.empty(),{diffIdentityProvider:o,diffDepth:1});return}const f=l.children.map(g=>g===s?u:g);this._setChildren(l.element,f,{diffIdentityProvider:o,diffDepth:s.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const n=this.model.getNode().children,o=vn.map(n,yae),r=vn.map(o,e?wM:yM);this._setChildren(null,r,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,n){const o=new Set,r=a=>{for(const l of a.element.elements)o.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)o.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},n),{onDidCreateNode:r,onDidDeleteNode:s}))}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=="undefined")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),n=this.model.getParentNodeLocation(t);return n===null?null:n.elements[n.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 n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const o=this.getCompressedNode(e);return this.model.setCollapsed(o,t,n)}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 Ol(this.user,`Tree element not found: ${e}`);return t}}const jht=i=>i[i.length-1];class EX{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new EX(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 Kht(i,e){return{splice(t,n,o){e.splice(t,n,o.map(r=>i.map(r)))},updateElementHeight(t,n){e.updateElementHeight(t,n)}}}function qht(i,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(i(t))}},sorter:e.sorter&&{compare(t,n){return e.sorter.compare(t.elements[0],n.elements[0])}},filter:e.filter&&{filter(t,n){return e.filter.filter(i(t),n)}}})}class Ght{get onDidSplice(){return st.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(n=>this.nodeMapper.map(n)),deletedNodes:t.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return st.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return st.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||jht;const o=r=>this.elementMapper(r.elements);this.nodeMapper=new wX(r=>new EX(o,r)),this.model=new Uht(e,Kht(this.nodeMapper,t),qht(o,n))}setChildren(e,t=vn.empty(),n={}){this.model.setChildren(e,t,n)}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=="undefined"?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,n){return this.model.setCollapsed(e,t,n)}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 Xht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};class DX extends aCe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,n,o,r={}){super(e,t,n,o,r),this.user=e}setChildren(e,t=vn.empty(),n){this.model.setChildren(e,t,n)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new LX(e,t,n)}}class cCe{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){const t=this.renderer.renderTemplate(e);return{compressedTreeNode:void 0,data:t}}renderElement(e,t,n,o){const r=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);r.element.elements.length===1?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,o)):(n.compressedTreeNode=r,this.renderer.renderCompressedElements(r,t,n.data,o))}disposeElement(e,t,n,o){var r,s,a,l;n.compressedTreeNode?(s=(r=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(r,n.compressedTreeNode,t,n.data,o):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,n.data,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}Xht([Mo],cCe.prototype,"compressedTreeNodeProvider",null);function Yht(i,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let n;try{n=i().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return n.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}class dCe extends DX{constructor(e,t,n,o,r={}){const s=()=>this,a=o.map(l=>new cCe(s,l));super(e,t,n,a,Yht(s,r))}setChildren(e,t=vn.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new Ght(e,t,n)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled!="undefined"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var $p=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function $9(i){return Object.assign(Object.assign({},i),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function S$(i,e){return e.parent?e.parent===i?!0:S$(i,e.parent):!1}function Zht(i,e){return i===e||S$(i,e)||S$(e,i)}class kX{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new kX(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 Qht{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,o){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Mt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Mt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,o){var r,s;(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,this.nodeMapper.map(e),t,n.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function wae(i){return{browserEvent:i.browserEvent,elements:i.elements.map(e=>e.element)}}function Sae(i){return{browserEvent:i.browserEvent,element:i.element&&i.element.element,target:i.target}}class Jht extends sT{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function z9(i){return i instanceof sT?new Jht(i):i}class eft{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(n=>n.element),t)}onDragStart(e,t){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,z9(e),t)}onDragOver(e,t,n,o,r=!0){return this.dnd.onDragOver(z9(e),t&&t.element,n,o)}drop(e,t,n,o){this.dnd.drop(z9(e),t&&t.element,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.dnd.dispose()}}function uCe(i){return i&&Object.assign(Object.assign({},i),{collapseByDefault:!0,identityProvider:i.identityProvider&&{getId(e){return i.identityProvider.getId(e.element)}},dnd:i.dnd&&new eft(i.dnd),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return i.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return i.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:i.accessibilityProvider&&Object.assign(Object.assign({},i.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:i.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=i.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return i.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return i.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider.getAriaLevel&&(e=>i.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))}),filter:i.filter&&{filter(e,t){return i.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},i.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof i.expandOnlyOnTwistieClick=="undefined"?void 0:typeof i.expandOnlyOnTwistieClick!="function"?i.expandOnlyOnTwistieClick:e=>i.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof i.defaultFindVisibility=="number"?i.defaultFindVisibility:typeof i.defaultFindVisibility=="undefined"?2:i.defaultFindVisibility(e.element)})}function x$(i,e){e(i),i.children.forEach(t=>x$(t,e))}class hCe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return st.map(this.tree.onDidChangeFocus,wae)}get onDidChangeSelection(){return st.map(this.tree.onDidChangeSelection,wae)}get onMouseDblClick(){return st.map(this.tree.onMouseDblClick,Sae)}get onPointer(){return st.map(this.tree.onPointer,Sae)}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,n,o,r,s={}){this.user=e,this.dataSource=r,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new le,this._onDidChangeNodeSlowState=new le,this.nodeMapper=new wX(a=>new kX(a)),this.disposables=new Be,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren=="undefined"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,n,o,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=$9({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,n,o,r){const s=new xX(n),a=o.map(c=>new Qht(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=uCe(r)||{};return new DX(e,t,s,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 $p(this,void 0,void 0,function*(){this.refreshPromises.forEach(o=>o.cancel()),this.refreshPromises.clear(),this.root.element=e;const n=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,n=!1,o,r){return $p(this,void 0,void 0,function*(){if(typeof this.root.element=="undefined")throw new Ol(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,o,r),n)try{this.tree.rerender(s)}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),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){const n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}expand(e,t=!1){return $p(this,void 0,void 0,function*(){if(typeof this.root.element=="undefined")throw new Ol(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event));const n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n)||(n.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n)))return!1;const o=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event)),o})}setSelection(e,t){const n=e.map(o=>this.getDataNode(o));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const n=e.map(o=>this.getDataNode(o));this.tree.setFocus(n,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),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Ol(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,n,o){return $p(this,void 0,void 0,function*(){yield this.refreshNode(e,t,n),this.render(e,n,o)})}refreshNode(e,t,n){return $p(this,void 0,void 0,function*(){let o;if(this.subTreeRefreshPromises.forEach((r,s)=>{!o&&Zht(s,e)&&(o=r.then(()=>this.refreshNode(e,t,n)))}),o)return o;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,n)})}doRefreshSubTree(e,t,n){return $p(this,void 0,void 0,function*(){let o;e.refreshPromise=new Promise(r=>o=r),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const r=yield this.doRefreshNode(e,t,n);e.stale=!1,yield QV.settled(r.map(s=>this.doRefreshSubTree(s,t,n)))}finally{o()}})}doRefreshNode(e,t,n){return $p(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let o;if(!e.hasChildren)o=Promise.resolve(vn.empty());else{const r=this.doGetChildren(e);if(roe(r))o=Promise.resolve(r);else{const s=xv(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),o=r.finally(()=>s.cancel())}}try{const r=yield o;return this.setChildren(e,r,t,n)}catch(r){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),sh(r))return[];throw r}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const n=this.dataSource.getChildren(e.element);return roe(n)?this.processChildren(n):(t=sr(()=>$p(this,void 0,void 0,function*(){return this.processChildren(yield n)})),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(en))}setChildren(e,t,n,o){const r=[...t];if(e.children.length===0&&r.length===0)return[];const s=new Map,a=new Map;for(const d of e.children)if(s.set(d.element,d),this.identityProvider){const u=this.tree.isCollapsed(d);a.set(d.id,{node:d,collapsed:u})}const l=[],c=r.map(d=>{const u=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=$9({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 s.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=u,n?f.collapsed?(p.children.forEach(v=>x$(v,m=>this.nodes.delete(m.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=$9({element:d,parent:e,id:h,hasChildren:u});return o&&o.viewState.focus&&o.viewState.focus.indexOf(h)>-1&&o.focus.push(g),o&&o.viewState.selection&&o.viewState.selection.indexOf(h)>-1&&o.selection.push(g),o&&o.viewState.expanded&&o.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 s.values())x$(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,n){const o=e.children.map(s=>this.asTreeElement(s,t)),r=n&&Object.assign(Object.assign({},n),{diffIdentityProvider:n.diffIdentityProvider&&{getId(s){return n.diffIdentityProvider.getId(s.element)}}});this.tree.setChildren(e===this.root?null:e,o,r),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 n;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?n=!1:n=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?vn.map(e.children,o=>this.asTreeElement(o,t)):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class IX{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 IX(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 tft{constructor(e,t,n,o){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=o,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,o){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,o)}renderCompressedElements(e,t,n,o){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Mt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Mt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,o){var r,s;(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,this.nodeMapper.map(e),t,n.templateData,o)}disposeCompressedElements(e,t,n,o){var r,s;(s=(r=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(r,this.compressibleNodeMapperProvider().map(e),t,n.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=si(this.disposables)}}function nft(i){const e=i&&uCe(i);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(n=>n.element))}})})}class ift extends hCe{constructor(e,t,n,o,r,s,a={}){super(e,t,n,r,s,a),this.compressionDelegate=o,this.compressibleNodeMapper=new wX(l=>new IX(l)),this.filter=a.filter}createTree(e,t,n,o,r){const s=new xX(n),a=o.map(c=>new tft(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=nft(r)||{};return new dCe(e,t,s,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 n=h=>this.identityProvider.getId(h).toString(),o=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 v of p.element.elements)f.add(n(v.element))}return f},r=o(this.tree.getSelection()),s=o(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 n=this.filter.filter(t,1),o=oft(n);if(o===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return o===1})),super.processChildren(e)}}function oft(i){return typeof i=="boolean"?i?1:0:SX(i)?bk(i.visibility):bk(i)}class rft extends aCe{constructor(e,t,n,o,r,s={}){super(e,t,n,o,s),this.user=e,this.dataSource=r,this.identityProvider=s.identityProvider}createModel(e,t,n){return new LX(e,t,n)}}new lt("isMac",Nn,C("isMac","Whether the operating system is macOS"));new lt("isLinux",xs,C("isLinux","Whether the operating system is Linux"));const W5=new lt("isWindows",ls,C("isWindows","Whether the operating system is Windows")),fCe=new lt("isWeb",Xv,C("isWeb","Whether the platform is a web browser"));new lt("isMacNative",Nn&&!Xv,C("isMacNative","Whether the operating system is macOS on a non-browser platform"));new lt("isIOS",Ku,C("isIOS","Whether the operating system is iOS"));new lt("isMobile",kXe,C("isMobile","Whether the platform is a mobile web browser"));new lt("isDevelopment",!1,!0);new lt("productQualityType","",C("productQualityType","Quality type of VS Code"));const gCe="inputFocus";new lt(gCe,!1,C("inputFocus","Whether keyboard focus is inside an input box"));var yp=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Oi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Xc=yn("listService");class sft{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Be,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(n=this._lastFocusedWidget)===null||n===void 0||n.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new q1e(Wc(),"").style(qb)),this.lists.some(o=>o.widget===e))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),Td(e.onDidFocus(()=>this.setLastFocusedList(e)),zt(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(o=>o!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const wk=new lt("listScrollAtBoundary","none");Me.or(wk.isEqualTo("top"),wk.isEqualTo("both"));Me.or(wk.isEqualTo("bottom"),wk.isEqualTo("both"));const pCe=new lt("listFocus",!0),V5=new lt("listSupportsMultiselect",!0),mCe=Me.and(pCe,Me.not(gCe)),TX=new lt("listHasSelectionOrFocus",!1),NX=new lt("listDoubleSelection",!1),RX=new lt("listMultiSelection",!1),H5=new lt("listSelectionNavigation",!1),aft=new lt("listSupportsFind",!0),MX=new lt("treeElementCanCollapse",!1),lft=new lt("treeElementHasParent",!1),AX=new lt("treeElementCanExpand",!1),cft=new lt("treeElementHasChild",!1),dft=new lt("treeFindOpen",!1),vCe="listTypeNavigationMode",_Ce="listAutomaticKeyboardNavigation";function $5(i,e){const t=i.createScoped(e.getHTMLElement());return pCe.bindTo(t),t}function z5(i,e){const t=wk.bindTo(i),n=()=>{const o=e.scrollTop===0,r=e.scrollHeight-e.renderHeight-e.scrollTop<1;o&&r?t.set("both"):o?t.set("top"):r?t.set("bottom"):t.set("none")};return n(),e.onDidScroll(n)}const Gb="workbench.list.multiSelectModifier",SM="workbench.list.openMode",Pc="workbench.list.horizontalScrolling",PX="workbench.list.defaultFindMode",OX="workbench.list.typeNavigationMode",GP="workbench.list.keyboardNavigation",Xu="workbench.list.scrollByPage",FX="workbench.list.defaultFindMatchType",Sk="workbench.tree.indent",XP="workbench.tree.renderIndentGuides",Yu="workbench.list.smoothScrolling",Cf="workbench.list.mouseWheelScrollSensitivity",yf="workbench.list.fastScrollSensitivity",YP="workbench.tree.expandMode";function wf(i){return i.getValue(Gb)==="alt"}class uft extends _e{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=wf(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Gb)&&(this.useAltAsMultipleSelectionModifier=wf(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:U1e(e)}isSelectionRangeChangeEvent(e){return j1e(e)}}function U5(i,e){var t;const n=i.get(En),o=i.get(xi),r=new Be;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return o.mightProducePrintableCharacter(a)}},smoothScrolling:Boolean(n.getValue(Yu)),mouseWheelScrollSensitivity:n.getValue(Cf),fastScrollSensitivity:n.getValue(yf),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:r.add(new uft(n)),keyboardNavigationEventFilter:gft(o),scrollByPage:Boolean(n.getValue(Xu))}),r]}let L$=class extends qd{constructor(e,t,n,o,r,s,a,l,c){const d=typeof r.horizontalScrolling!="undefined"?r.horizontalScrolling:Boolean(l.getValue(Pc)),[u,h]=c.invokeFunction(U5,r);super(e,t,n,o,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables.add(h),this.contextKeyService=$5(s,this),this.disposables.add(z5(this.contextKeyService,this)),this.listSupportsMultiSelect=V5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),H5.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this.listHasSelectionOrFocus=TX.bindTo(this.contextKeyService),this.listDoubleSelection=NX.bindTo(this.contextKeyService),this.listMultiSelection=RX.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=wf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.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(Gb)&&(this._useAltAsMultipleSelectionModifier=wf(l));let p={};if(g.affectsConfiguration(Pc)&&this.horizontalScrolling===void 0){const v=Boolean(l.getValue(Pc));p=Object.assign(Object.assign({},p),{horizontalScrolling:v})}if(g.affectsConfiguration(Xu)){const v=Boolean(l.getValue(Xu));p=Object.assign(Object.assign({},p),{scrollByPage:v})}if(g.affectsConfiguration(Yu)){const v=Boolean(l.getValue(Yu));p=Object.assign(Object.assign({},p),{smoothScrolling:v})}if(g.affectsConfiguration(Cf)){const v=l.getValue(Cf);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(yf)){const v=l.getValue(yf);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:v})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new bCe(this,Object.assign({configurationService:l},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?ES(e):qb)}};L$=yp([Oi(5,Ut),Oi(6,Xc),Oi(7,En),Oi(8,$t)],L$);let xae=class extends mht{constructor(e,t,n,o,r,s,a,l,c){const d=typeof r.horizontalScrolling!="undefined"?r.horizontalScrolling:Boolean(l.getValue(Pc)),[u,h]=c.invokeFunction(U5,r);super(e,t,n,o,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables=new Be,this.disposables.add(h),this.contextKeyService=$5(s,this),this.disposables.add(z5(this.contextKeyService,this.widget)),this.horizontalScrolling=r.horizontalScrolling,this.listSupportsMultiSelect=V5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),H5.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this._useAltAsMultipleSelectionModifier=wf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Gb)&&(this._useAltAsMultipleSelectionModifier=wf(l));let p={};if(g.affectsConfiguration(Pc)&&this.horizontalScrolling===void 0){const v=Boolean(l.getValue(Pc));p=Object.assign(Object.assign({},p),{horizontalScrolling:v})}if(g.affectsConfiguration(Xu)){const v=Boolean(l.getValue(Xu));p=Object.assign(Object.assign({},p),{scrollByPage:v})}if(g.affectsConfiguration(Yu)){const v=Boolean(l.getValue(Yu));p=Object.assign(Object.assign({},p),{smoothScrolling:v})}if(g.affectsConfiguration(Cf)){const v=l.getValue(Cf);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(yf)){const v=l.getValue(yf);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:v})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new bCe(this,Object.assign({configurationService:l},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?ES(e):qb)}dispose(){this.disposables.dispose(),super.dispose()}};xae=yp([Oi(5,Ut),Oi(6,Xc),Oi(7,En),Oi(8,$t)],xae);let Lae=class extends B5{constructor(e,t,n,o,r,s,a,l,c,d){const u=typeof s.horizontalScrolling!="undefined"?s.horizontalScrolling:Boolean(c.getValue(Pc)),[h,f]=d.invokeFunction(U5,s);super(e,t,n,o,r,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:u})),this.disposables.add(f),this.contextKeyService=$5(a,this),this.disposables.add(z5(this.contextKeyService,this)),this.listSupportsMultiSelect=V5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),H5.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=TX.bindTo(this.contextKeyService),this.listDoubleSelection=NX.bindTo(this.contextKeyService),this.listMultiSelection=RX.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=wf(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||v.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(Gb)&&(this._useAltAsMultipleSelectionModifier=wf(c));let v={};if(p.affectsConfiguration(Pc)&&this.horizontalScrolling===void 0){const m=Boolean(c.getValue(Pc));v=Object.assign(Object.assign({},v),{horizontalScrolling:m})}if(p.affectsConfiguration(Xu)){const m=Boolean(c.getValue(Xu));v=Object.assign(Object.assign({},v),{scrollByPage:m})}if(p.affectsConfiguration(Yu)){const m=Boolean(c.getValue(Yu));v=Object.assign(Object.assign({},v),{smoothScrolling:m})}if(p.affectsConfiguration(Cf)){const m=c.getValue(Cf);v=Object.assign(Object.assign({},v),{mouseWheelScrollSensitivity:m})}if(p.affectsConfiguration(yf)){const m=c.getValue(yf);v=Object.assign(Object.assign({},v),{fastScrollSensitivity:m})}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new hft(this,Object.assign({configurationService:c},s)),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?ES(e):qb)}dispose(){this.disposables.dispose(),super.dispose()}};Lae=yp([Oi(6,Ut),Oi(7,Xc),Oi(8,En),Oi(9,$t)],Lae);class BX extends _e{constructor(e,t){var n;super(),this.widget=e,this._onDidOpen=this._register(new le),this.onDidOpen=this._onDidOpen.event,this._register(st.filter(this.widget.onDidChangeSelection,o=>o.browserEvent instanceof KeyboardEvent)(o=>this.onSelectionFromKeyboard(o))),this._register(this.widget.onPointer(o=>this.onPointer(o.element,o.browserEvent))),this._register(this.widget.onMouseDblClick(o=>this.onMouseDblClick(o.element,o.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t==null?void 0:t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(SM))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration(SM)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(SM))!=="doubleClick")}))):this.openOnSingleClick=(n=t==null?void 0:t.openOnSingleClick)!==null&&n!==void 0?n:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,n=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,o=typeof t.pinned=="boolean"?t.pinned:!n,r=!1;this._open(this.getSelectedElement(),n,o,r,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const o=t.button===1,r=!0,s=o,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,s,a,t)}onMouseDblClick(e,t){if(!t)return;const n=t.target;if(n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&t.offsetX<16)return;const r=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,s,a,t)}_open(e,t,n,o,r){!e||this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:o,element:e,browserEvent:r})}}class bCe extends BX{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class hft extends BX{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class fft extends BX{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function gft(i){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const n=i.softDispatch(t,t.target);return n.kind===1?(e=!0,!1):(e=!1,n.kind===0)}}let Eae=class extends DX{constructor(e,t,n,o,r,s,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=s.invokeFunction(lT,r);super(e,t,n,o,d),this.disposables.add(h),this.internals=new cb(this,r,u,r.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Eae=yp([Oi(5,$t),Oi(6,Ut),Oi(7,Xc),Oi(8,En)],Eae);let Dae=class extends dCe{constructor(e,t,n,o,r,s,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=s.invokeFunction(lT,r);super(e,t,n,o,d),this.disposables.add(h),this.internals=new cb(this,r,u,r.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)}};Dae=yp([Oi(5,$t),Oi(6,Ut),Oi(7,Xc),Oi(8,En)],Dae);let kae=class extends rft{constructor(e,t,n,o,r,s,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(lT,s);super(e,t,n,o,r,u),this.disposables.add(f),this.internals=new cb(this,s,h,s.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)}};kae=yp([Oi(6,$t),Oi(7,Ut),Oi(8,Xc),Oi(9,En)],kae);let E$=class extends hCe{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,n,o,r,s,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(lT,s);super(e,t,n,o,r,u),this.disposables.add(f),this.internals=new cb(this,s,h,s.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)}};E$=yp([Oi(6,$t),Oi(7,Ut),Oi(8,Xc),Oi(9,En)],E$);let Iae=class extends ift{constructor(e,t,n,o,r,s,a,l,c,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(lT,a);super(e,t,n,o,r,s,h),this.disposables.add(g),this.internals=new cb(this,a,f,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Iae=yp([Oi(7,$t),Oi(8,Ut),Oi(9,Xc),Oi(10,En)],Iae);function CCe(i){const e=i.getValue(PX);if(e==="highlight")return tf.Highlight;if(e==="filter")return tf.Filter;const t=i.getValue(GP);if(t==="simple"||t==="highlight")return tf.Highlight;if(t==="filter")return tf.Filter}function yCe(i){const e=i.getValue(FX);if(e==="fuzzy")return lb.Fuzzy;if(e==="contiguous")return lb.Contiguous}function lT(i,e){var t;const n=i.get(En),o=i.get(bp),r=i.get(Ut),s=i.get($t),a=()=>{const f=r.getContextKeyValue(vCe);if(f==="automatic")return Wh.Automatic;if(f==="trigger"||r.getContextKeyValue(_Ce)===!1)return Wh.Trigger;const p=n.getValue(OX);if(p==="automatic")return Wh.Automatic;if(p==="trigger")return Wh.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:Boolean(n.getValue(Pc)),[c,d]=s.invokeFunction(U5,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:n.getValue(XP);return{getTypeNavigationMode:a,disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof n.getValue(Sk)=="number"?n.getValue(Sk):void 0,renderIndentGuides:h,smoothScrolling:Boolean(n.getValue(Yu)),defaultFindMode:CCe(n),defaultFindMatchType:yCe(n),horizontalScrolling:l,scrollByPage:Boolean(n.getValue(Xu)),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:n.getValue(YP)==="doubleClick",contextViewProvider:o,findWidgetStyles:Xut})}}let cb=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,n,o,r,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=$5(r,e),this.disposables.push(z5(this.contextKeyService,e)),this.listSupportsMultiSelect=V5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),H5.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=aft.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=TX.bindTo(this.contextKeyService),this.hasDoubleSelection=NX.bindTo(this.contextKeyService),this.hasMultiSelection=RX.bindTo(this.contextKeyService),this.treeElementCanCollapse=MX.bindTo(this.contextKeyService),this.treeElementHasParent=lft.bindTo(this.contextKeyService),this.treeElementCanExpand=AX.bindTo(this.contextKeyService),this.treeElementHasChild=cft.bindTo(this.contextKeyService),this.treeFindOpen=dft.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=wf(a),this.updateStyleOverrides(o);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(vCe),u.add(_Ce),this.disposables.push(this.contextKeyService,s.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(Gb)&&(this._useAltAsMultipleSelectionModifier=wf(a)),h.affectsConfiguration(Sk)){const g=a.getValue(Sk);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(XP)&&t.renderIndentGuides===void 0){const g=a.getValue(XP);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(Yu)){const g=Boolean(a.getValue(Yu));f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(PX)||h.affectsConfiguration(GP)){const g=CCe(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(OX)||h.affectsConfiguration(GP)){const g=n();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(FX)){const g=yCe(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(Pc)&&t.horizontalScrolling===void 0){const g=Boolean(a.getValue(Pc));f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(Xu)){const g=Boolean(a.getValue(Xu));f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(YP)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(YP)==="doubleClick"})),h.affectsConfiguration(Cf)){const g=a.getValue(Cf);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(yf)){const g=a.getValue(yf);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:n()})})),this.navigator=new fft(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?ES(e):qb)}dispose(){this.disposables=si(this.disposables)}};cb=yp([Oi(4,Ut),Oi(5,Xc),Oi(6,En)],cb);const pft=no.as(ch.Configuration);pft.registerConfiguration({id:"workbench",order:7,title:C("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[Gb]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[C("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),C("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:C({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.")},[SM]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:C({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.")},[Pc]:{type:"boolean",default:!1,description:C("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Xu]:{type:"boolean",default:!1,description:C("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[Sk]:{type:"number",default:8,minimum:4,maximum:40,description:C("tree indent setting","Controls tree indentation in pixels.")},[XP]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:C("render tree indent guides","Controls whether the tree should render indent guides.")},[Yu]:{type:"boolean",default:!1,description:C("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Cf]:{type:"number",default:1,markdownDescription:C("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[yf]:{type:"number",default:5,markdownDescription:C("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[PX]:{type:"string",enum:["highlight","filter"],enumDescriptions:[C("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),C("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:C("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[GP]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[C("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),C("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),C("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:C("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:C("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[FX]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[C("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),C("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:C("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[YP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:C("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.")},[OX]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:C("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 D$;(function(i){i[i.PRESERVE=0]="PRESERVE",i[i.LAST=1]="LAST"})(D$||(D$={}));const Xb={Quickaccess:"workbench.contributions.quickaccess"};class mft{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,n)=>n.prefix.length-t.prefix.length),zt(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return hf([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(n=>e.startsWith(n.prefix))||void 0||this.defaultProvider}}no.add(Xb.Quickaccess,new mft);const vft={ctrlCmd:!1,alt:!1};var xk;(function(i){i[i.Blur=1]="Blur",i[i.Gesture=2]="Gesture",i[i.Other=3]="Other"})(xk||(xk={}));var vu;(function(i){i[i.NONE=0]="NONE",i[i.FIRST=1]="FIRST",i[i.SECOND=2]="SECOND",i[i.LAST=3]="LAST"})(vu||(vu={}));const dh=yn("quickInputService");var _ft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Tae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let k$=class extends _e{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=no.as(Xb.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){var o;const[r,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(n!=null&&n.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,n);return}if(s&&!(n!=null&&n.preserveValue)){let f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=r==null?void 0:r.defaultFilterValue;g===D$.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new Be,d=c.add(this.quickInputService.createQuickPick());d.value=e,this.adjustValueSelection(d,s,n),d.placeholder=s==null?void 0:s.placeholder,d.quickNavigate=n==null?void 0:n.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!a,(typeof(n==null?void 0:n.itemActivation)=="number"||(n==null?void 0:n.quickNavigateConfiguration))&&(d.itemActivation=(o=n==null?void 0:n.itemActivation)!==null&&o!==void 0?o:vu.SECOND),d.contextKey=s==null?void 0:s.contextKey,d.filterValue=f=>f.substring(s?s.prefix.length:0);let u;t&&(u=new i5,c.add(st.once(d.onWillAccept)(f=>{f.veto(),d.hide()}))),c.add(this.registerPickerListeners(d,r,s,e,n==null?void 0:n.providerOptions));const h=c.add(new Ro);if(r&&c.add(r.provide(d,h.token,n==null?void 0:n.providerOptions)),st.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,n){var o;let r;n!=null&&n.preserveValue?r=[e.value.length,e.value.length]:r=[(o=t==null?void 0:t.prefix.length)!==null&&o!==void 0?o:0,e.value.length],e.valueSelection=r}registerPickerListeners(e,t,n,o,r){const s=new Be,a=this.visibleQuickAccess={picker:e,descriptor:n,value:o};return s.add(zt(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:r}):a.value=l})),n&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};k$=_ft([Tae(0,dh),Tae(1,$t)],k$);ve.white.toString(),ve.white.toString();class I$ extends _e{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new le),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 n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,o=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=o||"",this._element.style.backgroundColor=n||"",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(Ei.addTarget(this._element)),[et.CLICK,Di.Tap].forEach(r=>{this._register(ke(this._element,r,s=>{if(!this.enabled){un.stop(s);return}this._onDidClick.fire(s)}))}),this._register(ke(this._element,et.KEY_DOWN,r=>{const s=new Pi(r);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(r),a=!0):s.equals(9)&&(this._element.blur(),a=!0),a&&un.stop(s,!0)})),this._register(ke(this._element,et.MOUSE_OVER,r=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ke(this._element,et.MOUSE_OUT,r=>{this.updateBackground(!1)})),this.focusTracker=this._register(pf(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 n of Jm(e))if(typeof n=="string"){if(n=n.trim(),n==="")continue;const o=document.createElement("span");o.textContent=n,t.push(o)}else t.push(n);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||Qm(this._label)&&Qm(e)&&Bdt(this._label,e))return;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(Qm(e)){const o=A5(e,{inline:!0});o.dispose();const r=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(r){const s=l0e(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});n.innerHTML=s}else jr(n)}else this.options.supportIcons?jr(n,...this.getContentElements(e)):n.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=Jdt(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 T${constructor(e,t,n){this.options=t,this.styles=n,this.count=0,this.element=Ae(e,He(".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=Z0(this.countFormat,this.count),this.element.title=Z0(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const Nae="done",Rae="active",U9="infinite",j9="infinite-long-running",Mae="discrete";class j5 extends _e{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new bi(()=>nl(this.element),0)),this.longRunningScheduler=this._register(new bi(()=>this.infiniteLongRunning(),j5.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(Rae,U9,j9,Mae),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Nae),this.element.classList.contains(U9)?(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(Mae,Nae,j9),this.element.classList.add(Rae,U9),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(j9)}getContainer(){return this.element}}j5.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const bft=He;class Cft extends _e{constructor(e,t,n){super(),this.parent=e,this.onKeyDown=r=>ke(this.findInput.inputBox.inputElement,et.KEY_DOWN,s=>{r(new Pi(s))}),this.onMouseDown=r=>ke(this.findInput.inputBox.inputElement,et.MOUSE_DOWN,s=>{r(new kc(s))}),this.onDidChange=r=>this.findInput.onDidChange(r),this.container=Ae(this.parent,bft(".quick-input-box")),this.findInput=this._register(new sCe(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:n}));const o=this.findInput.inputBox.inputElement;o.role="combobox",o.ariaHasPopup="menu",o.ariaAutoComplete="list",o.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===So.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===So.Info?1:e===So.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===So.Info?1:e===So.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class tv{constructor(e,t){var n;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(n=t==null?void 0:t.supportIcons)!==null&&n!==void 0?n:!1,this.domNode=Ae(e,He("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],n="",o){e||(e=""),o&&(e=tv.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===n&&ql(this.highlights,t))&&(this.text=e,this.title=n,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const n of this.highlights){if(n.end===n.start)continue;if(t{o=r===`\r -`?-1:0,s+=n;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=o),a.end>=s&&(a.end+=o));return n+=o,"\u23CE"})}}class K9{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 ZP extends _e{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new K9(Ae(e,He(".monaco-icon-label")))),this.labelContainer=Ae(this.domNode.element,He(".monaco-icon-label-container"));const n=Ae(this.labelContainer,He("span.monaco-icon-name-container"));(t==null?void 0:t.supportHighlights)||(t==null?void 0:t.supportIcons)?this.nameNode=new Sft(n,!!t.supportIcons):this.nameNode=new yft(n),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,n){const o=["monaco-icon-label"],r=["monaco-icon-label-container"];let s="";if(n&&(n.extraClasses&&o.push(...n.extraClasses),n.italic&&o.push("italic"),n.strikethrough&&o.push("strikethrough"),n.disabledCommand&&r.push("disabled"),n.title&&(s+=n.title)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",s),this.labelContainer.className=r.join(" "),this.setupHover(n!=null&&n.descriptionTitle?this.labelContainer:this.element,n==null?void 0:n.title),this.nameNode.setLabel(e,n),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof tv?(a.set(t||"",n?n.descriptionMatches:void 0,void 0,n==null?void 0:n.labelEscapeNewLines),this.setupHover(a.element,n==null?void 0:n.descriptionTitle)):(a.textContent=t&&(n==null?void 0:n.labelEscapeNewLines)?tv.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(n==null?void 0:n.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)Hdt(e,t);else{const o=V1e(this.hoverDelegate,e,t);o&&this.customHovers.set(e,o)}}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 K9(Ae(this.labelContainer,He("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new tv(Ae(t.element,He("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new K9(Ae(t.element,He("span.label-description"))))}return this.descriptionNode}}class yft{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&ql(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=Ae(this.container,He("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 n=0;n{const r={start:n,end:n+o.length},s=t.map(a=>fs.intersect(r,a)).filter(a=>!fs.isEmpty(a)).map(({start:a,end:l})=>({start:a-n,end:l-n}));return n=r.end+e.length,s})}class Sft{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&ql(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 tv(Ae(this.container,He("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 n=(t==null?void 0:t.separator)||"/",o=wft(e,n,t==null?void 0:t.matches);for(let r=0;r{const i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:i,collatorIsNumeric:i.resolvedOptions().numeric}});new ah(()=>({collator:new Intl.Collator(void 0,{numeric:!0})}));new ah(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function Lft(i,e,t=!1){const n=i||"",o=e||"",r=Aae.value.collator.compare(n,o);return Aae.value.collatorIsNumeric&&r===0&&n!==o?no.length)return 1}return 0}var kft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};class wCe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}kft([Mo],wCe.prototype,"toString",null);const Ift=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function Tft(i){const e=[];let t=0,n;for(;n=Ift.exec(i);){n.index-t>0&&e.push(i.substring(t,n.index));const[,o,r,,s]=n;s?e.push({label:o,href:r,title:s}):e.push({label:o,href:r}),t=n.index+n[0].length}return t{UQe(f)&&un.stop(f,!0),t.callback(r.href)},c=t.disposables.add(new xn(a,et.CLICK)).event,d=t.disposables.add(new xn(a,et.KEY_DOWN)).event,u=st.chain(d,f=>f.filter(g=>{const p=new Pi(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Ei.addTarget(a));const h=t.disposables.add(new xn(a,Di.Tap)).event;st.any(c,h,u)(l,null,t.disposables),e.appendChild(a)}}var SCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Pae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const au=He;class Mft{constructor(e,t,n,o,r,s,a){var l,c,d;this._checked=!1,this._hidden=!1,this.hasCheckbox=o,this.index=n,this.fireButtonTriggered=r,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=o?st.map(st.filter(this._onChecked.event,u=>u.listElement===this),u=>u.checked):st.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 ah(()=>{var u;const h=(u=e.label)!==null&&u!==void 0?u:"",f=RL(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>Fdt(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 dT{constructor(e){this.themeService=e}get templateId(){return dT.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Ae(e,au(".quick-input-list-entry"));const n=Ae(t.entry,au("label.quick-input-list-label"));t.toDisposeTemplate.push(No(n,et.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=Ae(n,au("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(No(t.checkbox,et.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const o=Ae(n,au(".quick-input-list-rows")),r=Ae(o,au(".quick-input-list-row")),s=Ae(o,au(".quick-input-list-row"));t.label=new ZP(r,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=v0e(t.label.element,au(".quick-input-list-icon"));const a=Ae(r,au(".quick-input-list-entry-keybinding"));t.keybinding=new cT(a,Vl);const l=Ae(s,au(".quick-input-list-label-meta"));return t.detail=new ZP(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=Ae(t.entry,au(".quick-input-list-separator")),t.actionBar=new zc(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){var o,r,s,a;n.element=e,e.element=(o=n.entry)!==null&&o!==void 0?o:void 0;const l=e.item?e.item:e.separator;n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked(g=>n.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:d,detailHighlights:u}=e;if(!((r=e.item)===null||r===void 0)&&r.iconPath){const g=Ew(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,p=Rt.revive(g);n.icon.className="quick-input-list-icon",n.icon.style.backgroundImage=Sv(p)}else n.icon.style.backgroundImage="",n.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:d||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,n.entry.classList.remove("quick-input-list-separator-as-item")):n.entry.classList.add("quick-input-list-separator-as-item"),n.label.setLabel(e.saneLabel,e.saneDescription,h),n.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(n.detail.element.style.display="",n.detail.setLabel(e.saneDetail,void 0,{matches:u,title:e.saneDetail,labelEscapeNewLines:!0})):n.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",n.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const f=l.buttons;f&&f.length?(n.actionBar.push(f.map((g,p)=>{let v=g.iconClass||(g.iconPath?N$(g.iconPath):void 0);return g.alwaysVisible&&(v=v?`${v} always-visible`:"always-visible"),{id:`id-${p}`,class:v,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}),n.entry.classList.add("has-actions")):n.entry.classList.remove("has-actions")}disposeElement(e,t,n){n.toDisposeElement=si(n.toDisposeElement),n.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=si(e.toDisposeElement),e.toDisposeTemplate=si(e.toDisposeTemplate)}}dT.ID="listelement";class Aft{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return dT.ID}}var Sr;(function(i){i[i.First=1]="First",i[i.Second=2]="Second",i[i.Last=3]="Last",i[i.Next=4]="Next",i[i.Previous=5]="Previous",i[i.NextPage=6]="NextPage",i[i.PreviousPage=7]="PreviousPage"})(Sr||(Sr={}));class WX{constructor(e,t,n,o){this.parent=e,this.options=n,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 le,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new le,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new le,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new le,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new le,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new le,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new le,this.onKeyDown=this._onKeyDown.event,this._onLeave=new le,this.onLeave=this._onLeave.event,this._listElementChecked=new le,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Ae(this.parent,au(".quick-input-list"));const r=new Aft,s=new Fft;if(this.list=n.createList("QuickInput",this.container,r,[new dT(o)],{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:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new Pi(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(Nn?a.metaKey:a.ctrlKey)&&this.list.setFocus(Gs(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(ke(this.container,et.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]))})),n.hoverDelegate){const a=new E0e(n.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>Pae(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&rs(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>Pae(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(d){if(!sh(d))throw d}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;rs(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 st.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return st.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 n=0,o=e.length;n{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=si(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),n=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const o=new Map,r=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const d=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const u=new Mft(a,d,l,r,t,n,this._listElementChecked),h=s.length;return s.push(u),o.set((c=u.item)!==null&&c!==void 0?c:u.separator,h),s},[]),this.elementsToIndexes=o,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 n of e)t.add(n);for(const n of this.elements)n.checked=t.has(n.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===Sr.Second&&this.list.length<2&&(e=Sr.First),e){case Sr.First:this.list.scrollTop=0,this.list.focusFirst(void 0,n=>!!n.item);break;case Sr.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,n=>!!n.item);break;case Sr.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,n=>!!n.item);break;case Sr.Next:{this.list.focusNext(void 0,!0,void 0,o=>!!o.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Sr.Previous:{this.list.focusPrevious(void 0,!0,void 0,o=>!!o.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Sr.NextPage:this.list.focusNextPage(void 0,n=>!!n.item);break;case Sr.PreviousPage:this.list.focusPreviousPage(void 0,n=>!!n.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,n,o;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((n=(t=this.options.hoverDelegate).onDidHideHover)===null||n===void 0||n.call(t),(o=this._lastHover)===null||o===void 0||o.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:r=>{this.options.linkOpenerDelegate(r)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(o=>{o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=!1;const r=o.index&&this.inputElements[o.index-1];o.item&&(o.separator=r&&r.type==="separator"&&!r.buttons?r:void 0)});else{let o;this.elements.forEach(r=>{var s,a,l,c;let d;this.matchOnLabelMode==="fuzzy"?d=this.matchOnLabel&&(s=R9(e,RL(r.saneLabel)))!==null&&s!==void 0?s:void 0:d=this.matchOnLabel&&(a=Pft(t,RL(r.saneLabel)))!==null&&a!==void 0?a:void 0;const u=this.matchOnDescription&&(l=R9(e,RL(r.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=R9(e,RL(r.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(d||u||h?(r.labelHighlights=d,r.descriptionHighlights=u,r.detailHighlights=h,r.hidden=!1):(r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=r.item?!r.item.alwaysShow:!0),r.item?r.separator=void 0:r.separator&&(r.hidden=!0),!this.sortByLabel){const f=r.index&&this.inputElements[r.index-1];o=f&&f.type==="separator"?f:o,o&&!r.hidden&&(r.separator=o,o=void 0)}})}const n=this.elements.filter(o=>!o.hidden);if(this.sortByLabel&&e){const o=e.toLowerCase();n.sort((r,s)=>Oft(r,s,o))}return this.elementsToIndexes=n.reduce((o,r,s)=>{var a;return o.set((a=r.item)!==null&&a!==void 0?a:r.separator,s),o},new Map),this.list.splice(0,this.list.length,n),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(n.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.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=si(this.elementDisposables),this.disposables=si(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 n=new Be;n.add(this.list.onDidChangeFocus(o=>{o.indexes.length&&this.showHover(o.elements[0])})),this._lastHover&&n.add(this._lastHover),this._toggleHover=n,this.elementDisposables.push(this._toggleHover)}}SCe([Mo],WX.prototype,"onDidChangeFocus",null);SCe([Mo],WX.prototype,"onDidChangeSelection",null);function Pft(i,e){const{text:t,iconOffsets:n}=e;if(!n||n.length===0)return Oae(i,t);const o=VI(t," "),r=t.length-o.length,s=Oae(i,o);if(s)for(const a of s){const l=n[a.start+r]+r;a.start+=l,a.end+=l}return s}function Oae(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t!==-1?[{start:t,end:t+i.length}]:null}function Oft(i,e,t){const n=i.labelHighlights||[],o=e.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:n.length===0&&o.length===0?0:Eft(i.saneSortLabel,e.saneSortLabel,t)}class Fft{getWidgetAriaLabel(){return C("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!!e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var Fae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const R$={iconClass:Mt.asClassName(Xe.quickInputBack),tooltip:C("quickInput.back","Back"),handle:-1};class uT extends _e{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=uT.noPromptMessage,this._severity=So.Ignore,this.onDidTriggerButtonEmitter=this._register(new le),this.onDidHideEmitter=this._register(new le),this.onDisposeEmitter=this._register(new le),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&&!Ku;this._ignoreFocusOut=e&&!Ku,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=xk.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const n=this.getTitle();n&&this.ui.title.textContent!==n?this.ui.title.textContent=n:!n&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText="\xA0");const o=this.getDescription();if(this.ui.description1.textContent!==o&&(this.ui.description1.textContent=o),this.ui.description2.textContent!==o&&(this.ui.description2.textContent=o),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?jr(this.ui.widget,this._widget):jr(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new zd,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 s=this.buttons.filter(l=>l===R$);this.ui.leftActionBar.push(s.map((l,c)=>{const d=new ca(`id-${c}`,"",l.iconClass||N$(l.iconPath),!0,()=>Fae(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!==R$);this.ui.rightActionBar.push(a.map((l,c)=>{const d=new ca(`id-${c}`,"",l.iconClass||N$(l.iconPath),!0,()=>Fae(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 s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof kS))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const r=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==r&&(this._lastValidationMessage=r,jr(this.ui.message),Rft(r,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?C("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==So.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}uT.noPromptMessage=C("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class Lk extends uT{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new le),this.onWillAcceptEmitter=this._register(new le),this.onDidAcceptEmitter=this._register(new le),this.onDidCustomEmitter=this._register(new le),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=vu.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new le),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new le),this.onDidTriggerItemButtonEmitter=this._register(new le),this.onDidTriggerSeparatorButtonEmitter=this._register(new le),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?vft: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(Sr.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(Sr.Next),this.canSelectMany&&this.ui.list.domFocus(),un.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Sr.Previous):this.ui.list.focus(Sr.Last),this.canSelectMany&&this.ui.list.domFocus(),un.stop(e,!0);break;case 12:this.ui.list.focus(Sr.NextPage),this.canSelectMany&&this.ui.list.domFocus(),un.stop(e,!0);break;case 11:this.ui.list.focus(Sr.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),un.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(Sr.First),un.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Sr.Last),un.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&&Lo(e,this._activeItems,(t,n)=>t===n)||(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&&Lo(e,this._selectedItems,(n,o)=>n===o)||(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&&Lo(e,this._selectedItems,(t,n)=>t===n)||(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 ke(this.ui.container,et.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Pi(e),n=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&n===6||a[0].ctrlKey&&n===5||a[0].metaKey&&n===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,n={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(n),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 o=this.ariaLabel;if(!o&&n.inputBox&&(o=this.placeholder||Lk.DEFAULT_ARIA_LABEL,this.title&&(o+=` - ${this.title}`)),this.ui.list.ariaLabel!==o&&(this.ui.list.ariaLabel=o!=null?o: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 vu.NONE:this._itemActivation=vu.FIRST;break;case vu.SECOND:this.ui.list.focus(Sr.Second),this._itemActivation=vu.FIRST;break;case vu.LAST:this.ui.list.focus(Sr.Last),this._itemActivation=vu.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||"",n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Sr.First)),this.keepScrollPosition&&(this.scrollTop=e)}}Lk.DEFAULT_ARIA_LABEL=C("quickInputBox.ariaLabel","Type to narrow down results.");class Bft extends uT{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new le),this.onDidAcceptEmitter=this._register(new le),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 Xa=He;class K5 extends _e{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new le),this.onDidCustomEmitter=this._register(new le),this.onDidTriggerButtonEmitter=this._register(new le),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new le),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new le),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(ke(window,et.KEY_DOWN,e,!0)),this._register(ke(window,et.KEY_UP,e,!0)),this._register(ke(window,et.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Ae(this.parentElement,Xa(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Wc(e),n=Ae(e,Xa(".quick-input-titlebar")),o=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,r=this._register(new zc(n,o));r.domNode.classList.add("quick-input-left-action-bar");const s=Ae(n,Xa(".quick-input-title")),a=this._register(new zc(n,o));a.domNode.classList.add("quick-input-right-action-bar");const l=Ae(e,Xa(".quick-input-header")),c=Ae(l,Xa("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",C("quickInput.checkAll","Toggle all checkboxes")),this._register(No(c,et.CHANGE,N=>{const M=c.checked;A.setAllVisibleChecked(M)})),this._register(ke(c,et.CLICK,N=>{(N.x||N.y)&&f.setFocus()}));const d=Ae(l,Xa(".quick-input-description")),u=Ae(l,Xa(".quick-input-and-message")),h=Ae(u,Xa(".quick-input-filter")),f=this._register(new Cft(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Ae(h,Xa(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new T$(g,{countFormat:C({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),v=Ae(h,Xa(".quick-input-count"));v.setAttribute("aria-live","polite");const m=new T$(v,{countFormat:C({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),_=Ae(l,Xa(".quick-input-action")),y=this._register(new I$(_,this.styles.button));y.label=C("ok","OK"),this._register(y.onDidClick(N=>{this.onDidAcceptEmitter.fire()}));const w=Ae(l,Xa(".quick-input-action")),L=this._register(new I$(w,this.styles.button));L.label=C("custom","Custom"),this._register(L.onDidClick(N=>{this.onDidCustomEmitter.fire()}));const D=Ae(u,Xa(`#${this.idPrefix}message.quick-input-message`)),E=this._register(new j5(e,this.styles.progressBar));E.getContainer().classList.add("quick-input-progress");const I=Ae(e,Xa(".quick-input-html-widget"));I.tabIndex=-1;const k=Ae(e,Xa(".quick-input-description")),R=this.idPrefix+"list",A=this._register(new WX(e,R,this.options,this.themeService));f.setAttribute("aria-controls",R),this._register(A.onDidChangeFocus(()=>{var N;f.setAttribute("aria-activedescendant",(N=A.getActiveDescendant())!==null&&N!==void 0?N:"")})),this._register(A.onChangedAllVisibleChecked(N=>{c.checked=N})),this._register(A.onChangedVisibleCount(N=>{p.setCount(N)})),this._register(A.onChangedCheckedCount(N=>{m.setCount(N)})),this._register(A.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof Lk&&this.controller.canSelectMany&&A.clearFocus()},0)}));const P=pf(e);return this._register(P),this._register(ke(e,et.FOCUS,N=>{rs(N.relatedTarget,e)||(this.previousFocusElement=N.relatedTarget instanceof HTMLElement?N.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(xk.Blur),this.previousFocusElement=void 0})),this._register(ke(e,et.FOCUS,N=>{f.setFocus()})),this._register(No(e,et.KEY_DOWN,N=>{if(!rs(N.target,I))switch(N.keyCode){case 3:un.stop(N,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:un.stop(N,!0),this.hide(xk.Gesture);break;case 2:if(!N.altKey&&!N.ctrlKey&&!N.metaKey){const M=[".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")?M.push("input"):M.push("input[type=text]"),this.getUI().list.isDisplayed()&&M.push(".monaco-list"),this.getUI().message&&M.push(".quick-input-message a"),this.getUI().widget){if(rs(N.target,this.getUI().widget))break;M.push(".quick-input-html-widget")}const H=e.querySelectorAll(M.join(", "));N.shiftKey&&N.target===H[0]?(un.stop(N,!0),A.clearFocus()):!N.shiftKey&&rs(N.target,H[H.length-1])&&(un.stop(N,!0),H[0].focus())}break;case 10:N.ctrlKey&&(un.stop(N,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:r,titleBar:n,title:s,description1:k,description2:d,widget:I,rightActionBar:a,checkAll:c,inputContainer:u,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:v,count:m,okContainer:_,ok:y,message:D,customButtonContainer:w,customButton:L,list:A,progressBar:E,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:N=>this.show(N),hide:()=>this.hide(),setVisibilities:N=>this.setVisibilities(N),setEnabled:N=>this.setEnabled(N),setContextKey:N=>this.options.setContextKey(N),linkOpenerDelegate:N=>this.options.linkOpenerDelegate(N)},this.updateStyles(),this.ui}pick(e,t={},n=_n.None){return new Promise((o,r)=>{let s=d=>{var u;s=o,(u=t.onKeyMods)===null||u===void 0||u.call(t,a.keyMods),o(d)};if(n.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(s(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&&(s(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(v=>v!==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])}),n.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{si(c),s(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=>{r(d),a.hide()})})}createQuickPick(){const e=this.getUI();return new Lk(e)}createInputBox(){const e=this.getUI();return new Bft(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const n=this.controller;this.controller=e,n==null||n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",jr(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(So.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),jr(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 o=this.options.backKeybindingLabel();R$.tooltip=o?C("quickInput.backWithKeybinding","Back ({0})",o):C("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,n,o;const r=this.controller;if(!r)return;const s=!rs(document.activeElement,(n=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&n!==void 0?n:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(o=a.parentElement)!==null&&o!==void 0?o:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}r.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,K5.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:n,widgetBorder:o,widgetShadow:r}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e!=null?e:"",this.ui.container.style.backgroundColor=t!=null?t:"",this.ui.container.style.color=n!=null?n:"",this.ui.container.style.border=o?`1px solid ${o}`:"",this.ui.container.style.boxShadow=r?`0 0 8px 2px ${r}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.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)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const a=s.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}K5.MAX_WIDTH=600;var Wft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},H2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let M$=class extends bot{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(k$))),this._quickAccess}constructor(e,t,n,o){super(n),this.instantiationService=e,this.contextKeyService=t,this.layoutService=o,this._onShow=this._register(new le),this._onHide=this._register(new le),this.contexts=new Map}createController(e=this.layoutService,t){const n={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:r=>this.setContextKey(r),linkOpenerDelegate:r=>{this.instantiationService.invokeFunction(s=>{s.get(ml).open(r,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(r,s,a,l,c)=>this.instantiationService.createInstance(L$,r,s,a,l,c),styles:this.computeStyles()},o=this._register(new K5(Object.assign(Object.assign({},n),t),this.themeService));return o.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(r=>o.layout(r,e.offset.quickPickTop))),this._register(o.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(o.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),o}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new lt(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={},n=_n.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ct(Dre),quickInputForeground:ct(Lnt),quickInputTitleBackground:ct(Ent),widgetBorder:ct(SG),widgetShadow:ct(Gh)},inputBox:WP,toggle:BP,countBadge:X1e,button:qut,progressBar:Gut,keybindingLabel:Kut,list:ES({listBackground:Dre,listFocusBackground:p0,listFocusForeground:g0,listInactiveFocusForeground:g0,listInactiveSelectionIconForeground:OC,listInactiveFocusBackground:p0,listFocusOutline:Wi,listInactiveFocusOutline:Wi}),pickerGroup:{pickerGroupBorder:ct(Dnt),pickerGroupForeground:ct(abe)}}}};M$=Wft([H2(0,$t),H2(1,Ut),H2(2,vr),H2(3,LS)],M$);var xCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},XC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let A$=class extends M${constructor(e,t,n,o,r){super(t,n,o,new VH(e.getContainerDomNode(),r)),this.host=void 0;const s=Fw.get(e);if(s){const a=s.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)}};A$=xCe([XC(1,$t),XC(2,Ut),XC(3,vr),XC(4,Jn)],A$);let P$=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 n=t=this.instantiationService.createInstance(A$,e);this.mapEditorToService.set(e,t),yv(e.onDidDispose)(()=>{n.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={},n=_n.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};P$=xCe([XC(0,$t),XC(1,Jn)],P$);class Fw{static get(e){return e.getContribution(Fw.ID)}constructor(e){this.editor=e,this.widget=new q5(this.editor)}dispose(){this.widget.dispose()}}Fw.ID="editor.controller.quickInput";class q5{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return q5.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}q5.ID="editor.contrib.quickInputWidget";Un(Fw.ID,Fw,4);class Vft{constructor(e,t,n,o,r){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=n,this.foreground=o,this.background=r}}function Hft(i){if(!i||!Array.isArray(i))return[];const e=[];let t=0;for(let n=0,o=i.length;n{const h=qft(d.token,u.token);return h!==0?h:d.index-u.index});let t=0,n="000000",o="ffffff";for(;i.length>=1&&i[0].token==="";){const d=i.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(n=d.foreground),d.background!==null&&(o=d.background)}const r=new Uft;for(const d of e)r.getId(d);const s=r.getId(n),a=r.getId(o),l=new VX(t,s,a),c=new HX(l);for(let d=0,u=i.length;d>>0,this._cache.set(t,n)}return(n|e<<0)>>>0}}const jft=/\b(comment|string|regex|regexp)\b/;function Kft(i){const e=i.match(jft);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 qft(i,e){return ie?1:0}class VX{constructor(e,t,n){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new VX(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,n){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),n!==0&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class HX{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 n,o;t===-1?(n=e,o=""):(n=e.substring(0,t),o=e.substring(t+1));const r=this._children.get(n);return typeof r!="undefined"?r.match(o):this._mainRule}insert(e,t,n,o){if(e===""){this._mainRule.acceptOverwrite(t,n,o);return}const r=e.indexOf(".");let s,a;r===-1?(s=e,a=""):(s=e.substring(0,r),a=e.substring(r+1));let l=this._children.get(s);typeof l=="undefined"&&(l=new HX(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,n,o)}}function Gft(i){const e=[];for(let t=1,n=i.length;t({format:o.format,location:o.location.toString()}))}}i.toJSONObject=e;function t(n){const o=r=>la(r)?r:void 0;if(n&&Array.isArray(n.src)&&n.src.every(r=>la(r.format)&&la(r.location)))return{weight:o(n.weight),style:o(n.style),src:n.src.map(r=>({format:r.format,location:Rt.parse(r.location)}))}}i.fromJSONObject=t})(Wae||(Wae={}));class egt{constructor(){this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:C("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:C("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Mt.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,o){const r=this.iconsById[e];if(r){if(n&&!r.description){r.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=n),this._onDidChange.fire()}return r}const s={id:e,description:n,defaults:t,deprecationMessage:o};this.iconsById[e]=s;const a={$ref:"#/definitions/icons"};return o&&(a.deprecationMessage=o),n&&(a.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||""),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=(r,s)=>r.id.localeCompare(s.id),t=r=>{for(;Mt.isThemeIcon(r.defaults);)r=this.iconsById[r.defaults.id];return`codicon codicon-${r?r.id:""}`},n=[];n.push("| preview | identifier | default codicon ID | description"),n.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const o=Object.keys(this.iconsById).map(r=>this.iconsById[r]);for(const r of o.filter(s=>!!s.description).sort(e))n.push(`||${r.id}|${Mt.isThemeIcon(r.defaults)?r.defaults.id:r.id}|${r.description||""}|`);n.push("| preview | identifier "),n.push("| ----------- | --------------------------------- |");for(const r of o.filter(s=>!Mt.isThemeIcon(s.defaults)).sort(e))n.push(`||${r.id}|`);return n.join(` -`)}}const Yb=new egt;no.add(Jft.IconContribution,Yb);function Eo(i,e,t,n){return Yb.registerIcon(i,e,t,n)}function ECe(){return Yb}function tgt(){const i=W_e();for(const e in i){const t="\\"+i[e].toString(16);Yb.registerIcon(e,{fontCharacter:t})}}tgt();const DCe="vscode://schemas/icons",kCe=no.as(c5.JSONContribution);kCe.registerSchema(DCe,Yb.getIconSchema());const Vae=new bi(()=>kCe.notifySchemaChanged(DCe),200);Yb.onDidChange(()=>{Vae.isScheduled()||Vae.schedule()});const ICe=Eo("widget-close",Xe.close,C("widgetClose","Icon for the close action in widgets."));Eo("goto-previous-location",Xe.arrowUp,C("previousChangeIcon","Icon for goto previous editor location."));Eo("goto-next-location",Xe.arrowDown,C("nextChangeIcon","Icon for goto next editor location."));Mt.modify(Xe.sync,"spin");Mt.modify(Xe.loading,"spin");function ngt(i){const e=new Be,t=e.add(new le),n=ECe();return e.add(n.onDidChange(()=>t.fire())),i&&e.add(i.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const o=i?i.getProductIconTheme():new TCe,r={},s=l=>{const c=o.getIcon(l);if(!c)return;const d=c.font;return d?(r[d.id]=d.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${Moe(d.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of n.getIcons()){const c=s(l);c&&a.push(c)}for(const l in r){const c=r[l],d=c.weight?`font-weight: ${c.weight};`:"",u=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Sv(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${Moe(l)};${d}${u} font-display: block; }`)}return a.join(` -`)}}}class TCe{getIcon(e){const t=ECe();let n=e.defaults;for(;Mt.isThemeIcon(n);){const o=t.getIcon(n.id);if(!o)return;n=o.defaults}return n}}const Ig="vs",By="vs-dark",A0="hc-black",P0="hc-light",NCe=no.as(ibe.ColorContribution),igt=no.as(Cbe.ThemingContribution);class RCe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const n=t.base;e.length>0?(xM(e)?this.id=e:this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),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,ve.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=O$(this.themeData.base);for(const n in t.colors)e.has(n)||e.set(n,ve.fromHex(t.colors[n]))}this.colors=e}return this.colors}getColor(e,t){const n=this.getColors().get(e);if(n)return n;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=NCe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Ig:return Ic.LIGHT;case A0:return Ic.HIGH_CONTRAST_DARK;case P0:return Ic.HIGH_CONTRAST_LIGHT;default:return Ic.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const r=O$(this.themeData.base);e=r.rules,r.encodedTokensColors&&(t=r.encodedTokensColors)}const n=this.themeData.colors["editor.foreground"],o=this.themeData.colors["editor.background"];if(n||o){const r={token:""};n&&(r.foreground=n),o&&(r.background=o),e.push(r)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=LCe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,n){const r=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=is.getForeground(r),a=is.getFontStyle(r);return{foreground:s,italic:Boolean(a&1),bold:Boolean(a&2),underline:Boolean(a&4),strikethrough:Boolean(a&8)}}}function xM(i){return i===Ig||i===By||i===A0||i===P0}function O$(i){switch(i){case Ig:return Xft;case By:return Yft;case A0:return Zft;case P0:return Qft}}function $2(i){const e=O$(i);return new RCe(i,e)}class ogt extends _e{constructor(){super(),this._onColorThemeChange=this._register(new le),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new le),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new TCe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Ig,$2(Ig)),this._knownThemes.set(By,$2(By)),this._knownThemes.set(A0,$2(A0)),this._knownThemes.set(P0,$2(P0));const e=this._register(ngt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Ig),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Y_e("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return XA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Wc(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),_e.None}_registerShadowDomContainer(e){const t=Wc(e,n=>{n.className="monaco-colors",n.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let n=0;n{n.base===e&&n.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(Ig),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!==Hu(this._theme.type)){let t;Ew(this._theme.type)?t=e?A0:By:t=e?P0:Ig,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},n={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};igt.getThemingParticipants().forEach(s=>s(this._theme,n,this._environment));const o=[];for(const s of NCe.getColors()){const a=this._theme.getColor(s.id,!0);a&&o.push(`${wG(s.id)}: ${a.toString()};`)}n.addRule(`.monaco-editor, .monaco-diff-editor { ${o.join(` -`)} }`);const r=this._colorMapOverride||this._theme.tokenTheme.getColorMap();n.addRule(Gft(r)),this._themeCSS=e.join(` +`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}W5.InstanceCount=0;class kS extends Ud{constructor(e){super(),this._onChange=this._register(new le),this.onChange=this._onChange.event,this._onKeyDown=this._register(new le),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(...Mt.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,n=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}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 Iht=C("caseDescription","Match Case"),Tht=C("wordsDescription","Match Whole Word"),Nht=C("regexDescription","Use Regular Expression");class nCe extends kS{constructor(e){super({icon:Xe.caseSensitive,title:Iht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class iCe extends kS{constructor(e){super({icon:Xe.wholeWord,title:Tht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class oCe extends kS{constructor(e){super({icon:Xe.regex,title:Nht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Rht{constructor(e,t=0,n=e.length,o=t-1){this.items=e,this.start=t,this.end=n,this.index=o}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 Mht{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 Rht(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 Kx=He;class Aht extends Ud{constructor(e,t,n){var o;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new le),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(o=this.options.tooltip)!==null&&o!==void 0?o:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Ae(e,Kx(".monaco-inputbox.idle"));const r=this.options.flexibleHeight?"textarea":"input",s=Ae(this.element,Kx(".ibwrapper"));if(this.input=Ae(s,Kx(r+".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=Ae(s,Kx("div.mirror")),this.mirror.innerText="\xA0",this.scrollableElement=new bbe(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Ae(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new xn(document,"selectionchange")),l=st.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===s});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 zc(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:h0(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){if(this.state==="open"&&ql(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 n=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${I0(n.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=Ea(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:o=>{var r,s;if(!this.message)return null;e=Ae(o,Kx(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?Kdt(this.message.content,a):jdt(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(r=c.background)!==null&&r!==void 0?r:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",Ae(e,l),null},onHide:()=>{this.state="closed"},layout:t});let n;this.message.type===3?n=C("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?n=C("alertWarningMessage","Warning: {0}",this.message.content):n=C("alertInfoMessage","Info: {0}",this.message.content),Cs(n),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,n=e.charCodeAt(e.length-1)===10?" ":"";(e+n).replace(/\u000c/g,"")?this.mirror.textContent=e+n:this.mirror.innerText="\xA0",this.layout()}applyStyles(){var e,t,n;const o=this.options.inputBoxStyles,r=(e=o.inputBackground)!==null&&e!==void 0?e:"",s=(t=o.inputForeground)!==null&&t!==void 0?t:"",a=(n=o.inputBorder)!==null&&n!==void 0?n:"";this.element.style.backgroundColor=r,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${I0(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=h0(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,n=t.selectionStart,o=t.selectionEnd,r=t.value;n!==null&&o!==null&&(this.value=r.substr(0,n)+e+r.substr(o),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}}class rCe extends Aht{constructor(e,t,n){const o=C({key:"history.inputbox.hint",comment:["Text will be prefixed with \u21C5 plus a single space, then used as a hint where input field keeps history"]},"for history"),r=` or \u21C5 ${o}`,s=` (\u21C5 ${o})`;super(e,t,n),this._onDidFocus=this._register(new le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event,this.history=new Mht(n.history,100);const a=()=>{if(n.showHistoryHint&&n.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?r:s,c=this.placeholder+l;n.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 n.showPlaceholderOnFocus?this.placeholder=d:this.setPlaceHolder(d),!0}else return!1};l(s)||l(r)})}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:"",kv(this.value?this.value:C("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,kv(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 Pht=C("defaultLabel","input");class sCe extends Ud{constructor(e,t,n){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Kr),this.additionalToggles=[],this._onDidOptionChange=this._register(new le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new le),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new le),this._onKeyUp=this._register(new le),this._onCaseSensitiveKeyDown=this._register(new le),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new le),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||Pht,this.showCommonFindToggles=!!n.showCommonFindToggles;const o=n.appendCaseSensitiveLabel||"",r=n.appendWholeWordsLabel||"",s=n.appendRegexLabel||"",a=n.history||[],l=!!n.flexibleHeight,c=!!n.flexibleWidth,d=n.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new rCe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:n.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d,inputBoxStyles:n.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new oCe(Object.assign({appendTitle:s,isChecked:!1},n.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 iCe(Object.assign({appendTitle:r,isChecked:!1},n.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new nCe(Object.assign({appendTitle:o,isChecked:!1},n.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(),un.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(n==null?void 0:n.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(ke(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(ke(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,n;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(),(n=this.caseSensitive)===null||n===void 0||n.enable();for(const o of this.additionalToggles)o.enable()}disable(){var e,t,n;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(),(n=this.caseSensitive)===null||n===void 0||n.disable();for(const o of this.additionalToggles)o.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(n=>{this._onDidOptionChange.fire(n),!n&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,n,o,r,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((n=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&n!==void 0?n:0)+((r=(o=this.wholeWords)===null||o===void 0?void 0:o.width())!==null&&r!==void 0?r:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.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 xh;(function(i){i[i.Expanded=0]="Expanded",i[i.Collapsed=1]="Collapsed",i[i.PreserveOrExpanded=2]="PreserveOrExpanded",i[i.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(xh||(xh={}));var b0;(function(i){i[i.Unknown=0]="Unknown",i[i.Twistie=1]="Twistie",i[i.Element=2]="Element",i[i.Filter=3]="Filter"})(b0||(b0={}));class Ol extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class SX{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 xX(i){return typeof i=="object"&&"visibility"in i&&"data"in i}function bk(i){switch(i){case!0:return 1;case!1:return 0;default:return i}}function V9(i){return typeof i.collapsible=="boolean"}class Oht{constructor(e,t,n,o={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new jq,this._onDidChangeCollapseState=new le,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new le,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new le,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Wd(L0e),this.collapseByDefault=typeof o.collapseByDefault=="undefined"?!1:o.collapseByDefault,this.filter=o.filter,this.autoExpandSingleChildren=typeof o.autoExpandSingleChildren=="undefined"?!1:o.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=vn.empty(),o={}){if(e.length===0)throw new Ol(this.user,"Invalid tree location");o.diffIdentityProvider?this.spliceSmart(o.diffIdentityProvider,e,t,n,o):this.spliceSimple(e,t,n,o)}spliceSmart(e,t,n,o,r,s){var a;o===void 0&&(o=vn.empty()),s===void 0&&(s=(a=r.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,n,o,r);const c=[...o],d=t[t.length-1],u=new Ah({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,d),...c,...l.children.slice(d+n)].map(v=>e.getId(v.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,n,c,r);const h=t.slice(0,-1),f=(v,m,_)=>{if(s>0)for(let y=0;y<_;y++)v--,m--,this.spliceSmart(e,[...h,v,0],Number.MAX_SAFE_INTEGER,c[m].children,r,s-1)};let g=Math.min(l.children.length,d+n),p=c.length;for(const v of u.changes.sort((m,_)=>_.originalStart-m.originalStart))f(g,p,g-(v.originalStart+v.originalLength)),g=v.originalStart,p=v.modifiedStart-d,this.spliceSimple([...h,g],v.originalLength,vn.slice(c,p,p+v.modifiedLength),r);f(g,p,g)}spliceSimple(e,t,n=vn.empty(),{onDidCreateNode:o,onDidDeleteNode:r,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=vn.map(n,E=>this.createTreeNode(E,a,a.visible?1:0,c,u,o)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let E=f;E>=0&&Es.getId(E.element).toString())):a.lastDiffIds=a.children.map(E=>s.getId(E.element).toString()):a.lastDiffIds=void 0;let w=0;for(const E of y)E.visible&&w++;if(w!==0)for(let E=f+v.length;EI+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,_-E),this.list.splice(l,E,u)}if(y.length>0&&r){const E=I=>{r(I),I.children.forEach(E)};y.forEach(E)}this._onDidSplice.fire({insertedNodes:v,deletedNodes:y});const L=a.children.length>0;g!==L&&this.setCollapsible(e.slice(0,-1),L);let D=a;for(;D;){if(D.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}D=D.parent}}rerender(e){if(e.length===0)throw new Ol(this.user,"Invalid tree location");const{node:t,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e);t.visible&&o&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:n,revealed:o}=this.getTreeNodeWithListIndex(e);return n&&o?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const n=this.getTreeNode(e);typeof t=="undefined"&&(t=!n.collapsible);const o={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){const o=this.getTreeNode(e);typeof t=="undefined"&&(t=!o.collapsed);const r={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}_setCollapseState(e,t){const{node:n,listIndex:o,revealed:r}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(n,o,r,t);if(n!==this.root&&this.autoExpandSingleChildren&&s&&!V9(t)&&n.collapsible&&!n.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 s}_setListNodeCollapseState(e,t,n,o){const r=this._setNodeCollapseState(e,o,!1);if(!n||!e.visible||!r)return r;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),r}_setNodeCollapseState(e,t,n){let o;if(e===this.root?o=!1:(V9(t)?(o=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(o=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):o=!1,o&&this._onDidChangeCollapseState.fire({node:e,deep:n})),!V9(t)&&t.recursive)for(const r of e.children)o=this._setNodeCollapseState(r,t,!0)||o;return o}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,n,o,r,s){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!="undefined",collapsed:typeof e.collapsed=="undefined"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,n);a.visibility=l,o&&r.push(a);const c=e.children||vn.empty(),d=o&&l!==0&&!a.collapsed;let u=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,d,r,s);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,o&&r.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,o=!0){let r;if(e!==this.root){if(r=this._filterNode(e,t),r===0)return e.visible=!1,e.renderNodeCount=0,!1;o&&n.push(e)}const s=n.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||r!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,r,n,o&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=r===2?a:r===1,e.visibility=r),e.visible?e.collapsed||(e.renderNodeCount+=n.length-s):(e.renderNodeCount=0,o&&n.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 n=this.filter?this.filter.filter(e.element,t):1;return typeof n=="boolean"?(e.filterData=void 0,n?1:0):xX(n)?(e.filterData=n.data,bk(n.visibility)):(e.filterData=void 0,bk(n))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[n,...o]=e;return n<0||n>t.children.length?!1:this.hasTreeNode(o,t.children[n])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[n,...o]=e;if(n<0||n>t.children.length)throw new Ol(this.user,"Invalid tree location");return this.getTreeNode(o,t.children[n])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:n,revealed:o,visible:r}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new Ol(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:n,revealed:o,visible:r&&a.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,o=!0,r=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new Ol(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function H9(i){return i instanceof sT?new Fht(i):i}class Bht{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=_e.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(n=>n.element),t)}onDragStart(e,t){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,H9(e),t)}onDragOver(e,t,n,o,r=!0){const s=this.dnd.onDragOver(H9(e),t&&t.element,n,o),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t=="undefined")return s;if(a&&typeof s!="boolean"&&s.autoExpand&&(this.autoExpandDisposable=Lv(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof s=="boolean"||!s.accept||typeof s.bubble=="undefined"||s.feedback){if(!r){const h=typeof s=="boolean"?s:s.accept,f=typeof s=="boolean"?void 0:s.effect;return{accept:h,effect:f,feedback:[n]}}return s}if(s.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),p=h.getNode(g),v=g&&h.getListIndex(g);return this.onDragOver(e,p,v,o,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),d=l.getListIndex(c),u=l.getListRenderCount(c);return Object.assign(Object.assign({},s),{feedback:Gs(d,d+u)})}drop(e,t,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(H9(e),t&&t.element,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Wht(i,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Bht(i,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 n=i(),o=n.getNodeLocation(t),r=n.getParentNodeLocation(o);return n.getNode(r).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 LX{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 n,o;(o=(n=this.delegate).setDynamicHeight)===null||o===void 0||o.call(n,e.element,t)}}var Ck;(function(i){i.None="none",i.OnHover="onHover",i.Always="always"})(Ck||(Ck={}));class Vht{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Be,this.onDidChange=st.forEach(e,n=>this._elements=n,this.disposables)}dispose(){this.disposables.dispose()}}class yk{constructor(e,t,n,o,r,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=o,this.renderedIndentGuides=r,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=yk.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=_e.None,this.disposables=new Be,this.templateId=e.templateId,this.updateOptions(s),st.map(n,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!="undefined"){const t=Za(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[n,o]of this.renderedNodes)this.renderTreeElement(n,o)}}if(typeof e.renderIndentGuides!="undefined"){const t=e.renderIndentGuides!==Ck.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[n,o]of this.renderedNodes)this._renderIndentGuides(n,o);if(this.indentGuidesDisposable.dispose(),t){const n=new Be;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,n),this.indentGuidesDisposable=n,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements!="undefined"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Ae(e,He(".monaco-tl-row")),n=Ae(t,He(".monaco-tl-indent")),o=Ae(t,He(".monaco-tl-twistie")),r=Ae(t,He(".monaco-tl-contents")),s=this.renderer.renderTemplate(r);return{container:e,indent:n,twistie:o,indentGuidesDisposable:_e.None,templateData:s}}renderElement(e,t,n,o){this.renderedNodes.set(e,n),this.renderedElements.set(e.element,e),this.renderTreeElement(e,n),this.renderer.renderElement(e,t,n.templateData,o)}disposeElement(e,t,n,o){var r,s;n.indentGuidesDisposable.dispose(),(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,e,t,n.templateData,o),typeof o=="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 n=yk.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${n}px`,t.indent.style.width=`${n+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Mt.asClassNameArray(Xe.treeItemExpanded));let o=!1;this.renderer.renderTwistie&&(o=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(o||t.twistie.classList.add(...Mt.asClassNameArray(Xe.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(Ur(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new Be,o=this.modelProvider();for(;;){const r=o.getNodeLocation(e),s=o.getParentNodeLocation(r);if(!s)break;const a=o.getNode(s),l=He(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),n.add(zt(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,n=this.modelProvider();e.forEach(o=>{const r=n.getNodeLocation(o);try{const s=n.getParentNodeLocation(r);o.collapsible&&o.children.length>0&&!o.collapsed?t.add(o):s&&t.add(n.getNode(s))}catch{}}),this.activeIndentNodes.forEach(o=>{t.has(o)||this.renderedIndentGuides.forEach(o,r=>r.classList.remove("active"))}),t.forEach(o=>{this.activeIndentNodes.has(o)||this.renderedIndentGuides.forEach(o,r=>r.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),si(this.disposables)}}yk.DefaultIndent=8;class Hht{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,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 n=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?n=s?1:0:xX(s)?n=bk(s.visibility):n=s,n===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:$u.Default,visibility:n};const o=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),r=Array.isArray(o)?o:[o];for(const s of r){const a=s&&s.toString();if(typeof a=="undefined")return{data:$u.Default,visibility:n};let l;if(this.tree.findMatchType===lb.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=sb(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,r.length===1?{data:l,visibility:n}:{data:{label:a,score:l},visibility:n}}return this.tree.findMode===tf.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:$u.Default,visibility:n}}reset(){this._totalCount=0,this._matchCount=0}dispose(){si(this.disposables)}}var tf;(function(i){i[i.Highlight=0]="Highlight",i[i.Filter=1]="Filter"})(tf||(tf={}));var lb;(function(i){i[i.Fuzzy=0]="Fuzzy",i[i.Contiguous=1]="Contiguous"})(lb||(lb={}));class $ht{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,n,o,r,s={}){var a,l;this.tree=e,this.view=n,this.filter=o,this.contextViewProvider=r,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new le,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new le,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new le,this._onDidChangeOpenState=new le,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Be,this.disposables=new Be,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:tf.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:lb.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,n,o;const r=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&r?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:C("not found","No elements found.")}):(n=this.widget)===null||n===void 0||n.showMessage({type:2}):(o=this.widget)===null||o===void 0||o.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===tf.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!$u.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 yae(i){let e=b0.Unknown;return z6(i.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=b0.Twistie:z6(i.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=b0.Element:z6(i.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=b0.Filter),{browserEvent:i.browserEvent,element:i.element?i.element.element:null,target:e}}function CM(i,e){e(i),i.children.forEach(t=>CM(t,e))}class $9{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 le,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Lo(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const o=this;this._onDidChange.fire({get elements(){return o.get()},browserEvent:n})}}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=>CM(d,c)),this.set([...l.values()]);return}const n=new Set,o=l=>n.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>CM(l,o));const r=new Map,s=l=>r.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>CM(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!n.has(c))a.push(l);else{const u=r.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 zht extends K1e{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if($1e(e.browserEvent.target)||tv(e.browserEvent.target)||KC(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 n=e.browserEvent.target,o=n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let r=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,r&&!o&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const s=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([s]),this.tree.toggleCollapsed(s,a),r&&o){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 Uht extends qd{constructor(e,t,n,o,r,s,a,l){super(e,t,n,o,l),this.focusTrait=r,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new zht(this,e.tree)}splice(e,t,n=[]){if(super.splice(e,t,n),n.length===0)return;const o=[],r=[];let s;n.forEach((a,l)=>{this.focusTrait.has(a)&&o.push(e+l),this.selectionTrait.has(a)&&r.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),o.length>0&&super.setFocus(bv([...super.getFocus(),...o])),r.length>0&&super.setSelection(bv([...super.getSelection(),...r])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map(o=>this.element(o)),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||this.selectionTrait.set(e.map(o=>this.element(o)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e=="undefined"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class aCe{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 st.filter(st.map(this.view.onMouseDblClick,yae),e=>e.target!==b0.Filter)}get onPointer(){return st.map(this.view.onPointer,yae)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return st.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:tf.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:lb.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick=="undefined"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick=="undefined"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,n,o,r={}){var s;this._user=e,this._options=r,this.eventBufferer=new jq,this.onDidChangeFindOpenState=st.None,this.disposables=new Be,this._onWillRefilter=new le,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new le;const a=new LX(n),l=new hoe,c=new hoe,d=this.disposables.add(new Vht(c.event)),u=new gG;this.renderers=o.map(v=>new yk(v,()=>this.model,l.event,d,u,r));for(const v of this.renderers)this.disposables.add(v);let h;r.keyboardNavigationLabelProvider&&(h=new Hht(this,r.keyboardNavigationLabelProvider,r.filter),r=Object.assign(Object.assign({},r),{filter:h}),this.disposables.add(h)),this.focus=new $9(()=>this.view.getFocusedElements()[0],r.identityProvider),this.selection=new $9(()=>this.view.getSelectedElements()[0],r.identityProvider),this.anchor=new $9(()=>this.view.getAnchorElement(),r.identityProvider),this.view=new Uht(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},Wht(()=>this.model,r)),{tree:this})),this.model=this.createModel(e,this.view,r),l.input=this.model.onDidChangeCollapseState;const f=st.forEach(this.model.onDidSplice,v=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(v),this.selection.onDidModelSplice(v)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new le),p=this.disposables.add(new Wd(0));if(this.disposables.add(st.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{p.trigger(()=>{const v=new Set;for(const m of this.focus.getNodes())v.add(m);for(const m of this.selection.getNodes())v.add(m);g.fire([...v.values()])})})),c.input=g.event,r.keyboardSupport!==!1){const v=st.chain(this.view.onKeyDown,m=>m.filter(_=>!tv(_.target)).map(_=>new Pi(_)));st.chain(v,m=>m.filter(_=>_.keyCode===15))(this.onLeftArrow,this,this.disposables),st.chain(v,m=>m.filter(_=>_.keyCode===17))(this.onRightArrow,this,this.disposables),st.chain(v,m=>m.filter(_=>_.keyCode===10))(this.onSpace,this,this.disposables)}if(((s=r.findWidgetEnabled)!==null&&s!==void 0?s:!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider){const v=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new $ht(this,this.model,this.view,h,r.contextViewProvider,v),this.focusNavigationFilter=m=>this.findController.shouldAllowFocus(m),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=st.None,this.onDidChangeFindMatchType=st.None;this.styleElement=Wc(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Ck.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const n of this.renderers)n.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===Ck.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 n;this.view.layout(e,t),Cv(t)&&((n=this.findController)===null||n===void 0||n.layout(t))}style(e){const t=`.${this.view.domId}`,n=[];e.treeIndentGuidesStroke&&(n.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),n.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=n.join(` +`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const n=e.map(r=>this.model.getNode(r));this.selection.set(n,t);const o=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setSelection(o,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const n=e.map(r=>this.model.getNode(r));this.focus.set(n,t);const o=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setFocus(o,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const n=this.model.getListIndex(e);n!==-1&&this.view.reveal(n,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],o=this.model.getNodeLocation(n);if(!this.model.setCollapsed(o,!0)){const s=this.model.getParentNodeLocation(o);if(!s)return;const a=this.model.getListIndex(s);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 n=t[0],o=this.model.getNodeLocation(n);if(!this.model.setCollapsed(o,!1)){if(!n.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+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 n=t[0],o=this.model.getNodeLocation(n),r=e.browserEvent.altKey;this.model.setCollapsed(o,void 0,r)}dispose(){si(this.disposables),this.view.dispose()}}class EX{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Oht(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(o,r){return n.sorter.compare(o.element,r.element)}}),this.identityProvider=n.identityProvider}setChildren(e,t=vn.empty(),n={}){const o=this.getElementLocation(e);this._setChildren(o,this.preserveCollapseState(t),n)}_setChildren(e,t=vn.empty(),n){const o=new Set,r=new Set,s=l=>{var c;if(l.element===null)return;const d=l;if(o.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();r.add(u),this.nodesByIdentity.set(u,d)}(c=n.onDidCreateNode)===null||c===void 0||c.call(n,d)},a=l=>{var c;if(l.element===null)return;const d=l;if(o.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();r.has(u)||this.nodesByIdentity.delete(u)}(c=n.onDidDeleteNode)===null||c===void 0||c.call(n,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},n),{onDidCreateNode:s,onDidDeleteNode:a}))}preserveCollapseState(e=vn.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),vn.map(e,t=>{let n=this.nodes.get(t.element);if(!n&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();n=this.nodesByIdentity.get(s)}if(!n){let s;return typeof t.collapsed=="undefined"?s=void 0:t.collapsed===xh.Collapsed||t.collapsed===xh.PreserveOrCollapsed?s=!0:t.collapsed===xh.Expanded||t.collapsed===xh.PreserveOrExpanded?s=!1:s=Boolean(t.collapsed),Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:s})}const o=typeof t.collapsible=="boolean"?t.collapsible:n.collapsible;let r;return typeof t.collapsed=="undefined"||t.collapsed===xh.PreserveOrCollapsed||t.collapsed===xh.PreserveOrExpanded?r=n.collapsed:t.collapsed===xh.Collapsed?r=!0:t.collapsed===xh.Expanded?r=!1:r=Boolean(t.collapsed),Object.assign(Object.assign({},t),{collapsible:o,collapsed:r,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 n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const o=this.getElementLocation(e);return this.model.setCollapsed(o,t,n)}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 Ol(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Ol(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Ol(this.user,`Tree element not found: ${e}`);const n=this.model.getNodeLocation(t),o=this.model.getParentNodeLocation(n);return this.model.getNode(o).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Ol(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function yM(i){const e=[i.element],t=i.incompressible||!1;return{element:{elements:e,incompressible:t},children:vn.map(vn.from(i.children),yM),collapsible:i.collapsible,collapsed:i.collapsed}}function wM(i){const e=[i.element],t=i.incompressible||!1;let n,o;for(;[o,n]=vn.consume(vn.from(i.children),2),!(o.length!==1||o[0].incompressible);)i=o[0],e.push(i.element);return{element:{elements:e,incompressible:t},children:vn.map(vn.concat(o,n),wM),collapsible:i.collapsible,collapsed:i.collapsed}}function S$(i,e=0){let t;return eS$(n,0)),e===0&&i.element.incompressible?{element:i.element.elements[e],children:t,incompressible:!0,collapsible:i.collapsible,collapsed:i.collapsed}:{element:i.element.elements[e],children:t,collapsible:i.collapsible,collapsed:i.collapsed}}function wae(i){return S$(i,0)}function lCe(i,e,t){return i.element===e?Object.assign(Object.assign({},i),{children:t}):Object.assign(Object.assign({},i),{children:vn.map(vn.from(i.children),n=>lCe(n,e,t))})}const jht=i=>({getId(e){return e.elements.map(t=>i.getId(t).toString()).join("\0")}});class Kht{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new EX(e,t,n),this.enabled=typeof n.compressionEnabled=="undefined"?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(e,t=vn.empty(),n){const o=n.diffIdentityProvider&&jht(n.diffIdentityProvider);if(e===null){const g=vn.map(t,this.enabled?wM:yM);this._setChildren(null,g,{diffIdentityProvider:o,diffDepth:1/0});return}const r=this.nodes.get(e);if(!r)throw new Ol(this.user,"Unknown compressed tree node");const s=this.model.getNode(r),a=this.model.getParentNodeLocation(r),l=this.model.getNode(a),c=wae(s),d=lCe(c,e,t),u=(this.enabled?wM:yM)(d),h=n.diffIdentityProvider?(g,p)=>n.diffIdentityProvider.getId(g)===n.diffIdentityProvider.getId(p):void 0;if(Lo(u.element.elements,s.element.elements,h)){this._setChildren(r,u.children||vn.empty(),{diffIdentityProvider:o,diffDepth:1});return}const f=l.children.map(g=>g===s?u:g);this._setChildren(l.element,f,{diffIdentityProvider:o,diffDepth:s.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const n=this.model.getNode().children,o=vn.map(n,wae),r=vn.map(o,e?wM:yM);this._setChildren(null,r,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,n){const o=new Set,r=a=>{for(const l of a.element.elements)o.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)o.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},n),{onDidCreateNode:r,onDidDeleteNode:s}))}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=="undefined")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),n=this.model.getParentNodeLocation(t);return n===null?null:n.elements[n.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 n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const o=this.getCompressedNode(e);return this.model.setCollapsed(o,t,n)}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 Ol(this.user,`Tree element not found: ${e}`);return t}}const qht=i=>i[i.length-1];class DX{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new DX(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 Ght(i,e){return{splice(t,n,o){e.splice(t,n,o.map(r=>i.map(r)))},updateElementHeight(t,n){e.updateElementHeight(t,n)}}}function Xht(i,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(i(t))}},sorter:e.sorter&&{compare(t,n){return e.sorter.compare(t.elements[0],n.elements[0])}},filter:e.filter&&{filter(t,n){return e.filter.filter(i(t),n)}}})}class Yht{get onDidSplice(){return st.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(n=>this.nodeMapper.map(n)),deletedNodes:t.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return st.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return st.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||qht;const o=r=>this.elementMapper(r.elements);this.nodeMapper=new SX(r=>new DX(o,r)),this.model=new Kht(e,Ght(this.nodeMapper,t),Xht(o,n))}setChildren(e,t=vn.empty(),n={}){this.model.setChildren(e,t,n)}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=="undefined"?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,n){return this.model.setCollapsed(e,t,n)}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 Zht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};class kX extends aCe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,n,o,r={}){super(e,t,n,o,r),this.user=e}setChildren(e,t=vn.empty(),n){this.model.setChildren(e,t,n)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new EX(e,t,n)}}class cCe{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){const t=this.renderer.renderTemplate(e);return{compressedTreeNode:void 0,data:t}}renderElement(e,t,n,o){const r=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);r.element.elements.length===1?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,o)):(n.compressedTreeNode=r,this.renderer.renderCompressedElements(r,t,n.data,o))}disposeElement(e,t,n,o){var r,s,a,l;n.compressedTreeNode?(s=(r=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(r,n.compressedTreeNode,t,n.data,o):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,n.data,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}Zht([Mo],cCe.prototype,"compressedTreeNodeProvider",null);function Qht(i,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let n;try{n=i().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return n.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}class dCe extends kX{constructor(e,t,n,o,r={}){const s=()=>this,a=o.map(l=>new cCe(s,l));super(e,t,n,a,Qht(s,r))}setChildren(e,t=vn.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new Yht(e,t,n)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled!="undefined"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var zp=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function z9(i){return Object.assign(Object.assign({},i),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function x$(i,e){return e.parent?e.parent===i?!0:x$(i,e.parent):!1}function Jht(i,e){return i===e||x$(i,e)||x$(e,i)}class IX{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new IX(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 eft{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,o){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Mt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Mt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,o){var r,s;(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,this.nodeMapper.map(e),t,n.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function Sae(i){return{browserEvent:i.browserEvent,elements:i.elements.map(e=>e.element)}}function xae(i){return{browserEvent:i.browserEvent,element:i.element&&i.element.element,target:i.target}}class tft extends sT{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function U9(i){return i instanceof sT?new tft(i):i}class nft{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(n=>n.element),t)}onDragStart(e,t){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,U9(e),t)}onDragOver(e,t,n,o,r=!0){return this.dnd.onDragOver(U9(e),t&&t.element,n,o)}drop(e,t,n,o){this.dnd.drop(U9(e),t&&t.element,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.dnd.dispose()}}function uCe(i){return i&&Object.assign(Object.assign({},i),{collapseByDefault:!0,identityProvider:i.identityProvider&&{getId(e){return i.identityProvider.getId(e.element)}},dnd:i.dnd&&new nft(i.dnd),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return i.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return i.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:i.accessibilityProvider&&Object.assign(Object.assign({},i.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:i.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=i.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return i.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return i.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider.getAriaLevel&&(e=>i.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))}),filter:i.filter&&{filter(e,t){return i.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},i.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof i.expandOnlyOnTwistieClick=="undefined"?void 0:typeof i.expandOnlyOnTwistieClick!="function"?i.expandOnlyOnTwistieClick:e=>i.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof i.defaultFindVisibility=="number"?i.defaultFindVisibility:typeof i.defaultFindVisibility=="undefined"?2:i.defaultFindVisibility(e.element)})}function L$(i,e){e(i),i.children.forEach(t=>L$(t,e))}class hCe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return st.map(this.tree.onDidChangeFocus,Sae)}get onDidChangeSelection(){return st.map(this.tree.onDidChangeSelection,Sae)}get onMouseDblClick(){return st.map(this.tree.onMouseDblClick,xae)}get onPointer(){return st.map(this.tree.onPointer,xae)}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,n,o,r,s={}){this.user=e,this.dataSource=r,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new le,this._onDidChangeNodeSlowState=new le,this.nodeMapper=new SX(a=>new IX(a)),this.disposables=new Be,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren=="undefined"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,n,o,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=z9({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,n,o,r){const s=new LX(n),a=o.map(c=>new eft(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=uCe(r)||{};return new kX(e,t,s,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 zp(this,void 0,void 0,function*(){this.refreshPromises.forEach(o=>o.cancel()),this.refreshPromises.clear(),this.root.element=e;const n=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,n=!1,o,r){return zp(this,void 0,void 0,function*(){if(typeof this.root.element=="undefined")throw new Ol(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,o,r),n)try{this.tree.rerender(s)}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),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){const n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}expand(e,t=!1){return zp(this,void 0,void 0,function*(){if(typeof this.root.element=="undefined")throw new Ol(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event));const n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n)||(n.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n)))return!1;const o=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event)),o})}setSelection(e,t){const n=e.map(o=>this.getDataNode(o));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const n=e.map(o=>this.getDataNode(o));this.tree.setFocus(n,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),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Ol(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,n,o){return zp(this,void 0,void 0,function*(){yield this.refreshNode(e,t,n),this.render(e,n,o)})}refreshNode(e,t,n){return zp(this,void 0,void 0,function*(){let o;if(this.subTreeRefreshPromises.forEach((r,s)=>{!o&&Jht(s,e)&&(o=r.then(()=>this.refreshNode(e,t,n)))}),o)return o;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,n)})}doRefreshSubTree(e,t,n){return zp(this,void 0,void 0,function*(){let o;e.refreshPromise=new Promise(r=>o=r),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const r=yield this.doRefreshNode(e,t,n);e.stale=!1,yield JV.settled(r.map(s=>this.doRefreshSubTree(s,t,n)))}finally{o()}})}doRefreshNode(e,t,n){return zp(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let o;if(!e.hasChildren)o=Promise.resolve(vn.empty());else{const r=this.doGetChildren(e);if(soe(r))o=Promise.resolve(r);else{const s=xv(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),o=r.finally(()=>s.cancel())}}try{const r=yield o;return this.setChildren(e,r,t,n)}catch(r){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),sh(r))return[];throw r}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const n=this.dataSource.getChildren(e.element);return soe(n)?this.processChildren(n):(t=sr(()=>zp(this,void 0,void 0,function*(){return this.processChildren(yield n)})),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(en))}setChildren(e,t,n,o){const r=[...t];if(e.children.length===0&&r.length===0)return[];const s=new Map,a=new Map;for(const d of e.children)if(s.set(d.element,d),this.identityProvider){const u=this.tree.isCollapsed(d);a.set(d.id,{node:d,collapsed:u})}const l=[],c=r.map(d=>{const u=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=z9({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 s.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=u,n?f.collapsed?(p.children.forEach(v=>L$(v,m=>this.nodes.delete(m.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=z9({element:d,parent:e,id:h,hasChildren:u});return o&&o.viewState.focus&&o.viewState.focus.indexOf(h)>-1&&o.focus.push(g),o&&o.viewState.selection&&o.viewState.selection.indexOf(h)>-1&&o.selection.push(g),o&&o.viewState.expanded&&o.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 s.values())L$(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,n){const o=e.children.map(s=>this.asTreeElement(s,t)),r=n&&Object.assign(Object.assign({},n),{diffIdentityProvider:n.diffIdentityProvider&&{getId(s){return n.diffIdentityProvider.getId(s.element)}}});this.tree.setChildren(e===this.root?null:e,o,r),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 n;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?n=!1:n=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?vn.map(e.children,o=>this.asTreeElement(o,t)):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class TX{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 TX(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 ift{constructor(e,t,n,o){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=o,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,o){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,o)}renderCompressedElements(e,t,n,o){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Mt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Mt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,o){var r,s;(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,this.nodeMapper.map(e),t,n.templateData,o)}disposeCompressedElements(e,t,n,o){var r,s;(s=(r=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(r,this.compressibleNodeMapperProvider().map(e),t,n.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=si(this.disposables)}}function oft(i){const e=i&&uCe(i);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(n=>n.element))}})})}class rft extends hCe{constructor(e,t,n,o,r,s,a={}){super(e,t,n,r,s,a),this.compressionDelegate=o,this.compressibleNodeMapper=new SX(l=>new TX(l)),this.filter=a.filter}createTree(e,t,n,o,r){const s=new LX(n),a=o.map(c=>new ift(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=oft(r)||{};return new dCe(e,t,s,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 n=h=>this.identityProvider.getId(h).toString(),o=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 v of p.element.elements)f.add(n(v.element))}return f},r=o(this.tree.getSelection()),s=o(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 n=this.filter.filter(t,1),o=sft(n);if(o===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return o===1})),super.processChildren(e)}}function sft(i){return typeof i=="boolean"?i?1:0:xX(i)?bk(i.visibility):bk(i)}class aft extends aCe{constructor(e,t,n,o,r,s={}){super(e,t,n,o,s),this.user=e,this.dataSource=r,this.identityProvider=s.identityProvider}createModel(e,t,n){return new EX(e,t,n)}}new lt("isMac",Nn,C("isMac","Whether the operating system is macOS"));new lt("isLinux",xs,C("isLinux","Whether the operating system is Linux"));const V5=new lt("isWindows",ls,C("isWindows","Whether the operating system is Windows")),fCe=new lt("isWeb",Xv,C("isWeb","Whether the platform is a web browser"));new lt("isMacNative",Nn&&!Xv,C("isMacNative","Whether the operating system is macOS on a non-browser platform"));new lt("isIOS",Ku,C("isIOS","Whether the operating system is iOS"));new lt("isMobile",TXe,C("isMobile","Whether the platform is a mobile web browser"));new lt("isDevelopment",!1,!0);new lt("productQualityType","",C("productQualityType","Quality type of VS Code"));const gCe="inputFocus";new lt(gCe,!1,C("inputFocus","Whether keyboard focus is inside an input box"));var wp=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Oi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Xc=yn("listService");class lft{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Be,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(n=this._lastFocusedWidget)===null||n===void 0||n.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new q1e(Wc(),"").style(qb)),this.lists.some(o=>o.widget===e))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),Td(e.onDidFocus(()=>this.setLastFocusedList(e)),zt(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(o=>o!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const wk=new lt("listScrollAtBoundary","none");Me.or(wk.isEqualTo("top"),wk.isEqualTo("both"));Me.or(wk.isEqualTo("bottom"),wk.isEqualTo("both"));const pCe=new lt("listFocus",!0),H5=new lt("listSupportsMultiselect",!0),mCe=Me.and(pCe,Me.not(gCe)),NX=new lt("listHasSelectionOrFocus",!1),RX=new lt("listDoubleSelection",!1),MX=new lt("listMultiSelection",!1),$5=new lt("listSelectionNavigation",!1),cft=new lt("listSupportsFind",!0),AX=new lt("treeElementCanCollapse",!1),dft=new lt("treeElementHasParent",!1),PX=new lt("treeElementCanExpand",!1),uft=new lt("treeElementHasChild",!1),hft=new lt("treeFindOpen",!1),vCe="listTypeNavigationMode",_Ce="listAutomaticKeyboardNavigation";function z5(i,e){const t=i.createScoped(e.getHTMLElement());return pCe.bindTo(t),t}function U5(i,e){const t=wk.bindTo(i),n=()=>{const o=e.scrollTop===0,r=e.scrollHeight-e.renderHeight-e.scrollTop<1;o&&r?t.set("both"):o?t.set("top"):r?t.set("bottom"):t.set("none")};return n(),e.onDidScroll(n)}const Gb="workbench.list.multiSelectModifier",SM="workbench.list.openMode",Pc="workbench.list.horizontalScrolling",OX="workbench.list.defaultFindMode",FX="workbench.list.typeNavigationMode",GP="workbench.list.keyboardNavigation",Xu="workbench.list.scrollByPage",BX="workbench.list.defaultFindMatchType",Sk="workbench.tree.indent",XP="workbench.tree.renderIndentGuides",Yu="workbench.list.smoothScrolling",Cf="workbench.list.mouseWheelScrollSensitivity",yf="workbench.list.fastScrollSensitivity",YP="workbench.tree.expandMode";function wf(i){return i.getValue(Gb)==="alt"}class fft extends _e{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=wf(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Gb)&&(this.useAltAsMultipleSelectionModifier=wf(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:U1e(e)}isSelectionRangeChangeEvent(e){return j1e(e)}}function j5(i,e){var t;const n=i.get(En),o=i.get(xi),r=new Be;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return o.mightProducePrintableCharacter(a)}},smoothScrolling:Boolean(n.getValue(Yu)),mouseWheelScrollSensitivity:n.getValue(Cf),fastScrollSensitivity:n.getValue(yf),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:r.add(new fft(n)),keyboardNavigationEventFilter:mft(o),scrollByPage:Boolean(n.getValue(Xu))}),r]}let E$=class extends qd{constructor(e,t,n,o,r,s,a,l,c){const d=typeof r.horizontalScrolling!="undefined"?r.horizontalScrolling:Boolean(l.getValue(Pc)),[u,h]=c.invokeFunction(j5,r);super(e,t,n,o,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables.add(h),this.contextKeyService=z5(s,this),this.disposables.add(U5(this.contextKeyService,this)),this.listSupportsMultiSelect=H5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),$5.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this.listHasSelectionOrFocus=NX.bindTo(this.contextKeyService),this.listDoubleSelection=RX.bindTo(this.contextKeyService),this.listMultiSelection=MX.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=wf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.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(Gb)&&(this._useAltAsMultipleSelectionModifier=wf(l));let p={};if(g.affectsConfiguration(Pc)&&this.horizontalScrolling===void 0){const v=Boolean(l.getValue(Pc));p=Object.assign(Object.assign({},p),{horizontalScrolling:v})}if(g.affectsConfiguration(Xu)){const v=Boolean(l.getValue(Xu));p=Object.assign(Object.assign({},p),{scrollByPage:v})}if(g.affectsConfiguration(Yu)){const v=Boolean(l.getValue(Yu));p=Object.assign(Object.assign({},p),{smoothScrolling:v})}if(g.affectsConfiguration(Cf)){const v=l.getValue(Cf);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(yf)){const v=l.getValue(yf);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:v})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new bCe(this,Object.assign({configurationService:l},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?ES(e):qb)}};E$=wp([Oi(5,Ut),Oi(6,Xc),Oi(7,En),Oi(8,$t)],E$);let Lae=class extends _ht{constructor(e,t,n,o,r,s,a,l,c){const d=typeof r.horizontalScrolling!="undefined"?r.horizontalScrolling:Boolean(l.getValue(Pc)),[u,h]=c.invokeFunction(j5,r);super(e,t,n,o,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables=new Be,this.disposables.add(h),this.contextKeyService=z5(s,this),this.disposables.add(U5(this.contextKeyService,this.widget)),this.horizontalScrolling=r.horizontalScrolling,this.listSupportsMultiSelect=H5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),$5.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this._useAltAsMultipleSelectionModifier=wf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Gb)&&(this._useAltAsMultipleSelectionModifier=wf(l));let p={};if(g.affectsConfiguration(Pc)&&this.horizontalScrolling===void 0){const v=Boolean(l.getValue(Pc));p=Object.assign(Object.assign({},p),{horizontalScrolling:v})}if(g.affectsConfiguration(Xu)){const v=Boolean(l.getValue(Xu));p=Object.assign(Object.assign({},p),{scrollByPage:v})}if(g.affectsConfiguration(Yu)){const v=Boolean(l.getValue(Yu));p=Object.assign(Object.assign({},p),{smoothScrolling:v})}if(g.affectsConfiguration(Cf)){const v=l.getValue(Cf);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(yf)){const v=l.getValue(yf);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:v})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new bCe(this,Object.assign({configurationService:l},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?ES(e):qb)}dispose(){this.disposables.dispose(),super.dispose()}};Lae=wp([Oi(5,Ut),Oi(6,Xc),Oi(7,En),Oi(8,$t)],Lae);let Eae=class extends W5{constructor(e,t,n,o,r,s,a,l,c,d){const u=typeof s.horizontalScrolling!="undefined"?s.horizontalScrolling:Boolean(c.getValue(Pc)),[h,f]=d.invokeFunction(j5,s);super(e,t,n,o,r,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:u})),this.disposables.add(f),this.contextKeyService=z5(a,this),this.disposables.add(U5(this.contextKeyService,this)),this.listSupportsMultiSelect=H5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),$5.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=NX.bindTo(this.contextKeyService),this.listDoubleSelection=RX.bindTo(this.contextKeyService),this.listMultiSelection=MX.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=wf(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||v.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(Gb)&&(this._useAltAsMultipleSelectionModifier=wf(c));let v={};if(p.affectsConfiguration(Pc)&&this.horizontalScrolling===void 0){const m=Boolean(c.getValue(Pc));v=Object.assign(Object.assign({},v),{horizontalScrolling:m})}if(p.affectsConfiguration(Xu)){const m=Boolean(c.getValue(Xu));v=Object.assign(Object.assign({},v),{scrollByPage:m})}if(p.affectsConfiguration(Yu)){const m=Boolean(c.getValue(Yu));v=Object.assign(Object.assign({},v),{smoothScrolling:m})}if(p.affectsConfiguration(Cf)){const m=c.getValue(Cf);v=Object.assign(Object.assign({},v),{mouseWheelScrollSensitivity:m})}if(p.affectsConfiguration(yf)){const m=c.getValue(yf);v=Object.assign(Object.assign({},v),{fastScrollSensitivity:m})}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new gft(this,Object.assign({configurationService:c},s)),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?ES(e):qb)}dispose(){this.disposables.dispose(),super.dispose()}};Eae=wp([Oi(6,Ut),Oi(7,Xc),Oi(8,En),Oi(9,$t)],Eae);class WX extends _e{constructor(e,t){var n;super(),this.widget=e,this._onDidOpen=this._register(new le),this.onDidOpen=this._onDidOpen.event,this._register(st.filter(this.widget.onDidChangeSelection,o=>o.browserEvent instanceof KeyboardEvent)(o=>this.onSelectionFromKeyboard(o))),this._register(this.widget.onPointer(o=>this.onPointer(o.element,o.browserEvent))),this._register(this.widget.onMouseDblClick(o=>this.onMouseDblClick(o.element,o.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t==null?void 0:t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(SM))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration(SM)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(SM))!=="doubleClick")}))):this.openOnSingleClick=(n=t==null?void 0:t.openOnSingleClick)!==null&&n!==void 0?n:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,n=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,o=typeof t.pinned=="boolean"?t.pinned:!n,r=!1;this._open(this.getSelectedElement(),n,o,r,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const o=t.button===1,r=!0,s=o,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,s,a,t)}onMouseDblClick(e,t){if(!t)return;const n=t.target;if(n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&t.offsetX<16)return;const r=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,s,a,t)}_open(e,t,n,o,r){!e||this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:o,element:e,browserEvent:r})}}class bCe extends WX{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class gft extends WX{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class pft extends WX{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function mft(i){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const n=i.softDispatch(t,t.target);return n.kind===1?(e=!0,!1):(e=!1,n.kind===0)}}let Dae=class extends kX{constructor(e,t,n,o,r,s,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=s.invokeFunction(lT,r);super(e,t,n,o,d),this.disposables.add(h),this.internals=new cb(this,r,u,r.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Dae=wp([Oi(5,$t),Oi(6,Ut),Oi(7,Xc),Oi(8,En)],Dae);let kae=class extends dCe{constructor(e,t,n,o,r,s,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=s.invokeFunction(lT,r);super(e,t,n,o,d),this.disposables.add(h),this.internals=new cb(this,r,u,r.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)}};kae=wp([Oi(5,$t),Oi(6,Ut),Oi(7,Xc),Oi(8,En)],kae);let Iae=class extends aft{constructor(e,t,n,o,r,s,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(lT,s);super(e,t,n,o,r,u),this.disposables.add(f),this.internals=new cb(this,s,h,s.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)}};Iae=wp([Oi(6,$t),Oi(7,Ut),Oi(8,Xc),Oi(9,En)],Iae);let D$=class extends hCe{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,n,o,r,s,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(lT,s);super(e,t,n,o,r,u),this.disposables.add(f),this.internals=new cb(this,s,h,s.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)}};D$=wp([Oi(6,$t),Oi(7,Ut),Oi(8,Xc),Oi(9,En)],D$);let Tae=class extends rft{constructor(e,t,n,o,r,s,a,l,c,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(lT,a);super(e,t,n,o,r,s,h),this.disposables.add(g),this.internals=new cb(this,a,f,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Tae=wp([Oi(7,$t),Oi(8,Ut),Oi(9,Xc),Oi(10,En)],Tae);function CCe(i){const e=i.getValue(OX);if(e==="highlight")return tf.Highlight;if(e==="filter")return tf.Filter;const t=i.getValue(GP);if(t==="simple"||t==="highlight")return tf.Highlight;if(t==="filter")return tf.Filter}function yCe(i){const e=i.getValue(BX);if(e==="fuzzy")return lb.Fuzzy;if(e==="contiguous")return lb.Contiguous}function lT(i,e){var t;const n=i.get(En),o=i.get(Cp),r=i.get(Ut),s=i.get($t),a=()=>{const f=r.getContextKeyValue(vCe);if(f==="automatic")return Wh.Automatic;if(f==="trigger"||r.getContextKeyValue(_Ce)===!1)return Wh.Trigger;const p=n.getValue(FX);if(p==="automatic")return Wh.Automatic;if(p==="trigger")return Wh.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:Boolean(n.getValue(Pc)),[c,d]=s.invokeFunction(j5,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:n.getValue(XP);return{getTypeNavigationMode:a,disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof n.getValue(Sk)=="number"?n.getValue(Sk):void 0,renderIndentGuides:h,smoothScrolling:Boolean(n.getValue(Yu)),defaultFindMode:CCe(n),defaultFindMatchType:yCe(n),horizontalScrolling:l,scrollByPage:Boolean(n.getValue(Xu)),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:n.getValue(YP)==="doubleClick",contextViewProvider:o,findWidgetStyles:Zut})}}let cb=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,n,o,r,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=z5(r,e),this.disposables.push(U5(this.contextKeyService,e)),this.listSupportsMultiSelect=H5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),$5.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=cft.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=NX.bindTo(this.contextKeyService),this.hasDoubleSelection=RX.bindTo(this.contextKeyService),this.hasMultiSelection=MX.bindTo(this.contextKeyService),this.treeElementCanCollapse=AX.bindTo(this.contextKeyService),this.treeElementHasParent=dft.bindTo(this.contextKeyService),this.treeElementCanExpand=PX.bindTo(this.contextKeyService),this.treeElementHasChild=uft.bindTo(this.contextKeyService),this.treeFindOpen=hft.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=wf(a),this.updateStyleOverrides(o);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(vCe),u.add(_Ce),this.disposables.push(this.contextKeyService,s.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(Gb)&&(this._useAltAsMultipleSelectionModifier=wf(a)),h.affectsConfiguration(Sk)){const g=a.getValue(Sk);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(XP)&&t.renderIndentGuides===void 0){const g=a.getValue(XP);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(Yu)){const g=Boolean(a.getValue(Yu));f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(OX)||h.affectsConfiguration(GP)){const g=CCe(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(FX)||h.affectsConfiguration(GP)){const g=n();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(BX)){const g=yCe(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(Pc)&&t.horizontalScrolling===void 0){const g=Boolean(a.getValue(Pc));f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(Xu)){const g=Boolean(a.getValue(Xu));f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(YP)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(YP)==="doubleClick"})),h.affectsConfiguration(Cf)){const g=a.getValue(Cf);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(yf)){const g=a.getValue(yf);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:n()})})),this.navigator=new pft(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?ES(e):qb)}dispose(){this.disposables=si(this.disposables)}};cb=wp([Oi(4,Ut),Oi(5,Xc),Oi(6,En)],cb);const vft=no.as(ch.Configuration);vft.registerConfiguration({id:"workbench",order:7,title:C("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[Gb]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[C("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),C("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:C({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.")},[SM]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:C({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.")},[Pc]:{type:"boolean",default:!1,description:C("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Xu]:{type:"boolean",default:!1,description:C("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[Sk]:{type:"number",default:8,minimum:4,maximum:40,description:C("tree indent setting","Controls tree indentation in pixels.")},[XP]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:C("render tree indent guides","Controls whether the tree should render indent guides.")},[Yu]:{type:"boolean",default:!1,description:C("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Cf]:{type:"number",default:1,markdownDescription:C("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[yf]:{type:"number",default:5,markdownDescription:C("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[OX]:{type:"string",enum:["highlight","filter"],enumDescriptions:[C("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),C("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:C("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[GP]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[C("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),C("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),C("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:C("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:C("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[BX]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[C("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),C("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:C("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[YP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:C("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.")},[FX]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:C("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 k$;(function(i){i[i.PRESERVE=0]="PRESERVE",i[i.LAST=1]="LAST"})(k$||(k$={}));const Xb={Quickaccess:"workbench.contributions.quickaccess"};class _ft{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,n)=>n.prefix.length-t.prefix.length),zt(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return hf([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(n=>e.startsWith(n.prefix))||void 0||this.defaultProvider}}no.add(Xb.Quickaccess,new _ft);const bft={ctrlCmd:!1,alt:!1};var xk;(function(i){i[i.Blur=1]="Blur",i[i.Gesture=2]="Gesture",i[i.Other=3]="Other"})(xk||(xk={}));var vu;(function(i){i[i.NONE=0]="NONE",i[i.FIRST=1]="FIRST",i[i.SECOND=2]="SECOND",i[i.LAST=3]="LAST"})(vu||(vu={}));const dh=yn("quickInputService");var Cft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Nae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let I$=class extends _e{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=no.as(Xb.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){var o;const[r,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(n!=null&&n.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,n);return}if(s&&!(n!=null&&n.preserveValue)){let f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=r==null?void 0:r.defaultFilterValue;g===k$.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new Be,d=c.add(this.quickInputService.createQuickPick());d.value=e,this.adjustValueSelection(d,s,n),d.placeholder=s==null?void 0:s.placeholder,d.quickNavigate=n==null?void 0:n.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!a,(typeof(n==null?void 0:n.itemActivation)=="number"||(n==null?void 0:n.quickNavigateConfiguration))&&(d.itemActivation=(o=n==null?void 0:n.itemActivation)!==null&&o!==void 0?o:vu.SECOND),d.contextKey=s==null?void 0:s.contextKey,d.filterValue=f=>f.substring(s?s.prefix.length:0);let u;t&&(u=new o5,c.add(st.once(d.onWillAccept)(f=>{f.veto(),d.hide()}))),c.add(this.registerPickerListeners(d,r,s,e,n==null?void 0:n.providerOptions));const h=c.add(new Ro);if(r&&c.add(r.provide(d,h.token,n==null?void 0:n.providerOptions)),st.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,n){var o;let r;n!=null&&n.preserveValue?r=[e.value.length,e.value.length]:r=[(o=t==null?void 0:t.prefix.length)!==null&&o!==void 0?o:0,e.value.length],e.valueSelection=r}registerPickerListeners(e,t,n,o,r){const s=new Be,a=this.visibleQuickAccess={picker:e,descriptor:n,value:o};return s.add(zt(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:r}):a.value=l})),n&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};I$=Cft([Nae(0,dh),Nae(1,$t)],I$);ve.white.toString(),ve.white.toString();class T$ extends _e{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new le),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 n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,o=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=o||"",this._element.style.backgroundColor=n||"",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(Ei.addTarget(this._element)),[et.CLICK,Di.Tap].forEach(r=>{this._register(ke(this._element,r,s=>{if(!this.enabled){un.stop(s);return}this._onDidClick.fire(s)}))}),this._register(ke(this._element,et.KEY_DOWN,r=>{const s=new Pi(r);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(r),a=!0):s.equals(9)&&(this._element.blur(),a=!0),a&&un.stop(s,!0)})),this._register(ke(this._element,et.MOUSE_OVER,r=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ke(this._element,et.MOUSE_OUT,r=>{this.updateBackground(!1)})),this.focusTracker=this._register(pf(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 n of ev(e))if(typeof n=="string"){if(n=n.trim(),n==="")continue;const o=document.createElement("span");o.textContent=n,t.push(o)}else t.push(n);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||Jm(this._label)&&Jm(e)&&Vdt(this._label,e))return;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(Jm(e)){const o=P5(e,{inline:!0});o.dispose();const r=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(r){const s=l0e(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});n.innerHTML=s}else jr(n)}else this.options.supportIcons?jr(n,...this.getContentElements(e)):n.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=tut(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 N${constructor(e,t,n){this.options=t,this.styles=n,this.count=0,this.element=Ae(e,He(".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=Z0(this.countFormat,this.count),this.element.title=Z0(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const Rae="done",Mae="active",j9="infinite",K9="infinite-long-running",Aae="discrete";class K5 extends _e{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new bi(()=>nl(this.element),0)),this.longRunningScheduler=this._register(new bi(()=>this.infiniteLongRunning(),K5.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(Mae,j9,K9,Aae),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Rae),this.element.classList.contains(j9)?(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(Aae,Rae,K9),this.element.classList.add(Mae,j9),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(K9)}getContainer(){return this.element}}K5.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const yft=He;class wft extends _e{constructor(e,t,n){super(),this.parent=e,this.onKeyDown=r=>ke(this.findInput.inputBox.inputElement,et.KEY_DOWN,s=>{r(new Pi(s))}),this.onMouseDown=r=>ke(this.findInput.inputBox.inputElement,et.MOUSE_DOWN,s=>{r(new kc(s))}),this.onDidChange=r=>this.findInput.onDidChange(r),this.container=Ae(this.parent,yft(".quick-input-box")),this.findInput=this._register(new sCe(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:n}));const o=this.findInput.inputBox.inputElement;o.role="combobox",o.ariaHasPopup="menu",o.ariaAutoComplete="list",o.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===So.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===So.Info?1:e===So.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===So.Info?1:e===So.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class nv{constructor(e,t){var n;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(n=t==null?void 0:t.supportIcons)!==null&&n!==void 0?n:!1,this.domNode=Ae(e,He("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],n="",o){e||(e=""),o&&(e=nv.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===n&&ql(this.highlights,t))&&(this.text=e,this.title=n,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const n of this.highlights){if(n.end===n.start)continue;if(t{o=r===`\r +`?-1:0,s+=n;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=o),a.end>=s&&(a.end+=o));return n+=o,"\u23CE"})}}class q9{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 ZP extends _e{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new q9(Ae(e,He(".monaco-icon-label")))),this.labelContainer=Ae(this.domNode.element,He(".monaco-icon-label-container"));const n=Ae(this.labelContainer,He("span.monaco-icon-name-container"));(t==null?void 0:t.supportHighlights)||(t==null?void 0:t.supportIcons)?this.nameNode=new Lft(n,!!t.supportIcons):this.nameNode=new Sft(n),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,n){const o=["monaco-icon-label"],r=["monaco-icon-label-container"];let s="";if(n&&(n.extraClasses&&o.push(...n.extraClasses),n.italic&&o.push("italic"),n.strikethrough&&o.push("strikethrough"),n.disabledCommand&&r.push("disabled"),n.title&&(s+=n.title)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",s),this.labelContainer.className=r.join(" "),this.setupHover(n!=null&&n.descriptionTitle?this.labelContainer:this.element,n==null?void 0:n.title),this.nameNode.setLabel(e,n),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof nv?(a.set(t||"",n?n.descriptionMatches:void 0,void 0,n==null?void 0:n.labelEscapeNewLines),this.setupHover(a.element,n==null?void 0:n.descriptionTitle)):(a.textContent=t&&(n==null?void 0:n.labelEscapeNewLines)?nv.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(n==null?void 0:n.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)zdt(e,t);else{const o=V1e(this.hoverDelegate,e,t);o&&this.customHovers.set(e,o)}}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 q9(Ae(this.labelContainer,He("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new nv(Ae(t.element,He("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new q9(Ae(t.element,He("span.label-description"))))}return this.descriptionNode}}class Sft{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&ql(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=Ae(this.container,He("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 n=0;n{const r={start:n,end:n+o.length},s=t.map(a=>fs.intersect(r,a)).filter(a=>!fs.isEmpty(a)).map(({start:a,end:l})=>({start:a-n,end:l-n}));return n=r.end+e.length,s})}class Lft{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&ql(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 nv(Ae(this.container,He("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 n=(t==null?void 0:t.separator)||"/",o=xft(e,n,t==null?void 0:t.matches);for(let r=0;r{const i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:i,collatorIsNumeric:i.resolvedOptions().numeric}});new ah(()=>({collator:new Intl.Collator(void 0,{numeric:!0})}));new ah(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function Dft(i,e,t=!1){const n=i||"",o=e||"",r=Pae.value.collator.compare(n,o);return Pae.value.collatorIsNumeric&&r===0&&n!==o?no.length)return 1}return 0}var Tft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};class wCe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Tft([Mo],wCe.prototype,"toString",null);const Nft=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function Rft(i){const e=[];let t=0,n;for(;n=Nft.exec(i);){n.index-t>0&&e.push(i.substring(t,n.index));const[,o,r,,s]=n;s?e.push({label:o,href:r,title:s}):e.push({label:o,href:r}),t=n.index+n[0].length}return t{KQe(f)&&un.stop(f,!0),t.callback(r.href)},c=t.disposables.add(new xn(a,et.CLICK)).event,d=t.disposables.add(new xn(a,et.KEY_DOWN)).event,u=st.chain(d,f=>f.filter(g=>{const p=new Pi(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Ei.addTarget(a));const h=t.disposables.add(new xn(a,Di.Tap)).event;st.any(c,h,u)(l,null,t.disposables),e.appendChild(a)}}var SCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Oae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const au=He;class Pft{constructor(e,t,n,o,r,s,a){var l,c,d;this._checked=!1,this._hidden=!1,this.hasCheckbox=o,this.index=n,this.fireButtonTriggered=r,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=o?st.map(st.filter(this._onChecked.event,u=>u.listElement===this),u=>u.checked):st.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 ah(()=>{var u;const h=(u=e.label)!==null&&u!==void 0?u:"",f=RL(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>Wdt(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 dT{constructor(e){this.themeService=e}get templateId(){return dT.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Ae(e,au(".quick-input-list-entry"));const n=Ae(t.entry,au("label.quick-input-list-label"));t.toDisposeTemplate.push(No(n,et.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=Ae(n,au("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(No(t.checkbox,et.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const o=Ae(n,au(".quick-input-list-rows")),r=Ae(o,au(".quick-input-list-row")),s=Ae(o,au(".quick-input-list-row"));t.label=new ZP(r,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=v0e(t.label.element,au(".quick-input-list-icon"));const a=Ae(r,au(".quick-input-list-entry-keybinding"));t.keybinding=new cT(a,Vl);const l=Ae(s,au(".quick-input-list-label-meta"));return t.detail=new ZP(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=Ae(t.entry,au(".quick-input-list-separator")),t.actionBar=new zc(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){var o,r,s,a;n.element=e,e.element=(o=n.entry)!==null&&o!==void 0?o:void 0;const l=e.item?e.item:e.separator;n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked(g=>n.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:d,detailHighlights:u}=e;if(!((r=e.item)===null||r===void 0)&&r.iconPath){const g=Ew(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,p=Rt.revive(g);n.icon.className="quick-input-list-icon",n.icon.style.backgroundImage=Sv(p)}else n.icon.style.backgroundImage="",n.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:d||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,n.entry.classList.remove("quick-input-list-separator-as-item")):n.entry.classList.add("quick-input-list-separator-as-item"),n.label.setLabel(e.saneLabel,e.saneDescription,h),n.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(n.detail.element.style.display="",n.detail.setLabel(e.saneDetail,void 0,{matches:u,title:e.saneDetail,labelEscapeNewLines:!0})):n.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",n.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const f=l.buttons;f&&f.length?(n.actionBar.push(f.map((g,p)=>{let v=g.iconClass||(g.iconPath?R$(g.iconPath):void 0);return g.alwaysVisible&&(v=v?`${v} always-visible`:"always-visible"),{id:`id-${p}`,class:v,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}),n.entry.classList.add("has-actions")):n.entry.classList.remove("has-actions")}disposeElement(e,t,n){n.toDisposeElement=si(n.toDisposeElement),n.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=si(e.toDisposeElement),e.toDisposeTemplate=si(e.toDisposeTemplate)}}dT.ID="listelement";class Oft{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return dT.ID}}var Sr;(function(i){i[i.First=1]="First",i[i.Second=2]="Second",i[i.Last=3]="Last",i[i.Next=4]="Next",i[i.Previous=5]="Previous",i[i.NextPage=6]="NextPage",i[i.PreviousPage=7]="PreviousPage"})(Sr||(Sr={}));class VX{constructor(e,t,n,o){this.parent=e,this.options=n,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 le,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new le,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new le,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new le,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new le,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new le,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new le,this.onKeyDown=this._onKeyDown.event,this._onLeave=new le,this.onLeave=this._onLeave.event,this._listElementChecked=new le,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Ae(this.parent,au(".quick-input-list"));const r=new Oft,s=new Wft;if(this.list=n.createList("QuickInput",this.container,r,[new dT(o)],{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:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new Pi(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(Nn?a.metaKey:a.ctrlKey)&&this.list.setFocus(Gs(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(ke(this.container,et.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]))})),n.hoverDelegate){const a=new E0e(n.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>Oae(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&rs(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>Oae(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(d){if(!sh(d))throw d}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;rs(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 st.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return st.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 n=0,o=e.length;n{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=si(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),n=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const o=new Map,r=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const d=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const u=new Pft(a,d,l,r,t,n,this._listElementChecked),h=s.length;return s.push(u),o.set((c=u.item)!==null&&c!==void 0?c:u.separator,h),s},[]),this.elementsToIndexes=o,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 n of e)t.add(n);for(const n of this.elements)n.checked=t.has(n.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===Sr.Second&&this.list.length<2&&(e=Sr.First),e){case Sr.First:this.list.scrollTop=0,this.list.focusFirst(void 0,n=>!!n.item);break;case Sr.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,n=>!!n.item);break;case Sr.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,n=>!!n.item);break;case Sr.Next:{this.list.focusNext(void 0,!0,void 0,o=>!!o.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Sr.Previous:{this.list.focusPrevious(void 0,!0,void 0,o=>!!o.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Sr.NextPage:this.list.focusNextPage(void 0,n=>!!n.item);break;case Sr.PreviousPage:this.list.focusPreviousPage(void 0,n=>!!n.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,n,o;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((n=(t=this.options.hoverDelegate).onDidHideHover)===null||n===void 0||n.call(t),(o=this._lastHover)===null||o===void 0||o.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:r=>{this.options.linkOpenerDelegate(r)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(o=>{o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=!1;const r=o.index&&this.inputElements[o.index-1];o.item&&(o.separator=r&&r.type==="separator"&&!r.buttons?r:void 0)});else{let o;this.elements.forEach(r=>{var s,a,l,c;let d;this.matchOnLabelMode==="fuzzy"?d=this.matchOnLabel&&(s=M9(e,RL(r.saneLabel)))!==null&&s!==void 0?s:void 0:d=this.matchOnLabel&&(a=Fft(t,RL(r.saneLabel)))!==null&&a!==void 0?a:void 0;const u=this.matchOnDescription&&(l=M9(e,RL(r.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=M9(e,RL(r.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(d||u||h?(r.labelHighlights=d,r.descriptionHighlights=u,r.detailHighlights=h,r.hidden=!1):(r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=r.item?!r.item.alwaysShow:!0),r.item?r.separator=void 0:r.separator&&(r.hidden=!0),!this.sortByLabel){const f=r.index&&this.inputElements[r.index-1];o=f&&f.type==="separator"?f:o,o&&!r.hidden&&(r.separator=o,o=void 0)}})}const n=this.elements.filter(o=>!o.hidden);if(this.sortByLabel&&e){const o=e.toLowerCase();n.sort((r,s)=>Bft(r,s,o))}return this.elementsToIndexes=n.reduce((o,r,s)=>{var a;return o.set((a=r.item)!==null&&a!==void 0?a:r.separator,s),o},new Map),this.list.splice(0,this.list.length,n),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(n.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.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=si(this.elementDisposables),this.disposables=si(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 n=new Be;n.add(this.list.onDidChangeFocus(o=>{o.indexes.length&&this.showHover(o.elements[0])})),this._lastHover&&n.add(this._lastHover),this._toggleHover=n,this.elementDisposables.push(this._toggleHover)}}SCe([Mo],VX.prototype,"onDidChangeFocus",null);SCe([Mo],VX.prototype,"onDidChangeSelection",null);function Fft(i,e){const{text:t,iconOffsets:n}=e;if(!n||n.length===0)return Fae(i,t);const o=VI(t," "),r=t.length-o.length,s=Fae(i,o);if(s)for(const a of s){const l=n[a.start+r]+r;a.start+=l,a.end+=l}return s}function Fae(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t!==-1?[{start:t,end:t+i.length}]:null}function Bft(i,e,t){const n=i.labelHighlights||[],o=e.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:n.length===0&&o.length===0?0:kft(i.saneSortLabel,e.saneSortLabel,t)}class Wft{getWidgetAriaLabel(){return C("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!!e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var Bae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const M$={iconClass:Mt.asClassName(Xe.quickInputBack),tooltip:C("quickInput.back","Back"),handle:-1};class uT extends _e{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=uT.noPromptMessage,this._severity=So.Ignore,this.onDidTriggerButtonEmitter=this._register(new le),this.onDidHideEmitter=this._register(new le),this.onDisposeEmitter=this._register(new le),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&&!Ku;this._ignoreFocusOut=e&&!Ku,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=xk.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const n=this.getTitle();n&&this.ui.title.textContent!==n?this.ui.title.textContent=n:!n&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText="\xA0");const o=this.getDescription();if(this.ui.description1.textContent!==o&&(this.ui.description1.textContent=o),this.ui.description2.textContent!==o&&(this.ui.description2.textContent=o),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?jr(this.ui.widget,this._widget):jr(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new zd,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 s=this.buttons.filter(l=>l===M$);this.ui.leftActionBar.push(s.map((l,c)=>{const d=new ca(`id-${c}`,"",l.iconClass||R$(l.iconPath),!0,()=>Bae(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!==M$);this.ui.rightActionBar.push(a.map((l,c)=>{const d=new ca(`id-${c}`,"",l.iconClass||R$(l.iconPath),!0,()=>Bae(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 s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof kS))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const r=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==r&&(this._lastValidationMessage=r,jr(this.ui.message),Aft(r,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?C("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==So.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}uT.noPromptMessage=C("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class Lk extends uT{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new le),this.onWillAcceptEmitter=this._register(new le),this.onDidAcceptEmitter=this._register(new le),this.onDidCustomEmitter=this._register(new le),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=vu.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new le),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new le),this.onDidTriggerItemButtonEmitter=this._register(new le),this.onDidTriggerSeparatorButtonEmitter=this._register(new le),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?bft: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(Sr.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(Sr.Next),this.canSelectMany&&this.ui.list.domFocus(),un.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Sr.Previous):this.ui.list.focus(Sr.Last),this.canSelectMany&&this.ui.list.domFocus(),un.stop(e,!0);break;case 12:this.ui.list.focus(Sr.NextPage),this.canSelectMany&&this.ui.list.domFocus(),un.stop(e,!0);break;case 11:this.ui.list.focus(Sr.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),un.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(Sr.First),un.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Sr.Last),un.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&&Lo(e,this._activeItems,(t,n)=>t===n)||(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&&Lo(e,this._selectedItems,(n,o)=>n===o)||(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&&Lo(e,this._selectedItems,(t,n)=>t===n)||(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 ke(this.ui.container,et.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Pi(e),n=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&n===6||a[0].ctrlKey&&n===5||a[0].metaKey&&n===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,n={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(n),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 o=this.ariaLabel;if(!o&&n.inputBox&&(o=this.placeholder||Lk.DEFAULT_ARIA_LABEL,this.title&&(o+=` - ${this.title}`)),this.ui.list.ariaLabel!==o&&(this.ui.list.ariaLabel=o!=null?o: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 vu.NONE:this._itemActivation=vu.FIRST;break;case vu.SECOND:this.ui.list.focus(Sr.Second),this._itemActivation=vu.FIRST;break;case vu.LAST:this.ui.list.focus(Sr.Last),this._itemActivation=vu.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||"",n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Sr.First)),this.keepScrollPosition&&(this.scrollTop=e)}}Lk.DEFAULT_ARIA_LABEL=C("quickInputBox.ariaLabel","Type to narrow down results.");class Vft extends uT{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new le),this.onDidAcceptEmitter=this._register(new le),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 Xa=He;class q5 extends _e{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new le),this.onDidCustomEmitter=this._register(new le),this.onDidTriggerButtonEmitter=this._register(new le),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new le),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new le),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(ke(window,et.KEY_DOWN,e,!0)),this._register(ke(window,et.KEY_UP,e,!0)),this._register(ke(window,et.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Ae(this.parentElement,Xa(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Wc(e),n=Ae(e,Xa(".quick-input-titlebar")),o=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,r=this._register(new zc(n,o));r.domNode.classList.add("quick-input-left-action-bar");const s=Ae(n,Xa(".quick-input-title")),a=this._register(new zc(n,o));a.domNode.classList.add("quick-input-right-action-bar");const l=Ae(e,Xa(".quick-input-header")),c=Ae(l,Xa("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",C("quickInput.checkAll","Toggle all checkboxes")),this._register(No(c,et.CHANGE,N=>{const M=c.checked;A.setAllVisibleChecked(M)})),this._register(ke(c,et.CLICK,N=>{(N.x||N.y)&&f.setFocus()}));const d=Ae(l,Xa(".quick-input-description")),u=Ae(l,Xa(".quick-input-and-message")),h=Ae(u,Xa(".quick-input-filter")),f=this._register(new wft(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Ae(h,Xa(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new N$(g,{countFormat:C({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),v=Ae(h,Xa(".quick-input-count"));v.setAttribute("aria-live","polite");const m=new N$(v,{countFormat:C({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),_=Ae(l,Xa(".quick-input-action")),y=this._register(new T$(_,this.styles.button));y.label=C("ok","OK"),this._register(y.onDidClick(N=>{this.onDidAcceptEmitter.fire()}));const w=Ae(l,Xa(".quick-input-action")),L=this._register(new T$(w,this.styles.button));L.label=C("custom","Custom"),this._register(L.onDidClick(N=>{this.onDidCustomEmitter.fire()}));const D=Ae(u,Xa(`#${this.idPrefix}message.quick-input-message`)),E=this._register(new K5(e,this.styles.progressBar));E.getContainer().classList.add("quick-input-progress");const I=Ae(e,Xa(".quick-input-html-widget"));I.tabIndex=-1;const k=Ae(e,Xa(".quick-input-description")),R=this.idPrefix+"list",A=this._register(new VX(e,R,this.options,this.themeService));f.setAttribute("aria-controls",R),this._register(A.onDidChangeFocus(()=>{var N;f.setAttribute("aria-activedescendant",(N=A.getActiveDescendant())!==null&&N!==void 0?N:"")})),this._register(A.onChangedAllVisibleChecked(N=>{c.checked=N})),this._register(A.onChangedVisibleCount(N=>{p.setCount(N)})),this._register(A.onChangedCheckedCount(N=>{m.setCount(N)})),this._register(A.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof Lk&&this.controller.canSelectMany&&A.clearFocus()},0)}));const P=pf(e);return this._register(P),this._register(ke(e,et.FOCUS,N=>{rs(N.relatedTarget,e)||(this.previousFocusElement=N.relatedTarget instanceof HTMLElement?N.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(xk.Blur),this.previousFocusElement=void 0})),this._register(ke(e,et.FOCUS,N=>{f.setFocus()})),this._register(No(e,et.KEY_DOWN,N=>{if(!rs(N.target,I))switch(N.keyCode){case 3:un.stop(N,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:un.stop(N,!0),this.hide(xk.Gesture);break;case 2:if(!N.altKey&&!N.ctrlKey&&!N.metaKey){const M=[".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")?M.push("input"):M.push("input[type=text]"),this.getUI().list.isDisplayed()&&M.push(".monaco-list"),this.getUI().message&&M.push(".quick-input-message a"),this.getUI().widget){if(rs(N.target,this.getUI().widget))break;M.push(".quick-input-html-widget")}const H=e.querySelectorAll(M.join(", "));N.shiftKey&&N.target===H[0]?(un.stop(N,!0),A.clearFocus()):!N.shiftKey&&rs(N.target,H[H.length-1])&&(un.stop(N,!0),H[0].focus())}break;case 10:N.ctrlKey&&(un.stop(N,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:r,titleBar:n,title:s,description1:k,description2:d,widget:I,rightActionBar:a,checkAll:c,inputContainer:u,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:v,count:m,okContainer:_,ok:y,message:D,customButtonContainer:w,customButton:L,list:A,progressBar:E,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:N=>this.show(N),hide:()=>this.hide(),setVisibilities:N=>this.setVisibilities(N),setEnabled:N=>this.setEnabled(N),setContextKey:N=>this.options.setContextKey(N),linkOpenerDelegate:N=>this.options.linkOpenerDelegate(N)},this.updateStyles(),this.ui}pick(e,t={},n=_n.None){return new Promise((o,r)=>{let s=d=>{var u;s=o,(u=t.onKeyMods)===null||u===void 0||u.call(t,a.keyMods),o(d)};if(n.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(s(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&&(s(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(v=>v!==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])}),n.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{si(c),s(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=>{r(d),a.hide()})})}createQuickPick(){const e=this.getUI();return new Lk(e)}createInputBox(){const e=this.getUI();return new Vft(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const n=this.controller;this.controller=e,n==null||n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",jr(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(So.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),jr(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 o=this.options.backKeybindingLabel();M$.tooltip=o?C("quickInput.backWithKeybinding","Back ({0})",o):C("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,n,o;const r=this.controller;if(!r)return;const s=!rs(document.activeElement,(n=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&n!==void 0?n:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(o=a.parentElement)!==null&&o!==void 0?o:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}r.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,q5.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:n,widgetBorder:o,widgetShadow:r}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e!=null?e:"",this.ui.container.style.backgroundColor=t!=null?t:"",this.ui.container.style.color=n!=null?n:"",this.ui.container.style.border=o?`1px solid ${o}`:"",this.ui.container.style.boxShadow=r?`0 0 8px 2px ${r}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.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)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const a=s.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}q5.MAX_WIDTH=600;var Hft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},H2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let A$=class extends yot{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(I$))),this._quickAccess}constructor(e,t,n,o){super(n),this.instantiationService=e,this.contextKeyService=t,this.layoutService=o,this._onShow=this._register(new le),this._onHide=this._register(new le),this.contexts=new Map}createController(e=this.layoutService,t){const n={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:r=>this.setContextKey(r),linkOpenerDelegate:r=>{this.instantiationService.invokeFunction(s=>{s.get(ml).open(r,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(r,s,a,l,c)=>this.instantiationService.createInstance(E$,r,s,a,l,c),styles:this.computeStyles()},o=this._register(new q5(Object.assign(Object.assign({},n),t),this.themeService));return o.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(r=>o.layout(r,e.offset.quickPickTop))),this._register(o.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(o.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),o}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new lt(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={},n=_n.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ct(kre),quickInputForeground:ct(Dnt),quickInputTitleBackground:ct(knt),widgetBorder:ct(xG),widgetShadow:ct(Gh)},inputBox:WP,toggle:BP,countBadge:X1e,button:Xut,progressBar:Yut,keybindingLabel:Gut,list:ES({listBackground:kre,listFocusBackground:p0,listFocusForeground:g0,listInactiveFocusForeground:g0,listInactiveSelectionIconForeground:OC,listInactiveFocusBackground:p0,listFocusOutline:Wi,listInactiveFocusOutline:Wi}),pickerGroup:{pickerGroupBorder:ct(Int),pickerGroupForeground:ct(abe)}}}};A$=Hft([H2(0,$t),H2(1,Ut),H2(2,vr),H2(3,LS)],A$);var xCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},XC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let P$=class extends A${constructor(e,t,n,o,r){super(t,n,o,new HH(e.getContainerDomNode(),r)),this.host=void 0;const s=Fw.get(e);if(s){const a=s.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)}};P$=xCe([XC(1,$t),XC(2,Ut),XC(3,vr),XC(4,Jn)],P$);let O$=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 n=t=this.instantiationService.createInstance(P$,e);this.mapEditorToService.set(e,t),yv(e.onDidDispose)(()=>{n.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={},n=_n.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};O$=xCe([XC(0,$t),XC(1,Jn)],O$);class Fw{static get(e){return e.getContribution(Fw.ID)}constructor(e){this.editor=e,this.widget=new G5(this.editor)}dispose(){this.widget.dispose()}}Fw.ID="editor.controller.quickInput";class G5{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return G5.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}G5.ID="editor.contrib.quickInputWidget";Un(Fw.ID,Fw,4);class $ft{constructor(e,t,n,o,r){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=n,this.foreground=o,this.background=r}}function zft(i){if(!i||!Array.isArray(i))return[];const e=[];let t=0;for(let n=0,o=i.length;n{const h=Xft(d.token,u.token);return h!==0?h:d.index-u.index});let t=0,n="000000",o="ffffff";for(;i.length>=1&&i[0].token==="";){const d=i.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(n=d.foreground),d.background!==null&&(o=d.background)}const r=new Kft;for(const d of e)r.getId(d);const s=r.getId(n),a=r.getId(o),l=new HX(t,s,a),c=new $X(l);for(let d=0,u=i.length;d>>0,this._cache.set(t,n)}return(n|e<<0)>>>0}}const qft=/\b(comment|string|regex|regexp)\b/;function Gft(i){const e=i.match(qft);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 Xft(i,e){return ie?1:0}class HX{constructor(e,t,n){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new HX(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,n){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),n!==0&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class $X{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 n,o;t===-1?(n=e,o=""):(n=e.substring(0,t),o=e.substring(t+1));const r=this._children.get(n);return typeof r!="undefined"?r.match(o):this._mainRule}insert(e,t,n,o){if(e===""){this._mainRule.acceptOverwrite(t,n,o);return}const r=e.indexOf(".");let s,a;r===-1?(s=e,a=""):(s=e.substring(0,r),a=e.substring(r+1));let l=this._children.get(s);typeof l=="undefined"&&(l=new $X(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,n,o)}}function Yft(i){const e=[];for(let t=1,n=i.length;t({format:o.format,location:o.location.toString()}))}}i.toJSONObject=e;function t(n){const o=r=>la(r)?r:void 0;if(n&&Array.isArray(n.src)&&n.src.every(r=>la(r.format)&&la(r.location)))return{weight:o(n.weight),style:o(n.style),src:n.src.map(r=>({format:r.format,location:Rt.parse(r.location)}))}}i.fromJSONObject=t})(Vae||(Vae={}));class ngt{constructor(){this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:C("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:C("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Mt.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,o){const r=this.iconsById[e];if(r){if(n&&!r.description){r.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=n),this._onDidChange.fire()}return r}const s={id:e,description:n,defaults:t,deprecationMessage:o};this.iconsById[e]=s;const a={$ref:"#/definitions/icons"};return o&&(a.deprecationMessage=o),n&&(a.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||""),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=(r,s)=>r.id.localeCompare(s.id),t=r=>{for(;Mt.isThemeIcon(r.defaults);)r=this.iconsById[r.defaults.id];return`codicon codicon-${r?r.id:""}`},n=[];n.push("| preview | identifier | default codicon ID | description"),n.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const o=Object.keys(this.iconsById).map(r=>this.iconsById[r]);for(const r of o.filter(s=>!!s.description).sort(e))n.push(`||${r.id}|${Mt.isThemeIcon(r.defaults)?r.defaults.id:r.id}|${r.description||""}|`);n.push("| preview | identifier "),n.push("| ----------- | --------------------------------- |");for(const r of o.filter(s=>!Mt.isThemeIcon(s.defaults)).sort(e))n.push(`||${r.id}|`);return n.join(` +`)}}const Yb=new ngt;no.add(tgt.IconContribution,Yb);function Eo(i,e,t,n){return Yb.registerIcon(i,e,t,n)}function ECe(){return Yb}function igt(){const i=W_e();for(const e in i){const t="\\"+i[e].toString(16);Yb.registerIcon(e,{fontCharacter:t})}}igt();const DCe="vscode://schemas/icons",kCe=no.as(d5.JSONContribution);kCe.registerSchema(DCe,Yb.getIconSchema());const Hae=new bi(()=>kCe.notifySchemaChanged(DCe),200);Yb.onDidChange(()=>{Hae.isScheduled()||Hae.schedule()});const ICe=Eo("widget-close",Xe.close,C("widgetClose","Icon for the close action in widgets."));Eo("goto-previous-location",Xe.arrowUp,C("previousChangeIcon","Icon for goto previous editor location."));Eo("goto-next-location",Xe.arrowDown,C("nextChangeIcon","Icon for goto next editor location."));Mt.modify(Xe.sync,"spin");Mt.modify(Xe.loading,"spin");function ogt(i){const e=new Be,t=e.add(new le),n=ECe();return e.add(n.onDidChange(()=>t.fire())),i&&e.add(i.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const o=i?i.getProductIconTheme():new TCe,r={},s=l=>{const c=o.getIcon(l);if(!c)return;const d=c.font;return d?(r[d.id]=d.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${Aoe(d.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of n.getIcons()){const c=s(l);c&&a.push(c)}for(const l in r){const c=r[l],d=c.weight?`font-weight: ${c.weight};`:"",u=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Sv(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${Aoe(l)};${d}${u} font-display: block; }`)}return a.join(` +`)}}}class TCe{getIcon(e){const t=ECe();let n=e.defaults;for(;Mt.isThemeIcon(n);){const o=t.getIcon(n.id);if(!o)return;n=o.defaults}return n}}const Ig="vs",By="vs-dark",A0="hc-black",P0="hc-light",NCe=no.as(ibe.ColorContribution),rgt=no.as(Cbe.ThemingContribution);class RCe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const n=t.base;e.length>0?(xM(e)?this.id=e:this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),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,ve.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=F$(this.themeData.base);for(const n in t.colors)e.has(n)||e.set(n,ve.fromHex(t.colors[n]))}this.colors=e}return this.colors}getColor(e,t){const n=this.getColors().get(e);if(n)return n;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=NCe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Ig:return Ic.LIGHT;case A0:return Ic.HIGH_CONTRAST_DARK;case P0:return Ic.HIGH_CONTRAST_LIGHT;default:return Ic.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const r=F$(this.themeData.base);e=r.rules,r.encodedTokensColors&&(t=r.encodedTokensColors)}const n=this.themeData.colors["editor.foreground"],o=this.themeData.colors["editor.background"];if(n||o){const r={token:""};n&&(r.foreground=n),o&&(r.background=o),e.push(r)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=LCe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,n){const r=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=is.getForeground(r),a=is.getFontStyle(r);return{foreground:s,italic:Boolean(a&1),bold:Boolean(a&2),underline:Boolean(a&4),strikethrough:Boolean(a&8)}}}function xM(i){return i===Ig||i===By||i===A0||i===P0}function F$(i){switch(i){case Ig:return Zft;case By:return Qft;case A0:return Jft;case P0:return egt}}function $2(i){const e=F$(i);return new RCe(i,e)}class sgt extends _e{constructor(){super(),this._onColorThemeChange=this._register(new le),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new le),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new TCe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Ig,$2(Ig)),this._knownThemes.set(By,$2(By)),this._knownThemes.set(A0,$2(A0)),this._knownThemes.set(P0,$2(P0));const e=this._register(ogt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Ig),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Y_e("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return XA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Wc(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),_e.None}_registerShadowDomContainer(e){const t=Wc(e,n=>{n.className="monaco-colors",n.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let n=0;n{n.base===e&&n.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(Ig),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!==Hu(this._theme.type)){let t;Ew(this._theme.type)?t=e?A0:By:t=e?P0:Ig,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},n={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};rgt.getThemingParticipants().forEach(s=>s(this._theme,n,this._environment));const o=[];for(const s of NCe.getColors()){const a=this._theme.getColor(s.id,!0);a&&o.push(`${SG(s.id)}: ${a.toString()};`)}n.addRule(`.monaco-editor, .monaco-diff-editor { ${o.join(` +`)} }`);const r=this._colorMapOverride||this._theme.tokenTheme.getColorMap();n.addRule(Yft(r)),this._themeCSS=e.join(` `),this._updateCSS(),oo.setColorMap(r),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const ic=yn("themeService");var rgt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},G9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let F$=class extends _e{constructor(e,t,n){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=n,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new le,this._onDidChangeReducedMotion=new le,this._accessibilityModeEnabledContext=GI.bindTo(this._contextKeyService);const o=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(o(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),o(),this._register(this.onDidChangeScreenReaderOptimized(()=>o()));const r=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=r.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(r)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(ke(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const n=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",n),this._layoutService.container.classList.toggle("enable-motion",!n)};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}};F$=rgt([G9(0,Ut),G9(1,LS),G9(2,En)],F$);var G5=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},db=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fC,Zp;let B$=class{constructor(e,t){this._commandService=e,this._hiddenStates=new QP(t)}createMenu(e,t,n){return new V$(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},n),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};B$=G5([db(0,_o),db(1,Gd)],B$);let QP=fC=class{constructor(e){this._storageService=e,this._disposables=new Be,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(fC._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,fC._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(fC._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 n;return(n=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&n!==void 0?n:!1}setDefaultState(e,t,n){this._hiddenByDefaultCache.set(`${e.id}/${t}`,n)}isHidden(e,t){var n,o;const r=this._isHiddenByDefault(e,t),s=(o=(n=this._data[e.id])===null||n===void 0?void 0:n.includes(t))!==null&&o!==void 0?o:!1;return r?!s:s}updateHidden(e,t,n){this._isHiddenByDefault(e,t)&&(n=!n);const r=this._data[e.id];if(n)r?r.indexOf(t)<0&&r.push(t):this._data[e.id]=[t];else if(r){const s=r.indexOf(t);s>=0&&dXe(r,s),r.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(fC._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};QP._key="menu.hiddenCommands";QP=fC=G5([db(0,Gd)],QP);let W$=Zp=class{constructor(e,t,n,o,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=n,this._commandService=o,this._contextKeyService=r,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=Hr.getMenuItems(this._id);let t;e.sort(Zp._compareMenuItems);for(const n of e){const o=n.group||"";(!t||t[0]!==o)&&(t=[o,[]],this._menuGroups.push(t)),t[1].push(n),this._collectContextKeys(n)}}_collectContextKeys(e){if(Zp._fillInKbExprKeys(e.when,this._structureContextKeys),NC(e)){if(e.command.precondition&&Zp._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Zp._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Hr.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const n of this._menuGroups){const[o,r]=n,s=[];for(const a of r)if(this._contextKeyService.contextMatchesRules(a.when)){const l=NC(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=sgt(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new Fd(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const d=new Zp(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),u=kr.join(...d.map(h=>h[1]));u.length>0&&s.push(new BD(a,c,u))}}s.length>0&&t.push([o,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const n of e.keys())t.add(n)}static _compareMenuItems(e,t){const n=e.group,o=t.group;if(n!==o){if(n){if(!o)return-1}else return 1;if(n==="navigation")return-1;if(o==="navigation")return 1;const a=n.localeCompare(o);if(a!==0)return a}const r=e.order||0,s=t.order||0;return rs?1:Zp._compareTitles(NC(e)?e.command.title:e.title,NC(t)?t.command.title:t.title)}static _compareTitles(e,t){const n=typeof e=="string"?e:e.original,o=typeof t=="string"?t:t.original;return n.localeCompare(o)}};W$=Zp=G5([db(3,_o),db(4,Ut)],W$);let V$=class{constructor(e,t,n,o,r){this._disposables=new Be,this._menuInfo=new W$(e,t,n.emitEventsForSubmenuChanges,o,r);const s=new bi(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},n.eventDebounceDelay);this._disposables.add(s),this._disposables.add(Hr.onDidChangeMenu(d=>{d.has(e)&&s.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(r.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 k_e({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:n.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};V$=G5([db(3,_o),db(4,Ut)],V$);function sgt(i,e,t){const n=tQe(e)?e.submenu.id:e.id,o=typeof e.title=="string"?e.title:e.title.value,r=_y({id:`hide/${i.id}/${n}`,label:C("hide.label","Hide '{0}'",o),run(){t.updateHidden(i,n,!0)}}),s=_y({id:`toggle/${i.id}/${n}`,label:o,get checked(){return!t.isHidden(i,n)},run(){t.updateHidden(i,n,!!this.checked)}});return{hide:r,toggle:s,get isHidden(){return!s.checked}}}var agt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Hae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},w_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let H$=class extends _e{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(lp||Z_e)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new i5;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(n=>w_(this,void 0,void 0,function*(){(!(n instanceof Error)||n.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(n)}))};this.layoutService.hasContainer&&(this._register(ke(this.layoutService.container,"click",e)),this._register(ke(this.layoutService.container,"keydown",e)))}writeText(e,t){return w_(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(r){console.error(r)}const n=document.activeElement,o=document.body.appendChild(He("textarea",{"aria-hidden":!0}));o.style.height="1px",o.style.width="1px",o.style.position="absolute",o.value=e,o.focus(),o.select(),document.execCommand("copy"),n instanceof HTMLElement&&n.focus(),document.body.removeChild(o)})}readText(e){return w_(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 w_(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return w_(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return w_(this,void 0,void 0,function*(){this.resources=e})}readResources(){return w_(this,void 0,void 0,function*(){return this.resources})}};H$=agt([Hae(0,LS),Hae(1,nc)],H$);const wp=yn("clipboardService");var lgt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},cgt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const IE="data-keybinding-context";class $X{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=="undefined"&&this._parent?this._parent.getValue(e):t}}class Bw extends $X{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Bw.INSTANCE=new Bw;class Ek extends $X{constructor(e,t,n){super(e,null),this._configurationService=t,this._values=Ay.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(o=>{if(o.source===7){const r=Array.from(this._values,([s])=>s);this._values.clear(),n.fire(new zae(r))}else{const r=[];for(const s of o.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(r.push(...vn.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(r.push(a),this._values.delete(a))}n.fire(new zae(r))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Ek._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Ek._keyPrefix.length),n=this._configurationService.getValue(t);let o;switch(typeof n){case"number":case"boolean":case"string":o=n;break;default:Array.isArray(n)?o=JSON.stringify(n):o=n}return this._values.set(e,o),o}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}Ek._keyPrefix="config.";class dgt{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue=="undefined"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class $ae{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class zae{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 ugt{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 hgt(i,e){return i.allKeysContainedIn(new Set(Object.keys(e)))}class MCe extends _e{constructor(e){super(),this._onDidChangeContext=this._register(new Y0({merge:t=>new ugt(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 dgt(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 fgt(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 n=this.getContextValuesContainer(this._myContextId);!n||n.setValue(e,t)&&this._onDidChangeContext.fire(new $ae(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new $ae(e))}getContext(e){return this._isDisposed?Bw.INSTANCE:this.getContextValuesContainer(ggt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let $$=class extends MCe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new Ek(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?Bw.INSTANCE:this._contexts.get(e)||Bw.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 $X(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};$$=lgt([cgt(0,En)],$$);class fgt extends MCe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Kr),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(IE)){let n="";this._domNode.classList&&(n=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${n?": "+n:""}`)}this._domNode.setAttribute(IE,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const n=this._parent.getContextValuesContainer(this._myContextId).value;hgt(e,n)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(IE),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Bw.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 ggt(i){for(;i;){if(i.hasAttribute(IE)){const e=i.getAttribute(IE);return e?parseInt(e,10):NaN}i=i.parentElement}return 0}function pgt(i,e,t){i.get(Ut).createKey(String(e),mgt(t))}function mgt(i){return p_e(i,e=>{if(typeof e=="object"&&e.$mid===1)return Rt.revive(e).toString();if(e instanceof Rt)return e.toString()})}Rn.registerCommand("_setContext",pgt);Rn.registerCommand({id:"getContextKeyInfo",handler(){return[...lt.all()].sort((i,e)=>i.key.localeCompare(e.key))},description:{description:C("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Rn.registerCommand("_generateContextKeyInfo",function(){const i=[],e=new Set;for(const t of lt.all())e.has(t.key)||(e.add(t.key),i.push(t));i.sort((t,n)=>t.key.localeCompare(n.key)),console.log(JSON.stringify(i,void 0,2))});class vgt{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class Uae{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 n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(t);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new vgt(t,e),this._nodes.set(t,n)),n}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,n]of this._nodes)e.push(`${t} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const ic=yn("themeService");var agt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},X9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let B$=class extends _e{constructor(e,t,n){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=n,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new le,this._onDidChangeReducedMotion=new le,this._accessibilityModeEnabledContext=GI.bindTo(this._contextKeyService);const o=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(o(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),o(),this._register(this.onDidChangeScreenReaderOptimized(()=>o()));const r=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=r.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(r)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(ke(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const n=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",n),this._layoutService.container.classList.toggle("enable-motion",!n)};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}};B$=agt([X9(0,Ut),X9(1,LS),X9(2,En)],B$);var X5=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},db=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fC,Qp;let W$=class{constructor(e,t){this._commandService=e,this._hiddenStates=new QP(t)}createMenu(e,t,n){return new H$(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},n),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};W$=X5([db(0,_o),db(1,Gd)],W$);let QP=fC=class{constructor(e){this._storageService=e,this._disposables=new Be,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(fC._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,fC._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(fC._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 n;return(n=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&n!==void 0?n:!1}setDefaultState(e,t,n){this._hiddenByDefaultCache.set(`${e.id}/${t}`,n)}isHidden(e,t){var n,o;const r=this._isHiddenByDefault(e,t),s=(o=(n=this._data[e.id])===null||n===void 0?void 0:n.includes(t))!==null&&o!==void 0?o:!1;return r?!s:s}updateHidden(e,t,n){this._isHiddenByDefault(e,t)&&(n=!n);const r=this._data[e.id];if(n)r?r.indexOf(t)<0&&r.push(t):this._data[e.id]=[t];else if(r){const s=r.indexOf(t);s>=0&&hXe(r,s),r.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(fC._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};QP._key="menu.hiddenCommands";QP=fC=X5([db(0,Gd)],QP);let V$=Qp=class{constructor(e,t,n,o,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=n,this._commandService=o,this._contextKeyService=r,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=Hr.getMenuItems(this._id);let t;e.sort(Qp._compareMenuItems);for(const n of e){const o=n.group||"";(!t||t[0]!==o)&&(t=[o,[]],this._menuGroups.push(t)),t[1].push(n),this._collectContextKeys(n)}}_collectContextKeys(e){if(Qp._fillInKbExprKeys(e.when,this._structureContextKeys),NC(e)){if(e.command.precondition&&Qp._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Qp._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Hr.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const n of this._menuGroups){const[o,r]=n,s=[];for(const a of r)if(this._contextKeyService.contextMatchesRules(a.when)){const l=NC(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=lgt(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new Fd(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const d=new Qp(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),u=kr.join(...d.map(h=>h[1]));u.length>0&&s.push(new BD(a,c,u))}}s.length>0&&t.push([o,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const n of e.keys())t.add(n)}static _compareMenuItems(e,t){const n=e.group,o=t.group;if(n!==o){if(n){if(!o)return-1}else return 1;if(n==="navigation")return-1;if(o==="navigation")return 1;const a=n.localeCompare(o);if(a!==0)return a}const r=e.order||0,s=t.order||0;return rs?1:Qp._compareTitles(NC(e)?e.command.title:e.title,NC(t)?t.command.title:t.title)}static _compareTitles(e,t){const n=typeof e=="string"?e:e.original,o=typeof t=="string"?t:t.original;return n.localeCompare(o)}};V$=Qp=X5([db(3,_o),db(4,Ut)],V$);let H$=class{constructor(e,t,n,o,r){this._disposables=new Be,this._menuInfo=new V$(e,t,n.emitEventsForSubmenuChanges,o,r);const s=new bi(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},n.eventDebounceDelay);this._disposables.add(s),this._disposables.add(Hr.onDidChangeMenu(d=>{d.has(e)&&s.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(r.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 k_e({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:n.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};H$=X5([db(3,_o),db(4,Ut)],H$);function lgt(i,e,t){const n=iQe(e)?e.submenu.id:e.id,o=typeof e.title=="string"?e.title:e.title.value,r=_y({id:`hide/${i.id}/${n}`,label:C("hide.label","Hide '{0}'",o),run(){t.updateHidden(i,n,!0)}}),s=_y({id:`toggle/${i.id}/${n}`,label:o,get checked(){return!t.isHidden(i,n)},run(){t.updateHidden(i,n,!!this.checked)}});return{hide:r,toggle:s,get isHidden(){return!s.checked}}}var cgt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},$ae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},w_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let $$=class extends _e{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(cp||Z_e)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new o5;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(n=>w_(this,void 0,void 0,function*(){(!(n instanceof Error)||n.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(n)}))};this.layoutService.hasContainer&&(this._register(ke(this.layoutService.container,"click",e)),this._register(ke(this.layoutService.container,"keydown",e)))}writeText(e,t){return w_(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(r){console.error(r)}const n=document.activeElement,o=document.body.appendChild(He("textarea",{"aria-hidden":!0}));o.style.height="1px",o.style.width="1px",o.style.position="absolute",o.value=e,o.focus(),o.select(),document.execCommand("copy"),n instanceof HTMLElement&&n.focus(),document.body.removeChild(o)})}readText(e){return w_(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 w_(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return w_(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return w_(this,void 0,void 0,function*(){this.resources=e})}readResources(){return w_(this,void 0,void 0,function*(){return this.resources})}};$$=cgt([$ae(0,LS),$ae(1,nc)],$$);const Sp=yn("clipboardService");var dgt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ugt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const IE="data-keybinding-context";class zX{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=="undefined"&&this._parent?this._parent.getValue(e):t}}class Bw extends zX{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Bw.INSTANCE=new Bw;class Ek extends zX{constructor(e,t,n){super(e,null),this._configurationService=t,this._values=Ay.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(o=>{if(o.source===7){const r=Array.from(this._values,([s])=>s);this._values.clear(),n.fire(new Uae(r))}else{const r=[];for(const s of o.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(r.push(...vn.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(r.push(a),this._values.delete(a))}n.fire(new Uae(r))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Ek._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Ek._keyPrefix.length),n=this._configurationService.getValue(t);let o;switch(typeof n){case"number":case"boolean":case"string":o=n;break;default:Array.isArray(n)?o=JSON.stringify(n):o=n}return this._values.set(e,o),o}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}Ek._keyPrefix="config.";class hgt{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue=="undefined"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class zae{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Uae{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 fgt{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 ggt(i,e){return i.allKeysContainedIn(new Set(Object.keys(e)))}class MCe extends _e{constructor(e){super(),this._onDidChangeContext=this._register(new Y0({merge:t=>new fgt(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 hgt(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 pgt(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 n=this.getContextValuesContainer(this._myContextId);!n||n.setValue(e,t)&&this._onDidChangeContext.fire(new zae(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new zae(e))}getContext(e){return this._isDisposed?Bw.INSTANCE:this.getContextValuesContainer(mgt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let z$=class extends MCe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new Ek(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?Bw.INSTANCE:this._contexts.get(e)||Bw.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 zX(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};z$=dgt([ugt(0,En)],z$);class pgt extends MCe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Kr),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(IE)){let n="";this._domNode.classList&&(n=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${n?": "+n:""}`)}this._domNode.setAttribute(IE,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const n=this._parent.getContextValuesContainer(this._myContextId).value;ggt(e,n)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(IE),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Bw.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 mgt(i){for(;i;){if(i.hasAttribute(IE)){const e=i.getAttribute(IE);return e?parseInt(e,10):NaN}i=i.parentElement}return 0}function vgt(i,e,t){i.get(Ut).createKey(String(e),_gt(t))}function _gt(i){return p_e(i,e=>{if(typeof e=="object"&&e.$mid===1)return Rt.revive(e).toString();if(e instanceof Rt)return e.toString()})}Rn.registerCommand("_setContext",vgt);Rn.registerCommand({id:"getContextKeyInfo",handler(){return[...lt.all()].sort((i,e)=>i.key.localeCompare(e.key))},description:{description:C("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Rn.registerCommand("_generateContextKeyInfo",function(){const i=[],e=new Set;for(const t of lt.all())e.has(t.key)||(e.add(t.key),i.push(t));i.sort((t,n)=>t.key.localeCompare(n.key)),console.log(JSON.stringify(i,void 0,2))});class bgt{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class jae{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 n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(t);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new bgt(t,e),this._nodes.set(t,n)),n}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,n]of this._nodes)e.push(`${t} (-> incoming)[${[...n.incoming.keys()].join(", ")}] (outgoing ->)[${[...n.outgoing.keys()].join(",")}] `);return e.join(` -`)}findCycleSlow(){for(const[e,t]of this._nodes){const n=new Set([e]),o=this._findCycle(t,n);if(o)return o}}_findCycle(e,t){for(const[n,o]of e.outgoing){if(t.has(n))return[...t,n].join(" -> ");t.add(n);const r=this._findCycle(o,t);if(r)return r;t.delete(n)}}}const _gt=!1;class jae extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: -${e.toString()}`}}class JP{constructor(e=new E5,t=!1,n,o=_gt){var r;this._services=e,this._strict=t,this._parent=n,this._enableTracing=o,this._activeInstantiations=new Set,this._services.set($t,this),this._globalGraph=o?(r=n==null?void 0:n._globalGraph)!==null&&r!==void 0?r:new Uae(s=>s):void 0}createChild(e){return new JP(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const n=Ia.traceInvocation(this._enableTracing,e);let o=!1;try{return e({get:s=>{if(o)throw Vq("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(s,n);if(!a)throw new Error(`[invokeFunction] unknown service '${s}'`);return a}},...t)}finally{o=!0,n.stop()}}createInstance(e,...t){let n,o;return e instanceof Ih?(n=Ia.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=Ia.traceCreation(this._enableTracing,e),o=this._createInstance(e,t,n)),n.stop(),o}_createInstance(e,t=[],n){const o=Tu.getServiceDependencies(e).sort((a,l)=>a.index-l.index),r=[];for(const a of o){const l=this._getOrCreateServiceInstance(a.id,n);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),r.push(l)}const s=o.length>0?o[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const a=s-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,s)}return Reflect.construct(e,t.concat(r))}_setServiceInstance(e,t){if(this._services.get(e)instanceof Ih)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 n=this._getServiceInstanceOrDescriptor(e);return n instanceof Ih?this._safeCreateAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,t,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,n){var o;const r=new Uae(l=>l.id.toString());let s=0;const a=[{id:e,desc:t,_trace:n}];for(;a.length;){const l=a.pop();if(r.lookupOrInsertNode(l),s++>1e3)throw new jae(r);for(const c of Tu.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(o=this._globalGraph)===null||o===void 0||o.insertEdge(String(l.id),String(c.id)),d instanceof Ih){const u={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};r.insertEdge(l,u),a.push(u)}}}for(;;){const l=r.roots();if(l.length===0){if(!r.isEmpty())throw new jae(r);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Ih){const u=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,u)}r.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],o,r){if(this._services.get(e)instanceof Ih)return this._createServiceInstance(e,t,n,o,r);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,o,r);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,n=[],o,r){if(o){const s=new JP(void 0,this._strict,this,this._enableTracing);s._globalGraphImplicitDependency=String(e);const a=new Map,l=new oM(()=>{const c=s._createInstance(t,n,r);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 oa,a.set(d,f)),(p,v,m)=>{const _=f.push([p,v,m]);return zt(_)}}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,n,r)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Ia{static traceInvocation(e,t){return e?new Ia(2,t.name||new Error().stack.split(` +`)}findCycleSlow(){for(const[e,t]of this._nodes){const n=new Set([e]),o=this._findCycle(t,n);if(o)return o}}_findCycle(e,t){for(const[n,o]of e.outgoing){if(t.has(n))return[...t,n].join(" -> ");t.add(n);const r=this._findCycle(o,t);if(r)return r;t.delete(n)}}}const Cgt=!1;class Kae extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: +${e.toString()}`}}class JP{constructor(e=new D5,t=!1,n,o=Cgt){var r;this._services=e,this._strict=t,this._parent=n,this._enableTracing=o,this._activeInstantiations=new Set,this._services.set($t,this),this._globalGraph=o?(r=n==null?void 0:n._globalGraph)!==null&&r!==void 0?r:new jae(s=>s):void 0}createChild(e){return new JP(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const n=Ia.traceInvocation(this._enableTracing,e);let o=!1;try{return e({get:s=>{if(o)throw Hq("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(s,n);if(!a)throw new Error(`[invokeFunction] unknown service '${s}'`);return a}},...t)}finally{o=!0,n.stop()}}createInstance(e,...t){let n,o;return e instanceof Ih?(n=Ia.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=Ia.traceCreation(this._enableTracing,e),o=this._createInstance(e,t,n)),n.stop(),o}_createInstance(e,t=[],n){const o=Tu.getServiceDependencies(e).sort((a,l)=>a.index-l.index),r=[];for(const a of o){const l=this._getOrCreateServiceInstance(a.id,n);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),r.push(l)}const s=o.length>0?o[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const a=s-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,s)}return Reflect.construct(e,t.concat(r))}_setServiceInstance(e,t){if(this._services.get(e)instanceof Ih)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 n=this._getServiceInstanceOrDescriptor(e);return n instanceof Ih?this._safeCreateAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,t,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,n){var o;const r=new jae(l=>l.id.toString());let s=0;const a=[{id:e,desc:t,_trace:n}];for(;a.length;){const l=a.pop();if(r.lookupOrInsertNode(l),s++>1e3)throw new Kae(r);for(const c of Tu.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(o=this._globalGraph)===null||o===void 0||o.insertEdge(String(l.id),String(c.id)),d instanceof Ih){const u={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};r.insertEdge(l,u),a.push(u)}}}for(;;){const l=r.roots();if(l.length===0){if(!r.isEmpty())throw new Kae(r);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Ih){const u=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,u)}r.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],o,r){if(this._services.get(e)instanceof Ih)return this._createServiceInstance(e,t,n,o,r);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,o,r);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,n=[],o,r){if(o){const s=new JP(void 0,this._strict,this,this._enableTracing);s._globalGraphImplicitDependency=String(e);const a=new Map,l=new oM(()=>{const c=s._createInstance(t,n,r);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 oa,a.set(d,f)),(p,v,m)=>{const _=f.push([p,v,m]);return zt(_)}}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,n,r)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Ia{static traceInvocation(e,t){return e?new Ia(2,t.name||new Error().stack.split(` `).slice(3,4).join(` `)):Ia._None}static traceCreation(e,t){return e?new Ia(1,t.name):Ia._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const n=new Ia(3,e.toString());return this._dep.push([e,t,n]),n}stop(){const e=Date.now()-this._start;Ia._totals+=e;let t=!1;function n(r,s){const a=[],l=new Array(r+1).join(" ");for(const[c,d,u]of s._dep)if(d&&u){t=!0,a.push(`${l}CREATES -> ${c}`);const h=n(r+1,u);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` `)}const o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Ia._totals.toFixed(2)}ms)`];(e>2||t)&&Ia.all.add(o.join(` -`))}}Ia.all=new Set;Ia._None=new class extends Ia{constructor(){super(0,null)}stop(){}branch(){return this}};Ia._totals=0;const bgt=new Set([hn.inMemory,hn.vscodeSourceControl,hn.walkThrough,hn.walkThroughSnippet]);class Cgt{constructor(){this._byResource=new _s,this._byOwner=new Map}set(e,t,n){let o=this._byResource.get(e);o||(o=new Map,this._byResource.set(e,o)),o.set(t,n);let r=this._byOwner.get(t);r||(r=new _s,this._byOwner.set(t,r)),r.set(e,n)}get(e,t){const n=this._byResource.get(e);return n==null?void 0:n.get(t)}delete(e,t){let n=!1,o=!1;const r=this._byResource.get(e);r&&(n=r.delete(t));const s=this._byOwner.get(t);if(s&&(o=s.delete(e)),n!==o)throw new Error("illegal state");return n&&o}values(e){var t,n,o,r;return typeof e=="string"?(n=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&n!==void 0?n:vn.empty():Rt.isUri(e)?(r=(o=this._byResource.get(e))===null||o===void 0?void 0:o.values())!==null&&r!==void 0?r:vn.empty():vn.map(vn.concat(...this._byOwner.values()),s=>s[1])}}class ygt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new _s,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const n=this._data.get(t);n&&this._substract(n);const o=this._resourceStats(t);this._add(o),this._data.set(t,o)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(bgt.has(e.scheme))return t;for(const{severity:n}of this._service.read({resource:e}))n===ao.Error?t.errors+=1:n===ao.Warning?t.warnings+=1:n===ao.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 nm{constructor(){this._onMarkerChanged=new k_e({delay:0,merge:nm._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Cgt,this._stats=new ygt(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(c_e(n))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const o=[];for(const r of n){const s=nm._toMarker(e,t,r);s&&o.push(s)}this._data.set(t,e,o),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:o,severity:r,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}=n;if(!!s)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:o,severity:r,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}}changeAll(e,t){const n=[],o=this._data.values(e);if(o)for(const r of o){const s=vn.first(r);s&&(n.push(s.resource),this._data.delete(s.resource,e))}if(ws(t)){const r=new _s;for(const{resource:s,marker:a}of t){const l=nm._toMarker(e,s,a);if(!l)continue;const c=r.get(s);c?c.push(l):(r.set(s,[l]),n.push(s))}for(const[s,a]of r)this._data.set(s,e,a)}n.length>0&&this._onMarkerChanged.fire(n)}read(e=Object.create(null)){let{owner:t,resource:n,severities:o,take:r}=e;if((!r||r<0)&&(r=-1),t&&n){const s=this._data.get(n,t);if(s){const a=[];for(const l of s)if(nm._accept(l,o)){const c=a.push(l);if(r>0&&c===r)break}return a}else return[]}else if(!t&&!n){const s=[];for(const a of this._data.values())for(const l of a)if(nm._accept(l,o)){const c=s.push(l);if(r>0&&c===r)return s}return s}else{const s=this._data.values(n!=null?n:t),a=[];for(const l of s)for(const c of l)if(nm._accept(c,o)){const d=a.push(c);if(r>0&&d===r)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new _s;for(const n of e)for(const o of n)t.set(o,!0);return Array.from(t.keys())}}class wgt extends _e{constructor(){super(...arguments),this._configurationModel=new ps}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new ps;const e=no.as(ch.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const n=this.getConfigurationDefaultOverrides();for(const o of e){const r=n[o],s=t[o];r!==void 0?this._configurationModel.addValue(o,r):s?this._configurationModel.addValue(o,s.default):this._configurationModel.removeValue(o)}}}const hT=yn("audioCue");class gn{static register(e){return new gn(e.fileName)}constructor(e){this.fileName=e}}gn.error=gn.register({fileName:"error.mp3"});gn.warning=gn.register({fileName:"warning.mp3"});gn.foldedArea=gn.register({fileName:"foldedAreas.mp3"});gn.break=gn.register({fileName:"break.mp3"});gn.quickFixes=gn.register({fileName:"quickFixes.mp3"});gn.taskCompleted=gn.register({fileName:"taskCompleted.mp3"});gn.taskFailed=gn.register({fileName:"taskFailed.mp3"});gn.terminalBell=gn.register({fileName:"terminalBell.mp3"});gn.diffLineInserted=gn.register({fileName:"diffLineInserted.mp3"});gn.diffLineDeleted=gn.register({fileName:"diffLineDeleted.mp3"});gn.diffLineModified=gn.register({fileName:"diffLineModified.mp3"});gn.chatRequestSent=gn.register({fileName:"chatRequestSent.mp3"});gn.chatResponsePending=gn.register({fileName:"chatResponsePending.mp3"});gn.chatResponseReceived1=gn.register({fileName:"chatResponseReceived1.mp3"});gn.chatResponseReceived2=gn.register({fileName:"chatResponseReceived2.mp3"});gn.chatResponseReceived3=gn.register({fileName:"chatResponseReceived3.mp3"});gn.chatResponseReceived4=gn.register({fileName:"chatResponseReceived4.mp3"});class Sgt{constructor(e){this.randomOneOf=e}}class Wn{static register(e){const t=new Sgt("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),n=new Wn(t,e.name,e.settingsKey);return Wn._audioCues.add(n),n}constructor(e,t,n){this.sound=e,this.name=t,this.settingsKey=n}}Wn._audioCues=new Set;Wn.error=Wn.register({name:C("audioCues.lineHasError.name","Error on Line"),sound:gn.error,settingsKey:"audioCues.lineHasError"});Wn.warning=Wn.register({name:C("audioCues.lineHasWarning.name","Warning on Line"),sound:gn.warning,settingsKey:"audioCues.lineHasWarning"});Wn.foldedArea=Wn.register({name:C("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:gn.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});Wn.break=Wn.register({name:C("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:gn.break,settingsKey:"audioCues.lineHasBreakpoint"});Wn.inlineSuggestion=Wn.register({name:C("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:gn.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});Wn.terminalQuickFix=Wn.register({name:C("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:gn.quickFixes,settingsKey:"audioCues.terminalQuickFix"});Wn.onDebugBreak=Wn.register({name:C("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:gn.break,settingsKey:"audioCues.onDebugBreak"});Wn.noInlayHints=Wn.register({name:C("audioCues.noInlayHints","No Inlay Hints on Line"),sound:gn.error,settingsKey:"audioCues.noInlayHints"});Wn.taskCompleted=Wn.register({name:C("audioCues.taskCompleted","Task Completed"),sound:gn.taskCompleted,settingsKey:"audioCues.taskCompleted"});Wn.taskFailed=Wn.register({name:C("audioCues.taskFailed","Task Failed"),sound:gn.taskFailed,settingsKey:"audioCues.taskFailed"});Wn.terminalCommandFailed=Wn.register({name:C("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:gn.error,settingsKey:"audioCues.terminalCommandFailed"});Wn.terminalBell=Wn.register({name:C("audioCues.terminalBell","Terminal Bell"),sound:gn.terminalBell,settingsKey:"audioCues.terminalBell"});Wn.notebookCellCompleted=Wn.register({name:C("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:gn.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});Wn.notebookCellFailed=Wn.register({name:C("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:gn.taskFailed,settingsKey:"audioCues.notebookCellFailed"});Wn.diffLineInserted=Wn.register({name:C("audioCues.diffLineInserted","Diff Line Inserted"),sound:gn.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});Wn.diffLineDeleted=Wn.register({name:C("audioCues.diffLineDeleted","Diff Line Deleted"),sound:gn.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});Wn.diffLineModified=Wn.register({name:C("audioCues.diffLineModified","Diff Line Modified"),sound:gn.diffLineModified,settingsKey:"audioCues.diffLineModified"});Wn.chatRequestSent=Wn.register({name:C("audioCues.chatRequestSent","Chat Request Sent"),sound:gn.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});Wn.chatResponseReceived=Wn.register({name:C("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[gn.chatResponseReceived1,gn.chatResponseReceived2,gn.chatResponseReceived3,gn.chatResponseReceived4]}});Wn.chatResponsePending=Wn.register({name:C("audioCues.chatResponsePending","Chat Response Pending"),sound:gn.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class xgt extends _e{constructor(e,t=[]){super(),this.logger=new iQe([e,...t]),this._register(e.onDidChangeLogLevel(n=>this.setLevel(n)))}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 ACe=[];function X5(i){ACe.push(i)}function Lgt(){return ACe.slice(0)}var n_=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vr=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Wy=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Egt{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new le}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let z$=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new kYe(new Egt(t))):Promise.reject(new Error("Model not found"))}};z$=n_([Vr(0,Yi)],z$);class Y5{show(){return Y5.NULL_PROGRESS_RUNNER}showWhile(e,t){return Wy(this,void 0,void 0,function*(){yield e})}}Y5.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class Dgt{withProgress(e,t,n){return t({report:()=>{}})}}class kgt{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class Igt{confirm(e){return Wy(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let n=e;return t&&(n=n+` +`))}}Ia.all=new Set;Ia._None=new class extends Ia{constructor(){super(0,null)}stop(){}branch(){return this}};Ia._totals=0;const ygt=new Set([hn.inMemory,hn.vscodeSourceControl,hn.walkThrough,hn.walkThroughSnippet]);class wgt{constructor(){this._byResource=new _s,this._byOwner=new Map}set(e,t,n){let o=this._byResource.get(e);o||(o=new Map,this._byResource.set(e,o)),o.set(t,n);let r=this._byOwner.get(t);r||(r=new _s,this._byOwner.set(t,r)),r.set(e,n)}get(e,t){const n=this._byResource.get(e);return n==null?void 0:n.get(t)}delete(e,t){let n=!1,o=!1;const r=this._byResource.get(e);r&&(n=r.delete(t));const s=this._byOwner.get(t);if(s&&(o=s.delete(e)),n!==o)throw new Error("illegal state");return n&&o}values(e){var t,n,o,r;return typeof e=="string"?(n=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&n!==void 0?n:vn.empty():Rt.isUri(e)?(r=(o=this._byResource.get(e))===null||o===void 0?void 0:o.values())!==null&&r!==void 0?r:vn.empty():vn.map(vn.concat(...this._byOwner.values()),s=>s[1])}}class Sgt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new _s,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const n=this._data.get(t);n&&this._substract(n);const o=this._resourceStats(t);this._add(o),this._data.set(t,o)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(ygt.has(e.scheme))return t;for(const{severity:n}of this._service.read({resource:e}))n===ao.Error?t.errors+=1:n===ao.Warning?t.warnings+=1:n===ao.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 im{constructor(){this._onMarkerChanged=new k_e({delay:0,merge:im._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new wgt,this._stats=new Sgt(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(c_e(n))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const o=[];for(const r of n){const s=im._toMarker(e,t,r);s&&o.push(s)}this._data.set(t,e,o),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:o,severity:r,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}=n;if(!!s)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:o,severity:r,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}}changeAll(e,t){const n=[],o=this._data.values(e);if(o)for(const r of o){const s=vn.first(r);s&&(n.push(s.resource),this._data.delete(s.resource,e))}if(ws(t)){const r=new _s;for(const{resource:s,marker:a}of t){const l=im._toMarker(e,s,a);if(!l)continue;const c=r.get(s);c?c.push(l):(r.set(s,[l]),n.push(s))}for(const[s,a]of r)this._data.set(s,e,a)}n.length>0&&this._onMarkerChanged.fire(n)}read(e=Object.create(null)){let{owner:t,resource:n,severities:o,take:r}=e;if((!r||r<0)&&(r=-1),t&&n){const s=this._data.get(n,t);if(s){const a=[];for(const l of s)if(im._accept(l,o)){const c=a.push(l);if(r>0&&c===r)break}return a}else return[]}else if(!t&&!n){const s=[];for(const a of this._data.values())for(const l of a)if(im._accept(l,o)){const c=s.push(l);if(r>0&&c===r)return s}return s}else{const s=this._data.values(n!=null?n:t),a=[];for(const l of s)for(const c of l)if(im._accept(c,o)){const d=a.push(c);if(r>0&&d===r)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new _s;for(const n of e)for(const o of n)t.set(o,!0);return Array.from(t.keys())}}class xgt extends _e{constructor(){super(...arguments),this._configurationModel=new ps}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new ps;const e=no.as(ch.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const n=this.getConfigurationDefaultOverrides();for(const o of e){const r=n[o],s=t[o];r!==void 0?this._configurationModel.addValue(o,r):s?this._configurationModel.addValue(o,s.default):this._configurationModel.removeValue(o)}}}const hT=yn("audioCue");class gn{static register(e){return new gn(e.fileName)}constructor(e){this.fileName=e}}gn.error=gn.register({fileName:"error.mp3"});gn.warning=gn.register({fileName:"warning.mp3"});gn.foldedArea=gn.register({fileName:"foldedAreas.mp3"});gn.break=gn.register({fileName:"break.mp3"});gn.quickFixes=gn.register({fileName:"quickFixes.mp3"});gn.taskCompleted=gn.register({fileName:"taskCompleted.mp3"});gn.taskFailed=gn.register({fileName:"taskFailed.mp3"});gn.terminalBell=gn.register({fileName:"terminalBell.mp3"});gn.diffLineInserted=gn.register({fileName:"diffLineInserted.mp3"});gn.diffLineDeleted=gn.register({fileName:"diffLineDeleted.mp3"});gn.diffLineModified=gn.register({fileName:"diffLineModified.mp3"});gn.chatRequestSent=gn.register({fileName:"chatRequestSent.mp3"});gn.chatResponsePending=gn.register({fileName:"chatResponsePending.mp3"});gn.chatResponseReceived1=gn.register({fileName:"chatResponseReceived1.mp3"});gn.chatResponseReceived2=gn.register({fileName:"chatResponseReceived2.mp3"});gn.chatResponseReceived3=gn.register({fileName:"chatResponseReceived3.mp3"});gn.chatResponseReceived4=gn.register({fileName:"chatResponseReceived4.mp3"});class Lgt{constructor(e){this.randomOneOf=e}}class Wn{static register(e){const t=new Lgt("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),n=new Wn(t,e.name,e.settingsKey);return Wn._audioCues.add(n),n}constructor(e,t,n){this.sound=e,this.name=t,this.settingsKey=n}}Wn._audioCues=new Set;Wn.error=Wn.register({name:C("audioCues.lineHasError.name","Error on Line"),sound:gn.error,settingsKey:"audioCues.lineHasError"});Wn.warning=Wn.register({name:C("audioCues.lineHasWarning.name","Warning on Line"),sound:gn.warning,settingsKey:"audioCues.lineHasWarning"});Wn.foldedArea=Wn.register({name:C("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:gn.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});Wn.break=Wn.register({name:C("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:gn.break,settingsKey:"audioCues.lineHasBreakpoint"});Wn.inlineSuggestion=Wn.register({name:C("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:gn.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});Wn.terminalQuickFix=Wn.register({name:C("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:gn.quickFixes,settingsKey:"audioCues.terminalQuickFix"});Wn.onDebugBreak=Wn.register({name:C("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:gn.break,settingsKey:"audioCues.onDebugBreak"});Wn.noInlayHints=Wn.register({name:C("audioCues.noInlayHints","No Inlay Hints on Line"),sound:gn.error,settingsKey:"audioCues.noInlayHints"});Wn.taskCompleted=Wn.register({name:C("audioCues.taskCompleted","Task Completed"),sound:gn.taskCompleted,settingsKey:"audioCues.taskCompleted"});Wn.taskFailed=Wn.register({name:C("audioCues.taskFailed","Task Failed"),sound:gn.taskFailed,settingsKey:"audioCues.taskFailed"});Wn.terminalCommandFailed=Wn.register({name:C("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:gn.error,settingsKey:"audioCues.terminalCommandFailed"});Wn.terminalBell=Wn.register({name:C("audioCues.terminalBell","Terminal Bell"),sound:gn.terminalBell,settingsKey:"audioCues.terminalBell"});Wn.notebookCellCompleted=Wn.register({name:C("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:gn.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});Wn.notebookCellFailed=Wn.register({name:C("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:gn.taskFailed,settingsKey:"audioCues.notebookCellFailed"});Wn.diffLineInserted=Wn.register({name:C("audioCues.diffLineInserted","Diff Line Inserted"),sound:gn.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});Wn.diffLineDeleted=Wn.register({name:C("audioCues.diffLineDeleted","Diff Line Deleted"),sound:gn.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});Wn.diffLineModified=Wn.register({name:C("audioCues.diffLineModified","Diff Line Modified"),sound:gn.diffLineModified,settingsKey:"audioCues.diffLineModified"});Wn.chatRequestSent=Wn.register({name:C("audioCues.chatRequestSent","Chat Request Sent"),sound:gn.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});Wn.chatResponseReceived=Wn.register({name:C("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[gn.chatResponseReceived1,gn.chatResponseReceived2,gn.chatResponseReceived3,gn.chatResponseReceived4]}});Wn.chatResponsePending=Wn.register({name:C("audioCues.chatResponsePending","Chat Response Pending"),sound:gn.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class Egt extends _e{constructor(e,t=[]){super(),this.logger=new rQe([e,...t]),this._register(e.onDidChangeLogLevel(n=>this.setLevel(n)))}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 ACe=[];function Y5(i){ACe.push(i)}function Dgt(){return ACe.slice(0)}var n_=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vr=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Wy=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class kgt{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new le}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let U$=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new TYe(new kgt(t))):Promise.reject(new Error("Model not found"))}};U$=n_([Vr(0,Yi)],U$);class Z5{show(){return Z5.NULL_PROGRESS_RUNNER}showWhile(e,t){return Wy(this,void 0,void 0,function*(){yield e})}}Z5.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class Igt{withProgress(e,t,n){return t({report:()=>{}})}}class Tgt{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class Ngt{confirm(e){return Wy(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let n=e;return t&&(n=n+` -`+t),window.confirm(n)}prompt(e){var t,n;return Wy(this,void 0,void 0,function*(){let o;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),o=yield(n=s[0])===null||n===void 0?void 0:n.run({checkboxChecked:!1})}return{result:o}})}error(e,t){return Wy(this,void 0,void 0,function*(){yield this.prompt({type:So.Error,message:e,detail:t})})}}class Dk{info(e){return this.notify({severity:So.Info,message:e})}warn(e){return this.notify({severity:So.Warning,message:e})}error(e){return this.notify({severity:So.Error,message:e})}notify(e){switch(e.severity){case So.Error:console.error(e.message);break;case So.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Dk.NO_OP}prompt(e,t,n,o){return Dk.NO_OP}status(e,t){return _e.None}}Dk.NO_OP=new Mlt;let U$=class{constructor(e){this._onWillExecuteCommand=new le,this._onDidExecuteCommand=new le,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=Rn.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const o=this._instantiationService.invokeFunction.apply(this._instantiationService,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(o)}catch(o){return Promise.reject(o)}}};U$=n_([Vr(0,$t)],U$);let Ww=class extends Hct{constructor(e,t,n,o,r,s){super(e,t,n,o,r),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new Be;g.add(ke(f,et.KEY_DOWN,p=>{const v=new Pi(p);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),g.add(ke(f,et.KEY_UP,p=>{const v=new Pi(p);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new Tgt(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(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(d)),s.listCodeEditors().forEach(c);const u=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(u)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,n,o){return Td(Rn.registerCommand(e,n),this.addDynamicKeybindings([{keybinding:t,command:e,when:o}]))}addDynamicKeybindings(e){const t=e.map(n=>{var o;return{keybinding:qV(n.keybinding,Vl),command:(o=n.command)!==null&&o!==void 0?o:null,commandArgs:n.commandArgs,when:n.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),zt(()=>{for(let n=0;nthis._log(n))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let o=0;for(const r of e){const s=r.when||void 0,a=r.keybinding;if(!a)n[o++]=new nae(void 0,r.command,r.commandArgs,s,t,null,!1);else{const l=fk.resolveKeybinding(a,Vl);for(const c of l)n[o++]=new nae(c,r.command,r.commandArgs,s,t,null,!1)}}return n}resolveKeyboardEvent(e){const t=new cp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new fk([t],Vl)}};Ww=n_([Vr(0,Ut),Vr(1,_o),Vr(2,tc),Vr(3,Ao),Vr(4,nc),Vr(5,Jn)],Ww);class Tgt extends _e{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Kae(i){return i&&typeof i=="object"&&(!i.overrideIdentifier||typeof i.overrideIdentifier=="string")&&(!i.resource||i.resource instanceof Rt)}class PCe{constructor(){this._onDidChangeConfiguration=new le,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new wgt;this._configuration=new T5(e.reload(),new ps,new ps,new ps),e.dispose()}getValue(e,t){const n=typeof e=="string"?e:void 0,o=Kae(e)?e:Kae(t)?t:{};return this._configuration.getValue(n,o,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const o of e){const[r,s]=o;this.getValue(r)!==s&&(this._configuration.updateValue(r,s),n.push(r))}if(n.length>0){const o=new Fct({keys:n,overrides:[]},t,this._configuration);o.source=8,o.sourceConfig=null,this._onDidChangeConfiguration.fire(o)}return Promise.resolve()}updateValue(e,t,n,o){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let j$=class{constructor(e,t,n){this.configurationService=e,this.modelService=t,this.languageService=n,this._onDidChangeConfiguration=new le,this.configurationService.onDidChangeConfiguration(o=>{this._onDidChangeConfiguration.fire({affectedKeys:o.affectedKeys,affectsConfiguration:(r,s)=>o.affectsConfiguration(s)})})}getValue(e,t,n){const o=ae.isIPosition(t)?t:null,r=o?typeof n=="string"?n:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,o):void 0;return typeof r=="undefined"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(r,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const n=this.modelService.getModel(e);return n?t?n.getLanguageIdAtPosition(t.lineNumber,t.column):n.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};j$=n_([Vr(0,En),Vr(1,Yi),Vr(2,Ki)],j$);let K$=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&typeof n=="string"&&n!=="auto"?n:xs||Nn?` +`+t),window.confirm(n)}prompt(e){var t,n;return Wy(this,void 0,void 0,function*(){let o;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),o=yield(n=s[0])===null||n===void 0?void 0:n.run({checkboxChecked:!1})}return{result:o}})}error(e,t){return Wy(this,void 0,void 0,function*(){yield this.prompt({type:So.Error,message:e,detail:t})})}}class Dk{info(e){return this.notify({severity:So.Info,message:e})}warn(e){return this.notify({severity:So.Warning,message:e})}error(e){return this.notify({severity:So.Error,message:e})}notify(e){switch(e.severity){case So.Error:console.error(e.message);break;case So.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Dk.NO_OP}prompt(e,t,n,o){return Dk.NO_OP}status(e,t){return _e.None}}Dk.NO_OP=new Plt;let j$=class{constructor(e){this._onWillExecuteCommand=new le,this._onDidExecuteCommand=new le,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=Rn.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const o=this._instantiationService.invokeFunction.apply(this._instantiationService,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(o)}catch(o){return Promise.reject(o)}}};j$=n_([Vr(0,$t)],j$);let Ww=class extends zct{constructor(e,t,n,o,r,s){super(e,t,n,o,r),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new Be;g.add(ke(f,et.KEY_DOWN,p=>{const v=new Pi(p);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),g.add(ke(f,et.KEY_UP,p=>{const v=new Pi(p);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new Rgt(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(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(d)),s.listCodeEditors().forEach(c);const u=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(u)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,n,o){return Td(Rn.registerCommand(e,n),this.addDynamicKeybindings([{keybinding:t,command:e,when:o}]))}addDynamicKeybindings(e){const t=e.map(n=>{var o;return{keybinding:GV(n.keybinding,Vl),command:(o=n.command)!==null&&o!==void 0?o:null,commandArgs:n.commandArgs,when:n.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),zt(()=>{for(let n=0;nthis._log(n))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let o=0;for(const r of e){const s=r.when||void 0,a=r.keybinding;if(!a)n[o++]=new iae(void 0,r.command,r.commandArgs,s,t,null,!1);else{const l=fk.resolveKeybinding(a,Vl);for(const c of l)n[o++]=new iae(c,r.command,r.commandArgs,s,t,null,!1)}}return n}resolveKeyboardEvent(e){const t=new dp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new fk([t],Vl)}};Ww=n_([Vr(0,Ut),Vr(1,_o),Vr(2,tc),Vr(3,Ao),Vr(4,nc),Vr(5,Jn)],Ww);class Rgt extends _e{constructor(e,t){super(),this.domNode=e,this._register(t)}}function qae(i){return i&&typeof i=="object"&&(!i.overrideIdentifier||typeof i.overrideIdentifier=="string")&&(!i.resource||i.resource instanceof Rt)}class PCe{constructor(){this._onDidChangeConfiguration=new le,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new xgt;this._configuration=new N5(e.reload(),new ps,new ps,new ps),e.dispose()}getValue(e,t){const n=typeof e=="string"?e:void 0,o=qae(e)?e:qae(t)?t:{};return this._configuration.getValue(n,o,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const o of e){const[r,s]=o;this.getValue(r)!==s&&(this._configuration.updateValue(r,s),n.push(r))}if(n.length>0){const o=new Wct({keys:n,overrides:[]},t,this._configuration);o.source=8,o.sourceConfig=null,this._onDidChangeConfiguration.fire(o)}return Promise.resolve()}updateValue(e,t,n,o){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let K$=class{constructor(e,t,n){this.configurationService=e,this.modelService=t,this.languageService=n,this._onDidChangeConfiguration=new le,this.configurationService.onDidChangeConfiguration(o=>{this._onDidChangeConfiguration.fire({affectedKeys:o.affectedKeys,affectsConfiguration:(r,s)=>o.affectsConfiguration(s)})})}getValue(e,t,n){const o=ae.isIPosition(t)?t:null,r=o?typeof n=="string"?n:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,o):void 0;return typeof r=="undefined"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(r,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const n=this.modelService.getModel(e);return n?t?n.getLanguageIdAtPosition(t.lineNumber,t.column):n.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};K$=n_([Vr(0,En),Vr(1,Yi),Vr(2,Ki)],K$);let q$=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&typeof n=="string"&&n!=="auto"?n:xs||Nn?` `:`\r -`}};K$=n_([Vr(0,En)],K$);class Ngt{publicLog2(){}}class kk{constructor(){const e=Rt.from({scheme:kk.SCHEME,authority:"model",path:"/"});this.workspace={id:E1e,folders:[new ndt({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===kk.SCHEME?this.workspace.folders[0]:null}}kk.SCHEME="inmemory";function eO(i,e,t){if(!e||!(i instanceof PCe))return;const n=[];Object.keys(e).forEach(o=>{Rct(o)&&n.push([`editor.${o}`,e[o]]),t&&Mct(o)&&n.push([`diffEditor.${o}`,e[o]])}),n.length>0&&i.updateValues(n)}let q$=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return Wy(this,void 0,void 0,function*(){const n=Array.isArray(e)?e:sX.convert(e),o=new Map;for(const a of n){if(!(a instanceof Gg))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=o.get(l);c||(c=[],o.set(l,c)),c.push(Gi.replaceMove(V.lift(a.textEdit.range),a.textEdit.text))}let r=0,s=0;for(const[a,l]of o)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,r+=l.length;return{ariaSummary:Z0(ZH.bulkEditServiceSummary,r,s),isApplied:r>0}})}};q$=n_([Vr(0,Yi)],q$);class Rgt{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return $c(e)}}let G$=class extends QH{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const o=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();o&&(t=o.getContainerDomNode())}return super.showContextView(e,t,n)}};G$=n_([Vr(0,LS),Vr(1,Jn)],G$);class Mgt{constructor(){this._neverEmitter=new le,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class Agt extends mk{constructor(){super()}}class Pgt extends xgt{constructor(){super(new nQe)}}let X$=class extends m${constructor(e,t,n,o,r,s){super(e,t,n,o,r,s),this.configure({blockMouse:!1})}};X$=n_([Vr(0,tc),Vr(1,Ao),Vr(2,bp),Vr(3,xi),Vr(4,If),Vr(5,Ut)],X$);class Ogt{playAudioCue(e,t){return Wy(this,void 0,void 0,function*(){})}}Mn(En,PCe,0);Mn(pG,j$,0);Mn(X0e,K$,0);Mn(rb,kk,0);Mn(Rw,Rgt,0);Mn(tc,Ngt,0);Mn(iT,Igt,0);Mn(iX,kgt,0);Mn(Ao,Dk,0);Mn(Rf,nm,0);Mn(Ki,Agt,0);Mn(ic,ogt,0);Mn(nc,Pgt,0);Mn(Yi,UP,0);Mn(yG,y$,0);Mn(Ut,$$,0);Mn(L1e,Dgt,0);Mn(t_,Y5,0);Mn(Gd,Uut,0);Mn(Xd,lH,0);Mn(oT,q$,0);Mn(D1e,Mgt,0);Mn(za,z$,0);Mn(_p,F$,0);Mn(Xc,sft,0);Mn(_o,U$,0);Mn(xi,Ww,0);Mn(dh,P$,0);Mn(bp,G$,0);Mn(ml,C$,0);Mn(wp,H$,0);Mn(Kd,X$,0);Mn(If,B$,0);Mn(hT,Ogt,0);var Vt;(function(i){const e=new E5;for(const[l,c]of $oe())e.set(l,c);const t=new JP(e,!0);e.set($t,t);function n(l){o||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Ih?t.invokeFunction(d=>d.get(l)):c}i.get=n;let o=!1;const r=new le;function s(l){if(o)return t;o=!0;for(const[d,u]of $oe())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=yn(d);e.get(u)instanceof Ih&&e.set(u,l[d])}const c=Lgt();for(const d of c)try{t.createInstance(d)}catch(u){en(u)}return r.fire(),t}i.initialize=s;function a(l){if(o)return l();const c=new Be,d=c.add(r.event(()=>{d.dispose(),c.add(l())}));return c}i.withServices=a})(Vt||(Vt={}));let Fgt;function Yg(){return Fgt}let OCe;function Bgt(i){OCe=i}class FCe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const n=t===void 0?void 0:e,o=t===void 0?e:t;return OCe({owner:n,debugName:()=>{const r=Zb(o);if(r!==void 0)return r;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(o.toString());if(a)return`${this.debugName}.${a[2]}`;if(!n)return`${this.debugName} (mapped)`}},r=>o(this.read(r),r))}}class fT extends FCe{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 qi(i,e){const t=new BCe(i,e);try{i(t)}finally{t.finish()}}function Y$(i,e,t){i?e(i):qi(e,t)}class BCe{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(n=Yg())===null||n===void 0||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Zb(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:n,observable:o}of t)n.endUpdate(o);(e=Yg())===null||e===void 0||e.handleEndTransaction()}}function zX(i,e,t,n){let o;if(i!==void 0)if(typeof i=="function"){if(o=i(),o!==void 0)return o}else return i;if(e!==void 0&&(o=Zb(e),o!==void 0))return o;if(t!==void 0){for(const r in t)if(t[r]===n)return r}}function Zb(i){const e=i.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),o=n?n[1]:void 0;return o==null?void 0:o.trim()}function Ai(i,e){return typeof i=="string"?new Z$(void 0,i,e):new Z$(i,void 0,e)}class Z$ extends fT{get debugName(){var e;return(e=zX(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,n){super(),this._owner=e,this._debugName=t,this._value=n}get(){return this._value}set(e,t,n){var o;if(this._value===e)return;let r;t||(t=r=new BCe(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(o=Yg())===null||o===void 0||o.handleObservableChanged(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,n)}finally{r&&r.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function tO(i,e){return typeof i=="string"?new qae(void 0,i,e):new qae(i,void 0,e)}class qae extends Z${_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 Ik=(i,e)=>i===e;function In(i,e){return e!==void 0?new Nk(i,void 0,e,void 0,void 0,void 0,Ik):new Nk(void 0,void 0,i,void 0,void 0,void 0,Ik)}function Gae(i,e){var t;return new Nk(i.owner,i.debugName,e,void 0,void 0,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Ik)}function Wgt(i,e){var t;return new Nk(i.owner,i.debugName,e,i.createEmptyChangeSummary,i.handleChange,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Ik)}function Tk(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const o=new Be;return new Nk(n,()=>{var r;return(r=Zb(t))!==null&&r!==void 0?r:"(anonymous)"},r=>(o.clear(),t(r,o)),void 0,void 0,()=>o.dispose(),Ik)}Bgt(In);class Nk extends fT{get debugName(){var e;return(e=zX(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,o,r,s=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=n,this.createChangeSummary=o,this._handleChange=r,this._handleLastObserverRemoved=s,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=Yg())===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 n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n;const o=this.state!==0,r=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=o&&!this._equalityComparator(r,this.value);if((t=Yg())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:r,newValue:this.value,change:void 0,didChange:a,hadValue:o}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const n of this.observers)n.handlePossibleChange(this);if(t)for(const n of this.observers)n.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const n of t)n.endUpdate(this)}if(this.updateCount<0)throw new Vo}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 n=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:r=>r===e},this.changeSummary):!0,o=this.state===3;if(n&&(this.state===1||o)&&(this.state=2,o))for(const r of this.observers)r.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 UX(i,e){return new Q5(i.debugName,e,void 0,void 0)}function Ii(i){return new Q5(void 0,i,void 0,void 0)}function Z5(i,e){return new Q5(i.debugName,e,i.createEmptyChangeSummary,i.handleChange)}function Ja(i){const e=new Be,t=UX({debugName:()=>Zb(i)||"(anonymous)"},n=>{e.clear(),i(n,e)});return zt(()=>{t.dispose(),e.dispose()})}class Q5{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=Zb(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,n,o){var r,s;this._debugName=e,this._runFn=t,this.createChangeSummary=n,this._handleChange=o,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(r=this.createChangeSummary)===null||r===void 0?void 0:r.call(this),(s=Yg())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,n;if(this.state===3)return;const o=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=o,this.state=3;try{if(!this.disposed){(e=Yg())===null||e===void 0||e.handleAutorunTriggered(this);const r=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,r)}}finally{(n=Yg())===null||n===void 0||n.handleAutorunFinished(this);for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,FD(()=>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:o=>o===e},this.changeSummary):!0)&&(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(i){i.Observer=Q5})(Ii||(Ii={}));function nO(i){return new Vgt(i)}class Vgt extends FCe{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Hgt(i,e){return new Promise(t=>{let n=!1,o=!1;const r=Ii(s=>{const a=i.read(s);e(a)&&(n?r.dispose():o=!0,t(a))});n=!0,o&&r.dispose()})}function $r(i,e){return new WCe(i,e)}class WCe extends fT{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=n=>{var o;const r=this._getValue(n),s=!this.hasValue||this.value!==r;(o=Yg())===null||o===void 0||o.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:r,change:void 0,didChange:s,hadValue:this.hasValue}),s&&(this.value=r,this.hasValue&&qi(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return Zb(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(i){i.Observer=WCe})($r||($r={}));function Fl(i,e){return new $gt(i,e)}class $gt extends fT{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{qi(n=>{for(const o of this.observers)n.updateObserver(o,this),o.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function VCe(i){return typeof i=="string"?new Xae(i):new Xae(void 0,i)}class Xae extends fT{get debugName(){var e;return(e=zX(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){qi(n=>{this.trigger(n,t)},()=>`Trigger signal ${this.debugName}`);return}for(const n of this.observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}}function Rk(i){const e=new zgt(!0);return i.addObserver(e),i.reportChanges(),zt(()=>{i.removeObserver(e)})}class zgt{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 HCe(){return!!N_e.VSCODE_DEV}function Ugt(i){if(HCe()){const e=jgt();return e.add(i),{dispose(){e.delete(i)}}}else return{dispose(){}}}function jgt(){z2||(z2=new Set);const i=globalThis;return i.$hotReload_applyNewExports||(i.$hotReload_applyNewExports=e=>{for(const t of z2){const n=t(e);if(n)return n}}),z2}let z2;function Kgt(i,e,t,n){if(i.length===0)return e;if(e.length===0)return i;const o=[];let r=0,s=0;for(;rd?(o.push(l),s++):(o.push(n(a,l)),r++,s++)}for(;r`Apply decorations from ${e.debugName}`},o=>{const r=e.read(o);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function U2(i,e){return i.appendChild(e),zt(()=>{i.removeChild(e)})}class qgt extends _e{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new nbe(e,t)),this._width=Ai(this,this.elementSizeObserver.getWidth()),this._height=Ai(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>qi(o=>{this._width.set(this.elementSizeObserver.getWidth(),o),this._height.set(this.elementSizeObserver.getHeight(),o)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Yae(i,e){let t=i.get(),n=t,o=t;const r=Ai("animatedValue",t);let s=-1;const a=300;let l;e.add(Z5({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,u)=>(d.didChange(i)&&(u.animate=u.animate||d.change),!0)},(d,u)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),n=o,t=i.read(d),s=Date.now()-(u.animate?0:a),c()}));function c(){const d=Date.now()-s;o=Math.floor(Ggt(d,n,t-n,a)),d{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}class J5{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${J5._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}J5._counter=0;function nv(i,e){return Ii(t=>{for(let[n,o]of Object.entries(e))o&&typeof o=="object"&&"read"in o&&(o=o.read(t)),typeof o=="number"&&(o=`${o}px`),n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),i.style[n]=o})}function im(i,e){return Xgt([i],e),i}function Xgt(i,e){HCe()&&Fl("reload",n=>Ugt(o=>{if(!![...Object.values(o)].some(r=>i.includes(r)))return r=>(n(void 0),!0)})).read(e)}function rO(i,e,t){const n=new Be,o=[];return n.add(Ii(r=>{const s=e.read(r),a=new Map,l=new Map;t&&t(!0),i.changeViewZones(c=>{for(const d of o)c.removeZone(d);o.length=0;for(const d of s){const u=c.addZone(d);o.push(u),a.set(d,u)}}),t&&t(!1),n.add(Z5({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 s)u.onChange&&(l.set(u.onChange,a.get(u)),u.onChange.read(c));t&&t(!0),i.changeViewZones(u=>{for(const h of d)u.layoutZone(h)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),i.changeViewZones(r=>{for(const s of o)r.removeZone(s)}),t&&t(!1)}}),n}class Ygt extends Ro{dispose(){super.dispose(!0)}}var jX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},KX=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Zgt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Qgt=Eo("diff-review-insert",Xe.add,C("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),Jgt=Eo("diff-review-remove",Xe.remove,C("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),ept=Eo("diff-review-close",Xe.close,C("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let Tm=class extends _e{constructor(e,t,n,o,r,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=o,this._width=r,this._height=s,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=Tk(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(Q$,this._diffs,this._editors,this._setVisible,this._canClose)),g=u.add(this._instantiationService.createInstance(J$,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(Rk(this.model))}next(){qi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){qi(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){qi(e=>{this._setVisible(!1,e)})}};Tm._ttPolicy=vp("diffReview",{createHTML:i=>i});Tm=jX([KX(8,$t)],Tm);let Q$=class extends _e{constructor(e,t,n,o,r){super(),this._diffs=e,this._editors=t,this._setVisible=n,this.canClose=o,this._audioCueService=r,this._groups=Ai(this,[]),this._currentGroupIdx=Ai(this,0),this._currentElementIdx=Ai(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(Ii(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=tpt(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());qi(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(s);(a==null?void 0:a.type)===ea.Deleted?this._audioCueService.playAudioCue(Wn.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ea.Added&&this._audioCueService.playAudioCue(Wn.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ii(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==ea.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(V.fromPositions(new ae(c,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||Y$(t,o=>{this._currentGroupIdx.set(Cn.ofLength(n.length).clipCyclic(this._currentGroupIdx.get()+e),o),this._currentElementIdx.set(0,o)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||qi(n=>{this._currentElementIdx.set(Cn.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&qi(o=>{this._currentElementIdx.set(n,o)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ea.Deleted?(this._editors.original.setSelection(V.fromPositions(new ae(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==ea.Header&&(this._editors.modified.setSelection(V.fromPositions(new ae(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};Q$=jX([KX(4,hT)],Q$);const qx=3;function tpt(i,e,t){const n=[];for(const o of a_e(i,(r,s)=>s.modified.startLineNumber-r.modified.endLineNumberExclusive<2*qx)){const r=[];r.push(new ipt);const s=new ln(Math.max(1,o[0].original.startLineNumber-qx),Math.min(o[o.length-1].original.endLineNumberExclusive+qx,e+1)),a=new ln(Math.max(1,o[0].modified.startLineNumber-qx),Math.min(o[o.length-1].modified.endLineNumberExclusive+qx,t+1));l_e(o,(d,u)=>{const h=new ln(d?d.original.endLineNumberExclusive:s.startLineNumber,u?u.original.startLineNumber:s.endLineNumberExclusive),f=new ln(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{r.push(new spt(g,f.startLineNumber+(g-h.startLineNumber)))}),u&&(u.original.forEach(g=>{r.push(new opt(u,g))}),u.modified.forEach(g=>{r.push(new rpt(u,g))}))});const l=o[0].modified.join(o[o.length-1].modified),c=o[0].original.join(o[o.length-1].original);n.push(new npt(new mf(l,c),r))}return n}var ea;(function(i){i[i.Header=0]="Header",i[i.Unchanged=1]="Unchanged",i[i.Deleted=2]="Deleted",i[i.Added=3]="Added"})(ea||(ea={}));class npt{constructor(e,t){this.range=e,this.lines=t}}class ipt{constructor(){this.type=ea.Header}}class opt{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ea.Deleted,this.modifiedLineNumber=void 0}}class rpt{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ea.Added,this.originalLineNumber=void 0}}class spt{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ea.Unchanged}}let J$=class extends _e{constructor(e,t,n,o,r,s){super(),this._element=e,this._model=t,this._width=n,this._height=o,this._editors=r,this._languageService=s,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 zc(a)),this._register(Ii(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new ca("diffreview.close",C("label.close","Close"),"close-diff-review "+Mt.asClassName(ept),!0,()=>Zgt(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 QI(this._content,{})),jr(this.domNode,this._scrollbar.getDomNode(),a),this._register(zt(()=>{jr(this.domNode)})),this._register(nv(this.domNode,{width:this._width,height:this._height})),this._register(nv(this._content,{width:this._width,height:this._height})),this._register(Ja((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(No(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(),n=this._editors.modified.getOptions(),o=document.createElement("div");o.className="diff-review-table",o.setAttribute("role","list"),o.setAttribute("aria-label",C("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),ss(o,n.get(50)),jr(this._content,o);const r=this._editors.original.getModel(),s=this._editors.modified.getModel();if(!r||!s)return;const a=r.getOptions(),l=s.getOptions(),c=n.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===ea.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,v=this._model.currentGroupIndex.get(),m=this._model.groups.get().length,_=D=>D===0?C("no_lines_changed","no lines changed"):D===1?C("one_line_changed","1 line changed"):C("more_lines_changed","{0} lines changed",D),y=_(p.original.length),w=_(p.modified.length);g.setAttribute("aria-label",C({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}",v+1,m,p.original.startLineNumber,y,p.modified.startLineNumber,w));const L=document.createElement("div");L.className="diff-review-cell diff-review-summary",L.appendChild(document.createTextNode(`${v+1}/${m}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(L),h=g}else h=this._createRow(u,c,this._width.get(),t,r,a,n,s,l);o.appendChild(h);const f=In(g=>this._model.currentElement.read(g)===u);e.add(Ii(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(ke(h,"focus",()=>{this._model.goToLine(u)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,o,r,s,a,l,c){const d=o.get(143),u=d.glyphMarginWidth+d.lineNumbersWidth,h=a.get(143),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const v="diff-review-spacer";let m=null;switch(e.type){case ea.Added:g="diff-review-row line-insert",p=" char-insert",m=Qgt;break;case ea.Deleted:g="diff-review-row line-delete",p=" char-delete",m=Jgt;break}const _=document.createElement("div");_.style.minWidth=n+"px",_.className=g,_.setAttribute("role","listitem"),_.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,_.appendChild(y);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="\xA0",y.appendChild(w);const L=document.createElement("span");L.style.width=f+"px",L.style.minWidth=f+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?L.appendChild(document.createTextNode(String(e.modifiedLineNumber))):L.innerText="\xA0",y.appendChild(L);const D=document.createElement("span");if(D.className=v,m){const k=document.createElement("span");k.className=Mt.asClassName(m),k.innerText="\xA0\xA0",D.appendChild(k)}else D.innerText="\xA0\xA0";y.appendChild(D);let E;if(e.modifiedLineNumber!==void 0){let k=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Tm._ttPolicy&&(k=Tm._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),E=l.getLineContent(e.modifiedLineNumber)}else{let k=this._getLineHtml(r,o,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Tm._ttPolicy&&(k=Tm._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),E=r.getLineContent(e.originalLineNumber)}E.length===0&&(E=C("blankLine","blank"));let I="";switch(e.type){case ea.Unchanged:e.originalLineNumber===e.modifiedLineNumber?I=C({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",E,e.originalLineNumber):I=C("equalLine","{0} original line {1} modified line {2}",E,e.originalLineNumber,e.modifiedLineNumber);break;case ea.Added:I=C("insertLine","+ {0} modified line {1}",E,e.modifiedLineNumber);break;case ea.Deleted:I=C("deleteLine","- {0} original line {1}",E,e.originalLineNumber);break}return _.setAttribute("aria-label",I),_}_getLineHtml(e,t,n,o,r){const s=e.getLineContent(o),a=t.get(50),l=pr.createEmpty(s,r),c=Zl.isBasicASCII(s,e.mightContainNonBasicASCII()),d=Zl.containsRTL(s,c,e.mightContainRTL());return f5(new Jv(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,d,0,l,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==Pl.OFF,null)).html}};J$=jX([KX(5,Ki)],J$);const apt=Eo("diff-insert",Xe.add,C("diffInsertIcon","Line decoration for inserts in the diff editor.")),zCe=Eo("diff-remove",Xe.remove,C("diffRemoveIcon","Line decoration for removals in the diff editor.")),Zae=Jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Mt.asClassName(apt),marginClassName:"gutter-insert"}),Qae=Jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Mt.asClassName(zCe),marginClassName:"gutter-delete"}),Jae=Jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),ele=Jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),tle=Jt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),lpt=Jt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),cpt=Jt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),ez=Jt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),dpt=Jt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),upt=Jt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),hpt=Jt.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new os(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(C("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+Mt.asClassName(Xe.arrowRight),zIndex:10001});class iv extends _e{constructor(e,t,n,o,r){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=o,this._editors=r,this._originalScrollTop=$r(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Fl("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Ai(this,0),this._modifiedViewZonesChangedSignal=Fl("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Fl("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Tk((h,f)=>{var g;this._element.replaceChildren();const p=this._diffModel.read(h),v=(g=p==null?void 0:p.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!v||v.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const m=this._originalEditorLayoutInfo.read(h),_=this._modifiedEditorLayoutInfo.read(h);if(!m||!_){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const y=v.map(R=>{function A(K,j){const G=j.getTopForLineNumber(K.startLineNumber,!0),X=j.getTopForLineNumber(K.endLineNumberExclusive,!0);return(G+X)/2}const P=A(R.lineRangeMapping.original,this._editors.original),N=this._originalScrollTop.read(h),M=A(R.lineRangeMapping.modified,this._editors.modified),H=this._modifiedScrollTop.read(h),B=P-N,F=M-H,$=Math.min(P,M),z=Math.max(P,M);return{range:new Cn($,z),from:B,to:F,fromWithoutScroll:P,toWithoutScroll:M,move:R}});y.sort(gXe(Rc(R=>R.fromWithoutScroll>R.toWithoutScroll,pXe),Rc(R=>R.fromWithoutScroll>R.toWithoutScroll?R.fromWithoutScroll:-R.toWithoutScroll,jg)));const w=qX.compute(y.map(R=>R.range)),L=10,D=m.verticalScrollbarWidth,E=(w.getTrackCount()-1)*10+L*2,I=D+E+(_.contentLeft-iv.movedCodeBlockPadding);let k=0;for(const R of y){const A=w.getTrack(k),P=D+L+A*10,N=15,M=15,H=I,B=_.glyphMarginWidth+_.lineNumbersWidth,F=18,$=document.createElementNS("http://www.w3.org/2000/svg","rect");$.classList.add("arrow-rectangle"),$.setAttribute("x",`${H-B}`),$.setAttribute("y",`${R.to-F/2}`),$.setAttribute("width",`${B}`),$.setAttribute("height",`${F}`),this._element.appendChild($);const z=document.createElementNS("http://www.w3.org/2000/svg","g"),K=document.createElementNS("http://www.w3.org/2000/svg","path");K.setAttribute("d",`M ${0} ${R.from} L ${P} ${R.from} L ${P} ${R.to} L ${H-M} ${R.to}`),K.setAttribute("fill","none"),z.appendChild(K);const j=document.createElementNS("http://www.w3.org/2000/svg","polygon");j.classList.add("arrow"),f.add(Ii(G=>{K.classList.toggle("currentMove",R.move===p.activeMovedText.read(G)),j.classList.toggle("currentMove",R.move===p.activeMovedText.read(G))})),j.setAttribute("points",`${H-M},${R.to-N/2} ${H},${R.to} ${H-M},${R.to+N/2}`),z.appendChild(j),this._element.appendChild(z),k++}this.width.set(E,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(zt(()=>this._element.remove())),this._register(Ii(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-iv.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(Rk(this._state));const s=In(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 oO(nO(p.lineRangeMapping.original.startLineNumber-1),18),modified:new oO(nO(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(rO(this._editors.original,s.map(h=>h.map(f=>f.original)))),this._register(rO(this._editors.modified,s.map(h=>h.map(f=>f.modified)))),this._register(Ja((h,f)=>{const g=s.read(h);for(const p of g)f.add(new nle(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new nle(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=$r(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=$r(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Fl("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),d=Fl("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let u="modified";this._register(Z5({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 v=a.read(h);v&&(p=g.movedTexts.find(m=>m.lineRangeMapping.original.contains(v.lineNumber)))}if(g&&u==="modified"){const v=l.read(h);v&&(p=g.movedTexts.find(m=>m.lineRangeMapping.modified.contains(v.lineNumber)))}p!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(p)}))}}iv.movedCodeBlockPadding=4;class qX{static compute(e){const t=[],n=[];for(const o of e){let r=t.findIndex(s=>!s.intersectsStrict(o));r===-1&&(t.length>=6?r=Net(t,Rc(a=>a.intersectWithRangeLength(o),jg)):(r=t.length,t.push(new hG))),t[r].addRange(o),n.push(r)}return new qX(t.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class nle extends $Ce{constructor(e,t,n,o,r){const s=Or("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=n,this._kind=o,this._diffModel=r,this._nodes=Or("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Or("div.text-content@textContent"),Or("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=$r(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(nv(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;n.changes.length>0?l=this._kind==="original"?C("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):C("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?C("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):C("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new zc(this._nodes.actionBar,{highlightToggledItems:!0})),d=new ca("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new ca("","Compare",Mt.asClassName(Xe.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===n?void 0:this._move,void 0)});this._register(Ii(h=>{const f=this._diffModel.movedTextToCompare.read(h)===n;u.checked=f})),c.push(u,{icon:!1,label:!0})}}class fpt extends _e{constructor(e,t,n){super(),this._editors=e,this._diffModel=t,this._options=n,this._decorations=In(this,o=>{var r;const s=(r=this._diffModel.read(o))===null||r===void 0?void 0:r.diff.read(o);if(!s)return null;const a=this._diffModel.read(o).movedTextToCompare.read(o),l=this._options.renderIndicators.read(o),c=this._options.showEmptyDecorations.read(o),d=[],u=[];if(!a)for(const f of s.mappings){if(f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?Qae:ele}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?Zae:Jae}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:dpt}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:lpt});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?upt:ez}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&u.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?cpt:tle});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(o)&&!a&&u.push({range:V.fromPositions(new ae(f.lineRangeMapping.modified.startLineNumber,1)),options:hpt})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&d.push({range:g,options:l?Qae:ele});const p=f.modified.toInclusiveRange();p&&u.push({range:p,options:l?Zae:Jae});for(const v of f.innerChanges||[])d.push({range:v.originalRange,options:ez}),u.push({range:v.modifiedRange,options:tle})}const h=this._diffModel.read(o).activeMovedText.read(o);for(const f of s.movedTexts)d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[iv.movedCodeBlockPadding,0,iv.movedCodeBlockPadding,iv.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(iO(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(iO(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class gpt extends _e{constructor(e,t,n){super(),this._options=e,this._domNode=t,this._dimensions=n,this._sashRatio=Ai(this,void 0),this.sashLeft=In(this,o=>{var r;const s=(r=this._sashRatio.read(o))!==null&&r!==void 0?r:this._options.splitViewDefaultRatio.read(o);return this._computeSashLeft(s,o)}),this._sash=this._register(new gs(this._domNode,{getVerticalSashTop:o=>0,getVerticalSashLeft:o=>this.sashLeft.get(),getVerticalSashHeight:o=>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(o=>{const r=this._dimensions.width.get(),s=this._computeSashLeft((this._startSashPosition+(o.currentX-o.startX))/r,void 0);this._sashRatio.set(s/r,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(Ii(o=>{const r=this._options.enableSplitViewResizing.read(o);this._sash.state=r?3:0,this.sashLeft.read(o),this._dimensions.height.read(o),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const n=this._dimensions.width.read(t),o=Math.floor(this._options.splitViewDefaultRatio.read(t)*n),r=this._options.enableSplitViewResizing.read(t)?Math.floor(e*n):o,s=100;return n<=s*2?o:rn-s?n-s:r}}class YC{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let o=n;for(let r=0;t.children.get(o)!==void 0;r++)o=`${n}_${r}`;return o}static empty(e){return e.children.size===0}}class ile extends YC{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class ppt extends YC{constructor(e,t,n,o){super(),this.id=e,this.parent=t,this.label=n,this.order=o,this.children=new Map}}class om extends YC{static create(e,t,n){const o=new Ro(n),r=new om(t.uri),s=e.ordered(t),a=s.map((c,d)=>{var u;const h=YC.findId(`provider_${d}`,r),f=new ppt(h,r,(u=c.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,o.token)).then(g=>{for(const p of g||[])om._makeOutlineElement(p,f);return f},g=>($o(g),f)).then(g=>{YC.empty(g)?g.remove():r._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Lo(c,s)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!n.isCancellationRequested?om.create(e,t,n):r._compact()).finally(()=>{o.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const n=YC.findId(e,t),o=new ile(n,t,e);if(e.children)for(const r of e.children)om._makeOutlineElement(r,o);t.children.set(o.id,o)}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,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=vn.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof ile?e.push(t.symbol):e.push(...vn.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>V.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return om._flattenDocumentSymbols(t,e,""),t.sort((n,o)=>ae.compare(V.getStartPosition(n.range),V.getStartPosition(o.range))||ae.compare(V.getEndPosition(o.range),V.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const o of t)e.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&om._flattenDocumentSymbols(e,o.children,o.name)}}var UCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mpt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let tz=class extends _e{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,n,o){super(),this._editors=e,this._diffModel=t,this._options=n,this._languageFeaturesService=o,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=Tk(this,(c,d)=>{const u=this._editors.modifiedModel.read(c);if(!!u)return d.add(new nz(this._languageFeaturesService,u))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();qi(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();qi(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 r=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:[]}),s=Tk(this,(c,d)=>{const u=this._modifiedOutlineSource.read(c);if(!u)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),p=r.read(c);for(const v of p)if(!v.shouldHideControls(c)){{const m=In(y=>v.getHiddenOriginalRange(y).startLineNumber-1),_=new oO(m,24);h.push(_),d.add(new ole(this._editors.original,_,v,v.originalUnchangedRange,!g,u,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}{const m=In(y=>v.getHiddenModifiedRange(y).startLineNumber-1),_=new oO(m,24);f.push(_),d.add(new ole(this._editors.modified,_,v,v.modifiedUnchangedRange,!1,u,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,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 os(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(C("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Mt.asClassName(Xe.fold),zIndex:10001};this._register(iO(this._editors.original,In(c=>{const d=r.read(c),u=d.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:V.fromPositions(new ae(h.originalLineNumber,1)),options:l});return u}))),this._register(iO(this._editors.modified,In(c=>{const d=r.read(c),u=d.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:ln.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return u}))),this._register(rO(this._editors.original,s.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(rO(this._editors.modified,s.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(Ii(c=>{const d=r.read(c);this._editors.original.setHiddenAreas(d.map(u=>u.getHiddenOriginalRange(c).toInclusiveRange()).filter(kD)),this._editors.modified.setHiddenAreas(d.map(u=>u.getHiddenModifiedRange(c).toInclusiveRange()).filter(kD))})),this._register(this._editors.modified.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&((d=c.target.element)===null||d===void 0?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?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()}}))}};tz=UCe([jCe(3,pt)],tz);let nz=class extends _e{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=Ai(this,void 0);const n=Fl("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Fl("_textModel.onDidChangeContent",st.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Ja((r,s)=>mpt(this,void 0,void 0,function*(){n.read(r),o.read(r);const a=s.add(new Ygt),l=yield om.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);s.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const o=n.asListOfDocumentSymbols().filter(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return o.sort(h_e(Rc(r=>r.range.endLineNumber-r.range.startLineNumber,jg))),o.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};nz=UCe([jCe(0,pt)],nz);class ole extends $Ce{constructor(e,t,n,o,r,s,a,l){const c=Or("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=n,this._unchangedRegionRange=o,this.hide=r,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Or("div.diff-hidden-lines",[Or("div.top@top",{title:C("diff.hiddenLines.top","Click or drag to show more above")}),Or("div.center@content",{style:{display:"flex"}},[Or("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[He("a",{title:C("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Jm("$(unfold)"))]),Or("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Or("div.bottom@bottom",{title:C("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const d=$r(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?jr(this._nodes.first):this._register(nv(this._nodes.first,{width:d.map(h=>h.contentLeft)}));const u=this._editor;this._register(ke(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 v=ke(window,"mousemove",_=>{const w=_.clientY-f;g=g||Math.abs(w)>2;const L=Math.round(w/u.getOption(66)),D=Math.max(0,Math.min(p+L,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(D,void 0)}),m=ke(window,"mouseup",_=>{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),v.dispose(),m.dispose()})})),this._register(ke(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 v=ke(window,"mousemove",_=>{const w=_.clientY-f;g=g||Math.abs(w)>2;const L=Math.round(w/u.getOption(66)),D=Math.max(0,Math.min(p-L,this._unchangedRegion.getMaxVisibleLineCountBottom())),E=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(D,void 0);const I=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(I-E))}),m=ke(window,"mouseup",_=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const y=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-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),m.dispose()})})),this._register(Ii(h=>{const f=[];if(!this.hide){const g=n.getHiddenModifiedRange(h).length,p=C("hiddenLines","{0} hidden lines",g),v=He("span",{title:C("diff.hiddenLines.expandAll","Double click to unfold")},p);v.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const m=this._unchangedRegion.getHiddenModifiedRange(h),_=this._modifiedOutlineSource.getBreadcrumbItems(m,h);if(_.length>0){f.push(He("span",void 0,"\xA0\xA0|\xA0\xA0"));for(let y=0;y<_.length;y++){const w=_[y],L=$A.toIcon(w.kind),D=Or("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[r$(L),"\xA0",w.name,...y===_.length-1?[]:[r$(Xe.chevronRight)]]).root;f.push(D),D.onclick=()=>{this._revealModifiedHiddenLine(w.startLineNumber)}}}}jr(this._nodes.others,...f)}))}}class Zu{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Zu(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const o=e.getVisibleRanges();if(o.length>0){t=o[0].getStartPosition();const r=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-r}return new Zu(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,o,r){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=o,this._cursorPosition=r}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 n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n)}}var vpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},rle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},_pt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},F_;let sO=F_=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new le,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,n,o){var r,s;return _pt(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,o);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new Hc(new ln(1,2),new ln(1,t.getLineCount()+1),[new Dv(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(n)]),c=F_.diffCache.get(a);if(c&&c.context===l)return c.result;const d=Ls.create(),u=yield this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),h=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(r=u==null?void 0:u.quitEarly)!==null&&r!==void 0?r:!0,detectedMoves:n.computeMoves?(s=u==null?void 0:u.moves.length)!==null&&s!==void 0?s:0:-1}),o.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!u)throw new Error("no diff result available");return F_.diffCache.size>10&&F_.diffCache.delete(F_.diffCache.keys().next().value),F_.diffCache.set(a,{result:u,context:l}),u})}setOptions(e){var t;let n=!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())),n=!0),n&&this.onDidChangeEventEmitter.fire()}};sO.diffCache=new Map;sO=F_=vpt([rle(1,Xd),rle(2,tc)],sO);var bpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Cpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const KCe=yn("diffProviderFactoryService");let iz=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(sO,t)}};iz=bpt([Cpt(0,$t)],iz);Mn(KCe,iz,1);var ypt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},wpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},sle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let oz=class extends _e{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n,o){super(),this.model=e,this._options=t,this._editor=n,this._diffProviderFactoryService=o,this._isDiffUpToDate=Ai(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Ai(this,void 0),this.diff=this._diff,this._unchangedRegions=Ai(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=In(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(qi(c=>{for(const d of this._unchangedRegions.get().regions)d.collapseAll(c)}),[])),this.movedTextToCompare=Ai(this,void 0),this._activeMovedText=Ai(this,void 0),this._hoveredMovedText=Ai(this,void 0),this.activeMovedText=In(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 Ro,this._diffProvider=In(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),d=Fl("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:d}}),this._register(zt(()=>this._cancellationTokenSource.cancel()));const r=VCe("contentChangedSignal"),s=this._register(new bi(()=>r.trigger(void 0),200)),a=(l,c,d)=>{const u=aO.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(m=>e.original.getDecorationRange(m)).filter(m=>!!m).map(m=>ln.fromRange(m)),g=h.modifiedDecorationIds.map(m=>e.modified.getDecorationRange(m)).filter(m=>!!m).map(m=>ln.fromRange(m)),p=e.original.deltaDecorations(h.originalDecorationIds,u.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),v=e.modified.deltaDecorations(h.modifiedDecorationIds,u.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const m of u)for(let _=0;_{if(this._diff.get()){const d=Hg.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const d=Hg.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(Ja((l,c)=>sle(this,void 0,void 0,function*(){var d,u;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),s.cancel(),r.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),im(q0e,l),im(aH,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(v=>{const m=Hg.fromModelContentChanges(v.changes);f=bP(f,m)}));let g=[];c.add(e.modified.onDidChangeContent(v=>{const m=Hg.fromModelContentChanges(v.changes);g=bP(g,m)}));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=Spt(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,qi(v=>{a(p,v),this._lastDiff=p;const m=GX.fromDiffResult(p);this._diff.set(m,v),this._isDiffUpToDate.set(!0,v);const _=this.movedTextToCompare.get();this.movedTextToCompare.set(_?this._lastDiff.moves.find(y=>y.lineRangeMapping.modified.intersect(_.lineRangeMapping.modified)):void 0,v)}))})))}ensureModifiedLineIsVisible(e,t){var n;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const o=this._unchangedRegions.get().regions;for(const r of o)if(r.getHiddenModifiedRange(void 0).contains(e)){r.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var n;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const o=this._unchangedRegions.get().regions;for(const r of o)if(r.getHiddenOriginalRange(void 0).contains(e)){r.showOriginalLine(e,t);return}}waitForDiff(){return sle(this,void 0,void 0,function*(){yield Hgt(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(o=>ln.deserialize(o.range)),n=this._unchangedRegions.get();qi(o=>{for(const r of n.regions)for(const s of t)if(r.modifiedUnchangedRange.intersect(s)){r.setHiddenModifiedRange(s,o);break}})}};oz=ypt([wpt(3,KCe)],oz);function Spt(i,e,t){return{changes:i.changes.map(n=>new Hc(n.original,n.modified,n.innerChanges?n.innerChanges.map(o=>xpt(o,e,t)):void 0)),moves:i.moves,identical:i.identical,quitEarly:i.quitEarly}}function xpt(i,e,t){let n=i.originalRange,o=i.modifiedRange;return(n.endColumn!==1||o.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&o.endColumn===t.getLineMaxColumn(o.endLineNumber)&&n.endLineNumbernew qCe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,o){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=o}}class qCe{constructor(e){this.lineRangeMapping=e}}class aO{static fromDiffs(e,t,n,o,r){const s=Hc.inverse(e,t,n),a=[];for(const l of s){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===n+1;(h||f)&&u>=r+o?(h&&!f&&(u-=r),f&&!h&&(c+=r,d+=r,u-=r),a.push(new aO(c,d,u,0,0))):u>=r*2+o&&(c+=r,d+=r,u-=r*2,a.push(new aO(c,d,u,0,0)))}return a}get originalUnchangedRange(){return ln.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return ln.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,o,r){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Ai(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Ai(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=In(this,s=>this.visibleLineCountTop.read(s)+this.visibleLineCountBottom.read(s)===this.lineCount&&!this.isDragged.read(s)),this.isDragged=Ai(this,!1),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(r,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return ln.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return ln.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,o=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,o,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;n{var v;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(v=n.getDomNode())!==null&&v!==void 0?v:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const m=[],_=o.modified.isEmpty;return m.push(new ca("diff.clipboard.copyDeletedContent",_?o.original.length>1?C("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):C("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):o.original.length>1?C("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):C("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>X9(this,void 0,void 0,function*(){const w=this._originalTextModel.getValueInRange(o.original.toExclusiveRange());yield this._clipboardService.writeText(w)}))),o.original.length>1&&m.push(new ca("diff.clipboard.copyDeletedLineContent",_?C("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",o.original.startLineNumber+u):C("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",o.original.startLineNumber+u),void 0,!0,()=>X9(this,void 0,void 0,function*(){let w=this._originalTextModel.getLineContent(o.original.startLineNumber+u);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?` +`}};q$=n_([Vr(0,En)],q$);class Mgt{publicLog2(){}}class kk{constructor(){const e=Rt.from({scheme:kk.SCHEME,authority:"model",path:"/"});this.workspace={id:E1e,folders:[new odt({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===kk.SCHEME?this.workspace.folders[0]:null}}kk.SCHEME="inmemory";function eO(i,e,t){if(!e||!(i instanceof PCe))return;const n=[];Object.keys(e).forEach(o=>{Act(o)&&n.push([`editor.${o}`,e[o]]),t&&Pct(o)&&n.push([`diffEditor.${o}`,e[o]])}),n.length>0&&i.updateValues(n)}let G$=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return Wy(this,void 0,void 0,function*(){const n=Array.isArray(e)?e:aX.convert(e),o=new Map;for(const a of n){if(!(a instanceof Gg))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=o.get(l);c||(c=[],o.set(l,c)),c.push(Gi.replaceMove(V.lift(a.textEdit.range),a.textEdit.text))}let r=0,s=0;for(const[a,l]of o)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,r+=l.length;return{ariaSummary:Z0(QH.bulkEditServiceSummary,r,s),isApplied:r>0}})}};G$=n_([Vr(0,Yi)],G$);class Agt{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return $c(e)}}let X$=class extends JH{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const o=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();o&&(t=o.getContainerDomNode())}return super.showContextView(e,t,n)}};X$=n_([Vr(0,LS),Vr(1,Jn)],X$);class Pgt{constructor(){this._neverEmitter=new le,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class Ogt extends mk{constructor(){super()}}class Fgt extends Egt{constructor(){super(new oQe)}}let Y$=class extends v${constructor(e,t,n,o,r,s){super(e,t,n,o,r,s),this.configure({blockMouse:!1})}};Y$=n_([Vr(0,tc),Vr(1,Ao),Vr(2,Cp),Vr(3,xi),Vr(4,If),Vr(5,Ut)],Y$);class Bgt{playAudioCue(e,t){return Wy(this,void 0,void 0,function*(){})}}Mn(En,PCe,0);Mn(mG,K$,0);Mn(X0e,q$,0);Mn(rb,kk,0);Mn(Rw,Agt,0);Mn(tc,Mgt,0);Mn(iT,Ngt,0);Mn(oX,Tgt,0);Mn(Ao,Dk,0);Mn(Rf,im,0);Mn(Ki,Ogt,0);Mn(ic,sgt,0);Mn(nc,Fgt,0);Mn(Yi,UP,0);Mn(wG,w$,0);Mn(Ut,z$,0);Mn(L1e,Igt,0);Mn(t_,Z5,0);Mn(Gd,Kut,0);Mn(Xd,cH,0);Mn(oT,G$,0);Mn(D1e,Pgt,0);Mn(za,U$,0);Mn(bp,B$,0);Mn(Xc,lft,0);Mn(_o,j$,0);Mn(xi,Ww,0);Mn(dh,O$,0);Mn(Cp,X$,0);Mn(ml,y$,0);Mn(Sp,$$,0);Mn(Kd,Y$,0);Mn(If,W$,0);Mn(hT,Bgt,0);var Vt;(function(i){const e=new D5;for(const[l,c]of zoe())e.set(l,c);const t=new JP(e,!0);e.set($t,t);function n(l){o||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Ih?t.invokeFunction(d=>d.get(l)):c}i.get=n;let o=!1;const r=new le;function s(l){if(o)return t;o=!0;for(const[d,u]of zoe())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=yn(d);e.get(u)instanceof Ih&&e.set(u,l[d])}const c=Dgt();for(const d of c)try{t.createInstance(d)}catch(u){en(u)}return r.fire(),t}i.initialize=s;function a(l){if(o)return l();const c=new Be,d=c.add(r.event(()=>{d.dispose(),c.add(l())}));return c}i.withServices=a})(Vt||(Vt={}));let Wgt;function Yg(){return Wgt}let OCe;function Vgt(i){OCe=i}class FCe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const n=t===void 0?void 0:e,o=t===void 0?e:t;return OCe({owner:n,debugName:()=>{const r=Zb(o);if(r!==void 0)return r;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(o.toString());if(a)return`${this.debugName}.${a[2]}`;if(!n)return`${this.debugName} (mapped)`}},r=>o(this.read(r),r))}}class fT extends FCe{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 qi(i,e){const t=new BCe(i,e);try{i(t)}finally{t.finish()}}function Z$(i,e,t){i?e(i):qi(e,t)}class BCe{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(n=Yg())===null||n===void 0||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Zb(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:n,observable:o}of t)n.endUpdate(o);(e=Yg())===null||e===void 0||e.handleEndTransaction()}}function UX(i,e,t,n){let o;if(i!==void 0)if(typeof i=="function"){if(o=i(),o!==void 0)return o}else return i;if(e!==void 0&&(o=Zb(e),o!==void 0))return o;if(t!==void 0){for(const r in t)if(t[r]===n)return r}}function Zb(i){const e=i.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),o=n?n[1]:void 0;return o==null?void 0:o.trim()}function Ai(i,e){return typeof i=="string"?new Q$(void 0,i,e):new Q$(i,void 0,e)}class Q$ extends fT{get debugName(){var e;return(e=UX(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,n){super(),this._owner=e,this._debugName=t,this._value=n}get(){return this._value}set(e,t,n){var o;if(this._value===e)return;let r;t||(t=r=new BCe(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(o=Yg())===null||o===void 0||o.handleObservableChanged(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,n)}finally{r&&r.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function tO(i,e){return typeof i=="string"?new Gae(void 0,i,e):new Gae(i,void 0,e)}class Gae extends Q${_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 Ik=(i,e)=>i===e;function In(i,e){return e!==void 0?new Nk(i,void 0,e,void 0,void 0,void 0,Ik):new Nk(void 0,void 0,i,void 0,void 0,void 0,Ik)}function Xae(i,e){var t;return new Nk(i.owner,i.debugName,e,void 0,void 0,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Ik)}function Hgt(i,e){var t;return new Nk(i.owner,i.debugName,e,i.createEmptyChangeSummary,i.handleChange,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Ik)}function Tk(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const o=new Be;return new Nk(n,()=>{var r;return(r=Zb(t))!==null&&r!==void 0?r:"(anonymous)"},r=>(o.clear(),t(r,o)),void 0,void 0,()=>o.dispose(),Ik)}Vgt(In);class Nk extends fT{get debugName(){var e;return(e=UX(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,o,r,s=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=n,this.createChangeSummary=o,this._handleChange=r,this._handleLastObserverRemoved=s,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=Yg())===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 n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n;const o=this.state!==0,r=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=o&&!this._equalityComparator(r,this.value);if((t=Yg())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:r,newValue:this.value,change:void 0,didChange:a,hadValue:o}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const n of this.observers)n.handlePossibleChange(this);if(t)for(const n of this.observers)n.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const n of t)n.endUpdate(this)}if(this.updateCount<0)throw new Vo}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 n=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:r=>r===e},this.changeSummary):!0,o=this.state===3;if(n&&(this.state===1||o)&&(this.state=2,o))for(const r of this.observers)r.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 jX(i,e){return new J5(i.debugName,e,void 0,void 0)}function Ii(i){return new J5(void 0,i,void 0,void 0)}function Q5(i,e){return new J5(i.debugName,e,i.createEmptyChangeSummary,i.handleChange)}function Ja(i){const e=new Be,t=jX({debugName:()=>Zb(i)||"(anonymous)"},n=>{e.clear(),i(n,e)});return zt(()=>{t.dispose(),e.dispose()})}class J5{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=Zb(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,n,o){var r,s;this._debugName=e,this._runFn=t,this.createChangeSummary=n,this._handleChange=o,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(r=this.createChangeSummary)===null||r===void 0?void 0:r.call(this),(s=Yg())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,n;if(this.state===3)return;const o=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=o,this.state=3;try{if(!this.disposed){(e=Yg())===null||e===void 0||e.handleAutorunTriggered(this);const r=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,r)}}finally{(n=Yg())===null||n===void 0||n.handleAutorunFinished(this);for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,FD(()=>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:o=>o===e},this.changeSummary):!0)&&(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(i){i.Observer=J5})(Ii||(Ii={}));function nO(i){return new $gt(i)}class $gt extends FCe{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function zgt(i,e){return new Promise(t=>{let n=!1,o=!1;const r=Ii(s=>{const a=i.read(s);e(a)&&(n?r.dispose():o=!0,t(a))});n=!0,o&&r.dispose()})}function $r(i,e){return new WCe(i,e)}class WCe extends fT{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=n=>{var o;const r=this._getValue(n),s=!this.hasValue||this.value!==r;(o=Yg())===null||o===void 0||o.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:r,change:void 0,didChange:s,hadValue:this.hasValue}),s&&(this.value=r,this.hasValue&&qi(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return Zb(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(i){i.Observer=WCe})($r||($r={}));function Fl(i,e){return new Ugt(i,e)}class Ugt extends fT{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{qi(n=>{for(const o of this.observers)n.updateObserver(o,this),o.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function VCe(i){return typeof i=="string"?new Yae(i):new Yae(void 0,i)}class Yae extends fT{get debugName(){var e;return(e=UX(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){qi(n=>{this.trigger(n,t)},()=>`Trigger signal ${this.debugName}`);return}for(const n of this.observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}}function Rk(i){const e=new jgt(!0);return i.addObserver(e),i.reportChanges(),zt(()=>{i.removeObserver(e)})}class jgt{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 HCe(){return!!N_e.VSCODE_DEV}function Kgt(i){if(HCe()){const e=qgt();return e.add(i),{dispose(){e.delete(i)}}}else return{dispose(){}}}function qgt(){z2||(z2=new Set);const i=globalThis;return i.$hotReload_applyNewExports||(i.$hotReload_applyNewExports=e=>{for(const t of z2){const n=t(e);if(n)return n}}),z2}let z2;function Ggt(i,e,t,n){if(i.length===0)return e;if(e.length===0)return i;const o=[];let r=0,s=0;for(;rd?(o.push(l),s++):(o.push(n(a,l)),r++,s++)}for(;r`Apply decorations from ${e.debugName}`},o=>{const r=e.read(o);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function U2(i,e){return i.appendChild(e),zt(()=>{i.removeChild(e)})}class Xgt extends _e{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new nbe(e,t)),this._width=Ai(this,this.elementSizeObserver.getWidth()),this._height=Ai(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>qi(o=>{this._width.set(this.elementSizeObserver.getWidth(),o),this._height.set(this.elementSizeObserver.getHeight(),o)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Zae(i,e){let t=i.get(),n=t,o=t;const r=Ai("animatedValue",t);let s=-1;const a=300;let l;e.add(Q5({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,u)=>(d.didChange(i)&&(u.animate=u.animate||d.change),!0)},(d,u)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),n=o,t=i.read(d),s=Date.now()-(u.animate?0:a),c()}));function c(){const d=Date.now()-s;o=Math.floor(Ygt(d,n,t-n,a)),d{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}class eF{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${eF._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}eF._counter=0;function iv(i,e){return Ii(t=>{for(let[n,o]of Object.entries(e))o&&typeof o=="object"&&"read"in o&&(o=o.read(t)),typeof o=="number"&&(o=`${o}px`),n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),i.style[n]=o})}function om(i,e){return Zgt([i],e),i}function Zgt(i,e){HCe()&&Fl("reload",n=>Kgt(o=>{if(!![...Object.values(o)].some(r=>i.includes(r)))return r=>(n(void 0),!0)})).read(e)}function rO(i,e,t){const n=new Be,o=[];return n.add(Ii(r=>{const s=e.read(r),a=new Map,l=new Map;t&&t(!0),i.changeViewZones(c=>{for(const d of o)c.removeZone(d);o.length=0;for(const d of s){const u=c.addZone(d);o.push(u),a.set(d,u)}}),t&&t(!1),n.add(Q5({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 s)u.onChange&&(l.set(u.onChange,a.get(u)),u.onChange.read(c));t&&t(!0),i.changeViewZones(u=>{for(const h of d)u.layoutZone(h)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),i.changeViewZones(r=>{for(const s of o)r.removeZone(s)}),t&&t(!1)}}),n}class Qgt extends Ro{dispose(){super.dispose(!0)}}var KX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},qX=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Jgt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const ept=Eo("diff-review-insert",Xe.add,C("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),tpt=Eo("diff-review-remove",Xe.remove,C("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),npt=Eo("diff-review-close",Xe.close,C("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let Nm=class extends _e{constructor(e,t,n,o,r,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=o,this._width=r,this._height=s,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=Tk(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(J$,this._diffs,this._editors,this._setVisible,this._canClose)),g=u.add(this._instantiationService.createInstance(ez,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(Rk(this.model))}next(){qi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){qi(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){qi(e=>{this._setVisible(!1,e)})}};Nm._ttPolicy=_p("diffReview",{createHTML:i=>i});Nm=KX([qX(8,$t)],Nm);let J$=class extends _e{constructor(e,t,n,o,r){super(),this._diffs=e,this._editors=t,this._setVisible=n,this.canClose=o,this._audioCueService=r,this._groups=Ai(this,[]),this._currentGroupIdx=Ai(this,0),this._currentElementIdx=Ai(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(Ii(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=ipt(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());qi(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(s);(a==null?void 0:a.type)===ea.Deleted?this._audioCueService.playAudioCue(Wn.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ea.Added&&this._audioCueService.playAudioCue(Wn.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ii(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==ea.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(V.fromPositions(new ae(c,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||Z$(t,o=>{this._currentGroupIdx.set(Cn.ofLength(n.length).clipCyclic(this._currentGroupIdx.get()+e),o),this._currentElementIdx.set(0,o)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||qi(n=>{this._currentElementIdx.set(Cn.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&qi(o=>{this._currentElementIdx.set(n,o)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ea.Deleted?(this._editors.original.setSelection(V.fromPositions(new ae(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==ea.Header&&(this._editors.modified.setSelection(V.fromPositions(new ae(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};J$=KX([qX(4,hT)],J$);const qx=3;function ipt(i,e,t){const n=[];for(const o of a_e(i,(r,s)=>s.modified.startLineNumber-r.modified.endLineNumberExclusive<2*qx)){const r=[];r.push(new rpt);const s=new ln(Math.max(1,o[0].original.startLineNumber-qx),Math.min(o[o.length-1].original.endLineNumberExclusive+qx,e+1)),a=new ln(Math.max(1,o[0].modified.startLineNumber-qx),Math.min(o[o.length-1].modified.endLineNumberExclusive+qx,t+1));l_e(o,(d,u)=>{const h=new ln(d?d.original.endLineNumberExclusive:s.startLineNumber,u?u.original.startLineNumber:s.endLineNumberExclusive),f=new ln(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{r.push(new lpt(g,f.startLineNumber+(g-h.startLineNumber)))}),u&&(u.original.forEach(g=>{r.push(new spt(u,g))}),u.modified.forEach(g=>{r.push(new apt(u,g))}))});const l=o[0].modified.join(o[o.length-1].modified),c=o[0].original.join(o[o.length-1].original);n.push(new opt(new mf(l,c),r))}return n}var ea;(function(i){i[i.Header=0]="Header",i[i.Unchanged=1]="Unchanged",i[i.Deleted=2]="Deleted",i[i.Added=3]="Added"})(ea||(ea={}));class opt{constructor(e,t){this.range=e,this.lines=t}}class rpt{constructor(){this.type=ea.Header}}class spt{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ea.Deleted,this.modifiedLineNumber=void 0}}class apt{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ea.Added,this.originalLineNumber=void 0}}class lpt{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ea.Unchanged}}let ez=class extends _e{constructor(e,t,n,o,r,s){super(),this._element=e,this._model=t,this._width=n,this._height=o,this._editors=r,this._languageService=s,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 zc(a)),this._register(Ii(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new ca("diffreview.close",C("label.close","Close"),"close-diff-review "+Mt.asClassName(npt),!0,()=>Jgt(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 QI(this._content,{})),jr(this.domNode,this._scrollbar.getDomNode(),a),this._register(zt(()=>{jr(this.domNode)})),this._register(iv(this.domNode,{width:this._width,height:this._height})),this._register(iv(this._content,{width:this._width,height:this._height})),this._register(Ja((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(No(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(),n=this._editors.modified.getOptions(),o=document.createElement("div");o.className="diff-review-table",o.setAttribute("role","list"),o.setAttribute("aria-label",C("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),ss(o,n.get(50)),jr(this._content,o);const r=this._editors.original.getModel(),s=this._editors.modified.getModel();if(!r||!s)return;const a=r.getOptions(),l=s.getOptions(),c=n.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===ea.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,v=this._model.currentGroupIndex.get(),m=this._model.groups.get().length,_=D=>D===0?C("no_lines_changed","no lines changed"):D===1?C("one_line_changed","1 line changed"):C("more_lines_changed","{0} lines changed",D),y=_(p.original.length),w=_(p.modified.length);g.setAttribute("aria-label",C({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}",v+1,m,p.original.startLineNumber,y,p.modified.startLineNumber,w));const L=document.createElement("div");L.className="diff-review-cell diff-review-summary",L.appendChild(document.createTextNode(`${v+1}/${m}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(L),h=g}else h=this._createRow(u,c,this._width.get(),t,r,a,n,s,l);o.appendChild(h);const f=In(g=>this._model.currentElement.read(g)===u);e.add(Ii(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(ke(h,"focus",()=>{this._model.goToLine(u)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,o,r,s,a,l,c){const d=o.get(143),u=d.glyphMarginWidth+d.lineNumbersWidth,h=a.get(143),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const v="diff-review-spacer";let m=null;switch(e.type){case ea.Added:g="diff-review-row line-insert",p=" char-insert",m=ept;break;case ea.Deleted:g="diff-review-row line-delete",p=" char-delete",m=tpt;break}const _=document.createElement("div");_.style.minWidth=n+"px",_.className=g,_.setAttribute("role","listitem"),_.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,_.appendChild(y);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="\xA0",y.appendChild(w);const L=document.createElement("span");L.style.width=f+"px",L.style.minWidth=f+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?L.appendChild(document.createTextNode(String(e.modifiedLineNumber))):L.innerText="\xA0",y.appendChild(L);const D=document.createElement("span");if(D.className=v,m){const k=document.createElement("span");k.className=Mt.asClassName(m),k.innerText="\xA0\xA0",D.appendChild(k)}else D.innerText="\xA0\xA0";y.appendChild(D);let E;if(e.modifiedLineNumber!==void 0){let k=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Nm._ttPolicy&&(k=Nm._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),E=l.getLineContent(e.modifiedLineNumber)}else{let k=this._getLineHtml(r,o,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Nm._ttPolicy&&(k=Nm._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),E=r.getLineContent(e.originalLineNumber)}E.length===0&&(E=C("blankLine","blank"));let I="";switch(e.type){case ea.Unchanged:e.originalLineNumber===e.modifiedLineNumber?I=C({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",E,e.originalLineNumber):I=C("equalLine","{0} original line {1} modified line {2}",E,e.originalLineNumber,e.modifiedLineNumber);break;case ea.Added:I=C("insertLine","+ {0} modified line {1}",E,e.modifiedLineNumber);break;case ea.Deleted:I=C("deleteLine","- {0} original line {1}",E,e.originalLineNumber);break}return _.setAttribute("aria-label",I),_}_getLineHtml(e,t,n,o,r){const s=e.getLineContent(o),a=t.get(50),l=pr.createEmpty(s,r),c=Zl.isBasicASCII(s,e.mightContainNonBasicASCII()),d=Zl.containsRTL(s,c,e.mightContainRTL());return g5(new Jv(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,d,0,l,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==Pl.OFF,null)).html}};ez=KX([qX(5,Ki)],ez);const cpt=Eo("diff-insert",Xe.add,C("diffInsertIcon","Line decoration for inserts in the diff editor.")),zCe=Eo("diff-remove",Xe.remove,C("diffRemoveIcon","Line decoration for removals in the diff editor.")),Qae=Jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Mt.asClassName(cpt),marginClassName:"gutter-insert"}),Jae=Jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Mt.asClassName(zCe),marginClassName:"gutter-delete"}),ele=Jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),tle=Jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),nle=Jt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),dpt=Jt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),upt=Jt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),tz=Jt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),hpt=Jt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),fpt=Jt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),gpt=Jt.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new os(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(C("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+Mt.asClassName(Xe.arrowRight),zIndex:10001});class ov extends _e{constructor(e,t,n,o,r){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=o,this._editors=r,this._originalScrollTop=$r(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Fl("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Ai(this,0),this._modifiedViewZonesChangedSignal=Fl("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Fl("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Tk((h,f)=>{var g;this._element.replaceChildren();const p=this._diffModel.read(h),v=(g=p==null?void 0:p.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!v||v.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const m=this._originalEditorLayoutInfo.read(h),_=this._modifiedEditorLayoutInfo.read(h);if(!m||!_){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const y=v.map(R=>{function A(K,j){const G=j.getTopForLineNumber(K.startLineNumber,!0),X=j.getTopForLineNumber(K.endLineNumberExclusive,!0);return(G+X)/2}const P=A(R.lineRangeMapping.original,this._editors.original),N=this._originalScrollTop.read(h),M=A(R.lineRangeMapping.modified,this._editors.modified),H=this._modifiedScrollTop.read(h),B=P-N,F=M-H,$=Math.min(P,M),z=Math.max(P,M);return{range:new Cn($,z),from:B,to:F,fromWithoutScroll:P,toWithoutScroll:M,move:R}});y.sort(mXe(Rc(R=>R.fromWithoutScroll>R.toWithoutScroll,vXe),Rc(R=>R.fromWithoutScroll>R.toWithoutScroll?R.fromWithoutScroll:-R.toWithoutScroll,jg)));const w=GX.compute(y.map(R=>R.range)),L=10,D=m.verticalScrollbarWidth,E=(w.getTrackCount()-1)*10+L*2,I=D+E+(_.contentLeft-ov.movedCodeBlockPadding);let k=0;for(const R of y){const A=w.getTrack(k),P=D+L+A*10,N=15,M=15,H=I,B=_.glyphMarginWidth+_.lineNumbersWidth,F=18,$=document.createElementNS("http://www.w3.org/2000/svg","rect");$.classList.add("arrow-rectangle"),$.setAttribute("x",`${H-B}`),$.setAttribute("y",`${R.to-F/2}`),$.setAttribute("width",`${B}`),$.setAttribute("height",`${F}`),this._element.appendChild($);const z=document.createElementNS("http://www.w3.org/2000/svg","g"),K=document.createElementNS("http://www.w3.org/2000/svg","path");K.setAttribute("d",`M ${0} ${R.from} L ${P} ${R.from} L ${P} ${R.to} L ${H-M} ${R.to}`),K.setAttribute("fill","none"),z.appendChild(K);const j=document.createElementNS("http://www.w3.org/2000/svg","polygon");j.classList.add("arrow"),f.add(Ii(G=>{K.classList.toggle("currentMove",R.move===p.activeMovedText.read(G)),j.classList.toggle("currentMove",R.move===p.activeMovedText.read(G))})),j.setAttribute("points",`${H-M},${R.to-N/2} ${H},${R.to} ${H-M},${R.to+N/2}`),z.appendChild(j),this._element.appendChild(z),k++}this.width.set(E,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(zt(()=>this._element.remove())),this._register(Ii(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-ov.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(Rk(this._state));const s=In(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 oO(nO(p.lineRangeMapping.original.startLineNumber-1),18),modified:new oO(nO(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(rO(this._editors.original,s.map(h=>h.map(f=>f.original)))),this._register(rO(this._editors.modified,s.map(h=>h.map(f=>f.modified)))),this._register(Ja((h,f)=>{const g=s.read(h);for(const p of g)f.add(new ile(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new ile(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=$r(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=$r(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Fl("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),d=Fl("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let u="modified";this._register(Q5({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 v=a.read(h);v&&(p=g.movedTexts.find(m=>m.lineRangeMapping.original.contains(v.lineNumber)))}if(g&&u==="modified"){const v=l.read(h);v&&(p=g.movedTexts.find(m=>m.lineRangeMapping.modified.contains(v.lineNumber)))}p!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(p)}))}}ov.movedCodeBlockPadding=4;class GX{static compute(e){const t=[],n=[];for(const o of e){let r=t.findIndex(s=>!s.intersectsStrict(o));r===-1&&(t.length>=6?r=Met(t,Rc(a=>a.intersectWithRangeLength(o),jg)):(r=t.length,t.push(new fG))),t[r].addRange(o),n.push(r)}return new GX(t.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class ile extends $Ce{constructor(e,t,n,o,r){const s=Or("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=n,this._kind=o,this._diffModel=r,this._nodes=Or("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Or("div.text-content@textContent"),Or("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=$r(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(iv(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;n.changes.length>0?l=this._kind==="original"?C("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):C("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?C("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):C("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new zc(this._nodes.actionBar,{highlightToggledItems:!0})),d=new ca("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new ca("","Compare",Mt.asClassName(Xe.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===n?void 0:this._move,void 0)});this._register(Ii(h=>{const f=this._diffModel.movedTextToCompare.read(h)===n;u.checked=f})),c.push(u,{icon:!1,label:!0})}}class ppt extends _e{constructor(e,t,n){super(),this._editors=e,this._diffModel=t,this._options=n,this._decorations=In(this,o=>{var r;const s=(r=this._diffModel.read(o))===null||r===void 0?void 0:r.diff.read(o);if(!s)return null;const a=this._diffModel.read(o).movedTextToCompare.read(o),l=this._options.renderIndicators.read(o),c=this._options.showEmptyDecorations.read(o),d=[],u=[];if(!a)for(const f of s.mappings){if(f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?Jae:tle}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?Qae:ele}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:hpt}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:dpt});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?fpt:tz}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&u.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?upt:nle});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(o)&&!a&&u.push({range:V.fromPositions(new ae(f.lineRangeMapping.modified.startLineNumber,1)),options:gpt})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&d.push({range:g,options:l?Jae:tle});const p=f.modified.toInclusiveRange();p&&u.push({range:p,options:l?Qae:ele});for(const v of f.innerChanges||[])d.push({range:v.originalRange,options:tz}),u.push({range:v.modifiedRange,options:nle})}const h=this._diffModel.read(o).activeMovedText.read(o);for(const f of s.movedTexts)d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[ov.movedCodeBlockPadding,0,ov.movedCodeBlockPadding,ov.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(iO(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(iO(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class mpt extends _e{constructor(e,t,n){super(),this._options=e,this._domNode=t,this._dimensions=n,this._sashRatio=Ai(this,void 0),this.sashLeft=In(this,o=>{var r;const s=(r=this._sashRatio.read(o))!==null&&r!==void 0?r:this._options.splitViewDefaultRatio.read(o);return this._computeSashLeft(s,o)}),this._sash=this._register(new gs(this._domNode,{getVerticalSashTop:o=>0,getVerticalSashLeft:o=>this.sashLeft.get(),getVerticalSashHeight:o=>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(o=>{const r=this._dimensions.width.get(),s=this._computeSashLeft((this._startSashPosition+(o.currentX-o.startX))/r,void 0);this._sashRatio.set(s/r,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(Ii(o=>{const r=this._options.enableSplitViewResizing.read(o);this._sash.state=r?3:0,this.sashLeft.read(o),this._dimensions.height.read(o),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const n=this._dimensions.width.read(t),o=Math.floor(this._options.splitViewDefaultRatio.read(t)*n),r=this._options.enableSplitViewResizing.read(t)?Math.floor(e*n):o,s=100;return n<=s*2?o:rn-s?n-s:r}}class YC{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let o=n;for(let r=0;t.children.get(o)!==void 0;r++)o=`${n}_${r}`;return o}static empty(e){return e.children.size===0}}class ole extends YC{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class vpt extends YC{constructor(e,t,n,o){super(),this.id=e,this.parent=t,this.label=n,this.order=o,this.children=new Map}}class rm extends YC{static create(e,t,n){const o=new Ro(n),r=new rm(t.uri),s=e.ordered(t),a=s.map((c,d)=>{var u;const h=YC.findId(`provider_${d}`,r),f=new vpt(h,r,(u=c.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,o.token)).then(g=>{for(const p of g||[])rm._makeOutlineElement(p,f);return f},g=>($o(g),f)).then(g=>{YC.empty(g)?g.remove():r._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Lo(c,s)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!n.isCancellationRequested?rm.create(e,t,n):r._compact()).finally(()=>{o.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const n=YC.findId(e,t),o=new ole(n,t,e);if(e.children)for(const r of e.children)rm._makeOutlineElement(r,o);t.children.set(o.id,o)}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,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=vn.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof ole?e.push(t.symbol):e.push(...vn.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>V.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return rm._flattenDocumentSymbols(t,e,""),t.sort((n,o)=>ae.compare(V.getStartPosition(n.range),V.getStartPosition(o.range))||ae.compare(V.getEndPosition(o.range),V.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const o of t)e.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&rm._flattenDocumentSymbols(e,o.children,o.name)}}var UCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},_pt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let nz=class extends _e{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,n,o){super(),this._editors=e,this._diffModel=t,this._options=n,this._languageFeaturesService=o,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=Tk(this,(c,d)=>{const u=this._editors.modifiedModel.read(c);if(!!u)return d.add(new iz(this._languageFeaturesService,u))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();qi(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();qi(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 r=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:[]}),s=Tk(this,(c,d)=>{const u=this._modifiedOutlineSource.read(c);if(!u)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),p=r.read(c);for(const v of p)if(!v.shouldHideControls(c)){{const m=In(y=>v.getHiddenOriginalRange(y).startLineNumber-1),_=new oO(m,24);h.push(_),d.add(new rle(this._editors.original,_,v,v.originalUnchangedRange,!g,u,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}{const m=In(y=>v.getHiddenModifiedRange(y).startLineNumber-1),_=new oO(m,24);f.push(_),d.add(new rle(this._editors.modified,_,v,v.modifiedUnchangedRange,!1,u,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,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 os(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(C("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Mt.asClassName(Xe.fold),zIndex:10001};this._register(iO(this._editors.original,In(c=>{const d=r.read(c),u=d.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:V.fromPositions(new ae(h.originalLineNumber,1)),options:l});return u}))),this._register(iO(this._editors.modified,In(c=>{const d=r.read(c),u=d.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:ln.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return u}))),this._register(rO(this._editors.original,s.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(rO(this._editors.modified,s.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(Ii(c=>{const d=r.read(c);this._editors.original.setHiddenAreas(d.map(u=>u.getHiddenOriginalRange(c).toInclusiveRange()).filter(kD)),this._editors.modified.setHiddenAreas(d.map(u=>u.getHiddenModifiedRange(c).toInclusiveRange()).filter(kD))})),this._register(this._editors.modified.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&((d=c.target.element)===null||d===void 0?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?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()}}))}};nz=UCe([jCe(3,pt)],nz);let iz=class extends _e{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=Ai(this,void 0);const n=Fl("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Fl("_textModel.onDidChangeContent",st.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Ja((r,s)=>_pt(this,void 0,void 0,function*(){n.read(r),o.read(r);const a=s.add(new Qgt),l=yield rm.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);s.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const o=n.asListOfDocumentSymbols().filter(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return o.sort(h_e(Rc(r=>r.range.endLineNumber-r.range.startLineNumber,jg))),o.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};iz=UCe([jCe(0,pt)],iz);class rle extends $Ce{constructor(e,t,n,o,r,s,a,l){const c=Or("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=n,this._unchangedRegionRange=o,this.hide=r,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Or("div.diff-hidden-lines",[Or("div.top@top",{title:C("diff.hiddenLines.top","Click or drag to show more above")}),Or("div.center@content",{style:{display:"flex"}},[Or("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[He("a",{title:C("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...ev("$(unfold)"))]),Or("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Or("div.bottom@bottom",{title:C("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const d=$r(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?jr(this._nodes.first):this._register(iv(this._nodes.first,{width:d.map(h=>h.contentLeft)}));const u=this._editor;this._register(ke(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 v=ke(window,"mousemove",_=>{const w=_.clientY-f;g=g||Math.abs(w)>2;const L=Math.round(w/u.getOption(66)),D=Math.max(0,Math.min(p+L,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(D,void 0)}),m=ke(window,"mouseup",_=>{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),v.dispose(),m.dispose()})})),this._register(ke(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 v=ke(window,"mousemove",_=>{const w=_.clientY-f;g=g||Math.abs(w)>2;const L=Math.round(w/u.getOption(66)),D=Math.max(0,Math.min(p-L,this._unchangedRegion.getMaxVisibleLineCountBottom())),E=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(D,void 0);const I=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(I-E))}),m=ke(window,"mouseup",_=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const y=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-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),m.dispose()})})),this._register(Ii(h=>{const f=[];if(!this.hide){const g=n.getHiddenModifiedRange(h).length,p=C("hiddenLines","{0} hidden lines",g),v=He("span",{title:C("diff.hiddenLines.expandAll","Double click to unfold")},p);v.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const m=this._unchangedRegion.getHiddenModifiedRange(h),_=this._modifiedOutlineSource.getBreadcrumbItems(m,h);if(_.length>0){f.push(He("span",void 0,"\xA0\xA0|\xA0\xA0"));for(let y=0;y<_.length;y++){const w=_[y],L=$A.toIcon(w.kind),D=Or("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[s$(L),"\xA0",w.name,...y===_.length-1?[]:[s$(Xe.chevronRight)]]).root;f.push(D),D.onclick=()=>{this._revealModifiedHiddenLine(w.startLineNumber)}}}}jr(this._nodes.others,...f)}))}}class Zu{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Zu(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const o=e.getVisibleRanges();if(o.length>0){t=o[0].getStartPosition();const r=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-r}return new Zu(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,o,r){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=o,this._cursorPosition=r}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 n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n)}}var bpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},sle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Cpt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},F_;let sO=F_=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new le,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,n,o){var r,s;return Cpt(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,o);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new Hc(new ln(1,2),new ln(1,t.getLineCount()+1),[new Dv(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(n)]),c=F_.diffCache.get(a);if(c&&c.context===l)return c.result;const d=Ls.create(),u=yield this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),h=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(r=u==null?void 0:u.quitEarly)!==null&&r!==void 0?r:!0,detectedMoves:n.computeMoves?(s=u==null?void 0:u.moves.length)!==null&&s!==void 0?s:0:-1}),o.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!u)throw new Error("no diff result available");return F_.diffCache.size>10&&F_.diffCache.delete(F_.diffCache.keys().next().value),F_.diffCache.set(a,{result:u,context:l}),u})}setOptions(e){var t;let n=!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())),n=!0),n&&this.onDidChangeEventEmitter.fire()}};sO.diffCache=new Map;sO=F_=bpt([sle(1,Xd),sle(2,tc)],sO);var ypt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},wpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const KCe=yn("diffProviderFactoryService");let oz=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(sO,t)}};oz=ypt([wpt(0,$t)],oz);Mn(KCe,oz,1);var Spt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},xpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ale=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let rz=class extends _e{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n,o){super(),this.model=e,this._options=t,this._editor=n,this._diffProviderFactoryService=o,this._isDiffUpToDate=Ai(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Ai(this,void 0),this.diff=this._diff,this._unchangedRegions=Ai(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=In(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(qi(c=>{for(const d of this._unchangedRegions.get().regions)d.collapseAll(c)}),[])),this.movedTextToCompare=Ai(this,void 0),this._activeMovedText=Ai(this,void 0),this._hoveredMovedText=Ai(this,void 0),this.activeMovedText=In(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 Ro,this._diffProvider=In(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),d=Fl("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:d}}),this._register(zt(()=>this._cancellationTokenSource.cancel()));const r=VCe("contentChangedSignal"),s=this._register(new bi(()=>r.trigger(void 0),200)),a=(l,c,d)=>{const u=aO.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(m=>e.original.getDecorationRange(m)).filter(m=>!!m).map(m=>ln.fromRange(m)),g=h.modifiedDecorationIds.map(m=>e.modified.getDecorationRange(m)).filter(m=>!!m).map(m=>ln.fromRange(m)),p=e.original.deltaDecorations(h.originalDecorationIds,u.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),v=e.modified.deltaDecorations(h.modifiedDecorationIds,u.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const m of u)for(let _=0;_{if(this._diff.get()){const d=Hg.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const d=Hg.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(Ja((l,c)=>ale(this,void 0,void 0,function*(){var d,u;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),s.cancel(),r.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),om(q0e,l),om(lH,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(v=>{const m=Hg.fromModelContentChanges(v.changes);f=bP(f,m)}));let g=[];c.add(e.modified.onDidChangeContent(v=>{const m=Hg.fromModelContentChanges(v.changes);g=bP(g,m)}));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=Lpt(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,qi(v=>{a(p,v),this._lastDiff=p;const m=XX.fromDiffResult(p);this._diff.set(m,v),this._isDiffUpToDate.set(!0,v);const _=this.movedTextToCompare.get();this.movedTextToCompare.set(_?this._lastDiff.moves.find(y=>y.lineRangeMapping.modified.intersect(_.lineRangeMapping.modified)):void 0,v)}))})))}ensureModifiedLineIsVisible(e,t){var n;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const o=this._unchangedRegions.get().regions;for(const r of o)if(r.getHiddenModifiedRange(void 0).contains(e)){r.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var n;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const o=this._unchangedRegions.get().regions;for(const r of o)if(r.getHiddenOriginalRange(void 0).contains(e)){r.showOriginalLine(e,t);return}}waitForDiff(){return ale(this,void 0,void 0,function*(){yield zgt(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(o=>ln.deserialize(o.range)),n=this._unchangedRegions.get();qi(o=>{for(const r of n.regions)for(const s of t)if(r.modifiedUnchangedRange.intersect(s)){r.setHiddenModifiedRange(s,o);break}})}};rz=Spt([xpt(3,KCe)],rz);function Lpt(i,e,t){return{changes:i.changes.map(n=>new Hc(n.original,n.modified,n.innerChanges?n.innerChanges.map(o=>Ept(o,e,t)):void 0)),moves:i.moves,identical:i.identical,quitEarly:i.quitEarly}}function Ept(i,e,t){let n=i.originalRange,o=i.modifiedRange;return(n.endColumn!==1||o.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&o.endColumn===t.getLineMaxColumn(o.endLineNumber)&&n.endLineNumbernew qCe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,o){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=o}}class qCe{constructor(e){this.lineRangeMapping=e}}class aO{static fromDiffs(e,t,n,o,r){const s=Hc.inverse(e,t,n),a=[];for(const l of s){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===n+1;(h||f)&&u>=r+o?(h&&!f&&(u-=r),f&&!h&&(c+=r,d+=r,u-=r),a.push(new aO(c,d,u,0,0))):u>=r*2+o&&(c+=r,d+=r,u-=r*2,a.push(new aO(c,d,u,0,0)))}return a}get originalUnchangedRange(){return ln.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return ln.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,o,r){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Ai(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Ai(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=In(this,s=>this.visibleLineCountTop.read(s)+this.visibleLineCountBottom.read(s)===this.lineCount&&!this.isDragged.read(s)),this.isDragged=Ai(this,!1),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(r,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return ln.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return ln.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,o=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,o,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;n{var v;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(v=n.getDomNode())!==null&&v!==void 0?v:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const m=[],_=o.modified.isEmpty;return m.push(new ca("diff.clipboard.copyDeletedContent",_?o.original.length>1?C("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):C("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):o.original.length>1?C("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):C("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>Y9(this,void 0,void 0,function*(){const w=this._originalTextModel.getValueInRange(o.original.toExclusiveRange());yield this._clipboardService.writeText(w)}))),o.original.length>1&&m.push(new ca("diff.clipboard.copyDeletedLineContent",_?C("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",o.original.startLineNumber+u):C("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",o.original.startLineNumber+u),void 0,!0,()=>Y9(this,void 0,void 0,function*(){let w=this._originalTextModel.getLineContent(o.original.startLineNumber+u);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r -`),yield this._clipboardService.writeText(w)}))),n.getOption(90)||m.push(new ca("diff.inline.revertChange",C("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>X9(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),m},autoSelectFirstItem:!0})};this._register(No(this._diffActions,"mousedown",g=>{const{top:p,height:v}=Yo(this._diffActions),m=Math.floor(d/3);g.preventDefault(),f(g.posx,p+v+m)})),this._register(n.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(n.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,n){const{top:o}=Yo(e),r=t-o,s=Math.floor(r/n),a=s*n;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;ci});function Ept(i,e,t,n){ss(n,e.fontInfo);const o=t.length>0,r=new yS(1e4);let s=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Zl.isBasicASCII(l,o),d=Zl.containsRTL(l,c,r),u=qI(new Jv(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Pl.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var kpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},cle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let rz=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editors=e,this._diffModel=t,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._clipboardService=s,this._contextMenuService=a,this._originalTopPadding=Ai(this,0),this._originalScrollOffset=Ai(this,0),this._originalScrollOffsetAnimated=Yae(this._originalScrollOffset,this._store),this._modifiedTopPadding=Ai(this,0),this._modifiedScrollOffset=Ai(this,0),this._modifiedScrollOffsetAnimated=Yae(this._modifiedScrollOffset,this._store);let l=!1;const c=Ai("state",0),d=this._register(new bi(()=>{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?$r(w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,L)=>w==null?void 0:w.read(L)),h=new Set,f=new Set,g=In(w=>{const L=this._diffModel.read(w),D=L==null?void 0:L.diff.read(w);if(!L||!D)return null;c.read(w);const I=this._options.renderSideBySide.read(w);return dle(this._editors.original,this._editors.modified,D.mappings,h,f,I)}),p=In(w=>{var L;const D=(L=this._diffModel.read(w))===null||L===void 0?void 0:L.movedTextToCompare.read(w);if(!D)return null;c.read(w);const E=D.changes.map(I=>new qCe(I));return dle(this._editors.original,this._editors.modified,E,h,f,!0)});function v(){const w=document.createElement("div");return w.className="diagonal-fill",w}const m=this._register(new Be),_=In(w=>{var L,D,E,I,k,R,A,P;m.clear();const N=g.read(w)||[],M=[],H=[],B=this._modifiedTopPadding.read(w);B>0&&H.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:B,showInHiddenAreas:!0,suppressMouseDown:!0});const F=this._originalTopPadding.read(w);F>0&&M.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:F,showInHiddenAreas:!0,suppressMouseDown:!0});const $=this._options.renderSideBySide.read(w),z=$||(L=this._editors.modified._getViewModel())===null||L===void 0?void 0:L.createLineBreaksComputer();if(z){for(const be of N)if(be.diff)for(let Se=be.originalRange.startLineNumber;Sethis._editors.original.getModel().tokenization.getLineTokens(Ee)),be.originalRange.mapToLineArray(Ee=>K[j++]),ue,fe),ce=[];for(const Ee of be.diff.innerChanges||[])ce.push(new hE(Ee.originalRange.delta(-(be.diff.original.startLineNumber-1)),ez.className,0));const Pe=Ept(De,pe,ce,Fe),Oe=document.createElement("div");if(Oe.className="inline-deleted-margin-view-zone",ss(Oe,pe.fontInfo),this._options.renderIndicators.read(w))for(let Ee=0;Eec0(xe),Oe,this._editors.modified,be.diff,this._diffEditorWidget,Pe.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Ee=0;Ee1&&M.push({afterLineNumber:be.originalRange.startLineNumber+Ee,domNode:v(),heightInPx:(tt-1)*G,showInHiddenAreas:!0,suppressMouseDown:!0})}H.push({afterLineNumber:be.modifiedRange.startLineNumber-1,domNode:Fe,heightInPx:Pe.heightInLines*G,minWidthInPx:Pe.minWidthInPx,marginDomNode:Oe,setZoneId(Ee){xe=Ee},showInHiddenAreas:!0,suppressMouseDown:!0})}const Se=document.createElement("div");Se.className="gutter-delete",M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:be.modifiedHeightInPx,marginDomNode:Se,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Se=be.modifiedHeightInPx-be.originalHeightInPx;if(Se>0){if(X!=null&&X.lineRangeMapping.original.delta(-1).deltaLength(2).contains(be.originalRange.endLineNumberExclusive-1))continue;M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Se,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Fe=function(){const ce=document.createElement("div");return ce.className="arrow-revert-change "+Mt.asClassName(Xe.arrowRight),He("div",{},ce)};if(X!=null&&X.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(be.modifiedRange.endLineNumberExclusive-1))continue;let De;be.diff&&be.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(w)&&(De=Fe()),H.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Se,marginDomNode:De,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const be of(P=p.read(w))!==null&&P!==void 0?P:[]){if(!(X!=null&&X.lineRangeMapping.original.intersect(be.originalRange))||!(X!=null&&X.lineRangeMapping.modified.intersect(be.modifiedRange)))continue;const Se=be.modifiedHeightInPx-be.originalHeightInPx;Se>0?M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Se,showInHiddenAreas:!0,suppressMouseDown:!0}):H.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Se,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:M,mod:H}});this._register(Ja(w=>{const L=Zu.capture(this._editors.modified),D=_.read(w);l=!0,this._editors.original.changeViewZones(E=>{for(const I of h)E.removeZone(I);h.clear();for(const I of D.orig){const k=E.addZone(I);I.setZoneId&&I.setZoneId(k),h.add(k)}}),this._editors.modified.changeViewZones(E=>{for(const I of f)E.removeZone(I);f.clear();for(const I of D.mod){const k=E.addZone(I);I.setZoneId&&I.setZoneId(k),f.add(k)}}),l=!1,L.restore(this._editors.modified)})),this._register(zt(()=>{this._editors.original.changeViewZones(w=>{for(const L of h)w.removeZone(L);h.clear()}),this._editors.modified.changeViewZones(w=>{for(const L of f)w.removeZone(L);f.clear()})}));let y=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.modified.setScrollLeft(w.scrollLeft),y=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.original.setScrollLeft(w.scrollLeft),y=!1)})),this._originalScrollTop=$r(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Ii(w=>{const L=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(w));L!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(L,1)})),this._register(Ii(w=>{const L=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(w));L!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(L,1)})),this._register(Ii(w=>{var L;const D=(L=this._diffModel.read(w))===null||L===void 0?void 0:L.movedTextToCompare.read(w);let E=0;if(D){const I=this._editors.original.getTopForLineNumber(D.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(D.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-I}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,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()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};rz=kpt([cle(5,wp),cle(6,Kd)],rz);function dle(i,e,t,n,o,r){const s=new ap(ule(i,n)),a=new ap(ule(e,o)),l=i.getOption(66),c=e.getOption(66),d=[];let u=0,h=0;function f(g,p){for(;;){let v=s.peek(),m=a.peek();if(v&&v.lineNumber>=g&&(v=void 0),m&&m.lineNumber>=p&&(m=void 0),!v&&!m)break;const _=v?v.lineNumber-u:Number.MAX_VALUE,y=m?m.lineNumber-h:Number.MAX_VALUE;_y?(a.dequeue(),v={lineNumber:m.lineNumber-h+u,heightInPx:0}):(s.dequeue(),a.dequeue()),d.push({originalRange:ln.ofLength(v.lineNumber,1),modifiedRange:ln.ofLength(m.lineNumber,1),originalHeightInPx:l+v.heightInPx,modifiedHeightInPx:c+m.heightInPx,diff:void 0})}}for(const g of t){let y=function(w,L){var D,E,I,k;if(w<_||LM.lineNumberM+H.heightInPx,0))!==null&&E!==void 0?E:0,N=(k=(I=a.takeWhile(M=>M.lineNumberM+H.heightInPx,0))!==null&&k!==void 0?k:0;d.push({originalRange:R,modifiedRange:A,originalHeightInPx:R.length*l+P,modifiedHeightInPx:A.length*c+N,diff:g.lineRangeMapping}),_=w,m=L};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let v=!0,m=p.modified.startLineNumber,_=p.original.startLineNumber;if(r)for(const w of p.innerChanges||[])w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&y(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber),w.originalRange.endColumn1&&n.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of i.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:r.convertViewPositionToModelPosition(new ae(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return Kgt(t,n,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var Ipt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Tpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cu;let Zg=cu=class extends _e{constructor(e,t,n,o,r,s,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=n,this._rootWidth=o,this._rootHeight=r,this._modifiedEditorLayoutInfo=s,this._options=a,this._themeService=l;const c=$r(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=In(f=>{const g=c.read(f),p=g.getColor(jnt)||(g.getColor(znt)||pH).transparent(2),v=g.getColor(Knt)||(g.getColor(Unt)||mH).transparent(2);return{insertColor:p,removeColor:v}}),u=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(Ja((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=ti(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const v=Or("div.diffOverview",{style:{position:"absolute",top:"0px",width:cu.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(U2(v,p.domNode)),g.add(No(v,et.POINTER_DOWN,m=>{this._editors.modified.delegateVerticalScrollbarPointerDown(m)})),g.add(ke(v,et.MOUSE_WHEEL,m=>{this._editors.modified.delegateScrollFromMouseWheelEvent(m)},{passive:!1})),g.add(U2(this._rootElement,v)),g.add(Ja((m,_)=>{const y=this._diffModel.read(m),w=this._editors.original.createOverviewRuler("original diffOverviewRuler");w&&(_.add(w),_.add(U2(v,w.getDomNode())));const L=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(L&&(_.add(L),_.add(U2(v,L.getDomNode()))),!w||!L)return;const D=Fl("viewZoneChanged",this._editors.original.onDidChangeViewZones),E=Fl("viewZoneChanged",this._editors.modified.onDidChangeViewZones),I=Fl("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),k=Fl("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);_.add(Ii(R=>{var A;D.read(R),E.read(R),I.read(R),k.read(R);const P=d.read(R),N=(A=y==null?void 0:y.diff.read(R))===null||A===void 0?void 0:A.mappings;function M(F,$,z){const K=z._getViewModel();return K?F.filter(j=>j.length>0).map(j=>{const G=K.coordinatesConverter.convertModelPositionToViewPosition(new ae(j.startLineNumber,1)),X=K.coordinatesConverter.convertModelPositionToViewPosition(new ae(j.endLineNumberExclusive,1)),ue=X.lineNumber-G.lineNumber;return new Vbe(G.lineNumber,X.lineNumber,ue,$.toString())}):[]}const H=M((N||[]).map(F=>F.lineRangeMapping.original),P.removeColor,this._editors.original),B=M((N||[]).map(F=>F.lineRangeMapping.modified),P.insertColor,this._editors.modified);w==null||w.setZones(H),L==null||L.setZones(B)})),_.add(Ii(R=>{const A=this._rootHeight.read(R),P=this._rootWidth.read(R),N=this._modifiedEditorLayoutInfo.read(R);if(N){const M=cu.ENTIRE_DIFF_OVERVIEW_WIDTH-2*cu.ONE_OVERVIEW_WIDTH;w.setLayout({top:0,height:A,right:M+cu.ONE_OVERVIEW_WIDTH,width:cu.ONE_OVERVIEW_WIDTH}),L.setLayout({top:0,height:A,right:0,width:cu.ONE_OVERVIEW_WIDTH});const H=u.read(R),B=h.read(R),F=this._editors.modified.getOption(102),$=new Iw(F.verticalHasArrows?F.arrowSize:0,F.verticalScrollbarSize,0,N.height,B,H);p.setTop($.getSliderPosition()),p.setHeight($.getSliderSize())}else p.setTop(0),p.setHeight(0);v.style.height=A+"px",v.style.left=P-cu.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(cu.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};Zg.ONE_OVERVIEW_WIDTH=15;Zg.ENTIRE_DIFF_OVERVIEW_WIDTH=cu.ONE_OVERVIEW_WIDTH*2;Zg=cu=Ipt([Tpt(7,vr)],Zg);J("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},C("diffEditor.move.border","The border color for text that got moved in the diff editor."));J("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},C("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class eF extends _e{constructor(){super(...arguments),this._id=++eF.idCounter,this._onDidDispose=this._register(new le),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,n=0){this._targetEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._targetEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._targetEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,o=!0){this._targetEditor.revealRange(e,t,n,o)}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,n){this._targetEditor.trigger(e,t,n)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}eF.idCounter=0;var Npt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},hle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let sz=class extends _e{constructor(e,t,n,o,r,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=n,this._createInnerEditor=r,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new le),this.original=this._register(this._createLeftHandSideEditor(n.editorOptions.get(),o.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(n.editorOptions.get(),o.modifiedEditor||{})),this.modifiedModel=$r(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(Z5({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(n.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{n.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 n=this._adjustOptionsForLeftHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,n,t);return o.setContextValue("isInDiffLeftEditor",!0),o}_createRightHandSideEditor(e,t){const n=this._adjustOptionsForRightHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,n,t);return o.setContextValue("isInDiffRightEditor",!0),o}_constructInnerEditor(e,t,n,o){const r=this._createInnerEditor(e,t,n,o);return this._register(r.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Zg.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),r}_adjustOptionsForLeftHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(n.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},n.wordWrapOverride1=this._options.diffWordWrap.get()):(n.wordWrapOverride1="off",n.wordWrapOverride2="off",n.stickyScroll={enabled:!1},n.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(n.ariaLabel=t.originalAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.readOnly=!this._options.originalEditable.get(),n.dropIntoEditor={enabled:!n.readOnly},n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.wordWrapOverride1=this._options.diffWordWrap.get(),n.revealHorizontalRightPadding=rh.revealHorizontalRightPadding.defaultValue+Zg.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}_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 n=C("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+n:e?e.replaceAll(n,""):""}};sz=Npt([hle(5,$t),hle(6,xi)],sz);class Rpt{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=In(this,o=>this._options.read(o).renderSideBySide&&this.diffEditorWidth.read(o)<=this._options.read(o).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=In(this,o=>this._options.read(o).renderOverviewRuler),this.renderSideBySide=In(this,o=>this._options.read(o).renderSideBySide&&!(this._options.read(o).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(o))),this.readOnly=In(this,o=>this._options.read(o).readOnly),this.shouldRenderRevertArrows=In(this,o=>!(!this._options.read(o).renderMarginRevertIcon||!this.renderSideBySide.read(o)||this.readOnly.read(o))),this.renderIndicators=In(this,o=>this._options.read(o).renderIndicators),this.enableSplitViewResizing=In(this,o=>this._options.read(o).enableSplitViewResizing),this.splitViewDefaultRatio=In(this,o=>this._options.read(o).splitViewDefaultRatio),this.ignoreTrimWhitespace=In(this,o=>this._options.read(o).ignoreTrimWhitespace),this.maxComputationTimeMs=In(this,o=>this._options.read(o).maxComputationTime),this.showMoves=In(this,o=>this._options.read(o).experimental.showMoves&&this.renderSideBySide.read(o)),this.isInEmbeddedEditor=In(this,o=>this._options.read(o).isInEmbeddedEditor),this.diffWordWrap=In(this,o=>this._options.read(o).diffWordWrap),this.originalEditable=In(this,o=>this._options.read(o).originalEditable),this.diffCodeLens=In(this,o=>this._options.read(o).diffCodeLens),this.accessibilityVerbose=In(this,o=>this._options.read(o).accessibilityVerbose),this.diffAlgorithm=In(this,o=>this._options.read(o).diffAlgorithm),this.showEmptyDecorations=In(this,o=>this._options.read(o).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=In(this,o=>this._options.read(o).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=In(this,o=>this._options.read(o).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.minimumLineCount);const n=Object.assign(Object.assign({},e),fle(e,As));this._options=Ai(this,n)}updateOptions(e){const t=fle(e,this._options.get()),n=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(n,void 0,{changedOptions:e})}}function fle(i,e){var t,n,o,r,s,a,l,c;return{enableSplitViewResizing:xt(i.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:OXe(i.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:xt(i.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:xt(i.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:M_(i.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:M_(i.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:xt(i.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:xt(i.renderIndicators,e.renderIndicators),originalEditable:xt(i.originalEditable,e.originalEditable),diffCodeLens:xt(i.diffCodeLens,e.diffCodeLens),renderOverviewRuler:xt(i.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:To(i.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:To(i.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:xt(i.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:xt((t=i.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:xt((n=i.experimental)===null||n===void 0?void 0:n.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:xt((r=(o=i.hideUnchangedRegions)===null||o===void 0?void 0:o.enabled)!==null&&r!==void 0?r:(s=i.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:M_((a=i.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:M_((l=i.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:M_((c=i.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:xt(i.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:xt(i.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:M_(i.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:xt(i.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var Mpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Gx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ub=class extends eF{constructor(e,t,n,o,r,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=o,this._parentInstantiationService=r,this._audioCueService=a,this._editorProgressService=l,this.elements=Or("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Or("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[He("span",{},"No Changes")]),Or("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Or("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Or("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(tO("diffModel",void 0)),this.onDidChangeModel=st.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new E5([Ut,this._contextKeyService])),this._boundarySashes=Ai(this,void 0),this._accessibleDiffViewerShouldBeVisible=Ai(this,!1),this._accessibleDiffViewerVisible=In(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=Ai(this,void 0),this._layoutInfo=In(this,p=>{var v,m,_;const y=this._rootSizeObserver.width.read(p),w=this._rootSizeObserver.height.read(p),L=(v=this._sash.read(p))===null||v===void 0?void 0:v.sashLeft.read(p),D=L!=null?L:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),E=y-D-(this._options.renderOverviewRuler.read(p)?Zg.ENTIRE_DIFF_OVERVIEW_WIDTH:0),I=(_=(m=this.movedBlocksLinesPart.read(p))===null||m===void 0?void 0:m.width.read(p))!==null&&_!==void 0?_:0,k=D-I;return this.elements.original.style.width=k+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=E+"px",this.elements.modified.style.left=D+"px",this._editors.original.layout({width:k,height:w}),this._editors.modified.layout({width:E,height:w}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((p,v)=>p==null?void 0:p.diff.read(v)),this.onDidUpdateDiff=st.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(zt(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new qgt(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new Rpt(t,this._rootSizeObserver.width),this._contextKeyService.createKey(Q.isEmbeddedDiffEditor.key,!1);const d=Q.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(Ii(p=>{d.set(this._options.isInEmbeddedEditor.read(p))}));const u=Q.comparingMovedCode.bindTo(this._contextKeyService);this._register(Ii(p=>{var v;u.set(!!(!((v=this._diffModel.read(p))===null||v===void 0)&&v.movedTextToCompare.read(p)))}));const h=Q.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(Ii(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(sz,this.elements.original,this.elements.modified,this._options,n,(p,v,m,_)=>this._createInnerEditor(p,v,m,_))),this._sash=Tk(this,(p,v)=>{const m=this._options.renderSideBySide.read(p);if(this.elements.root.classList.toggle("side-by-side",m),!m)return;const _=v.add(new gpt(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,w)=>y-(this._options.renderOverviewRuler.read(w)?Zg.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return v.add(Ii(y=>{const w=this._boundarySashes.read(y);w&&_.setBoundarySashes(w)})),_}),this._register(Rk(this._sash)),this._register(Ja((p,v)=>{this.unchangedRangesFeature=v.add(this._instantiationService.createInstance(im(tz,p),this._editors,this._diffModel,this._options))})),this._register(Ja((p,v)=>{v.add(new(im(fpt,p))(this._editors,this._diffModel,this._options))})),this._register(Ja((p,v)=>{v.add(this._instantiationService.createInstance(im(rz,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(Ja((p,v)=>{v.add(this._instantiationService.createInstance(im(Zg,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(m=>m.modifiedEditor),this._options))})),this._register(Ja((p,v)=>{this._accessibleDiffViewer=v.add(this._register(this._instantiationService.createInstance(im(Tm,p),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(m,_)=>this._accessibleDiffViewerShouldBeVisible.set(m,_),this._options.onlyShowAccessibleDiffViewer.map(m=>!m),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((m,_)=>{var y;return(y=m==null?void 0:m.diff.read(_))===null||y===void 0?void 0:y.mappings.map(w=>w.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(nv(this.elements.modified,{visibility:f})),this._register(nv(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(Rk(this._layoutInfo)),this._register(Ja((p,v)=>{this.movedBlocksLinesPart.set(v.add(new(im(iv,p))(this.elements.root,this._diffModel,this._layoutInfo.map(m=>m.originalEditor),this._layoutInfo.map(m=>m.modifiedEditor),this._editors)),void 0)})),this._register(nv(this.elements.overlay,{width:this._layoutInfo.map((p,v)=>p.originalEditor.width+(this._options.renderSideBySide.read(v)?0:p.modifiedEditor.width)),visibility:In(p=>{var v,m;return this._options.hideUnchangedRegions.read(p)&&((m=(v=this._diffModel.read(p))===null||v===void 0?void 0:v.diff.read(p))===null||m===void 0?void 0:m.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(p=>{var v,m;if(!p.event.rightButton&&p.target.position&&((v=p.target.element)===null||v===void 0?void 0:v.className.includes("arrow-revert-change"))){const _=p.target.position.lineNumber,y=p.target,w=this._diffModel.get();if(!w)return;const L=(m=w.diff.get())===null||m===void 0?void 0:m.mappings;if(!L)return;const D=L.find(E=>(y==null?void 0:y.detail.afterLineNumber)===E.lineRangeMapping.modified.startLineNumber-1||E.lineRangeMapping.modified.startLineNumber===_);if(!D)return;this.revert(D.lineRangeMapping),p.event.stopPropagation()}})),this._register(st.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,p=>{var v,m;if((p==null?void 0:p.reason)===3){const _=(m=(v=this._diffModel.get())===null||v===void 0?void 0:v.diff.get())===null||m===void 0?void 0:m.mappings.find(y=>y.lineRangeMapping.modified.contains(p.position.lineNumber));_!=null&&_.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(Wn.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):_!=null&&_.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(Wn.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):_&&this._audioCueService.playAudioCue(Wn.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,v)=>p==null?void 0:p.isDiffUpToDate.read(v));this._register(Ja((p,v)=>{if(g.read(p)===!1){const m=this._editorProgressService.show(!0,1e3);v.add(zt(()=>m.done()))}}))}_createInnerEditor(e,t,n,o){return e.createInstance(Nw,t,n,o)}_createDiffEditorContributions(){const e=by.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(n){en(n)}}get _targetEditor(){return this._editors.modified}getEditorType(){return KI.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(),n=this._editors.modified.saveViewState();return{original:t,modified:n,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const n=e;this._editors.original.restoreViewState(n.original),this._editors.modified.restoreViewState(n.modified),n.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(n.modelState))}}createViewModel(e){return this._instantiationService.createInstance(oz,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),qi(n=>{this._diffModel.set(t,n)})}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?Opt(t):null}revert(e){var t;const n=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!n)return;const o=e.innerChanges?e.innerChanges.map(r=>({range:r.modifiedRange,text:n.original.getValueInRange(r.originalRange)})):[{range:e.modified.toExclusiveRange(),text:n.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",o)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const n=this._editors.modified.hasWidgetFocus(),o=n?this._editors.modified:this._editors.original,r=n?this._editors.original:this._editors.modified;let s;const a=o.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=>n?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=gle(a.getStartPosition(),l),d=gle(a.getEndPosition(),l);s=V.plusRange(c,d)}}return{destination:r,destinationSelection:s}}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||qi(n=>{for(const o of t)o.collapseAll(n)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();!t||qi(n=>{for(const o of t)o.showAll(n)})}};ub=Mpt([Gx(3,Ut),Gx(4,$t),Gx(5,Jn),Gx(6,hT),Gx(7,t_)],ub);function gle(i,e){const t=nP(e,o=>o.original.startLineNumber<=i.lineNumber);if(!t)return V.fromPositions(i);if(t.original.endLineNumberExclusive<=i.lineNumber){const o=i.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return V.fromPositions(new ae(o,i.column))}if(!t.innerChanges)return V.fromPositions(new ae(t.modified.startLineNumber,1));const n=nP(t.innerChanges,o=>o.originalRange.getStartPosition().isBeforeOrEqual(i));if(!n){const o=i.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return V.fromPositions(new ae(o,i.column))}if(n.originalRange.containsPosition(i))return n.modifiedRange;{const o=Apt(n.originalRange.getEndPosition(),i);return V.fromPositions(Ppt(n.modifiedRange.getEndPosition(),o))}}function Apt(i,e){return i.lineNumber===e.lineNumber?new sk(0,e.column-i.column):new sk(e.lineNumber-i.lineNumber,e.column-1)}function Ppt(i,e){return e.lineCount===0?new ae(i.lineNumber,i.column+e.columnCount):new ae(i.lineNumber+e.lineCount,e.columnCount+1)}function Opt(i){return i.mappings.map(e=>{const t=e.lineRangeMapping;let n,o,r,s,a=t.innerChanges;return t.original.isEmpty?(n=t.original.startLineNumber-1,o=0,a=void 0):(n=t.original.startLineNumber,o=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(r=t.modified.startLineNumber-1,s=0,a=void 0):(r=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:n,originalEndLineNumber:o,modifiedStartLineNumber:r,modifiedEndLineNumber:s,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 YX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Fpt=0,ple=!1;function Bpt(i){if(!i){if(ple)return;ple=!0}Htt(i||document.body)}let lO=class extends Nw{constructor(e,t,n,o,r,s,a,l,c,d,u,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||MP.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+MP.accessibilityHelpMessage,super(e,f,{},n,o,r,s,l,c,d,u,h),a instanceof Ww?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,Bpt(f.ariaContainerElement)}addCommand(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const o="DYNAMIC_"+ ++Fpt,r=Me.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(o,e,t,r),o}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"),_e.None;const t=e.id,n=e.label,o=Me.and(Me.equals("editorId",this.getId()),Me.deserialize(e.precondition)),r=e.keybindings,s=Me.and(o,Me.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(Rn.registerCommand(u,c)),a){const f={command:{id:u,title:n},when:o,group:a,order:l};d.add(Hr.appendMenuItem(Z.EditorContext,f))}if(Array.isArray(r))for(const f of r)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,f,c,s));const h=new Hbe(u,n,n,o,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),d.add(zt(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof LP)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};lO=YX([zi(2,$t),zi(3,Jn),zi(4,_o),zi(5,Ut),zi(6,xi),zi(7,vr),zi(8,Ao),zi(9,_p),zi(10,Ti),zi(11,pt)],lO);let az=class extends lO{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f,g,p){const v=Object.assign({},t);eO(d,v,!1);const m=l.registerEditorContainer(e);typeof v.theme=="string"&&l.setTheme(v.theme),typeof v.autoDetectHighContrast!="undefined"&&l.setAutoDetectHighContrast(Boolean(v.autoDetectHighContrast));const _=v.model;delete v.model,super(e,v,n,o,r,s,a,l,c,u,g,p),this._configurationService=d,this._standaloneThemeService=l,this._register(m);let y;if(typeof _=="undefined"){const w=f.getLanguageIdByMimeType(v.language)||v.language||Gl;y=GCe(h,f,v.value||"",w,void 0),this._ownsModel=!0}else y=_,this._ownsModel=!1;if(this._attachModel(y),y){const w={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(w)}}dispose(){super.dispose()}updateOptions(e){eO(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};az=YX([zi(2,$t),zi(3,Jn),zi(4,_o),zi(5,Ut),zi(6,xi),zi(7,ic),zi(8,Ao),zi(9,En),zi(10,_p),zi(11,Yi),zi(12,Ki),zi(13,Ti),zi(14,pt)],az);let lz=class extends ub{constructor(e,t,n,o,r,s,a,l,c,d,u,h){const f=Object.assign({},t);eO(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast!="undefined"&&s.setAutoDetectHighContrast(Boolean(f.autoDetectHighContrast)),super(e,f,{},o,n,r,h,d),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){eO(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,n){return e.createInstance(lO,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};lz=YX([zi(2,$t),zi(3,Ut),zi(4,Jn),zi(5,ic),zi(6,Ao),zi(7,En),zi(8,Kd),zi(9,t_),zi(10,wp),zi(11,hT)],lz);function GCe(i,e,t,n,o){if(t=t||"",!n){const r=t.indexOf(` -`);let s=t;return r!==-1&&(s=t.substring(0,r)),mle(i,t,e.createByFilepathOrFirstLine(o||null,s),o)}return mle(i,t,e.createById(n),o)}function mle(i,e,t,n){return i.createModel(e,t,n)}var XCe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Wpt(i,e,t){return Vt.initialize(t||{}).createInstance(az,i,e)}function Vpt(i){return Vt.get(Jn).onCodeEditorAdd(t=>{i(t)})}function Hpt(i){return Vt.get(Jn).onDiffEditorAdd(t=>{i(t)})}function $pt(){return Vt.get(Jn).listCodeEditors()}function zpt(){return Vt.get(Jn).listDiffEditors()}function Upt(i,e,t){return Vt.initialize(t||{}).createInstance(lz,i,e)}function jpt(i){if(typeof i.id!="string"||typeof i.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Rn.registerCommand(i.id,i.run)}function Kpt(i){if(typeof i.id!="string"||typeof i.label!="string"||typeof i.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Me.deserialize(i.precondition),t=(o,...r)=>Ir.runEditorCommand(o,r,e,(s,a,l)=>Promise.resolve(i.run(a,...l))),n=new Be;if(n.add(Rn.registerCommand(i.id,t)),i.contextMenuGroupId){const o={command:{id:i.id,title:i.label},when:e,group:i.contextMenuGroupId,order:i.contextMenuOrder||0};n.add(Hr.appendMenuItem(Z.EditorContext,o))}if(Array.isArray(i.keybindings)){const o=Vt.get(xi);if(!(o instanceof Ww))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const r=Me.and(e,Me.deserialize(i.keybindingContext));n.add(o.addDynamicKeybindings(i.keybindings.map(s=>({keybinding:s,command:i.id,when:r}))))}}return n}function qpt(i){return YCe([i])}function YCe(i){const e=Vt.get(xi);return e instanceof Ww?e.addDynamicKeybindings(i.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Me.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),_e.None)}function Gpt(i,e,t){const n=Vt.get(Ki),o=n.getLanguageIdByMimeType(e)||e;return GCe(Vt.get(Yi),n,i,o,t)}function Xpt(i,e){const t=Vt.get(Ki),n=t.getLanguageIdByMimeType(e)||e||Gl;i.setLanguage(t.createById(n))}function Ypt(i,e,t){i&&Vt.get(Rf).changeOne(e,i.uri,t)}function Zpt(i){Vt.get(Rf).changeAll(i,[])}function Qpt(i){return Vt.get(Rf).read(i)}function Jpt(i){return Vt.get(Rf).onMarkerChanged(i)}function emt(i){return Vt.get(Yi).getModel(i)}function tmt(){return Vt.get(Yi).getModels()}function nmt(i){return Vt.get(Yi).onModelAdded(i)}function imt(i){return Vt.get(Yi).onModelRemoved(i)}function omt(i){return Vt.get(Yi).onModelLanguageChanged(t=>{i({model:t.model,oldLanguage:t.oldLanguageId})})}function rmt(i){return gtt(Vt.get(Yi),Vt.get(Ti),i)}function smt(i,e){const t=Vt.get(Ki),n=Vt.get(ic);return CG.colorizeElement(n,t,i,e).then(()=>{n.registerEditorContainer(i)})}function amt(i,e,t){const n=Vt.get(Ki);return Vt.get(ic).registerEditorContainer(document.body),CG.colorize(n,i,e,t)}function lmt(i,e,t=4){return Vt.get(ic).registerEditorContainer(document.body),CG.colorizeModelLine(i,e,t)}function cmt(i){const e=oo.get(i);return e||{getInitialState:()=>ww,tokenize:(t,n,o)=>vG(i,o)}}function dmt(i,e){oo.getOrCreate(e);const t=cmt(e),n=gf(i),o=[];let r=t.getInitialState();for(let s=0,a=n.length;sXCe(this,void 0,void 0,function*(){var r;if(!n)return null;const s=(r=t.options)===null||r===void 0?void 0:r.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),(yield i.openCodeEditor(n,t.resource,a))?n:null}))}function vmt(){return{create:Wpt,getEditors:$pt,getDiffEditors:zpt,onDidCreateEditor:Vpt,onDidCreateDiffEditor:Hpt,createDiffEditor:Upt,addCommand:jpt,addEditorAction:Kpt,addKeybindingRule:qpt,addKeybindingRules:YCe,createModel:Gpt,setModelLanguage:Xpt,setModelMarkers:Ypt,getModelMarkers:Qpt,removeAllMarkers:Zpt,onDidChangeMarkers:Jpt,getModels:tmt,getModel:emt,onDidCreateModel:nmt,onWillDisposeModel:imt,onDidChangeModelLanguage:omt,createWebWorker:rmt,colorizeElement:smt,colorize:amt,colorizeModelLine:lmt,tokenize:dmt,defineTheme:umt,setTheme:hmt,remeasureFonts:fmt,registerCommand:gmt,registerLinkOpener:pmt,registerEditorOpener:mmt,AccessibilitySupport:nV,ContentWidgetPositionPreference:lV,CursorChangeReason:cV,DefaultEndOfLine:dV,EditorAutoIndentStrategy:hV,EditorOption:fV,EndOfLinePreference:gV,EndOfLineSequence:pV,MinimapPosition:xV,MouseTargetType:LV,OverlayWidgetPositionPreference:EV,OverviewRulerLane:DV,GlyphMarginLane:mV,RenderLineNumbersType:IV,RenderMinimap:TV,ScrollbarVisibility:RV,ScrollType:NV,TextEditorCursorBlinkingStyle:FV,TextEditorCursorStyle:BV,TrackedRangeStickiness:WV,WrappingIndent:VV,InjectedTextCursorStops:_V,PositionAffinity:kV,ConfigurationChangedEvent:x_e,BareFontInfo:k0,FontInfo:zV,TextModelResolvedOptions:sM,FindMatch:HD,ApplyUpdateResult:cE,EditorZoom:xc,EditorType:KI,EditorOptions:rh}}function _mt(i,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!i(t))return!1;return!0}function j2(i,e){return typeof i=="boolean"?i:e}function vle(i,e){return typeof i=="string"?i:e}function bmt(i){const e={};for(const t of i)e[t]=!0;return e}function _le(i,e=!1){e&&(i=i.map(function(n){return n.toLowerCase()}));const t=bmt(i);return e?function(n){return t[n.toLowerCase()]!==void 0&&t.hasOwnProperty(n.toLowerCase())}:function(n){return t[n]!==void 0&&t.hasOwnProperty(n)}}function cz(i,e){e=e.replace(/@@/g,"");let t=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,s){n=!0;let a="";if(typeof i[s]=="string")a=i[s];else if(i[s]&&i[s]instanceof RegExp)a=i[s].source;else throw i[s]===void 0?Bi(i,"language definition does not contain attribute '"+s+"', used at: "+e):Bi(i,"attribute reference '"+s+"' must be a string, used at: "+e);return uC(a)?"":"(?:"+a+")"}),t++;while(n&&t<5);e=e.replace(/\x01/g,"@");const o=(i.ignoreCase?"i":"")+(i.unicode?"u":"");return new RegExp(e,o)}function Cmt(i,e,t,n){if(n<0)return i;if(n=100){n=n-100;const o=t.split(".");if(o.unshift(t),n=0&&(n.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")n.bracket=1;else if(t.bracket==="@close")n.bracket=-1;else throw Bi(i,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Bi(i,"the next state must be a string value in rule: "+e);{let o=t.next;if(!/^(@pop|@push|@popall)$/.test(o)&&(o[0]==="@"&&(o=o.substr(1)),o.indexOf("$")<0&&!Mtt(i,lm(i,o,"",[],""))))throw Bi(i,"the next state '"+t.next+"' is not defined in rule: "+e);n.next=o}}return typeof t.goBack=="number"&&(n.goBack=t.goBack),typeof t.switchTo=="string"&&(n.switchTo=t.switchTo),typeof t.log=="string"&&(n.log=t.log),typeof t.nextEmbedded=="string"&&(n.nextEmbedded=t.nextEmbedded,i.usesEmbedded=!0),n}}else if(Array.isArray(t)){const n=[];for(let o=0,r=t.length;o0&&n[0]==="^",this.name=this.name+": "+n,this.regex=cz(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=dz(e,this.name,t)}}function ZCe(i,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=i,t.includeLF=j2(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=j2(e.ignoreCase,!1),t.unicode=j2(e.unicode,!1),t.tokenPostfix=vle(e.tokenPostfix,"."+t.languageId),t.defaultToken=vle(e.defaultToken,"source"),t.usesEmbedded=!1;const n=e;n.languageId=i,n.includeLF=t.includeLF,n.ignoreCase=t.ignoreCase,n.unicode=t.unicode,n.noThrow=t.noThrow,n.usesEmbedded=t.usesEmbedded,n.stateNames=e.tokenizer,n.defaultToken=t.defaultToken;function o(s,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Bi(t,"an 'include' attribute must be a string at: "+s);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Bi(t,"include target '"+d+"' is not defined at: "+s);o(s+"."+d,a,e.tokenizer[d])}else{const u=new wmt(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(n,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(n,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],u.setAction(n,h)}else throw Bi(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: "+s);else u.setAction(n,c[1]);else{if(!c.regex)throw Bi(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=j2(c.matchOnlyAtLineStart,!1)),u.setRegex(n,c.regex),u.setAction(n,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Bi(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,o("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=n.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Bi(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 r=[];for(const s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Bi(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")r.push({token:a.token+t.tokenPostfix,open:Ym(t,a.open),close:Ym(t,a.close)});else throw Bi(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=r,t.noThrow=!0,t}var Smt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function xmt(i){Cw.registerLanguage(i)}function Lmt(){let i=[];return i=i.concat(Cw.getLanguages()),i}function Emt(i){return Vt.get(Ki).languageIdCodec.encodeLanguageId(i)}function Dmt(i,e){return Vt.withServices(()=>{const n=Vt.get(Ki).onDidRequestRichLanguageFeatures(o=>{o===i&&(n.dispose(),e())});return n})}function kmt(i,e){return Vt.withServices(()=>{const n=Vt.get(Ki).onDidRequestBasicLanguageFeatures(o=>{o===i&&(n.dispose(),e())});return n})}function Imt(i,e){if(!Vt.get(Ki).isRegisteredLanguageId(i))throw new Error(`Cannot set configuration for unknown language ${i}`);return Vt.get(Ti).register(i,e,100)}class Tmt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){if(typeof this._actual.tokenize=="function")return Mk.adaptTokenize(this._languageId,this._actual,e,n);throw new Error("Not supported!")}tokenizeEncoded(e,t,n){const o=this._actual.tokenizeEncoded(e,n);return new $4(o.tokens,o.endState)}}class Mk{constructor(e,t,n,o){this._languageId=e,this._actual=t,this._languageService=n,this._standaloneThemeService=o}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const n=[];let o=0;for(let r=0,s=e.length;r0&&r[s-1]===h)continue;let f=u.startIndex;c===0?f=0:fSmt(this,void 0,void 0,function*(){const n=yield Promise.resolve(e.create());return n?Nmt(n)?JCe(i,n):new GD(Vt.get(Ki),Vt.get(ic),i,ZCe(i,n),Vt.get(En)):null}));return oo.registerFactory(i,t)}function Amt(i,e){if(!Vt.get(Ki).isRegisteredLanguageId(i))throw new Error(`Cannot set tokens provider for unknown language ${i}`);return QCe(e)?ZX(i,{create:()=>e}):oo.register(i,JCe(i,e))}function Pmt(i,e){const t=n=>new GD(Vt.get(Ki),Vt.get(ic),i,ZCe(i,n),Vt.get(En));return QCe(e)?ZX(i,{create:()=>e}):oo.register(i,t(e))}function Omt(i,e){return Vt.get(pt).referenceProvider.register(i,e)}function Fmt(i,e){return Vt.get(pt).renameProvider.register(i,e)}function Bmt(i,e){return Vt.get(pt).signatureHelpProvider.register(i,e)}function Wmt(i,e){return Vt.get(pt).hoverProvider.register(i,{provideHover:(n,o,r)=>{const s=n.getWordAtPosition(o);return Promise.resolve(e.provideHover(n,o,r)).then(a=>{if(!!a)return!a.range&&s&&(a.range=new V(o.lineNumber,s.startColumn,o.lineNumber,s.endColumn)),a.range||(a.range=new V(o.lineNumber,o.column,o.lineNumber,o.column)),a})}})}function Vmt(i,e){return Vt.get(pt).documentSymbolProvider.register(i,e)}function Hmt(i,e){return Vt.get(pt).documentHighlightProvider.register(i,e)}function $mt(i,e){return Vt.get(pt).linkedEditingRangeProvider.register(i,e)}function zmt(i,e){return Vt.get(pt).definitionProvider.register(i,e)}function Umt(i,e){return Vt.get(pt).implementationProvider.register(i,e)}function jmt(i,e){return Vt.get(pt).typeDefinitionProvider.register(i,e)}function Kmt(i,e){return Vt.get(pt).codeLensProvider.register(i,e)}function qmt(i,e,t){return Vt.get(pt).codeActionProvider.register(i,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(o,r,s,a)=>{const c=Vt.get(Rf).read({resource:o.uri}).filter(d=>V.areIntersectingOrTouching(d,r));return e.provideCodeActions(o,r,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Gmt(i,e){return Vt.get(pt).documentFormattingEditProvider.register(i,e)}function Xmt(i,e){return Vt.get(pt).documentRangeFormattingEditProvider.register(i,e)}function Ymt(i,e){return Vt.get(pt).onTypeFormattingEditProvider.register(i,e)}function Zmt(i,e){return Vt.get(pt).linkProvider.register(i,e)}function Qmt(i,e){return Vt.get(pt).completionProvider.register(i,e)}function Jmt(i,e){return Vt.get(pt).colorProvider.register(i,e)}function evt(i,e){return Vt.get(pt).foldingRangeProvider.register(i,e)}function tvt(i,e){return Vt.get(pt).declarationProvider.register(i,e)}function nvt(i,e){return Vt.get(pt).selectionRangeProvider.register(i,e)}function ivt(i,e){return Vt.get(pt).documentSemanticTokensProvider.register(i,e)}function ovt(i,e){return Vt.get(pt).documentRangeSemanticTokensProvider.register(i,e)}function rvt(i,e){return Vt.get(pt).inlineCompletionsProvider.register(i,e)}function svt(i,e){return Vt.get(pt).inlayHintsProvider.register(i,e)}function avt(){return{register:xmt,getLanguages:Lmt,onLanguage:Dmt,onLanguageEncountered:kmt,getEncodedLanguageId:Emt,setLanguageConfiguration:Imt,setColorMap:Mmt,registerTokensProviderFactory:ZX,setTokensProvider:Amt,setMonarchTokensProvider:Pmt,registerReferenceProvider:Omt,registerRenameProvider:Fmt,registerCompletionItemProvider:Qmt,registerSignatureHelpProvider:Bmt,registerHoverProvider:Wmt,registerDocumentSymbolProvider:Vmt,registerDocumentHighlightProvider:Hmt,registerLinkedEditingRangeProvider:$mt,registerDefinitionProvider:zmt,registerImplementationProvider:Umt,registerTypeDefinitionProvider:jmt,registerCodeLensProvider:Kmt,registerCodeActionProvider:qmt,registerDocumentFormattingEditProvider:Gmt,registerDocumentRangeFormattingEditProvider:Xmt,registerOnTypeFormattingEditProvider:Ymt,registerLinkProvider:Zmt,registerColorProvider:Jmt,registerFoldingRangeProvider:evt,registerDeclarationProvider:tvt,registerSelectionRangeProvider:nvt,registerDocumentSemanticTokensProvider:ivt,registerDocumentRangeSemanticTokensProvider:ovt,registerInlineCompletionsProvider:rvt,registerInlayHintsProvider:svt,DocumentHighlightKind:uV,CompletionItemKind:rV,CompletionItemTag:sV,CompletionItemInsertTextRule:oV,SymbolKind:PV,SymbolTag:OV,IndentAction:vV,CompletionTriggerKind:aV,SignatureHelpTriggerKind:AV,InlayHintKind:bV,InlineCompletionTriggerKind:CV,CodeActionTriggerType:iV,FoldingRangeKind:ra,SelectedSuggestionInfo:V_e}}const QX=yn("IEditorCancelService"),eye=new lt("cancellableOperation",!1,C("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Mn(QX,class{constructor(){this._tokens=new WeakMap}add(i,e){let t=this._tokens.get(i);t||(t=i.invokeWithinContext(o=>{const r=eye.bindTo(o.get(Ut)),s=new oa;return{key:r,tokens:s}}),this._tokens.set(i,t));let n;return t.key.set(!0),n=t.tokens.push(e),()=>{n&&(n(),t.key.set(!t.tokens.isEmpty()),n=void 0)}}cancel(i){const e=this._tokens.get(i);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class lvt extends Ro{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(n=>n.get(QX).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ye(new class extends Ir{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:eye})}runEditorCommand(i,e){i.get(QX).cancel(e)}});class Ak{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const n=e.getModel();this.modelVersionId=n?Z0("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Ak))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 Ak(e,this.flags))}}class Av extends lvt{constructor(e,t,n,o){super(e,o),this._listener=new Be,t&4&&this._listener.add(e.onDidChangeCursorPosition(r=>{(!n||!V.containsPosition(n,r.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(r=>{(!n||!V.containsRange(n,r.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(r=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(r=>this.cancel())),this._listener.add(e.onDidChangeModelContent(r=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class JX extends Ro{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Sf(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===KI.ICodeEditor:!1}function tye(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===KI.IDiffEditor:!1}function cvt(i){return!!i&&typeof i=="object"&&typeof i.onDidChangeActiveEditor=="function"}function nye(i){return Sf(i)?i:tye(i)?i.getModifiedEditor():cvt(i)&&Sf(i.activeCodeEditor)?i.activeCodeEditor:null}class Vw{static _handleEolEdits(e,t){let n;const o=[];for(const r of t)typeof r.eol=="number"&&(n=r.eol),r.range&&typeof r.text=="string"&&o.push(r);return typeof n=="number"&&e.hasModel()&&e.getModel().pushEOL(n),o}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const n=e.getModel(),o=n.validateRange(t.range);return n.getFullModelRange().equalsRange(o)}static execute(e,t,n){n&&e.pushUndoStop();const o=Zu.capture(e),r=Vw._handleEolEdits(e,t);r.length===1&&Vw._isFullModelReplaceEdit(e,r[0])?e.executeEdits("formatEditsCommand",r.map(s=>Gi.replace(V.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",r.map(s=>Gi.replaceMove(V.lift(s.range),s.text))),n&&e.pushUndoStop(),o.restoreRelativeVerticalPositionOfCursor(e)}}class ble{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class dvt{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(ble.toKey(e))}has(e){return this._set.has(ble.toKey(e))}}var Qu=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function eY(i){if(i=i.filter(o=>o.range),!i.length)return;let{range:e}=i[0];for(let o=1;o0&&V.areIntersectingOrTouching(u[h-1],m)?u[h-1]=V.fromPositions(u[h-1].getStartPosition(),m.getEndPosition()):h=u.push(m);const f=m=>Qu(this,void 0,void 0,function*(){var _,y;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(_=e.extensionId)===null||_===void 0?void 0:_.value,m);const w=(yield e.provideDocumentRangeFormattingEdits(c,m,c.getFormattingOptions(),d.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)===null||y===void 0?void 0:y.value,w),w}),g=(m,_)=>{if(!m.length||!_.length)return!1;const y=m.reduce((w,L)=>V.plusRange(w,L.range),m[0].range);if(!_.some(w=>V.intersectRanges(y,w.range)))return!1;for(const w of m)for(const L of _)if(V.intersectRanges(w.range,L.range))return!0;return!1},p=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(r=e.extensionId)===null||r===void 0?void 0:r.value,u);const m=(yield e.provideDocumentRangesFormattingEdits(c,u,c.getFormattingOptions(),d.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(s=e.extensionId)===null||s===void 0?void 0:s.value,m),v.push(m)}else{for(const m of u){if(d.token.isCancellationRequested)return!0;v.push(yield f(m))}for(let m=0;m({text:y.text,range:V.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:w}of y)if(V.areIntersectingOrTouching(w,_))return[new gt(w.startLineNumber,w.startColumn,w.endLineNumber,w.endColumn)];return null})}return!0})}function hvt(i,e,t,n,o){return Qu(this,void 0,void 0,function*(){const r=i.get($t),s=i.get(pt),a=Sf(e)?e.getModel():e,l=iye(s.documentFormattingEditProvider,s.documentRangeFormattingEditProvider,a),c=yield hb.select(l,a,t);c&&(n.report(c),yield r.invokeFunction(fvt,c,e,t,o))})}function fvt(i,e,t,n,o){return Qu(this,void 0,void 0,function*(){const r=i.get(Xd);let s,a;Sf(t)?(s=t.getModel(),a=new Av(t,5,void 0,o)):(s=t,a=new JX(t,o));let l;try{const c=yield e.provideDocumentFormattingEdits(s,s.getFormattingOptions(),a.token);if(l=yield r.computeMoreMinimalEdits(s.uri,c),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||l.length===0)return!1;if(Sf(t))Vw.execute(t,l,n!==2),n!==2&&(eY(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:c}]=l,d=new gt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn);s.pushEditOperations([d],l.map(u=>({text:u.text,range:V.lift(u.range),forceMoveMarkers:!0})),u=>{for(const{range:h}of u)if(V.areIntersectingOrTouching(h,d))return[new gt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn)];return null})}return!0})}function gvt(i,e,t,n,o,r){return Qu(this,void 0,void 0,function*(){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,n,o,r)).catch($o);if(ws(l))return yield i.computeMoreMinimalEdits(t.uri,l)}})}function pvt(i,e,t,n,o){return Qu(this,void 0,void 0,function*(){const r=iye(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of r){const a=yield Promise.resolve(s.provideDocumentFormattingEdits(t,n,o)).catch($o);if(ws(a))return yield i.computeMoreMinimalEdits(t.uri,a)}})}function rye(i,e,t,n,o,r,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,n,o,r,s)).catch($o).then(l=>i.computeMoreMinimalEdits(t.uri,l))}Rn.registerCommand("_executeFormatRangeProvider",function(i,...e){return Qu(this,void 0,void 0,function*(){const[t,n,o]=e;fi(Rt.isUri(t)),fi(V.isIRange(n));const r=i.get(za),s=i.get(Xd),a=i.get(pt),l=yield r.createModelReference(t);try{return gvt(s,a,l.object.textEditorModel,V.lift(n),o,_n.None)}finally{l.dispose()}})});Rn.registerCommand("_executeFormatDocumentProvider",function(i,...e){return Qu(this,void 0,void 0,function*(){const[t,n]=e;fi(Rt.isUri(t));const o=i.get(za),r=i.get(Xd),s=i.get(pt),a=yield o.createModelReference(t);try{return pvt(r,s,a.object.textEditorModel,n,_n.None)}finally{a.dispose()}})});Rn.registerCommand("_executeFormatOnTypeProvider",function(i,...e){return Qu(this,void 0,void 0,function*(){const[t,n,o,r]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string");const s=i.get(za),a=i.get(Xd),l=i.get(pt),c=yield s.createModelReference(t);try{return rye(a,l,c.object.textEditorModel,ae.lift(n),o,r,_n.None)}finally{c.dispose()}})});rh.wrappingIndent.defaultValue=0;rh.glyphMargin.defaultValue=!1;rh.autoIndent.defaultValue=3;rh.overviewRulerLanes.defaultValue=2;hb.setFormatterSelector((i,e,t)=>Promise.resolve(i[0]));const va=H_e();va.editor=vmt();va.languages=avt();const mvt=va.CancellationTokenSource,vvt=va.Emitter,_vt=va.KeyCode,bvt=va.KeyMod,Cvt=va.Position,yvt=va.Range,wvt=va.Selection,Svt=va.SelectionDirection,xvt=va.MarkerSeverity,Lvt=va.MarkerTag,Evt=va.Uri,Dvt=va.Token,sye=va.editor,aye=va.languages,Y9=globalThis.MonacoEnvironment;((Y9==null?void 0:Y9.globalAPI)||typeof define=="function"&&define.amd)&&(globalThis.monaco=va);typeof globalThis.require!="undefined"&&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"]});var gT=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:mvt,Emitter:vvt,KeyCode:_vt,KeyMod:bvt,Position:Cvt,Range:yvt,Selection:wvt,SelectionDirection:Svt,MarkerSeverity:xvt,MarkerTag:Lvt,Uri:Evt,Token:Dvt,editor:sye,languages:aye},Symbol.toStringTag,{value:"Module"}));const kvt="_editor_kujsi_1";var Ivt={editor:kvt};const Tvt="modulepreload",Cle={},Nvt="/eos/",wt=function(e,t){return!t||t.length===0?e():Promise.all(t.map(n=>{if(n=`${Nvt}${n}`,n in Cle)return;Cle[n]=!0;const o=n.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${r}`))return;const s=document.createElement("link");if(s.rel=o?"stylesheet":Tvt,o||(s.as="script",s.crossOrigin=""),s.href=n,document.head.appendChild(s),o)return new Promise((a,l)=>{s.addEventListener("load",a),s.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>e())};/*!----------------------------------------------------------------------------- +`),yield this._clipboardService.writeText(w)}))),n.getOption(90)||m.push(new ca("diff.inline.revertChange",C("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>Y9(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),m},autoSelectFirstItem:!0})};this._register(No(this._diffActions,"mousedown",g=>{const{top:p,height:v}=Yo(this._diffActions),m=Math.floor(d/3);g.preventDefault(),f(g.posx,p+v+m)})),this._register(n.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(n.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,n){const{top:o}=Yo(e),r=t-o,s=Math.floor(r/n),a=s*n;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;ci});function kpt(i,e,t,n){ss(n,e.fontInfo);const o=t.length>0,r=new yS(1e4);let s=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Zl.isBasicASCII(l,o),d=Zl.containsRTL(l,c,r),u=qI(new Jv(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Pl.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var Tpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},dle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let sz=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editors=e,this._diffModel=t,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._clipboardService=s,this._contextMenuService=a,this._originalTopPadding=Ai(this,0),this._originalScrollOffset=Ai(this,0),this._originalScrollOffsetAnimated=Zae(this._originalScrollOffset,this._store),this._modifiedTopPadding=Ai(this,0),this._modifiedScrollOffset=Ai(this,0),this._modifiedScrollOffsetAnimated=Zae(this._modifiedScrollOffset,this._store);let l=!1;const c=Ai("state",0),d=this._register(new bi(()=>{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?$r(w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,L)=>w==null?void 0:w.read(L)),h=new Set,f=new Set,g=In(w=>{const L=this._diffModel.read(w),D=L==null?void 0:L.diff.read(w);if(!L||!D)return null;c.read(w);const I=this._options.renderSideBySide.read(w);return ule(this._editors.original,this._editors.modified,D.mappings,h,f,I)}),p=In(w=>{var L;const D=(L=this._diffModel.read(w))===null||L===void 0?void 0:L.movedTextToCompare.read(w);if(!D)return null;c.read(w);const E=D.changes.map(I=>new qCe(I));return ule(this._editors.original,this._editors.modified,E,h,f,!0)});function v(){const w=document.createElement("div");return w.className="diagonal-fill",w}const m=this._register(new Be),_=In(w=>{var L,D,E,I,k,R,A,P;m.clear();const N=g.read(w)||[],M=[],H=[],B=this._modifiedTopPadding.read(w);B>0&&H.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:B,showInHiddenAreas:!0,suppressMouseDown:!0});const F=this._originalTopPadding.read(w);F>0&&M.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:F,showInHiddenAreas:!0,suppressMouseDown:!0});const $=this._options.renderSideBySide.read(w),z=$||(L=this._editors.modified._getViewModel())===null||L===void 0?void 0:L.createLineBreaksComputer();if(z){for(const be of N)if(be.diff)for(let Se=be.originalRange.startLineNumber;Sethis._editors.original.getModel().tokenization.getLineTokens(Ee)),be.originalRange.mapToLineArray(Ee=>K[j++]),ue,fe),ce=[];for(const Ee of be.diff.innerChanges||[])ce.push(new hE(Ee.originalRange.delta(-(be.diff.original.startLineNumber-1)),tz.className,0));const Pe=kpt(De,pe,ce,Fe),Oe=document.createElement("div");if(Oe.className="inline-deleted-margin-view-zone",ss(Oe,pe.fontInfo),this._options.renderIndicators.read(w))for(let Ee=0;Eec0(xe),Oe,this._editors.modified,be.diff,this._diffEditorWidget,Pe.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Ee=0;Ee1&&M.push({afterLineNumber:be.originalRange.startLineNumber+Ee,domNode:v(),heightInPx:(tt-1)*G,showInHiddenAreas:!0,suppressMouseDown:!0})}H.push({afterLineNumber:be.modifiedRange.startLineNumber-1,domNode:Fe,heightInPx:Pe.heightInLines*G,minWidthInPx:Pe.minWidthInPx,marginDomNode:Oe,setZoneId(Ee){xe=Ee},showInHiddenAreas:!0,suppressMouseDown:!0})}const Se=document.createElement("div");Se.className="gutter-delete",M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:be.modifiedHeightInPx,marginDomNode:Se,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Se=be.modifiedHeightInPx-be.originalHeightInPx;if(Se>0){if(X!=null&&X.lineRangeMapping.original.delta(-1).deltaLength(2).contains(be.originalRange.endLineNumberExclusive-1))continue;M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Se,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Fe=function(){const ce=document.createElement("div");return ce.className="arrow-revert-change "+Mt.asClassName(Xe.arrowRight),He("div",{},ce)};if(X!=null&&X.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(be.modifiedRange.endLineNumberExclusive-1))continue;let De;be.diff&&be.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(w)&&(De=Fe()),H.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Se,marginDomNode:De,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const be of(P=p.read(w))!==null&&P!==void 0?P:[]){if(!(X!=null&&X.lineRangeMapping.original.intersect(be.originalRange))||!(X!=null&&X.lineRangeMapping.modified.intersect(be.modifiedRange)))continue;const Se=be.modifiedHeightInPx-be.originalHeightInPx;Se>0?M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Se,showInHiddenAreas:!0,suppressMouseDown:!0}):H.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Se,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:M,mod:H}});this._register(Ja(w=>{const L=Zu.capture(this._editors.modified),D=_.read(w);l=!0,this._editors.original.changeViewZones(E=>{for(const I of h)E.removeZone(I);h.clear();for(const I of D.orig){const k=E.addZone(I);I.setZoneId&&I.setZoneId(k),h.add(k)}}),this._editors.modified.changeViewZones(E=>{for(const I of f)E.removeZone(I);f.clear();for(const I of D.mod){const k=E.addZone(I);I.setZoneId&&I.setZoneId(k),f.add(k)}}),l=!1,L.restore(this._editors.modified)})),this._register(zt(()=>{this._editors.original.changeViewZones(w=>{for(const L of h)w.removeZone(L);h.clear()}),this._editors.modified.changeViewZones(w=>{for(const L of f)w.removeZone(L);f.clear()})}));let y=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.modified.setScrollLeft(w.scrollLeft),y=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.original.setScrollLeft(w.scrollLeft),y=!1)})),this._originalScrollTop=$r(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Ii(w=>{const L=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(w));L!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(L,1)})),this._register(Ii(w=>{const L=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(w));L!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(L,1)})),this._register(Ii(w=>{var L;const D=(L=this._diffModel.read(w))===null||L===void 0?void 0:L.movedTextToCompare.read(w);let E=0;if(D){const I=this._editors.original.getTopForLineNumber(D.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(D.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-I}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,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()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};sz=Tpt([dle(5,Sp),dle(6,Kd)],sz);function ule(i,e,t,n,o,r){const s=new lp(hle(i,n)),a=new lp(hle(e,o)),l=i.getOption(66),c=e.getOption(66),d=[];let u=0,h=0;function f(g,p){for(;;){let v=s.peek(),m=a.peek();if(v&&v.lineNumber>=g&&(v=void 0),m&&m.lineNumber>=p&&(m=void 0),!v&&!m)break;const _=v?v.lineNumber-u:Number.MAX_VALUE,y=m?m.lineNumber-h:Number.MAX_VALUE;_y?(a.dequeue(),v={lineNumber:m.lineNumber-h+u,heightInPx:0}):(s.dequeue(),a.dequeue()),d.push({originalRange:ln.ofLength(v.lineNumber,1),modifiedRange:ln.ofLength(m.lineNumber,1),originalHeightInPx:l+v.heightInPx,modifiedHeightInPx:c+m.heightInPx,diff:void 0})}}for(const g of t){let y=function(w,L){var D,E,I,k;if(w<_||LM.lineNumberM+H.heightInPx,0))!==null&&E!==void 0?E:0,N=(k=(I=a.takeWhile(M=>M.lineNumberM+H.heightInPx,0))!==null&&k!==void 0?k:0;d.push({originalRange:R,modifiedRange:A,originalHeightInPx:R.length*l+P,modifiedHeightInPx:A.length*c+N,diff:g.lineRangeMapping}),_=w,m=L};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let v=!0,m=p.modified.startLineNumber,_=p.original.startLineNumber;if(r)for(const w of p.innerChanges||[])w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&y(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber),w.originalRange.endColumn1&&n.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of i.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:r.convertViewPositionToModelPosition(new ae(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return Ggt(t,n,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var Npt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Rpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cu;let Zg=cu=class extends _e{constructor(e,t,n,o,r,s,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=n,this._rootWidth=o,this._rootHeight=r,this._modifiedEditorLayoutInfo=s,this._options=a,this._themeService=l;const c=$r(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=In(f=>{const g=c.read(f),p=g.getColor(qnt)||(g.getColor(jnt)||mH).transparent(2),v=g.getColor(Gnt)||(g.getColor(Knt)||vH).transparent(2);return{insertColor:p,removeColor:v}}),u=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(Ja((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=ti(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const v=Or("div.diffOverview",{style:{position:"absolute",top:"0px",width:cu.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(U2(v,p.domNode)),g.add(No(v,et.POINTER_DOWN,m=>{this._editors.modified.delegateVerticalScrollbarPointerDown(m)})),g.add(ke(v,et.MOUSE_WHEEL,m=>{this._editors.modified.delegateScrollFromMouseWheelEvent(m)},{passive:!1})),g.add(U2(this._rootElement,v)),g.add(Ja((m,_)=>{const y=this._diffModel.read(m),w=this._editors.original.createOverviewRuler("original diffOverviewRuler");w&&(_.add(w),_.add(U2(v,w.getDomNode())));const L=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(L&&(_.add(L),_.add(U2(v,L.getDomNode()))),!w||!L)return;const D=Fl("viewZoneChanged",this._editors.original.onDidChangeViewZones),E=Fl("viewZoneChanged",this._editors.modified.onDidChangeViewZones),I=Fl("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),k=Fl("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);_.add(Ii(R=>{var A;D.read(R),E.read(R),I.read(R),k.read(R);const P=d.read(R),N=(A=y==null?void 0:y.diff.read(R))===null||A===void 0?void 0:A.mappings;function M(F,$,z){const K=z._getViewModel();return K?F.filter(j=>j.length>0).map(j=>{const G=K.coordinatesConverter.convertModelPositionToViewPosition(new ae(j.startLineNumber,1)),X=K.coordinatesConverter.convertModelPositionToViewPosition(new ae(j.endLineNumberExclusive,1)),ue=X.lineNumber-G.lineNumber;return new Vbe(G.lineNumber,X.lineNumber,ue,$.toString())}):[]}const H=M((N||[]).map(F=>F.lineRangeMapping.original),P.removeColor,this._editors.original),B=M((N||[]).map(F=>F.lineRangeMapping.modified),P.insertColor,this._editors.modified);w==null||w.setZones(H),L==null||L.setZones(B)})),_.add(Ii(R=>{const A=this._rootHeight.read(R),P=this._rootWidth.read(R),N=this._modifiedEditorLayoutInfo.read(R);if(N){const M=cu.ENTIRE_DIFF_OVERVIEW_WIDTH-2*cu.ONE_OVERVIEW_WIDTH;w.setLayout({top:0,height:A,right:M+cu.ONE_OVERVIEW_WIDTH,width:cu.ONE_OVERVIEW_WIDTH}),L.setLayout({top:0,height:A,right:0,width:cu.ONE_OVERVIEW_WIDTH});const H=u.read(R),B=h.read(R),F=this._editors.modified.getOption(102),$=new Iw(F.verticalHasArrows?F.arrowSize:0,F.verticalScrollbarSize,0,N.height,B,H);p.setTop($.getSliderPosition()),p.setHeight($.getSliderSize())}else p.setTop(0),p.setHeight(0);v.style.height=A+"px",v.style.left=P-cu.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(cu.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};Zg.ONE_OVERVIEW_WIDTH=15;Zg.ENTIRE_DIFF_OVERVIEW_WIDTH=cu.ONE_OVERVIEW_WIDTH*2;Zg=cu=Npt([Rpt(7,vr)],Zg);J("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},C("diffEditor.move.border","The border color for text that got moved in the diff editor."));J("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},C("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class tF extends _e{constructor(){super(...arguments),this._id=++tF.idCounter,this._onDidDispose=this._register(new le),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,n=0){this._targetEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._targetEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._targetEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,o=!0){this._targetEditor.revealRange(e,t,n,o)}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,n){this._targetEditor.trigger(e,t,n)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}tF.idCounter=0;var Mpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let az=class extends _e{constructor(e,t,n,o,r,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=n,this._createInnerEditor=r,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new le),this.original=this._register(this._createLeftHandSideEditor(n.editorOptions.get(),o.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(n.editorOptions.get(),o.modifiedEditor||{})),this.modifiedModel=$r(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(Q5({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(n.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{n.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 n=this._adjustOptionsForLeftHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,n,t);return o.setContextValue("isInDiffLeftEditor",!0),o}_createRightHandSideEditor(e,t){const n=this._adjustOptionsForRightHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,n,t);return o.setContextValue("isInDiffRightEditor",!0),o}_constructInnerEditor(e,t,n,o){const r=this._createInnerEditor(e,t,n,o);return this._register(r.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Zg.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),r}_adjustOptionsForLeftHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(n.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},n.wordWrapOverride1=this._options.diffWordWrap.get()):(n.wordWrapOverride1="off",n.wordWrapOverride2="off",n.stickyScroll={enabled:!1},n.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(n.ariaLabel=t.originalAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.readOnly=!this._options.originalEditable.get(),n.dropIntoEditor={enabled:!n.readOnly},n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.wordWrapOverride1=this._options.diffWordWrap.get(),n.revealHorizontalRightPadding=rh.revealHorizontalRightPadding.defaultValue+Zg.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}_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 n=C("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+n:e?e.replaceAll(n,""):""}};az=Mpt([fle(5,$t),fle(6,xi)],az);class Apt{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=In(this,o=>this._options.read(o).renderSideBySide&&this.diffEditorWidth.read(o)<=this._options.read(o).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=In(this,o=>this._options.read(o).renderOverviewRuler),this.renderSideBySide=In(this,o=>this._options.read(o).renderSideBySide&&!(this._options.read(o).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(o))),this.readOnly=In(this,o=>this._options.read(o).readOnly),this.shouldRenderRevertArrows=In(this,o=>!(!this._options.read(o).renderMarginRevertIcon||!this.renderSideBySide.read(o)||this.readOnly.read(o))),this.renderIndicators=In(this,o=>this._options.read(o).renderIndicators),this.enableSplitViewResizing=In(this,o=>this._options.read(o).enableSplitViewResizing),this.splitViewDefaultRatio=In(this,o=>this._options.read(o).splitViewDefaultRatio),this.ignoreTrimWhitespace=In(this,o=>this._options.read(o).ignoreTrimWhitespace),this.maxComputationTimeMs=In(this,o=>this._options.read(o).maxComputationTime),this.showMoves=In(this,o=>this._options.read(o).experimental.showMoves&&this.renderSideBySide.read(o)),this.isInEmbeddedEditor=In(this,o=>this._options.read(o).isInEmbeddedEditor),this.diffWordWrap=In(this,o=>this._options.read(o).diffWordWrap),this.originalEditable=In(this,o=>this._options.read(o).originalEditable),this.diffCodeLens=In(this,o=>this._options.read(o).diffCodeLens),this.accessibilityVerbose=In(this,o=>this._options.read(o).accessibilityVerbose),this.diffAlgorithm=In(this,o=>this._options.read(o).diffAlgorithm),this.showEmptyDecorations=In(this,o=>this._options.read(o).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=In(this,o=>this._options.read(o).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=In(this,o=>this._options.read(o).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.minimumLineCount);const n=Object.assign(Object.assign({},e),gle(e,As));this._options=Ai(this,n)}updateOptions(e){const t=gle(e,this._options.get()),n=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(n,void 0,{changedOptions:e})}}function gle(i,e){var t,n,o,r,s,a,l,c;return{enableSplitViewResizing:xt(i.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:BXe(i.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:xt(i.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:xt(i.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:M_(i.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:M_(i.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:xt(i.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:xt(i.renderIndicators,e.renderIndicators),originalEditable:xt(i.originalEditable,e.originalEditable),diffCodeLens:xt(i.diffCodeLens,e.diffCodeLens),renderOverviewRuler:xt(i.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:To(i.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:To(i.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:xt(i.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:xt((t=i.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:xt((n=i.experimental)===null||n===void 0?void 0:n.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:xt((r=(o=i.hideUnchangedRegions)===null||o===void 0?void 0:o.enabled)!==null&&r!==void 0?r:(s=i.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:M_((a=i.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:M_((l=i.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:M_((c=i.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:xt(i.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:xt(i.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:M_(i.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:xt(i.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var Ppt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Gx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ub=class extends tF{constructor(e,t,n,o,r,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=o,this._parentInstantiationService=r,this._audioCueService=a,this._editorProgressService=l,this.elements=Or("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Or("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[He("span",{},"No Changes")]),Or("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Or("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Or("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(tO("diffModel",void 0)),this.onDidChangeModel=st.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new D5([Ut,this._contextKeyService])),this._boundarySashes=Ai(this,void 0),this._accessibleDiffViewerShouldBeVisible=Ai(this,!1),this._accessibleDiffViewerVisible=In(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=Ai(this,void 0),this._layoutInfo=In(this,p=>{var v,m,_;const y=this._rootSizeObserver.width.read(p),w=this._rootSizeObserver.height.read(p),L=(v=this._sash.read(p))===null||v===void 0?void 0:v.sashLeft.read(p),D=L!=null?L:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),E=y-D-(this._options.renderOverviewRuler.read(p)?Zg.ENTIRE_DIFF_OVERVIEW_WIDTH:0),I=(_=(m=this.movedBlocksLinesPart.read(p))===null||m===void 0?void 0:m.width.read(p))!==null&&_!==void 0?_:0,k=D-I;return this.elements.original.style.width=k+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=E+"px",this.elements.modified.style.left=D+"px",this._editors.original.layout({width:k,height:w}),this._editors.modified.layout({width:E,height:w}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((p,v)=>p==null?void 0:p.diff.read(v)),this.onDidUpdateDiff=st.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(zt(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new Xgt(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new Apt(t,this._rootSizeObserver.width),this._contextKeyService.createKey(Q.isEmbeddedDiffEditor.key,!1);const d=Q.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(Ii(p=>{d.set(this._options.isInEmbeddedEditor.read(p))}));const u=Q.comparingMovedCode.bindTo(this._contextKeyService);this._register(Ii(p=>{var v;u.set(!!(!((v=this._diffModel.read(p))===null||v===void 0)&&v.movedTextToCompare.read(p)))}));const h=Q.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(Ii(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(az,this.elements.original,this.elements.modified,this._options,n,(p,v,m,_)=>this._createInnerEditor(p,v,m,_))),this._sash=Tk(this,(p,v)=>{const m=this._options.renderSideBySide.read(p);if(this.elements.root.classList.toggle("side-by-side",m),!m)return;const _=v.add(new mpt(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,w)=>y-(this._options.renderOverviewRuler.read(w)?Zg.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return v.add(Ii(y=>{const w=this._boundarySashes.read(y);w&&_.setBoundarySashes(w)})),_}),this._register(Rk(this._sash)),this._register(Ja((p,v)=>{this.unchangedRangesFeature=v.add(this._instantiationService.createInstance(om(nz,p),this._editors,this._diffModel,this._options))})),this._register(Ja((p,v)=>{v.add(new(om(ppt,p))(this._editors,this._diffModel,this._options))})),this._register(Ja((p,v)=>{v.add(this._instantiationService.createInstance(om(sz,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(Ja((p,v)=>{v.add(this._instantiationService.createInstance(om(Zg,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(m=>m.modifiedEditor),this._options))})),this._register(Ja((p,v)=>{this._accessibleDiffViewer=v.add(this._register(this._instantiationService.createInstance(om(Nm,p),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(m,_)=>this._accessibleDiffViewerShouldBeVisible.set(m,_),this._options.onlyShowAccessibleDiffViewer.map(m=>!m),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((m,_)=>{var y;return(y=m==null?void 0:m.diff.read(_))===null||y===void 0?void 0:y.mappings.map(w=>w.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(iv(this.elements.modified,{visibility:f})),this._register(iv(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(Rk(this._layoutInfo)),this._register(Ja((p,v)=>{this.movedBlocksLinesPart.set(v.add(new(om(ov,p))(this.elements.root,this._diffModel,this._layoutInfo.map(m=>m.originalEditor),this._layoutInfo.map(m=>m.modifiedEditor),this._editors)),void 0)})),this._register(iv(this.elements.overlay,{width:this._layoutInfo.map((p,v)=>p.originalEditor.width+(this._options.renderSideBySide.read(v)?0:p.modifiedEditor.width)),visibility:In(p=>{var v,m;return this._options.hideUnchangedRegions.read(p)&&((m=(v=this._diffModel.read(p))===null||v===void 0?void 0:v.diff.read(p))===null||m===void 0?void 0:m.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(p=>{var v,m;if(!p.event.rightButton&&p.target.position&&((v=p.target.element)===null||v===void 0?void 0:v.className.includes("arrow-revert-change"))){const _=p.target.position.lineNumber,y=p.target,w=this._diffModel.get();if(!w)return;const L=(m=w.diff.get())===null||m===void 0?void 0:m.mappings;if(!L)return;const D=L.find(E=>(y==null?void 0:y.detail.afterLineNumber)===E.lineRangeMapping.modified.startLineNumber-1||E.lineRangeMapping.modified.startLineNumber===_);if(!D)return;this.revert(D.lineRangeMapping),p.event.stopPropagation()}})),this._register(st.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,p=>{var v,m;if((p==null?void 0:p.reason)===3){const _=(m=(v=this._diffModel.get())===null||v===void 0?void 0:v.diff.get())===null||m===void 0?void 0:m.mappings.find(y=>y.lineRangeMapping.modified.contains(p.position.lineNumber));_!=null&&_.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(Wn.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):_!=null&&_.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(Wn.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):_&&this._audioCueService.playAudioCue(Wn.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,v)=>p==null?void 0:p.isDiffUpToDate.read(v));this._register(Ja((p,v)=>{if(g.read(p)===!1){const m=this._editorProgressService.show(!0,1e3);v.add(zt(()=>m.done()))}}))}_createInnerEditor(e,t,n,o){return e.createInstance(Nw,t,n,o)}_createDiffEditorContributions(){const e=by.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(n){en(n)}}get _targetEditor(){return this._editors.modified}getEditorType(){return KI.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(),n=this._editors.modified.saveViewState();return{original:t,modified:n,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const n=e;this._editors.original.restoreViewState(n.original),this._editors.modified.restoreViewState(n.modified),n.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(n.modelState))}}createViewModel(e){return this._instantiationService.createInstance(rz,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),qi(n=>{this._diffModel.set(t,n)})}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?Bpt(t):null}revert(e){var t;const n=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!n)return;const o=e.innerChanges?e.innerChanges.map(r=>({range:r.modifiedRange,text:n.original.getValueInRange(r.originalRange)})):[{range:e.modified.toExclusiveRange(),text:n.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",o)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const n=this._editors.modified.hasWidgetFocus(),o=n?this._editors.modified:this._editors.original,r=n?this._editors.original:this._editors.modified;let s;const a=o.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=>n?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=ple(a.getStartPosition(),l),d=ple(a.getEndPosition(),l);s=V.plusRange(c,d)}}return{destination:r,destinationSelection:s}}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||qi(n=>{for(const o of t)o.collapseAll(n)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();!t||qi(n=>{for(const o of t)o.showAll(n)})}};ub=Ppt([Gx(3,Ut),Gx(4,$t),Gx(5,Jn),Gx(6,hT),Gx(7,t_)],ub);function ple(i,e){const t=nP(e,o=>o.original.startLineNumber<=i.lineNumber);if(!t)return V.fromPositions(i);if(t.original.endLineNumberExclusive<=i.lineNumber){const o=i.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return V.fromPositions(new ae(o,i.column))}if(!t.innerChanges)return V.fromPositions(new ae(t.modified.startLineNumber,1));const n=nP(t.innerChanges,o=>o.originalRange.getStartPosition().isBeforeOrEqual(i));if(!n){const o=i.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return V.fromPositions(new ae(o,i.column))}if(n.originalRange.containsPosition(i))return n.modifiedRange;{const o=Opt(n.originalRange.getEndPosition(),i);return V.fromPositions(Fpt(n.modifiedRange.getEndPosition(),o))}}function Opt(i,e){return i.lineNumber===e.lineNumber?new sk(0,e.column-i.column):new sk(e.lineNumber-i.lineNumber,e.column-1)}function Fpt(i,e){return e.lineCount===0?new ae(i.lineNumber,i.column+e.columnCount):new ae(i.lineNumber+e.lineCount,e.columnCount+1)}function Bpt(i){return i.mappings.map(e=>{const t=e.lineRangeMapping;let n,o,r,s,a=t.innerChanges;return t.original.isEmpty?(n=t.original.startLineNumber-1,o=0,a=void 0):(n=t.original.startLineNumber,o=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(r=t.modified.startLineNumber-1,s=0,a=void 0):(r=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:n,originalEndLineNumber:o,modifiedStartLineNumber:r,modifiedEndLineNumber:s,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 ZX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Wpt=0,mle=!1;function Vpt(i){if(!i){if(mle)return;mle=!0}ztt(i||document.body)}let lO=class extends Nw{constructor(e,t,n,o,r,s,a,l,c,d,u,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||MP.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+MP.accessibilityHelpMessage,super(e,f,{},n,o,r,s,l,c,d,u,h),a instanceof Ww?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,Vpt(f.ariaContainerElement)}addCommand(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const o="DYNAMIC_"+ ++Wpt,r=Me.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(o,e,t,r),o}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"),_e.None;const t=e.id,n=e.label,o=Me.and(Me.equals("editorId",this.getId()),Me.deserialize(e.precondition)),r=e.keybindings,s=Me.and(o,Me.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(Rn.registerCommand(u,c)),a){const f={command:{id:u,title:n},when:o,group:a,order:l};d.add(Hr.appendMenuItem(Z.EditorContext,f))}if(Array.isArray(r))for(const f of r)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,f,c,s));const h=new Hbe(u,n,n,o,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),d.add(zt(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof LP)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};lO=ZX([zi(2,$t),zi(3,Jn),zi(4,_o),zi(5,Ut),zi(6,xi),zi(7,vr),zi(8,Ao),zi(9,bp),zi(10,Ti),zi(11,pt)],lO);let lz=class extends lO{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f,g,p){const v=Object.assign({},t);eO(d,v,!1);const m=l.registerEditorContainer(e);typeof v.theme=="string"&&l.setTheme(v.theme),typeof v.autoDetectHighContrast!="undefined"&&l.setAutoDetectHighContrast(Boolean(v.autoDetectHighContrast));const _=v.model;delete v.model,super(e,v,n,o,r,s,a,l,c,u,g,p),this._configurationService=d,this._standaloneThemeService=l,this._register(m);let y;if(typeof _=="undefined"){const w=f.getLanguageIdByMimeType(v.language)||v.language||Gl;y=GCe(h,f,v.value||"",w,void 0),this._ownsModel=!0}else y=_,this._ownsModel=!1;if(this._attachModel(y),y){const w={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(w)}}dispose(){super.dispose()}updateOptions(e){eO(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};lz=ZX([zi(2,$t),zi(3,Jn),zi(4,_o),zi(5,Ut),zi(6,xi),zi(7,ic),zi(8,Ao),zi(9,En),zi(10,bp),zi(11,Yi),zi(12,Ki),zi(13,Ti),zi(14,pt)],lz);let cz=class extends ub{constructor(e,t,n,o,r,s,a,l,c,d,u,h){const f=Object.assign({},t);eO(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast!="undefined"&&s.setAutoDetectHighContrast(Boolean(f.autoDetectHighContrast)),super(e,f,{},o,n,r,h,d),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){eO(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,n){return e.createInstance(lO,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};cz=ZX([zi(2,$t),zi(3,Ut),zi(4,Jn),zi(5,ic),zi(6,Ao),zi(7,En),zi(8,Kd),zi(9,t_),zi(10,Sp),zi(11,hT)],cz);function GCe(i,e,t,n,o){if(t=t||"",!n){const r=t.indexOf(` +`);let s=t;return r!==-1&&(s=t.substring(0,r)),vle(i,t,e.createByFilepathOrFirstLine(o||null,s),o)}return vle(i,t,e.createById(n),o)}function vle(i,e,t,n){return i.createModel(e,t,n)}var XCe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Hpt(i,e,t){return Vt.initialize(t||{}).createInstance(lz,i,e)}function $pt(i){return Vt.get(Jn).onCodeEditorAdd(t=>{i(t)})}function zpt(i){return Vt.get(Jn).onDiffEditorAdd(t=>{i(t)})}function Upt(){return Vt.get(Jn).listCodeEditors()}function jpt(){return Vt.get(Jn).listDiffEditors()}function Kpt(i,e,t){return Vt.initialize(t||{}).createInstance(cz,i,e)}function qpt(i){if(typeof i.id!="string"||typeof i.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Rn.registerCommand(i.id,i.run)}function Gpt(i){if(typeof i.id!="string"||typeof i.label!="string"||typeof i.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Me.deserialize(i.precondition),t=(o,...r)=>Ir.runEditorCommand(o,r,e,(s,a,l)=>Promise.resolve(i.run(a,...l))),n=new Be;if(n.add(Rn.registerCommand(i.id,t)),i.contextMenuGroupId){const o={command:{id:i.id,title:i.label},when:e,group:i.contextMenuGroupId,order:i.contextMenuOrder||0};n.add(Hr.appendMenuItem(Z.EditorContext,o))}if(Array.isArray(i.keybindings)){const o=Vt.get(xi);if(!(o instanceof Ww))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const r=Me.and(e,Me.deserialize(i.keybindingContext));n.add(o.addDynamicKeybindings(i.keybindings.map(s=>({keybinding:s,command:i.id,when:r}))))}}return n}function Xpt(i){return YCe([i])}function YCe(i){const e=Vt.get(xi);return e instanceof Ww?e.addDynamicKeybindings(i.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Me.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),_e.None)}function Ypt(i,e,t){const n=Vt.get(Ki),o=n.getLanguageIdByMimeType(e)||e;return GCe(Vt.get(Yi),n,i,o,t)}function Zpt(i,e){const t=Vt.get(Ki),n=t.getLanguageIdByMimeType(e)||e||Gl;i.setLanguage(t.createById(n))}function Qpt(i,e,t){i&&Vt.get(Rf).changeOne(e,i.uri,t)}function Jpt(i){Vt.get(Rf).changeAll(i,[])}function emt(i){return Vt.get(Rf).read(i)}function tmt(i){return Vt.get(Rf).onMarkerChanged(i)}function nmt(i){return Vt.get(Yi).getModel(i)}function imt(){return Vt.get(Yi).getModels()}function omt(i){return Vt.get(Yi).onModelAdded(i)}function rmt(i){return Vt.get(Yi).onModelRemoved(i)}function smt(i){return Vt.get(Yi).onModelLanguageChanged(t=>{i({model:t.model,oldLanguage:t.oldLanguageId})})}function amt(i){return mtt(Vt.get(Yi),Vt.get(Ti),i)}function lmt(i,e){const t=Vt.get(Ki),n=Vt.get(ic);return yG.colorizeElement(n,t,i,e).then(()=>{n.registerEditorContainer(i)})}function cmt(i,e,t){const n=Vt.get(Ki);return Vt.get(ic).registerEditorContainer(document.body),yG.colorize(n,i,e,t)}function dmt(i,e,t=4){return Vt.get(ic).registerEditorContainer(document.body),yG.colorizeModelLine(i,e,t)}function umt(i){const e=oo.get(i);return e||{getInitialState:()=>ww,tokenize:(t,n,o)=>_G(i,o)}}function hmt(i,e){oo.getOrCreate(e);const t=umt(e),n=gf(i),o=[];let r=t.getInitialState();for(let s=0,a=n.length;sXCe(this,void 0,void 0,function*(){var r;if(!n)return null;const s=(r=t.options)===null||r===void 0?void 0:r.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),(yield i.openCodeEditor(n,t.resource,a))?n:null}))}function bmt(){return{create:Hpt,getEditors:Upt,getDiffEditors:jpt,onDidCreateEditor:$pt,onDidCreateDiffEditor:zpt,createDiffEditor:Kpt,addCommand:qpt,addEditorAction:Gpt,addKeybindingRule:Xpt,addKeybindingRules:YCe,createModel:Ypt,setModelLanguage:Zpt,setModelMarkers:Qpt,getModelMarkers:emt,removeAllMarkers:Jpt,onDidChangeMarkers:tmt,getModels:imt,getModel:nmt,onDidCreateModel:omt,onWillDisposeModel:rmt,onDidChangeModelLanguage:smt,createWebWorker:amt,colorizeElement:lmt,colorize:cmt,colorizeModelLine:dmt,tokenize:hmt,defineTheme:fmt,setTheme:gmt,remeasureFonts:pmt,registerCommand:mmt,registerLinkOpener:vmt,registerEditorOpener:_mt,AccessibilitySupport:iV,ContentWidgetPositionPreference:cV,CursorChangeReason:dV,DefaultEndOfLine:uV,EditorAutoIndentStrategy:fV,EditorOption:gV,EndOfLinePreference:pV,EndOfLineSequence:mV,MinimapPosition:LV,MouseTargetType:EV,OverlayWidgetPositionPreference:DV,OverviewRulerLane:kV,GlyphMarginLane:vV,RenderLineNumbersType:TV,RenderMinimap:NV,ScrollbarVisibility:MV,ScrollType:RV,TextEditorCursorBlinkingStyle:BV,TextEditorCursorStyle:WV,TrackedRangeStickiness:VV,WrappingIndent:HV,InjectedTextCursorStops:bV,PositionAffinity:IV,ConfigurationChangedEvent:x_e,BareFontInfo:k0,FontInfo:UV,TextModelResolvedOptions:sM,FindMatch:HD,ApplyUpdateResult:cE,EditorZoom:xc,EditorType:KI,EditorOptions:rh}}function Cmt(i,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!i(t))return!1;return!0}function j2(i,e){return typeof i=="boolean"?i:e}function _le(i,e){return typeof i=="string"?i:e}function ymt(i){const e={};for(const t of i)e[t]=!0;return e}function ble(i,e=!1){e&&(i=i.map(function(n){return n.toLowerCase()}));const t=ymt(i);return e?function(n){return t[n.toLowerCase()]!==void 0&&t.hasOwnProperty(n.toLowerCase())}:function(n){return t[n]!==void 0&&t.hasOwnProperty(n)}}function dz(i,e){e=e.replace(/@@/g,"");let t=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,s){n=!0;let a="";if(typeof i[s]=="string")a=i[s];else if(i[s]&&i[s]instanceof RegExp)a=i[s].source;else throw i[s]===void 0?Bi(i,"language definition does not contain attribute '"+s+"', used at: "+e):Bi(i,"attribute reference '"+s+"' must be a string, used at: "+e);return uC(a)?"":"(?:"+a+")"}),t++;while(n&&t<5);e=e.replace(/\x01/g,"@");const o=(i.ignoreCase?"i":"")+(i.unicode?"u":"");return new RegExp(e,o)}function wmt(i,e,t,n){if(n<0)return i;if(n=100){n=n-100;const o=t.split(".");if(o.unshift(t),n=0&&(n.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")n.bracket=1;else if(t.bracket==="@close")n.bracket=-1;else throw Bi(i,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Bi(i,"the next state must be a string value in rule: "+e);{let o=t.next;if(!/^(@pop|@push|@popall)$/.test(o)&&(o[0]==="@"&&(o=o.substr(1)),o.indexOf("$")<0&&!Ptt(i,cm(i,o,"",[],""))))throw Bi(i,"the next state '"+t.next+"' is not defined in rule: "+e);n.next=o}}return typeof t.goBack=="number"&&(n.goBack=t.goBack),typeof t.switchTo=="string"&&(n.switchTo=t.switchTo),typeof t.log=="string"&&(n.log=t.log),typeof t.nextEmbedded=="string"&&(n.nextEmbedded=t.nextEmbedded,i.usesEmbedded=!0),n}}else if(Array.isArray(t)){const n=[];for(let o=0,r=t.length;o0&&n[0]==="^",this.name=this.name+": "+n,this.regex=dz(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=uz(e,this.name,t)}}function ZCe(i,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=i,t.includeLF=j2(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=j2(e.ignoreCase,!1),t.unicode=j2(e.unicode,!1),t.tokenPostfix=_le(e.tokenPostfix,"."+t.languageId),t.defaultToken=_le(e.defaultToken,"source"),t.usesEmbedded=!1;const n=e;n.languageId=i,n.includeLF=t.includeLF,n.ignoreCase=t.ignoreCase,n.unicode=t.unicode,n.noThrow=t.noThrow,n.usesEmbedded=t.usesEmbedded,n.stateNames=e.tokenizer,n.defaultToken=t.defaultToken;function o(s,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Bi(t,"an 'include' attribute must be a string at: "+s);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Bi(t,"include target '"+d+"' is not defined at: "+s);o(s+"."+d,a,e.tokenizer[d])}else{const u=new xmt(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(n,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(n,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],u.setAction(n,h)}else throw Bi(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: "+s);else u.setAction(n,c[1]);else{if(!c.regex)throw Bi(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=j2(c.matchOnlyAtLineStart,!1)),u.setRegex(n,c.regex),u.setAction(n,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Bi(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,o("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=n.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Bi(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 r=[];for(const s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Bi(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")r.push({token:a.token+t.tokenPostfix,open:Zm(t,a.open),close:Zm(t,a.close)});else throw Bi(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=r,t.noThrow=!0,t}var Lmt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Emt(i){Cw.registerLanguage(i)}function Dmt(){let i=[];return i=i.concat(Cw.getLanguages()),i}function kmt(i){return Vt.get(Ki).languageIdCodec.encodeLanguageId(i)}function Imt(i,e){return Vt.withServices(()=>{const n=Vt.get(Ki).onDidRequestRichLanguageFeatures(o=>{o===i&&(n.dispose(),e())});return n})}function Tmt(i,e){return Vt.withServices(()=>{const n=Vt.get(Ki).onDidRequestBasicLanguageFeatures(o=>{o===i&&(n.dispose(),e())});return n})}function Nmt(i,e){if(!Vt.get(Ki).isRegisteredLanguageId(i))throw new Error(`Cannot set configuration for unknown language ${i}`);return Vt.get(Ti).register(i,e,100)}class Rmt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){if(typeof this._actual.tokenize=="function")return Mk.adaptTokenize(this._languageId,this._actual,e,n);throw new Error("Not supported!")}tokenizeEncoded(e,t,n){const o=this._actual.tokenizeEncoded(e,n);return new z4(o.tokens,o.endState)}}class Mk{constructor(e,t,n,o){this._languageId=e,this._actual=t,this._languageService=n,this._standaloneThemeService=o}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const n=[];let o=0;for(let r=0,s=e.length;r0&&r[s-1]===h)continue;let f=u.startIndex;c===0?f=0:fLmt(this,void 0,void 0,function*(){const n=yield Promise.resolve(e.create());return n?Mmt(n)?JCe(i,n):new GD(Vt.get(Ki),Vt.get(ic),i,ZCe(i,n),Vt.get(En)):null}));return oo.registerFactory(i,t)}function Omt(i,e){if(!Vt.get(Ki).isRegisteredLanguageId(i))throw new Error(`Cannot set tokens provider for unknown language ${i}`);return QCe(e)?QX(i,{create:()=>e}):oo.register(i,JCe(i,e))}function Fmt(i,e){const t=n=>new GD(Vt.get(Ki),Vt.get(ic),i,ZCe(i,n),Vt.get(En));return QCe(e)?QX(i,{create:()=>e}):oo.register(i,t(e))}function Bmt(i,e){return Vt.get(pt).referenceProvider.register(i,e)}function Wmt(i,e){return Vt.get(pt).renameProvider.register(i,e)}function Vmt(i,e){return Vt.get(pt).signatureHelpProvider.register(i,e)}function Hmt(i,e){return Vt.get(pt).hoverProvider.register(i,{provideHover:(n,o,r)=>{const s=n.getWordAtPosition(o);return Promise.resolve(e.provideHover(n,o,r)).then(a=>{if(!!a)return!a.range&&s&&(a.range=new V(o.lineNumber,s.startColumn,o.lineNumber,s.endColumn)),a.range||(a.range=new V(o.lineNumber,o.column,o.lineNumber,o.column)),a})}})}function $mt(i,e){return Vt.get(pt).documentSymbolProvider.register(i,e)}function zmt(i,e){return Vt.get(pt).documentHighlightProvider.register(i,e)}function Umt(i,e){return Vt.get(pt).linkedEditingRangeProvider.register(i,e)}function jmt(i,e){return Vt.get(pt).definitionProvider.register(i,e)}function Kmt(i,e){return Vt.get(pt).implementationProvider.register(i,e)}function qmt(i,e){return Vt.get(pt).typeDefinitionProvider.register(i,e)}function Gmt(i,e){return Vt.get(pt).codeLensProvider.register(i,e)}function Xmt(i,e,t){return Vt.get(pt).codeActionProvider.register(i,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(o,r,s,a)=>{const c=Vt.get(Rf).read({resource:o.uri}).filter(d=>V.areIntersectingOrTouching(d,r));return e.provideCodeActions(o,r,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Ymt(i,e){return Vt.get(pt).documentFormattingEditProvider.register(i,e)}function Zmt(i,e){return Vt.get(pt).documentRangeFormattingEditProvider.register(i,e)}function Qmt(i,e){return Vt.get(pt).onTypeFormattingEditProvider.register(i,e)}function Jmt(i,e){return Vt.get(pt).linkProvider.register(i,e)}function evt(i,e){return Vt.get(pt).completionProvider.register(i,e)}function tvt(i,e){return Vt.get(pt).colorProvider.register(i,e)}function nvt(i,e){return Vt.get(pt).foldingRangeProvider.register(i,e)}function ivt(i,e){return Vt.get(pt).declarationProvider.register(i,e)}function ovt(i,e){return Vt.get(pt).selectionRangeProvider.register(i,e)}function rvt(i,e){return Vt.get(pt).documentSemanticTokensProvider.register(i,e)}function svt(i,e){return Vt.get(pt).documentRangeSemanticTokensProvider.register(i,e)}function avt(i,e){return Vt.get(pt).inlineCompletionsProvider.register(i,e)}function lvt(i,e){return Vt.get(pt).inlayHintsProvider.register(i,e)}function cvt(){return{register:Emt,getLanguages:Dmt,onLanguage:Imt,onLanguageEncountered:Tmt,getEncodedLanguageId:kmt,setLanguageConfiguration:Nmt,setColorMap:Pmt,registerTokensProviderFactory:QX,setTokensProvider:Omt,setMonarchTokensProvider:Fmt,registerReferenceProvider:Bmt,registerRenameProvider:Wmt,registerCompletionItemProvider:evt,registerSignatureHelpProvider:Vmt,registerHoverProvider:Hmt,registerDocumentSymbolProvider:$mt,registerDocumentHighlightProvider:zmt,registerLinkedEditingRangeProvider:Umt,registerDefinitionProvider:jmt,registerImplementationProvider:Kmt,registerTypeDefinitionProvider:qmt,registerCodeLensProvider:Gmt,registerCodeActionProvider:Xmt,registerDocumentFormattingEditProvider:Ymt,registerDocumentRangeFormattingEditProvider:Zmt,registerOnTypeFormattingEditProvider:Qmt,registerLinkProvider:Jmt,registerColorProvider:tvt,registerFoldingRangeProvider:nvt,registerDeclarationProvider:ivt,registerSelectionRangeProvider:ovt,registerDocumentSemanticTokensProvider:rvt,registerDocumentRangeSemanticTokensProvider:svt,registerInlineCompletionsProvider:avt,registerInlayHintsProvider:lvt,DocumentHighlightKind:hV,CompletionItemKind:sV,CompletionItemTag:aV,CompletionItemInsertTextRule:rV,SymbolKind:OV,SymbolTag:FV,IndentAction:_V,CompletionTriggerKind:lV,SignatureHelpTriggerKind:PV,InlayHintKind:CV,InlineCompletionTriggerKind:yV,CodeActionTriggerType:oV,FoldingRangeKind:ra,SelectedSuggestionInfo:V_e}}const JX=yn("IEditorCancelService"),eye=new lt("cancellableOperation",!1,C("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Mn(JX,class{constructor(){this._tokens=new WeakMap}add(i,e){let t=this._tokens.get(i);t||(t=i.invokeWithinContext(o=>{const r=eye.bindTo(o.get(Ut)),s=new oa;return{key:r,tokens:s}}),this._tokens.set(i,t));let n;return t.key.set(!0),n=t.tokens.push(e),()=>{n&&(n(),t.key.set(!t.tokens.isEmpty()),n=void 0)}}cancel(i){const e=this._tokens.get(i);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class dvt extends Ro{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(n=>n.get(JX).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ye(new class extends Ir{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:eye})}runEditorCommand(i,e){i.get(JX).cancel(e)}});class Ak{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const n=e.getModel();this.modelVersionId=n?Z0("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Ak))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 Ak(e,this.flags))}}class Av extends dvt{constructor(e,t,n,o){super(e,o),this._listener=new Be,t&4&&this._listener.add(e.onDidChangeCursorPosition(r=>{(!n||!V.containsPosition(n,r.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(r=>{(!n||!V.containsRange(n,r.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(r=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(r=>this.cancel())),this._listener.add(e.onDidChangeModelContent(r=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class eY extends Ro{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Sf(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===KI.ICodeEditor:!1}function tye(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===KI.IDiffEditor:!1}function uvt(i){return!!i&&typeof i=="object"&&typeof i.onDidChangeActiveEditor=="function"}function nye(i){return Sf(i)?i:tye(i)?i.getModifiedEditor():uvt(i)&&Sf(i.activeCodeEditor)?i.activeCodeEditor:null}class Vw{static _handleEolEdits(e,t){let n;const o=[];for(const r of t)typeof r.eol=="number"&&(n=r.eol),r.range&&typeof r.text=="string"&&o.push(r);return typeof n=="number"&&e.hasModel()&&e.getModel().pushEOL(n),o}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const n=e.getModel(),o=n.validateRange(t.range);return n.getFullModelRange().equalsRange(o)}static execute(e,t,n){n&&e.pushUndoStop();const o=Zu.capture(e),r=Vw._handleEolEdits(e,t);r.length===1&&Vw._isFullModelReplaceEdit(e,r[0])?e.executeEdits("formatEditsCommand",r.map(s=>Gi.replace(V.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",r.map(s=>Gi.replaceMove(V.lift(s.range),s.text))),n&&e.pushUndoStop(),o.restoreRelativeVerticalPositionOfCursor(e)}}class Cle{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class hvt{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(Cle.toKey(e))}has(e){return this._set.has(Cle.toKey(e))}}var Qu=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function tY(i){if(i=i.filter(o=>o.range),!i.length)return;let{range:e}=i[0];for(let o=1;o0&&V.areIntersectingOrTouching(u[h-1],m)?u[h-1]=V.fromPositions(u[h-1].getStartPosition(),m.getEndPosition()):h=u.push(m);const f=m=>Qu(this,void 0,void 0,function*(){var _,y;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(_=e.extensionId)===null||_===void 0?void 0:_.value,m);const w=(yield e.provideDocumentRangeFormattingEdits(c,m,c.getFormattingOptions(),d.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)===null||y===void 0?void 0:y.value,w),w}),g=(m,_)=>{if(!m.length||!_.length)return!1;const y=m.reduce((w,L)=>V.plusRange(w,L.range),m[0].range);if(!_.some(w=>V.intersectRanges(y,w.range)))return!1;for(const w of m)for(const L of _)if(V.intersectRanges(w.range,L.range))return!0;return!1},p=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(r=e.extensionId)===null||r===void 0?void 0:r.value,u);const m=(yield e.provideDocumentRangesFormattingEdits(c,u,c.getFormattingOptions(),d.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(s=e.extensionId)===null||s===void 0?void 0:s.value,m),v.push(m)}else{for(const m of u){if(d.token.isCancellationRequested)return!0;v.push(yield f(m))}for(let m=0;m({text:y.text,range:V.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:w}of y)if(V.areIntersectingOrTouching(w,_))return[new gt(w.startLineNumber,w.startColumn,w.endLineNumber,w.endColumn)];return null})}return!0})}function gvt(i,e,t,n,o){return Qu(this,void 0,void 0,function*(){const r=i.get($t),s=i.get(pt),a=Sf(e)?e.getModel():e,l=iye(s.documentFormattingEditProvider,s.documentRangeFormattingEditProvider,a),c=yield hb.select(l,a,t);c&&(n.report(c),yield r.invokeFunction(pvt,c,e,t,o))})}function pvt(i,e,t,n,o){return Qu(this,void 0,void 0,function*(){const r=i.get(Xd);let s,a;Sf(t)?(s=t.getModel(),a=new Av(t,5,void 0,o)):(s=t,a=new eY(t,o));let l;try{const c=yield e.provideDocumentFormattingEdits(s,s.getFormattingOptions(),a.token);if(l=yield r.computeMoreMinimalEdits(s.uri,c),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||l.length===0)return!1;if(Sf(t))Vw.execute(t,l,n!==2),n!==2&&(tY(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:c}]=l,d=new gt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn);s.pushEditOperations([d],l.map(u=>({text:u.text,range:V.lift(u.range),forceMoveMarkers:!0})),u=>{for(const{range:h}of u)if(V.areIntersectingOrTouching(h,d))return[new gt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn)];return null})}return!0})}function mvt(i,e,t,n,o,r){return Qu(this,void 0,void 0,function*(){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,n,o,r)).catch($o);if(ws(l))return yield i.computeMoreMinimalEdits(t.uri,l)}})}function vvt(i,e,t,n,o){return Qu(this,void 0,void 0,function*(){const r=iye(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of r){const a=yield Promise.resolve(s.provideDocumentFormattingEdits(t,n,o)).catch($o);if(ws(a))return yield i.computeMoreMinimalEdits(t.uri,a)}})}function rye(i,e,t,n,o,r,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,n,o,r,s)).catch($o).then(l=>i.computeMoreMinimalEdits(t.uri,l))}Rn.registerCommand("_executeFormatRangeProvider",function(i,...e){return Qu(this,void 0,void 0,function*(){const[t,n,o]=e;fi(Rt.isUri(t)),fi(V.isIRange(n));const r=i.get(za),s=i.get(Xd),a=i.get(pt),l=yield r.createModelReference(t);try{return mvt(s,a,l.object.textEditorModel,V.lift(n),o,_n.None)}finally{l.dispose()}})});Rn.registerCommand("_executeFormatDocumentProvider",function(i,...e){return Qu(this,void 0,void 0,function*(){const[t,n]=e;fi(Rt.isUri(t));const o=i.get(za),r=i.get(Xd),s=i.get(pt),a=yield o.createModelReference(t);try{return vvt(r,s,a.object.textEditorModel,n,_n.None)}finally{a.dispose()}})});Rn.registerCommand("_executeFormatOnTypeProvider",function(i,...e){return Qu(this,void 0,void 0,function*(){const[t,n,o,r]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string");const s=i.get(za),a=i.get(Xd),l=i.get(pt),c=yield s.createModelReference(t);try{return rye(a,l,c.object.textEditorModel,ae.lift(n),o,r,_n.None)}finally{c.dispose()}})});rh.wrappingIndent.defaultValue=0;rh.glyphMargin.defaultValue=!1;rh.autoIndent.defaultValue=3;rh.overviewRulerLanes.defaultValue=2;hb.setFormatterSelector((i,e,t)=>Promise.resolve(i[0]));const va=H_e();va.editor=bmt();va.languages=cvt();const _vt=va.CancellationTokenSource,bvt=va.Emitter,Cvt=va.KeyCode,yvt=va.KeyMod,wvt=va.Position,Svt=va.Range,xvt=va.Selection,Lvt=va.SelectionDirection,Evt=va.MarkerSeverity,Dvt=va.MarkerTag,kvt=va.Uri,Ivt=va.Token,sye=va.editor,aye=va.languages,Z9=globalThis.MonacoEnvironment;((Z9==null?void 0:Z9.globalAPI)||typeof define=="function"&&define.amd)&&(globalThis.monaco=va);typeof globalThis.require!="undefined"&&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"]});var gT=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:_vt,Emitter:bvt,KeyCode:Cvt,KeyMod:yvt,Position:wvt,Range:Svt,Selection:xvt,SelectionDirection:Lvt,MarkerSeverity:Evt,MarkerTag:Dvt,Uri:kvt,Token:Ivt,editor:sye,languages:aye},Symbol.toStringTag,{value:"Module"}));const Tvt="_editor_kujsi_1";var Nvt={editor:Tvt};const Rvt="modulepreload",yle={},Mvt="/eos/",wt=function(e,t){return!t||t.length===0?e():Promise.all(t.map(n=>{if(n=`${Mvt}${n}`,n in yle)return;yle[n]=!0;const o=n.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${r}`))return;const s=document.createElement("link");if(s.rel=o?"stylesheet":Rvt,o||(s.as="script",s.crossOrigin=""),s.href=n,document.head.appendChild(s),o)return new Promise((a,l)=>{s.addEventListener("load",a),s.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>e())};/*!----------------------------------------------------------------------------- * 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 Rvt=Object.defineProperty,Mvt=Object.getOwnPropertyDescriptor,Avt=Object.getOwnPropertyNames,Pvt=Object.prototype.hasOwnProperty,yle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Avt(e))!Pvt.call(i,o)&&o!==t&&Rvt(i,o,{get:()=>e[o],enumerable:!(n=Mvt(e,o))||n.enumerable});return i},Ovt=(i,e,t)=>(yle(i,e,"default"),t&&yle(t,e,"default")),AL={};Ovt(AL,gT);var lye={},Z9={},cye=class{constructor(i){bt(this,"_languageId");bt(this,"_loadingTriggered");bt(this,"_lazyLoadPromise");bt(this,"_lazyLoadPromiseResolve");bt(this,"_lazyLoadPromiseReject");this._languageId=i,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(i){return Z9[i]||(Z9[i]=new cye(i)),Z9[i]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,lye[this._languageId].loader().then(i=>this._lazyLoadPromiseResolve(i),i=>this._lazyLoadPromiseReject(i))),this._lazyLoadPromise}};function kt(i){const e=i.id;lye[e]=i,AL.languages.register(i);const t=cye.getOrCreate(e);AL.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),AL.languages.onLanguageEncountered(e,async()=>{const n=await t.load();AL.languages.setLanguageConfiguration(e,n.conf)})}kt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>wt(()=>import("./abap.3df96923.js"),[])});kt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>wt(()=>import("./apex.d1ffdff5.js"),[])});kt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>wt(()=>import("./azcli.fdf71a81.js"),[])});kt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>wt(()=>import("./bat.3391c7ff.js"),[])});kt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>wt(()=>import("./bicep.aac3fde2.js"),[])});kt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>wt(()=>import("./cameligo.78c571cd.js"),[])});kt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>wt(()=>import("./clojure.e027f54b.js"),[])});kt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>wt(()=>import("./coffee.a7180991.js"),[])});kt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>wt(()=>import("./cpp.2270e81d.js"),[])});kt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>wt(()=>import("./cpp.2270e81d.js"),[])});kt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>wt(()=>import("./csharp.411410a8.js"),[])});kt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>wt(()=>import("./csp.ae568e81.js"),[])});kt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>wt(()=>import("./css.c2187dbf.js"),[])});kt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>wt(()=>import("./cypher.f6c52cfd.js"),[])});kt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>wt(()=>import("./dart.dd76bad2.js"),[])});kt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>wt(()=>import("./dockerfile.72430457.js"),[])});kt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>wt(()=>import("./ecl.370373e0.js"),[])});kt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>wt(()=>import("./elixir.482d2283.js"),[])});kt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>wt(()=>import("./flow9.03dcae4f.js"),[])});kt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>wt(()=>import("./fsharp.94bebcbd.js"),[])});kt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>wt(()=>import("./freemarker2.756d07c5.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>wt(()=>import("./freemarker2.756d07c5.js"),[]).then(i=>i.TagAngleInterpolationDollar)});kt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>wt(()=>import("./freemarker2.756d07c5.js"),[]).then(i=>i.TagBracketInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>wt(()=>import("./freemarker2.756d07c5.js"),[]).then(i=>i.TagAngleInterpolationBracket)});kt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>wt(()=>import("./freemarker2.756d07c5.js"),[]).then(i=>i.TagBracketInterpolationBracket)});kt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>wt(()=>import("./freemarker2.756d07c5.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>wt(()=>import("./freemarker2.756d07c5.js"),[]).then(i=>i.TagAutoInterpolationBracket)});kt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>wt(()=>import("./go.41070db7.js"),[])});kt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>wt(()=>import("./graphql.eaec13f6.js"),[])});kt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>wt(()=>import("./handlebars.f394fbe4.js"),[])});kt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>wt(()=>import("./hcl.9433a9c6.js"),[])});kt({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:()=>wt(()=>import("./html.53b68c08.js"),[])});kt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>wt(()=>import("./ini.2c645055.js"),[])});kt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>wt(()=>import("./java.4f5ee283.js"),[])});kt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>wt(()=>import("./javascript.ffc97e56.js"),["assets/javascript.ffc97e56.js","assets/typescript.e652792e.js"])});kt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>wt(()=>import("./julia.a5a48340.js"),[])});kt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>wt(()=>import("./kotlin.4b123a17.js"),[])});kt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>wt(()=>import("./less.c923c3f2.js"),[])});kt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>wt(()=>import("./lexon.aafd9092.js"),[])});kt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>wt(()=>import("./lua.cbab0342.js"),[])});kt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>wt(()=>import("./liquid.a3ff61c7.js"),[])});kt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>wt(()=>import("./m3.9c94e963.js"),[])});kt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>wt(()=>import("./markdown.2c72b2d7.js"),[])});kt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>wt(()=>import("./mdx.12093909.js"),[])});kt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>wt(()=>import("./mips.5fb9d463.js"),[])});kt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>wt(()=>import("./msdax.035d2ce9.js"),[])});kt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>wt(()=>import("./mysql.5b2d4486.js"),[])});kt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>wt(()=>import("./objective-c.1a2f9997.js"),[])});kt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>wt(()=>import("./pascal.d86e3bfa.js"),[])});kt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>wt(()=>import("./pascaligo.cdff4867.js"),[])});kt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>wt(()=>import("./perl.0f77918c.js"),[])});kt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>wt(()=>import("./pgsql.b13bfeb4.js"),[])});kt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>wt(()=>import("./php.1137c5b1.js"),[])});kt({id:"pla",extensions:[".pla"],loader:()=>wt(()=>import("./pla.ba073561.js"),[])});kt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>wt(()=>import("./postiats.47bdbb11.js"),[])});kt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>wt(()=>import("./powerquery.28fe50a6.js"),[])});kt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>wt(()=>import("./powershell.02411d15.js"),[])});kt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>wt(()=>import("./protobuf.4e58fedc.js"),[])});kt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>wt(()=>import("./pug.979aef3f.js"),[])});kt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>wt(()=>import("./python.77882a55.js"),[])});kt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>wt(()=>import("./qsharp.2dc435e0.js"),[])});kt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>wt(()=>import("./r.4245e0f1.js"),[])});kt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>wt(()=>import("./razor.65d26acd.js"),[])});kt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>wt(()=>import("./redis.8c9b0fd3.js"),[])});kt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>wt(()=>import("./redshift.92dc9727.js"),[])});kt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>wt(()=>import("./restructuredtext.8eb364a9.js"),[])});kt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>wt(()=>import("./ruby.34b90da2.js"),[])});kt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>wt(()=>import("./rust.11449c53.js"),[])});kt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>wt(()=>import("./sb.224ac2e4.js"),[])});kt({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:()=>wt(()=>import("./scala.17169120.js"),[])});kt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>wt(()=>import("./scheme.1d4e49e8.js"),[])});kt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>wt(()=>import("./scss.61c83d96.js"),[])});kt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>wt(()=>import("./shell.27d828bc.js"),[])});kt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>wt(()=>import("./solidity.90deba7f.js"),[])});kt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>wt(()=>import("./sophia.f5d72e68.js"),[])});kt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>wt(()=>import("./sparql.9c78b461.js"),[])});kt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>wt(()=>import("./sql.8b01cffb.js"),[])});kt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>wt(()=>import("./st.90b91d4c.js"),[])});kt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>wt(()=>import("./swift.458b3759.js"),[])});kt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>wt(()=>import("./systemverilog.34f30287.js"),[])});kt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>wt(()=>import("./systemverilog.34f30287.js"),[])});kt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>wt(()=>import("./tcl.89fcd7eb.js"),[])});kt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>wt(()=>import("./twig.9c6962ef.js"),[])});kt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>wt(()=>import("./typescript.e652792e.js"),[])});kt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>wt(()=>import("./vb.46a3924e.js"),[])});kt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>wt(()=>import("./wgsl.2c55715c.js"),[])});kt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\wt(()=>import("./xml.ea9fa0dc.js"),[])});kt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>wt(()=>import("./yaml.d8459d8e.js"),[])});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Avt=Object.defineProperty,Pvt=Object.getOwnPropertyDescriptor,Ovt=Object.getOwnPropertyNames,Fvt=Object.prototype.hasOwnProperty,wle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ovt(e))!Fvt.call(i,o)&&o!==t&&Avt(i,o,{get:()=>e[o],enumerable:!(n=Pvt(e,o))||n.enumerable});return i},Bvt=(i,e,t)=>(wle(i,e,"default"),t&&wle(t,e,"default")),AL={};Bvt(AL,gT);var lye={},Q9={},cye=class{constructor(i){bt(this,"_languageId");bt(this,"_loadingTriggered");bt(this,"_lazyLoadPromise");bt(this,"_lazyLoadPromiseResolve");bt(this,"_lazyLoadPromiseReject");this._languageId=i,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(i){return Q9[i]||(Q9[i]=new cye(i)),Q9[i]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,lye[this._languageId].loader().then(i=>this._lazyLoadPromiseResolve(i),i=>this._lazyLoadPromiseReject(i))),this._lazyLoadPromise}};function kt(i){const e=i.id;lye[e]=i,AL.languages.register(i);const t=cye.getOrCreate(e);AL.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),AL.languages.onLanguageEncountered(e,async()=>{const n=await t.load();AL.languages.setLanguageConfiguration(e,n.conf)})}kt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>wt(()=>import("./abap.3df96923.js"),[])});kt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>wt(()=>import("./apex.d1ffdff5.js"),[])});kt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>wt(()=>import("./azcli.fdf71a81.js"),[])});kt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>wt(()=>import("./bat.3391c7ff.js"),[])});kt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>wt(()=>import("./bicep.aac3fde2.js"),[])});kt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>wt(()=>import("./cameligo.78c571cd.js"),[])});kt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>wt(()=>import("./clojure.e027f54b.js"),[])});kt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>wt(()=>import("./coffee.a7180991.js"),[])});kt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>wt(()=>import("./cpp.2270e81d.js"),[])});kt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>wt(()=>import("./cpp.2270e81d.js"),[])});kt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>wt(()=>import("./csharp.411410a8.js"),[])});kt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>wt(()=>import("./csp.ae568e81.js"),[])});kt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>wt(()=>import("./css.c2187dbf.js"),[])});kt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>wt(()=>import("./cypher.f6c52cfd.js"),[])});kt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>wt(()=>import("./dart.dd76bad2.js"),[])});kt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>wt(()=>import("./dockerfile.72430457.js"),[])});kt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>wt(()=>import("./ecl.370373e0.js"),[])});kt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>wt(()=>import("./elixir.482d2283.js"),[])});kt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>wt(()=>import("./flow9.03dcae4f.js"),[])});kt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>wt(()=>import("./fsharp.94bebcbd.js"),[])});kt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>wt(()=>import("./freemarker2.3b2f34fd.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>wt(()=>import("./freemarker2.3b2f34fd.js"),[]).then(i=>i.TagAngleInterpolationDollar)});kt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>wt(()=>import("./freemarker2.3b2f34fd.js"),[]).then(i=>i.TagBracketInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>wt(()=>import("./freemarker2.3b2f34fd.js"),[]).then(i=>i.TagAngleInterpolationBracket)});kt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>wt(()=>import("./freemarker2.3b2f34fd.js"),[]).then(i=>i.TagBracketInterpolationBracket)});kt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>wt(()=>import("./freemarker2.3b2f34fd.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>wt(()=>import("./freemarker2.3b2f34fd.js"),[]).then(i=>i.TagAutoInterpolationBracket)});kt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>wt(()=>import("./go.41070db7.js"),[])});kt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>wt(()=>import("./graphql.eaec13f6.js"),[])});kt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>wt(()=>import("./handlebars.18e0667c.js"),[])});kt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>wt(()=>import("./hcl.9433a9c6.js"),[])});kt({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:()=>wt(()=>import("./html.1bf06998.js"),[])});kt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>wt(()=>import("./ini.2c645055.js"),[])});kt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>wt(()=>import("./java.4f5ee283.js"),[])});kt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>wt(()=>import("./javascript.85c4a255.js"),["assets/javascript.85c4a255.js","assets/typescript.5993deda.js"])});kt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>wt(()=>import("./julia.a5a48340.js"),[])});kt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>wt(()=>import("./kotlin.4b123a17.js"),[])});kt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>wt(()=>import("./less.c923c3f2.js"),[])});kt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>wt(()=>import("./lexon.aafd9092.js"),[])});kt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>wt(()=>import("./lua.cbab0342.js"),[])});kt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>wt(()=>import("./liquid.61cc9740.js"),[])});kt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>wt(()=>import("./m3.9c94e963.js"),[])});kt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>wt(()=>import("./markdown.2c72b2d7.js"),[])});kt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>wt(()=>import("./mdx.1b36e47c.js"),[])});kt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>wt(()=>import("./mips.5fb9d463.js"),[])});kt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>wt(()=>import("./msdax.035d2ce9.js"),[])});kt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>wt(()=>import("./mysql.5b2d4486.js"),[])});kt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>wt(()=>import("./objective-c.1a2f9997.js"),[])});kt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>wt(()=>import("./pascal.d86e3bfa.js"),[])});kt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>wt(()=>import("./pascaligo.cdff4867.js"),[])});kt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>wt(()=>import("./perl.0f77918c.js"),[])});kt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>wt(()=>import("./pgsql.b13bfeb4.js"),[])});kt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>wt(()=>import("./php.1137c5b1.js"),[])});kt({id:"pla",extensions:[".pla"],loader:()=>wt(()=>import("./pla.ba073561.js"),[])});kt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>wt(()=>import("./postiats.47bdbb11.js"),[])});kt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>wt(()=>import("./powerquery.28fe50a6.js"),[])});kt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>wt(()=>import("./powershell.02411d15.js"),[])});kt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>wt(()=>import("./protobuf.4e58fedc.js"),[])});kt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>wt(()=>import("./pug.979aef3f.js"),[])});kt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>wt(()=>import("./python.402e94f8.js"),[])});kt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>wt(()=>import("./qsharp.2dc435e0.js"),[])});kt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>wt(()=>import("./r.4245e0f1.js"),[])});kt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>wt(()=>import("./razor.d50b3781.js"),[])});kt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>wt(()=>import("./redis.8c9b0fd3.js"),[])});kt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>wt(()=>import("./redshift.92dc9727.js"),[])});kt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>wt(()=>import("./restructuredtext.8eb364a9.js"),[])});kt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>wt(()=>import("./ruby.34b90da2.js"),[])});kt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>wt(()=>import("./rust.11449c53.js"),[])});kt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>wt(()=>import("./sb.224ac2e4.js"),[])});kt({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:()=>wt(()=>import("./scala.17169120.js"),[])});kt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>wt(()=>import("./scheme.1d4e49e8.js"),[])});kt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>wt(()=>import("./scss.61c83d96.js"),[])});kt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>wt(()=>import("./shell.27d828bc.js"),[])});kt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>wt(()=>import("./solidity.90deba7f.js"),[])});kt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>wt(()=>import("./sophia.f5d72e68.js"),[])});kt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>wt(()=>import("./sparql.9c78b461.js"),[])});kt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>wt(()=>import("./sql.8b01cffb.js"),[])});kt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>wt(()=>import("./st.90b91d4c.js"),[])});kt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>wt(()=>import("./swift.458b3759.js"),[])});kt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>wt(()=>import("./systemverilog.34f30287.js"),[])});kt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>wt(()=>import("./systemverilog.34f30287.js"),[])});kt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>wt(()=>import("./tcl.89fcd7eb.js"),[])});kt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>wt(()=>import("./twig.9c6962ef.js"),[])});kt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>wt(()=>import("./typescript.5993deda.js"),[])});kt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>wt(()=>import("./vb.46a3924e.js"),[])});kt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>wt(()=>import("./wgsl.2c55715c.js"),[])});kt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\wt(()=>import("./xml.c84ad9c7.js"),[])});kt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>wt(()=>import("./yaml.75677e06.js"),[])});/*!----------------------------------------------------------------------------- * 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 Fvt=Object.defineProperty,Bvt=Object.getOwnPropertyDescriptor,Wvt=Object.getOwnPropertyNames,Vvt=Object.prototype.hasOwnProperty,wle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Wvt(e))!Vvt.call(i,o)&&o!==t&&Fvt(i,o,{get:()=>e[o],enumerable:!(n=Bvt(e,o))||n.enumerable});return i},Hvt=(i,e,t)=>(wle(i,e,"default"),t&&wle(t,e,"default")),IS={};Hvt(IS,gT);var tY=class{constructor(i,e,t){bt(this,"_onDidChange",new IS.Emitter);bt(this,"_options");bt(this,"_modeConfiguration");bt(this,"_languageId");this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}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(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(i){this.setOptions(i)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},nY={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}},iY={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},dye=new tY("css",nY,iY),uye=new tY("scss",nY,iY),hye=new tY("less",nY,iY);IS.languages.css={cssDefaults:dye,lessDefaults:hye,scssDefaults:uye};function oY(){return wt(()=>import("./cssMode.3fb2bfb9.js"),[])}IS.languages.onLanguage("less",()=>{oY().then(i=>i.setupMode(hye))});IS.languages.onLanguage("scss",()=>{oY().then(i=>i.setupMode(uye))});IS.languages.onLanguage("css",()=>{oY().then(i=>i.setupMode(dye))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Wvt=Object.defineProperty,Vvt=Object.getOwnPropertyDescriptor,Hvt=Object.getOwnPropertyNames,$vt=Object.prototype.hasOwnProperty,Sle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Hvt(e))!$vt.call(i,o)&&o!==t&&Wvt(i,o,{get:()=>e[o],enumerable:!(n=Vvt(e,o))||n.enumerable});return i},zvt=(i,e,t)=>(Sle(i,e,"default"),t&&Sle(t,e,"default")),IS={};zvt(IS,gT);var nY=class{constructor(i,e,t){bt(this,"_onDidChange",new IS.Emitter);bt(this,"_options");bt(this,"_modeConfiguration");bt(this,"_languageId");this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}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(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(i){this.setOptions(i)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},iY={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}},oY={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},dye=new nY("css",iY,oY),uye=new nY("scss",iY,oY),hye=new nY("less",iY,oY);IS.languages.css={cssDefaults:dye,lessDefaults:hye,scssDefaults:uye};function rY(){return wt(()=>import("./cssMode.7a415312.js"),[])}IS.languages.onLanguage("less",()=>{rY().then(i=>i.setupMode(hye))});IS.languages.onLanguage("scss",()=>{rY().then(i=>i.setupMode(uye))});IS.languages.onLanguage("css",()=>{rY().then(i=>i.setupMode(dye))});/*!----------------------------------------------------------------------------- * 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 $vt=Object.defineProperty,zvt=Object.getOwnPropertyDescriptor,Uvt=Object.getOwnPropertyNames,jvt=Object.prototype.hasOwnProperty,Sle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Uvt(e))!jvt.call(i,o)&&o!==t&&$vt(i,o,{get:()=>e[o],enumerable:!(n=zvt(e,o))||n.enumerable});return i},Kvt=(i,e,t)=>(Sle(i,e,"default"),t&&Sle(t,e,"default")),tF={};Kvt(tF,gT);var qvt=class{constructor(i,e,t){bt(this,"_onDidChange",new tF.Emitter);bt(this,"_options");bt(this,"_modeConfiguration");bt(this,"_languageId");this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},Gvt={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"},nF={format:Gvt,suggest:{},data:{useDefaultDataProvider:!0}};function iF(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===TE,documentFormattingEdits:i===TE,documentRangeFormattingEdits:i===TE}}var TE="html",xle="handlebars",Lle="razor",fye=oF(TE,nF,iF(TE)),Xvt=fye.defaults,gye=oF(xle,nF,iF(xle)),Yvt=gye.defaults,pye=oF(Lle,nF,iF(Lle)),Zvt=pye.defaults;tF.languages.html={htmlDefaults:Xvt,razorDefaults:Zvt,handlebarDefaults:Yvt,htmlLanguageService:fye,handlebarLanguageService:gye,razorLanguageService:pye,registerHTMLLanguageService:oF};function Qvt(){return wt(()=>import("./htmlMode.897a5543.js"),[])}function oF(i,e=nF,t=iF(i)){const n=new qvt(i,e,t);let o;const r=tF.languages.onLanguage(i,async()=>{o=(await Qvt()).setupMode(n)});return{defaults:n,dispose(){r.dispose(),o==null||o.dispose(),o=void 0}}}/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Uvt=Object.defineProperty,jvt=Object.getOwnPropertyDescriptor,Kvt=Object.getOwnPropertyNames,qvt=Object.prototype.hasOwnProperty,xle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Kvt(e))!qvt.call(i,o)&&o!==t&&Uvt(i,o,{get:()=>e[o],enumerable:!(n=jvt(e,o))||n.enumerable});return i},Gvt=(i,e,t)=>(xle(i,e,"default"),t&&xle(t,e,"default")),nF={};Gvt(nF,gT);var Xvt=class{constructor(i,e,t){bt(this,"_onDidChange",new nF.Emitter);bt(this,"_options");bt(this,"_modeConfiguration");bt(this,"_languageId");this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},Yvt={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"},iF={format:Yvt,suggest:{},data:{useDefaultDataProvider:!0}};function oF(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===TE,documentFormattingEdits:i===TE,documentRangeFormattingEdits:i===TE}}var TE="html",Lle="handlebars",Ele="razor",fye=rF(TE,iF,oF(TE)),Zvt=fye.defaults,gye=rF(Lle,iF,oF(Lle)),Qvt=gye.defaults,pye=rF(Ele,iF,oF(Ele)),Jvt=pye.defaults;nF.languages.html={htmlDefaults:Zvt,razorDefaults:Jvt,handlebarDefaults:Qvt,htmlLanguageService:fye,handlebarLanguageService:gye,razorLanguageService:pye,registerHTMLLanguageService:rF};function e_t(){return wt(()=>import("./htmlMode.abd248db.js"),[])}function rF(i,e=iF,t=oF(i)){const n=new Xvt(i,e,t);let o;const r=nF.languages.onLanguage(i,async()=>{o=(await e_t()).setupMode(n)});return{defaults:n,dispose(){r.dispose(),o==null||o.dispose(),o=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 Jvt=Object.defineProperty,e_t=Object.getOwnPropertyDescriptor,t_t=Object.getOwnPropertyNames,n_t=Object.prototype.hasOwnProperty,Ele=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of t_t(e))!n_t.call(i,o)&&o!==t&&Jvt(i,o,{get:()=>e[o],enumerable:!(n=e_t(e,o))||n.enumerable});return i},i_t=(i,e,t)=>(Ele(i,e,"default"),t&&Ele(t,e,"default")),pT={};i_t(pT,gT);var o_t=class{constructor(i,e,t){bt(this,"_onDidChange",new pT.Emitter);bt(this,"_diagnosticsOptions");bt(this,"_modeConfiguration");bt(this,"_languageId");this._languageId=i,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},r_t={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},s_t={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},mye=new o_t("json",r_t,s_t);pT.languages.json={jsonDefaults:mye};function a_t(){return wt(()=>import("./jsonMode.db6fe524.js"),[])}pT.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});pT.languages.onLanguage("json",()=>{a_t().then(i=>i.setupMode(mye))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var t_t=Object.defineProperty,n_t=Object.getOwnPropertyDescriptor,i_t=Object.getOwnPropertyNames,o_t=Object.prototype.hasOwnProperty,Dle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of i_t(e))!o_t.call(i,o)&&o!==t&&t_t(i,o,{get:()=>e[o],enumerable:!(n=n_t(e,o))||n.enumerable});return i},r_t=(i,e,t)=>(Dle(i,e,"default"),t&&Dle(t,e,"default")),pT={};r_t(pT,gT);var s_t=class{constructor(i,e,t){bt(this,"_onDidChange",new pT.Emitter);bt(this,"_diagnosticsOptions");bt(this,"_modeConfiguration");bt(this,"_languageId");this._languageId=i,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},a_t={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},l_t={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},mye=new s_t("json",a_t,l_t);pT.languages.json={jsonDefaults:mye};function c_t(){return wt(()=>import("./jsonMode.ed18ab76.js"),[])}pT.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});pT.languages.onLanguage("json",()=>{c_t().then(i=>i.setupMode(mye))});/*!----------------------------------------------------------------------------- * 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 l_t=Object.defineProperty,c_t=Object.getOwnPropertyDescriptor,d_t=Object.getOwnPropertyNames,u_t=Object.prototype.hasOwnProperty,Dle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d_t(e))!u_t.call(i,o)&&o!==t&&l_t(i,o,{get:()=>e[o],enumerable:!(n=c_t(e,o))||n.enumerable});return i},h_t=(i,e,t)=>(Dle(i,e,"default"),t&&Dle(t,e,"default")),f_t="5.0.2",Hw={};h_t(Hw,gT);var vye=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(vye||{}),_ye=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(_ye||{}),bye=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(bye||{}),Cye=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(Cye||{}),yye=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(yye||{}),wye=class{constructor(i,e,t,n,o){bt(this,"_onDidChange",new Hw.Emitter);bt(this,"_onDidExtraLibsChange",new Hw.Emitter);bt(this,"_extraLibs");bt(this,"_removedExtraLibs");bt(this,"_eagerModelSync");bt(this,"_compilerOptions");bt(this,"_diagnosticsOptions");bt(this,"_workerOptions");bt(this,"_onDidExtraLibsChangeTimeout");bt(this,"_inlayHintsOptions");bt(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(o),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(i,e){let t;if(typeof e=="undefined"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let o=this._extraLibs[t];!o||o.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let o=1;this._removedExtraLibs[t]&&(o=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:o}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},g_t=f_t,Sye={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},xye=new wye({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Sye),Lye=new wye({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Sye),p_t=()=>rF().then(i=>i.getTypeScriptWorker()),m_t=()=>rF().then(i=>i.getJavaScriptWorker());Hw.languages.typescript={ModuleKind:vye,JsxEmit:_ye,NewLineKind:bye,ScriptTarget:Cye,ModuleResolutionKind:yye,typescriptVersion:g_t,typescriptDefaults:xye,javascriptDefaults:Lye,getTypeScriptWorker:p_t,getJavaScriptWorker:m_t};function rF(){return wt(()=>import("./tsMode.3620dac5.js"),[])}Hw.languages.onLanguage("typescript",()=>rF().then(i=>i.setupTypeScript(xye)));Hw.languages.onLanguage("javascript",()=>rF().then(i=>i.setupJavaScript(Lye)));class v_t extends ec{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:C("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Xe.map,toggled:Me.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Me.has("isInDiffEditor"),menu:{when:Me.has("isInDiffEditor"),id:Z.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}}$i(v_t);class Eye extends ec{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:C("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:Me.has("isInDiffEditor")})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",o)}}$i(Eye);class Dye extends ec{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:C("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:Me.has("isInDiffEditor")})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}}$i(Dye);Hr.appendMenuItem(Z.EditorTitle,{command:{id:new Dye().desc.id,title:C("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Me.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Me.has("isInDiffEditor")},order:11,group:"1_diff",when:Me.and(Q.diffEditorRenderSideBySideInlineBreakpointReached,Me.has("isInDiffEditor"))});Hr.appendMenuItem(Z.EditorTitle,{command:{id:new Eye().desc.id,title:C("showMoves","Show Moved Code Blocks"),icon:Xe.move,toggled:_S.create("config.diffEditor.experimental.showMoves",!0),precondition:Me.has("isInDiffEditor")},order:10,group:"1_diff",when:Me.has("isInDiffEditor")});const sF={value:C("diffEditor","Diff Editor"),original:"Diff Editor"};class __t extends lh{constructor(){super({id:"diffEditor.switchSide",title:{value:C("switchSide","Switch Side"),original:"Switch Side"},icon:Xe.arrowSwap,precondition:Me.has("isInDiffEditor"),f1:!0,category:sF})}runEditorCommand(e,t,n){const o=NS(e);if(o instanceof ub){if(n&&n.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}}$i(__t);class b_t extends lh{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:C("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:Xe.close,precondition:Q.comparingMovedCode,f1:!1,category:sF,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const o=NS(e);o instanceof ub&&o.exitCompareMove()}}$i(b_t);class C_t extends lh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:C("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Xe.fold,precondition:Me.has("isInDiffEditor"),f1:!0,category:sF})}runEditorCommand(e,t,...n){const o=NS(e);o instanceof ub&&o.collapseAllUnchangedRegions()}}$i(C_t);class y_t extends lh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:C("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Xe.unfold,precondition:Me.has("isInDiffEditor"),f1:!0,category:sF})}runEditorCommand(e,t,...n){const o=NS(e);o instanceof ub&&o.showAllUnchangedRegions()}}$i(y_t);const kye={value:C("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class TS extends ec{constructor(){super({id:TS.id,title:{value:C("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:kye,precondition:Me.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=NS(e);t==null||t.accessibleDiffViewerNext()}}TS.id="editor.action.accessibleDiffViewer.next";Hr.appendMenuItem(Z.EditorTitle,{command:{id:TS.id,title:C("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Me.has("isInDiffEditor")},order:10,group:"2_diff",when:Me.and(Q.accessibleDiffViewerVisible.negate(),Me.has("isInDiffEditor"))});class mT extends ec{constructor(){super({id:mT.id,title:{value:C("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:kye,precondition:Me.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=NS(e);t==null||t.accessibleDiffViewerPrev()}}mT.id="editor.action.accessibleDiffViewer.prev";function NS(i){var e;const t=i.get(Jn),n=t.listDiffEditors(),o=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!o)return null;for(let s=0,a=n.length;s=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},x_t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},aF=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},uz;const lF=new lt("selectionAnchorSet",!1);let dp=uz=class{static get(e){return e.getContribution(uz.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=lF.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(gt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new os().appendText(C("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Cs(C("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(gt.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()}};dp.ID="editor.contrib.selectionAnchorController";dp=uz=S_t([x_t(1,Ut)],dp);class L_t extends ft{constructor(){super({id:"editor.action.setSelectionAnchor",label:C("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2080),weight:100}})}run(e,t){var n;return aF(this,void 0,void 0,function*(){(n=dp.get(t))===null||n===void 0||n.setSelectionAnchor()})}}class E_t extends ft{constructor(){super({id:"editor.action.goToSelectionAnchor",label:C("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:lF})}run(e,t){var n;return aF(this,void 0,void 0,function*(){(n=dp.get(t))===null||n===void 0||n.goToSelectionAnchor()})}}class D_t extends ft{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:C("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:lF,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2089),weight:100}})}run(e,t){var n;return aF(this,void 0,void 0,function*(){(n=dp.get(t))===null||n===void 0||n.selectFromAnchorToCursor()})}}class k_t extends ft{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:C("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:lF,kbOpts:{kbExpr:Q.editorTextFocus,primary:9,weight:100}})}run(e,t){var n;return aF(this,void 0,void 0,function*(){(n=dp.get(t))===null||n===void 0||n.cancelSelectionAnchor()})}}Un(dp.ID,dp,4);ze(L_t);ze(E_t);ze(D_t);ze(k_t);const I_t=J("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},C("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class T_t extends ft{constructor(){super({id:"editor.action.jumpToBracket",label:C("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=Rd.get(t))===null||n===void 0||n.jumpToBracket()}}class N_t extends ft{constructor(){super({id:"editor.action.selectToBracket",label:C("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,n){var o;let r=!0;n&&n.selectBrackets===!1&&(r=!1),(o=Rd.get(t))===null||o===void 0||o.selectToBracket(r)}}class R_t extends ft{constructor(){super({id:"editor.action.removeBrackets",label:C("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=Rd.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class M_t{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class Rd extends _e{static get(e){return e.getContribution(Rd.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new bi(()=>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(n=>{const o=n.getStartPosition(),r=e.bracketPairs.matchBracket(o);let s=null;if(r)r[0].containsPosition(o)&&!r[1].containsPosition(o)?s=r[1].getStartPosition():r[1].containsPosition(o)&&(s=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(o);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(o);l&&l.range&&(s=l.range.getStartPosition())}}return s?new gt(s.lineNumber,s.column,s.lineNumber,s.column):new gt(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(o=>{const r=o.getStartPosition();let s=t.bracketPairs.matchBracket(r);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(r),!s)){const c=t.bracketPairs.findNextBracket(r);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(V.compareRangesUsingStarts);const[c,d]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(r)){const u=a;a=l,l=u}}a&&l&&n.push(new gt(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const o=n.getPosition();let r=t.bracketPairs.matchBracket(o);r||(r=t.bracketPairs.findEnclosingBrackets(o)),r&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:r[0],text:""},{range:r[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const n of this._lastBracketsData){const o=n.brackets;o&&(e[t++]={range:o[0],options:n.options},e[t++]={range:o[1],options:n.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(),n=t.getVersionId();let o=[];this._lastVersionId===n&&(o=this._lastBracketsData);const r=[];let s=0;for(let u=0,h=e.length;u1&&r.sort(ae.compare);const a=[];let l=0,c=0;const d=o.length;for(let u=0,h=r.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}}ze(F_t);var B_t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const fb="9_cutcopypaste",W_t=Fu||document.queryCommandSupported("cut"),Tye=Fu||document.queryCommandSupported("copy"),V_t=typeof navigator.clipboard=="undefined"||Fc?document.queryCommandSupported("paste"):!0;function rY(i){return i.register(),i}const H_t=W_t?rY(new CS({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Fu?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:Z.EditorContext,group:fb,title:C("actions.clipboard.cutLabel","Cut"),when:Q.writable,order:1},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.cutLabel","Cut"),order:1},{menuId:Z.SimpleEditorContext,group:fb,title:C("actions.clipboard.cutLabel","Cut"),when:Q.writable,order:1}]})):void 0,$_t=Tye?rY(new CS({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Fu?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:Z.EditorContext,group:fb,title:C("actions.clipboard.copyLabel","Copy"),order:2},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.copyLabel","Copy"),order:1},{menuId:Z.SimpleEditorContext,group:fb,title:C("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Hr.appendMenuItem(Z.MenubarEditMenu,{submenu:Z.MenubarCopy,title:{value:C("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextCopy,title:{value:C("copy as","Copy As"),original:"Copy As"},group:fb,order:3});Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1,when:Me.and(Me.notEquals("resourceScheme","output"),Q.editorTextFocus)});Hr.appendMenuItem(Z.EditorTitleContext,{submenu:Z.EditorTitleContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1});Hr.appendMenuItem(Z.ExplorerContext,{submenu:Z.ExplorerContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1});const Q9=V_t?rY(new CS({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Fu?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:Z.EditorContext,group:fb,title:C("actions.clipboard.pasteLabel","Paste"),when:Q.writable,order:4},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:Z.SimpleEditorContext,group:fb,title:C("actions.clipboard.pasteLabel","Paste"),when:Q.writable,order:4}]})):void 0;class z_t extends ft{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:C("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(_H.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),_H.forceCopyWithSyntaxHighlighting=!1)}}function Nye(i,e){!i||(i.addImplementation(1e4,"code-editor",(t,n)=>{const o=t.get(Jn).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const r=o.getOption(37),s=o.getSelection();return s&&s.isEmpty()&&!r||o.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(e5().execCommand(e),!0)))}Nye(H_t,"cut");Nye($_t,"copy");Q9&&(Q9.addImplementation(1e4,"code-editor",(i,e)=>{const t=i.get(Jn),n=i.get(wp),o=t.getFocusedCodeEditor();return o&&o.hasTextFocus()?!o.getContainerDomNode().ownerDocument.execCommand("paste")&&Xv?(()=>B_t(void 0,void 0,void 0,function*(){const s=yield n.readText();if(s!==""){const a=tk.INSTANCE.get(s);let l=!1,c=null,d=null;a&&(l=o.getOption(37)&&!!a.isFromEmptySelection,c=typeof a.multicursorText!="undefined"?a.multicursorText:null,d=a.mode),o.trigger("keyboard","paste",{text:s,pasteOnNewLine:l,multicursorText:c,mode:d})}}))():!0:!1}),Q9.addImplementation(0,"generic-dom",(i,e)=>(e5().execCommand("paste"),!0)));Tye&&ze(z_t);var U_t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Wt{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+Wt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Wt(this.value+Wt.sep+e)}}Wt.sep=".";Wt.None=new Wt("@@none@@");Wt.Empty=new Wt("");Wt.QuickFix=new Wt("quickfix");Wt.Refactor=new Wt("refactor");Wt.RefactorExtract=Wt.Refactor.append("extract");Wt.RefactorInline=Wt.Refactor.append("inline");Wt.RefactorMove=Wt.Refactor.append("move");Wt.RefactorRewrite=Wt.Refactor.append("rewrite");Wt.Notebook=new Wt("notebook");Wt.Source=new Wt("source");Wt.SourceOrganizeImports=Wt.Source.append("organizeImports");Wt.SourceFixAll=Wt.Source.append("fixAll");Wt.SurroundWith=Wt.Refactor.append("surround");var fl;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(fl||(fl={}));function j_t(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>Rye(e,t,i.include))||!i.includeSourceActions&&Wt.Source.contains(e))}function K_t(i,e){const t=e.kind?new Wt(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>Rye(t,n,i.include))||!i.includeSourceActions&&t&&Wt.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function Rye(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class Hh{static fromUser(e,t){return!e||typeof e!="object"?new Hh(t.kind,t.apply,!1):new Hh(Hh.getKindFromUser(e,t.kind),Hh.getApplyFromUser(e,t.apply),Hh.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 Wt(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class q_t{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}resolve(e){var t;return U_t(this,void 0,void 0,function*(){if(((t=this.provider)===null||t===void 0?void 0:t.resolveCodeAction)&&!this.action.edit){let n;try{n=yield this.provider.resolveCodeAction(this.action,e)}catch(o){$o(o)}n&&(this.action.edit=n.edit)}return this})}}var cO=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Mye="editor.action.codeAction",sY="editor.action.quickFix",Aye="editor.action.autoFix",Pye="editor.action.refactor",Oye="editor.action.sourceAction",aY="editor.action.organizeImports",lY="editor.action.fixAll";class NE extends _e{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return ws(e.diagnostics)?ws(t.diagnostics)?NE.codeActionsPreferredComparator(e,t):-1:ws(t.diagnostics)?1:NE.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(NE.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Wt.QuickFix.contains(new Wt(e.kind))&&!!e.isPreferred)}}const kle={actions:[],documentation:void 0};function RE(i,e,t,n,o,r){var s;return cO(this,void 0,void 0,function*(){const a=n.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],Wt.Notebook]}),c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:n.type},d=new JX(e,r),u=n.type===2,h=G_t(i,e,u?l:a),f=new Be,g=h.map(v=>cO(this,void 0,void 0,function*(){try{o.report(v);const m=yield v.provideCodeActions(e,t,c,d.token);if(m&&f.add(m),d.token.isCancellationRequested)return kle;const _=((m==null?void 0:m.actions)||[]).filter(w=>w&&K_t(a,w)),y=Y_t(v,_,a.include);return{actions:_.map(w=>new q_t(w,v)),documentation:y}}catch(m){if(sh(m))throw m;return $o(m),kle}})),p=i.onDidChange(()=>{const v=i.all(e);Lo(v,h)||d.cancel()});try{const v=yield Promise.all(g),m=v.map(y=>y.actions).flat(),_=[...hf(v.map(y=>y.documentation)),...X_t(i,e,n,m)];return new NE(m,_,f)}finally{p.dispose(),d.dispose()}})}function G_t(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(o=>j_t(t,new Wt(o))):!0)}function*X_t(i,e,t,n){var o,r,s;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)===null||o===void 0?void 0:o.call(a,{trigger:t.type,only:(s=(r=t.filter)===null||r===void 0?void 0:r.include)===null||s===void 0?void 0:s.value},n.map(l=>l.action)))}function Y_t(i,e,t){if(!i.documentation)return;const n=i.documentation.map(o=>({kind:new Wt(o.kind),command:o.command}));if(t){let o;for(const r of n)r.kind.contains(t)&&(o?o.kind.contains(r.kind)&&(o=r):o=r);if(o)return o==null?void 0:o.command}for(const o of e)if(!!o.kind){for(const r of n)if(r.kind.contains(new Wt(o.kind)))return r.command}}var dO;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions"})(dO||(dO={}));function Z_t(i,e,t,n,o=_n.None){var r;return cO(this,void 0,void 0,function*(){const s=i.get(oT),a=i.get(_o),l=i.get(tc),c=i.get(Ao);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(o),!o.isCancellationRequested&&!(!((r=e.action.edit)===null||r===void 0)&&r.edits.length&&!(yield s.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==dO.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const u=Q_t(d);c.error(typeof u=="string"?u:C("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function Q_t(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}Rn.registerCommand("_executeCodeActionProvider",function(i,e,t,n,o){return cO(this,void 0,void 0,function*(){if(!(e instanceof Rt))throw Mc();const{codeActionProvider:r}=i.get(pt),s=i.get(Yi).getModel(e);if(!s)throw Mc();const a=gt.isISelection(t)?gt.liftSelection(t):V.isIRange(t)?s.validateRange(t):void 0;if(!a)throw Mc();const l=typeof n=="string"?new Wt(n):void 0,c=yield RE(r,s,a,{type:1,triggerAction:fl.Default,filter:{includeSourceActions:!0,include:l}},Xg.None,_n.None),d=[],u=Math.min(c.validActions.length,typeof o=="number"?o:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}})});var J_t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},e0t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},hz;let uO=hz=class{constructor(e){this.keybindingService=e}getResolver(){const e=new ah(()=>this.keybindingService.getKeybindings().filter(t=>hz.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let n=t.commandArgs;return t.command===aY?n={kind:Wt.SourceOrganizeImports.value}:t.command===lY&&(n={kind:Wt.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Hh.fromUser(n,{kind:Wt.None,apply:"never"}))}));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.value);return n==null?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new Wt(e.kind);return t.filter(o=>o.kind.contains(n)).filter(o=>o.preferred?e.isPreferred:!0).reduceRight((o,r)=>o?o.kind.contains(r.kind)?r:o:r,void 0)}};uO.codeActionCommands=[Pye,Mye,Oye,aY,lY];uO=hz=J_t([e0t(0,xi)],uO);J("symbolIcon.arrayForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.booleanForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.colorForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.constantForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.fileForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.folderForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.keyForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.keywordForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.moduleForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.namespaceForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.nullForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.numberForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.objectForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.operatorForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.packageForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.propertyForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.referenceForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.snippetForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.stringForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.structForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.textForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.typeParameterForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.unitForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const Fye=Object.freeze({kind:Wt.Empty,title:C("codeAction.widget.id.more","More Actions...")}),t0t=Object.freeze([{kind:Wt.QuickFix,title:C("codeAction.widget.id.quickfix","Quick Fix")},{kind:Wt.RefactorExtract,title:C("codeAction.widget.id.extract","Extract"),icon:Xe.wrench},{kind:Wt.RefactorInline,title:C("codeAction.widget.id.inline","Inline"),icon:Xe.wrench},{kind:Wt.RefactorRewrite,title:C("codeAction.widget.id.convert","Rewrite"),icon:Xe.wrench},{kind:Wt.RefactorMove,title:C("codeAction.widget.id.move","Move"),icon:Xe.wrench},{kind:Wt.SurroundWith,title:C("codeAction.widget.id.surround","Surround With"),icon:Xe.symbolSnippet},{kind:Wt.Source,title:C("codeAction.widget.id.source","Source Action"),icon:Xe.symbolFile},Fye]);function n0t(i,e,t){if(!e)return i.map(r=>{var s;return{kind:"action",item:r,group:Fye,disabled:!!r.action.disabled,label:r.action.disabled||r.action.title,canPreview:!!(!((s=r.action.edit)===null||s===void 0)&&s.edits.length)}});const n=t0t.map(r=>({group:r,actions:[]}));for(const r of i){const s=r.action.kind?new Wt(r.action.kind):Wt.None;for(const a of n)if(a.group.kind.contains(s)){a.actions.push(r);break}}const o=[];for(const r of n)if(r.actions.length){o.push({kind:"header",group:r.group});for(const s of r.actions)o.push({kind:"action",item:s,group:r.group,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}return o}var i0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},o0t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fz,ZC;(function(i){i.Hidden={type:0};class e{constructor(n,o,r,s){this.actions=n,this.trigger=o,this.editorPosition=r,this.widgetPosition=s,this.type=1}}i.Showing=e})(ZC||(ZC={}));let gb=fz=class extends _e{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new le),this.onClick=this._onClick.event,this._state=ZC.Hidden,this._domNode=He("div.lightBulbWidget"),this._register(Ei.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(FQe(this._domNode,n=>{if(this.state.type!==1)return;this._editor.focus(),n.preventDefault();const{top:o,height:r}=Yo(this._domNode),s=this._editor.getOption(66);let a=Math.floor(s/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(n.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(st.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var n,o,r,s;this._preferredKbLabel=(o=(n=t.lookupKeybinding(Aye))===null||n===void 0?void 0:n.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(s=(r=t.lookupKeybinding(sY))===null||r===void 0?void 0:r.getLabel())!==null&&s!==void 0?s: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,n){if(e.validActions.length<=0)return this.hide();const o=this._editor.getOptions();if(!o.get(64).enabled)return this.hide();const r=this._editor.getModel();if(!r)return this.hide();const{lineNumber:s,column:a}=r.validatePosition(n),l=r.getOptions().tabSize,c=o.get(50),d=r.getLineContent(s),u=w5(d,l),h=c.spaceWidth*u>22,f=p=>p>2&&this._editor.getTopForLineNumber(p)===this._editor.getTopForLineNumber(p-1);let g=s;if(!h){if(s>1&&!f(s-1))g-=1;else if(!f(s+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new ZC.Showing(e,t,n,{position:{lineNumber:g,column:1},preference:fz._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==ZC.Hidden&&(this.state=ZC.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(...Mt.asClassNameArray(Xe.lightBulb)),this._domNode.classList.add(...Mt.asClassNameArray(Xe.lightbulbAutofix)),this._preferredKbLabel)){this.title=C("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Mt.asClassNameArray(Xe.lightbulbAutofix)),this._domNode.classList.add(...Mt.asClassNameArray(Xe.lightBulb)),this._quickFixKbLabel?this.title=C("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=C("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};gb.ID="editor.contrib.lightbulbWidget";gb._posPref=[0];gb=fz=i0t([o0t(1,xi)],gb);var r0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ile=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Bye=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},gz;let up=gz=class{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new le,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const o=new Be,r=o.add(A5(e,Object.assign(Object.assign({},this._getRenderOptions(e,o)),t),n));return r.element.classList.add("rendered-markdown"),{element:r.element,dispose:()=>o.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(n,o)=>Bye(this,void 0,void 0,function*(){var r,s,a;let l;n?l=this._languageService.getLanguageIdByLanguageName(n):this._options.editor&&(l=(r=this._options.editor.getModel())===null||r===void 0?void 0:r.getLanguageId()),l||(l=Gl);const c=yield glt(this._languageService,o,l),d=document.createElement("span");if(d.innerHTML=(a=(s=gz._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const u=this._options.editor.getOption(50);ss(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:n=>Wye(this._openerService,n,e.isTrusted),disposables:t}}}};up._ttpTokenizer=vp("tokenizeToString",{createHTML(i){return i}});up=gz=r0t([Ile(1,Ki),Ile(2,ml)],up);function Wye(i,e,t){return Bye(this,void 0,void 0,function*(){try{return yield i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:s0t(t)})}catch(n){return en(n),!1}})}function s0t(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var a0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Tle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},LM;let cl=LM=class{static get(e){return e.getContribution(LM.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Kr,this._messageListeners=new Be,this._mouseOverMessage=!1,this._editor=e,this._visible=LM.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){Cs(Qm(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Qm(e)?A5(e,{actionHandler:{callback:o=>Wye(this._openerService,o,Qm(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Nle(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(st.debounce(this._editor.onDidBlurEditorText,(o,r)=>r,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&rs(Nd(),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(ke(this._messageWidget.value.getDomNode(),et.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ke(this._messageWidget.value.getDomNode(),et.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(o=>{!o.target.position||(n?n.containsPosition(o.target.position)||this.closeMessage():n=new V(t.lineNumber-3,1,o.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Nle.fadeOut(this._messageWidget.value))}};cl.ID="editor.contrib.messageController";cl.MESSAGE_VISIBLE=new lt("messageVisible",!1,C("messageVisible","Whether the editor is currently showing an inline message"));cl=LM=a0t([Tle(1,Ut),Tle(2,ml)],cl);const l0t=Ir.bindToContribution(cl.get);Ye(new l0t({id:"leaveEditorMessage",precondition:cl.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:100+30,primary:9}}));class Nle{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener("animationend",t)},n=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:n},o){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const r=document.createElement("div");r.classList.add("anchor","top"),this._domNode.appendChild(r);const s=document.createElement("div");typeof o=="string"?(s.classList.add("message"),s.textContent=o):(o.classList.add("message"),s.appendChild(o)),this._domNode.appendChild(s);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)}}Un(cl.ID,cl,4);var Vye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},pz=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},c0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Hye="acceptSelectedCodeAction",$ye="previewSelectedCodeAction";class d0t{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,n){var o,r;n.text.textContent=(r=(o=e.group)===null||o===void 0?void 0:o.title)!==null&&r!==void 0?r:""}disposeTemplate(e){}}let mz=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 n=document.createElement("span");n.className="title",e.append(n);const o=new cT(e,Vl);return{container:e,icon:t,text:n,keybinding:o}}renderElement(e,t,n){var o,r,s;if(!((o=e.group)===null||o===void 0)&&o.icon?(n.icon.className=Mt.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=ct(e.group.icon.color.id))):(n.icon.className=Mt.asClassName(Xe.lightBulb),n.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;n.text.textContent=zye(e.label),n.keybinding.set(e.keybinding),GQe(!!e.keybinding,n.keybinding.element);const a=(r=this._keybindingService.lookupKeybinding(Hye))===null||r===void 0?void 0:r.getLabel(),l=(s=this._keybindingService.lookupKeybinding($ye))===null||s===void 0?void 0:s.getLabel();n.container.classList.toggle("option-disabled",e.disabled),e.disabled?n.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?n.container.title=C({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):n.container.title=C({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):n.container.title=""}disposeTemplate(e){}};mz=Vye([pz(1,xi)],mz);class u0t extends UIEvent{constructor(){super("acceptSelectedAction")}}class Rle extends UIEvent{constructor(){super("previewSelectedAction")}}function h0t(i){if(i.kind==="action")return i.label}let vz=class extends _e{constructor(e,t,n,o,r,s){super(),this._delegate=o,this._contextViewService=r,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Ro),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 qd(e,this.domNode,a,[new mz(t,this._keybindingService),new d0t],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:h0t},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?zye(l==null?void 0:l.label):"";return l.disabled&&(c=C({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>C({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(qb),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=n,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,o=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(o);const r=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}),s=Math.max(...r,e),a=.7,l=Math.min(o,document.body.clientHeight*a);return this._list.layout(l,s),this.domNode.style.height=`${l}px`,this._list.domFocus(),s}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 n=t[0],o=this._list.element(n);if(!this.focusCondition(o))return;const r=e?new Rle:new u0t;this._list.setSelection([n],r)}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 Rle):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const n=this._list.getFocus();if(n.length===0)return;const o=n[0],r=this._list.element(o);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,r.item)}onListHover(e){return c0t(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 n=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=n?n.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([])}};vz=Vye([pz(4,bp),pz(5,xi)],vz);function zye(i){return i.replace(/\r\n|\r|\n/g," ")}var f0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},J9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};J("actionBar.toggledBackground",{dark:f0,light:f0,hcDark:f0,hcLight:f0},C("actionBar.toggledBackground","Background color for toggled action items in action bar."));const pb={Visible:new lt("codeActionMenuVisible",!1,C("codeActionMenuVisible","Whether the action widget list is visible"))},Qb=yn("actionWidgetService");let mb=class extends _e{get isVisible(){return pb.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Kr)}show(e,t,n,o,r,s,a){const l=pb.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(vz,e,t,n,o);this._contextViewService.showContextView({getAnchor:()=>r,render:d=>(l.set(!0),this._renderWidget(d,c,a!=null?a:[])),onHide:d=>{l.reset(),this._onWidgetClosed(d)}},s,!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,n){var o;const r=document.createElement("div");if(r.classList.add("action-widget"),e.appendChild(r),this._list.value=t,this._list.value)r.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Be,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(ke(l,et.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),d=e.appendChild(c);d.classList.add("context-view-pointerBlock"),s.add(ke(d,et.POINTER_MOVE,()=>d.remove())),s.add(ke(d,et.MOUSE_DOWN,()=>d.remove()));let u=0;if(n.length){const g=this._createActionBar(".action-widget-action-bar",n);g&&(r.appendChild(g.getContainer().parentElement),s.add(g),u=g.getContainer().offsetWidth)}const h=(o=this._list.value)===null||o===void 0?void 0:o.layout(u);r.style.width=`${h}px`;const f=s.add(pf(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const n=He(e),o=new zc(n);return o.push(t,{icon:!1,label:!0}),o}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};mb=f0t([J9(0,bp),J9(1,Ut),J9(2,$t)],mb);Mn(Qb,mb,1);const vT=100+1e3;$i(class extends ec{constructor(){super({id:"hideCodeActionWidget",title:{value:C("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:pb.Visible,keybinding:{weight:vT,primary:9,secondary:[1033]}})}run(i){i.get(Qb).hide()}});$i(class extends ec{constructor(){super({id:"selectPrevCodeAction",title:{value:C("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:pb.Visible,keybinding:{weight:vT,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(Qb);e instanceof mb&&e.focusPrevious()}});$i(class extends ec{constructor(){super({id:"selectNextCodeAction",title:{value:C("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:pb.Visible,keybinding:{weight:vT,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(Qb);e instanceof mb&&e.focusNext()}});$i(class extends ec{constructor(){super({id:Hye,title:{value:C("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:pb.Visible,keybinding:{weight:vT,primary:3,secondary:[2137]}})}run(i){const e=i.get(Qb);e instanceof mb&&e.acceptSelected()}});$i(class extends ec{constructor(){super({id:$ye,title:{value:C("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:pb.Visible,keybinding:{weight:vT,primary:2051}})}run(i){const e=i.get(Qb);e instanceof mb&&e.acceptSelected(!0)}});var g0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Uye=new lt("supportedCodeAction","");class p0t extends _e{constructor(e,t,n,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=o,this._autoTriggerTimer=this._register(new zd),this._register(this._markerService.onMarkerChanged(r=>this._onMarkerChanges(r))),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(n=>$G(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:fl.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&e.type===2){const{lineNumber:o,column:r}=n.getPosition(),s=t.getLineContent(o);if(s.length===0)return;if(r===1){if(/\s/.test(s[0]))return}else if(r===t.getLineMaxColumn(o)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[r-2])&&/\s/.test(s[r-1]))return}return n}}var X_;(function(i){i.Empty={type:0};class e{constructor(n,o,r){this.trigger=n,this.position=o,this._cancellablePromise=r,this.type=1,this.actions=r.catch(s=>{if(sh(s))return jye;throw s})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(X_||(X_={}));const jye=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class m0t extends _e{constructor(e,t,n,o,r,s){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=r,this._configurationService=s,this._codeActionOracle=this._register(new Kr),this._state=X_.Empty,this._onDidChangeState=this._register(new le),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Uye.bindTo(o),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(X_.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(X_.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(n=>{var o;return(o=n.providedCodeActionKinds)!==null&&o!==void 0?o:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new p0t(this._editor,this._markerService,n=>{var o;if(!n){this.setState(X_.Empty);return}const r=n.selection.getStartPosition(),s=sr(a=>g0t(this,void 0,void 0,function*(){var l,c,d,u,h,f;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===fl.QuickFix||((c=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0?void 0:c.contains(Wt.QuickFix)))){const g=yield RE(this._registry,e,n.selection,n.trigger,Xg.None,a);if(a.isCancellationRequested)return jye;if(!((d=g.validActions)===null||d===void 0?void 0:d.some(v=>v.action.kind?Wt.QuickFix.contains(new Wt(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const m=n.selection.getPosition();let _=m,y=Number.MAX_VALUE,w=!1;for(const L of v){const D=L.endColumn,E=L.endLineNumber,I=L.startLineNumber;(E===m.lineNumber||I===m.lineNumber)&&Math.abs(m.column-D){k.highlightRange=k.action.isPreferred}),I.push(...E.validActions)),{validActions:I,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return RE(this._registry,e,n.selection,n.trigger,Xg.None,a)}));n.trigger.type===1&&((o=this._progressService)===null||o===void 0||o.showWhile(s,250)),this.setState(new X_.Triggered(n.trigger,r,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:fl.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 v0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Xx=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},EM;const _0t="quickfix-edit-highlight";let Pv=EM=class extends _e{static get(e){return e.getContribution(EM.ID)}constructor(e,t,n,o,r,s,a,l,c,d){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._activeCodeActions=this._register(new Kr),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new m0t(this._editor,r.codeActionProvider,t,n,s,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new ah(()=>{const u=this._editor.getContribution(gb.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=o.createInstance(uO),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,o){var r;if(!this._editor.hasModel())return;(r=cl.get(this._editor))===null||r===void 0||r.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:o,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,n){return Xx(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(Z_t,e,dO.FromCodeActions,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:fl.QuickFix,filter:{}})}})}update(e){var t,n,o,r,s,a,l;return Xx(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){en(d);return}if(!this._disposed)if((n=this._lightBulbWidget.value)===null||n===void 0||n.update(c,e.trigger,e.position),e.trigger.type===1){if(!((o=e.trigger.filter)===null||o===void 0)&&o.include){const u=this.tryGetValidActionToApply(e.trigger,c);if(u){try{(r=this._lightBulbWidget.value)===null||r===void 0||r.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){(s=cl.get(this._editor))===null||s===void 0||s.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=cl.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:n})=>n.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,n){return Xx(this,void 0,void 0,function*(){const o=this._editor.createDecorationsCollection(),r=this._editor.getDomNode();if(!r)return;const s=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=ae.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,d)=>Xx(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!d),this._actionWidgetService.hide(),o.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),o.clear()},onHover:(c,d)=>Xx(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:EM.DECORATION}];o.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;kv(C("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else o.clear()}};this._actionWidgetService.show("codeActionWidget",!0,n0t(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,r,this._getActionBarActions(e,t,n))})}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),n=Yo(this._editor.getDomNode()),o=n.left+t.left,r=n.top+t.top+t.height;return{x:o,y:r}}_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,n){if(n.fromLightbulb)return[];const o=e.documentation.map(r=>{var s;return{id:r.id,label:r.title,tooltip:(s=r.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(r.id,...(a=r.arguments)!==null&&a!==void 0?a:[])}}});return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&o.push(this._showDisabled?{id:"hideMoreActions",label:C("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:"showMoreActions",label:C("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),o}};Pv.ID="editor.contrib.codeActionController";Pv.DECORATION=Jt.register({description:"quickfix-highlight",className:_0t});Pv=EM=v0t([eg(1,Rf),eg(2,Ut),eg(3,$t),eg(4,pt),eg(5,t_),eg(6,_o),eg(7,En),eg(8,Qb),eg(9,$t)],Pv);jd((i,e)=>{((o,r)=>{r&&e.addRule(`.monaco-editor ${o} { background-color: ${r}; }`)})(".quickfix-edit-highlight",i.getColor(Jh));const n=i.getColor(Lm);n&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Hu(i.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)});function _T(i){return Me.regex(Uye.keys()[0],new RegExp("(\\s|^)"+Xl(i.value)+"\\b"))}const cY={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:C("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:C("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[C("args.schema.apply.first","Always apply the first returned code action."),C("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),C("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:C("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function Jb(i,e,t,n,o=fl.Default){if(i.hasModel()){const r=Pv.get(i);r==null||r.manualTriggerAtCurrentPosition(e,o,t,n)}}class b0t extends ft{constructor(){super({id:sY,label:C("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),kbOpts:{kbExpr:Q.textInputFocus,primary:2137,weight:100}})}run(e,t){return Jb(t,C("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,fl.QuickFix)}}class C0t extends Ir{constructor(){super({id:Mye,precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:cY}]}})}runEditorCommand(e,t,n){const o=Hh.fromUser(n,{kind:Wt.Empty,apply:"ifSingle"});return Jb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):C("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):o.preferred?C("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):C("editor.action.codeAction.noneMessage","No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}}class y0t extends ft{constructor(){super({id:Pye,label:C("refactor.label","Refactor..."),alias:"Refactor...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),kbOpts:{kbExpr:Q.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Me.and(Q.writable,_T(Wt.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:cY}]}})}run(e,t,n){const o=Hh.fromUser(n,{kind:Wt.Refactor,apply:"never"});return Jb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):C("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):o.preferred?C("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):C("editor.action.refactor.noneMessage","No refactorings available"),{include:Wt.Refactor.contains(o.kind)?o.kind:Wt.None,onlyIncludePreferredActions:o.preferred},o.apply,fl.Refactor)}}class w0t extends ft{constructor(){super({id:Oye,label:C("source.label","Source Action..."),alias:"Source Action...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Me.and(Q.writable,_T(Wt.Source))},description:{description:"Source Action...",args:[{name:"args",schema:cY}]}})}run(e,t,n){const o=Hh.fromUser(n,{kind:Wt.Source,apply:"never"});return Jb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):C("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):o.preferred?C("editor.action.source.noneMessage.preferred","No preferred source actions available"):C("editor.action.source.noneMessage","No source actions available"),{include:Wt.Source.contains(o.kind)?o.kind:Wt.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,fl.SourceAction)}}class S0t extends ft{constructor(){super({id:aY,label:C("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:Me.and(Q.writable,_T(Wt.SourceOrganizeImports)),kbOpts:{kbExpr:Q.textInputFocus,primary:1581,weight:100}})}run(e,t){return Jb(t,C("editor.action.organize.noneMessage","No organize imports action available"),{include:Wt.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",fl.OrganizeImports)}}class x0t extends ft{constructor(){super({id:lY,label:C("fixAll.label","Fix All"),alias:"Fix All",precondition:Me.and(Q.writable,_T(Wt.SourceFixAll))})}run(e,t){return Jb(t,C("fixAll.noneMessage","No fix all action available"),{include:Wt.SourceFixAll,includeSourceActions:!0},"ifSingle",fl.FixAll)}}class L0t extends ft{constructor(){super({id:Aye,label:C("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:Me.and(Q.writable,_T(Wt.QuickFix)),kbOpts:{kbExpr:Q.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Jb(t,C("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Wt.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",fl.AutoFix)}}Un(Pv.ID,Pv,3);Un(gb.ID,gb,4);ze(b0t);ze(y0t);ze(w0t);ze(S0t);ze(L0t);ze(x0t);Ye(new C0t);no.as(ch.Configuration).registerConfiguration(Object.assign(Object.assign({},I5),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:C("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));no.as(ch.Configuration).registerConfiguration(Object.assign(Object.assign({},I5),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:C("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var Mle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class _z{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 n of e.lenses)this.lenses.push({symbol:n,provider:t})}}function Kye(i,e,t){return Mle(this,void 0,void 0,function*(){const n=i.ordered(e),o=new Map,r=new _z,s=n.map((a,l)=>Mle(this,void 0,void 0,function*(){o.set(a,l);try{const c=yield Promise.resolve(a.provideCodeLenses(e,t));c&&r.add(c,a)}catch(c){$o(c)}}));return yield Promise.all(s),r.lenses=r.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:o.get(a.provider)o.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),r})}Rn.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;fi(Rt.isUri(t)),fi(typeof n=="number"||!n);const{codeLensProvider:o}=i.get(pt),r=i.get(Yi).getModel(t);if(!r)throw Mc();const s=[],a=new Be;return Kye(o,r,_n.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)n==null||Boolean(d.symbol.command)?s.push(d.symbol):n-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(r,d.symbol,_n.None)).then(u=>s.push(u||d.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var E0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},D0t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const qye=yn("ICodeLensCache");class Ale{constructor(e,t){this.lineCount=e,this.data=t}}let bz=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Qv(20,.75);const t="codelens/cache";Ag(()=>e.remove(t,1));const n="codelens/cache2",o=e.get(n,1,"{}");this._deserialize(o),st.once(e.onWillSaveState)(r=>{r.reason===FP.SHUTDOWN&&e.store(n,this._serialize(),1,1)})}put(e,t){const n=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),o=new _z;o.add({lenses:n,dispose:()=>{}},this._fakeProvider);const r=new Ale(e.getLineCount(),o);this._cache.set(e.uri.toString(),r)}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,n]of this._cache){const o=new Set;for(const r of n.data.lenses)o.add(r.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...o.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const n in t){const o=t[n],r=[];for(const a of o.lines)r.push({range:new V(a,1,a,11)});const s=new _z;s.add({lenses:r,dispose(){}},this._fakeProvider),this._cache.set(n,new Ale(o.lineCount,s))}}catch{}}};bz=E0t([D0t(0,Gd)],bz);Mn(qye,bz,1);class k0t{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,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 cF{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${cF._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let o=!1;for(let r=0;r{c.symbol.command&&l.push(c.symbol),n.addDecoration({range:c.symbol.range,options:Ple},u=>this._decorationIds[d]=u),a?a=V.plusRange(a,c.symbol.range):a=V.lift(c.symbol.range)}),this._viewZone=new k0t(a.startLineNumber-1,r,s),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new cF(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 n=this._editor.getModel().getDecorationRange(e),o=this._data[t].symbol;return!!(n&&V.isEmpty(o.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,o)=>{t.addDecoration({range:n.symbol.range,options:Ple},r=>this._decorationIds[o]=r)})}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--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Yx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Gye=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let $w=class{constructor(e,t,n,o,r,s){this._editor=e,this._languageFeaturesService=t,this._commandService=o,this._notificationService=r,this._codeLensCache=s,this._disposables=new Be,this._localToDispose=new Be,this._lenses=[],this._oldCodeLensModels=new Be,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new bi(()=>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(),n=this._editor.getOption(18),o=this._editor.getOption(50),{style:r}=this._editor.getContainerDomNode();r.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),r.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),r.setProperty("--vscode-editorCodeLens-fontFeatureSettings",o.fontFeatureSettings),n&&(r.setProperty("--vscode-editorCodeLens-fontFamily",n),r.setProperty("--vscode-editorCodeLens-fontFamilyDefault",al.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,n;(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(),(n=this._currentCodeLensModel)===null||n===void 0||n.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(Lv(()=>{const o=this._codeLensCache.get(e);t===o&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const o of this._languageFeaturesService.codeLensProvider.all(e))if(typeof o.onDidChange=="function"){const r=o.onDidChange(()=>n.schedule());this._localToDispose.add(r)}const n=new bi(()=>{var o;const r=Date.now();(o=this._getCodeLensModelPromise)===null||o===void 0||o.cancel(),this._getCodeLensModelPromise=sr(s=>Kye(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-r);n.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},en)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(zt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var o;this._editor.changeDecorations(r=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(d=>{!d.isValid()||l===d.getLineNumber()?a.push(d):(d.update(s),l=d.getLineNumber())});const c=new e7;a.forEach(d=>{d.dispose(c,s),this._lenses.splice(this._lenses.indexOf(d),1)}),c.commit(r)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),(o=this._resolveCodeLensesPromise)===null||o===void 0||o.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(o=>{o.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(zt(()=>{if(this._editor.getModel()){const o=Zu.capture(this._editor);this._editor.changeDecorations(r=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(r,s)})}),o.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(o=>{if(o.target.type!==9)return;let r=o.target.element;if((r==null?void 0:r.tagName)==="SPAN"&&(r=r.parentElement),(r==null?void 0:r.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(r);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),n.schedule()}_disposeAllLenses(e,t){const n=new e7;for(const o of this._lenses)o.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),n=[];let o;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(o&&o[o.length-1].symbol.range.startLineNumber===l?o.push(a):(o=[a],n.push(o)))}if(!n.length&&!this._lenses.length)return;const r=Zu.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new e7;let d=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),d++,u++)}for(;dthis._resolveCodeLensesInViewportSoon())),u++;c.commit(a)})}),r.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 n=[],o=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(n.push(l),o.push(a))}),n.length===0)return;const r=Date.now(),s=sr(a=>{const l=n.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},$o):(u[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!o[d].isDisposed()&&o[d].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-r);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{en(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return Gye(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})}};$w.ID="css.editor.codeLens";$w=I0t([Yx(1,pt),Yx(2,qc),Yx(3,_o),Yx(4,Ao),Yx(5,qye)],$w);Un($w.ID,$w,1);ze(class extends ft{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:Q.hasCodeLensProvider,label:C("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return Gye(this,void 0,void 0,function*(){if(!t.hasModel())return;const n=e.get(dh),o=e.get(_o),r=e.get(Ao),s=t.getSelection().positionLineNumber,a=t.getContribution($w.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===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const d=yield n.pick(c,{canPickMany:!1,placeHolder:C("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===s&&((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 o.executeCommand(u.id,...u.arguments||[])}catch(h){r.error(h)}})}});var T0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},t7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},N0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class dY{constructor(e,t){this._editorWorkerClient=new mG(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return N0t(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,n){const o=t.range,r=t.color,s=r.alpha,a=new ve(new Tn(Math.round(255*r.red),Math.round(255*r.green),Math.round(255*r.blue),s)),l=s?ve.Format.CSS.formatRGB(a):ve.Format.CSS.formatRGBA(a),c=s?ve.Format.CSS.formatHSL(a):ve.Format.CSS.formatHSLA(a),d=s?ve.Format.CSS.formatHex(a):ve.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:o,text:l}}),u.push({label:c,textEdit:{range:o,text:c}}),u.push({label:d,textEdit:{range:o,text:d}}),u}}let Cz=class extends _e{constructor(e,t,n){super(),this._register(n.colorProvider.register("*",new dY(e,t)))}};Cz=T0t([t7(0,Yi),t7(1,Ti),t7(2,pt)],Cz);X5(Cz);var bT=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Xye(i,e,t,n=!0){return bT(this,void 0,void 0,function*(){return uY(new R0t,i,e,t,n)})}function Yye(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class R0t{constructor(){}compute(e,t,n,o){return bT(this,void 0,void 0,function*(){const r=yield e.provideDocumentColors(t,n);if(Array.isArray(r))for(const s of r)o.push({colorInfo:s,provider:e});return Array.isArray(r)})}}class M0t{constructor(){}compute(e,t,n,o){return bT(this,void 0,void 0,function*(){const r=yield e.provideDocumentColors(t,n);if(Array.isArray(r))for(const s of r)o.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(r)})}}class A0t{constructor(e){this.colorInfo=e}compute(e,t,n,o){return bT(this,void 0,void 0,function*(){const r=yield e.provideColorPresentations(t,this.colorInfo,_n.None);return Array.isArray(r)&&o.push(...r),Array.isArray(r)})}}function uY(i,e,t,n,o){return bT(this,void 0,void 0,function*(){let r=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d instanceof dY)s=d;else try{(yield i.compute(d,t,n,a))&&(r=!0)}catch(u){$o(u)}}return r?a:s&&o?(yield i.compute(s,t,n,a),a):[]})}function Zye(i,e){const{colorProvider:t}=i.get(pt),n=i.get(Yi).getModel(e);if(!n)throw Mc();const o=i.get(En).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:o}}Rn.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof Rt))throw Mc();const{model:n,colorProviderRegistry:o,isDefaultColorDecoratorsEnabled:r}=Zye(i,t);return uY(new M0t,o,n,_n.None,r)});Rn.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:o,range:r}=n;if(!(o instanceof Rt)||!Array.isArray(t)||t.length!==4||!V.isIRange(r))throw Mc();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=Zye(i,o),[c,d,u,h]=t;return uY(new A0t({range:r,color:{red:c,green:d,blue:u,alpha:h}}),a,s,_n.None,l)});var P0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},n7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Fle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},yz;const Qye=Object.create({});let Ov=yz=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new Be),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new XI(this._editor),this._decoratorLimitReporter=new O0t,this._colorDecorationClassRefs=this._register(new Be),this._debounceInformation=o.for(n.colorProvider,"Document Colors",{min:yz.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(r=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=s!==this._isColorDecoratorsEnabled||r.hasChanged(21),l=r.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(),n=this._configurationService.getValue(t);if(n&&typeof n=="object"){const o=n.colorDecorators;if(o&&o.enable!==void 0&&!o.enable)return o.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 zd,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return Fle(this,void 0,void 0,function*(){this._computePromise=sr(e=>Fle(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const n=new Ls(!1),o=yield Xye(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,n.elapsed()),o}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){en(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(n=>({range:{startLineNumber:n.colorInfo.range.startLineNumber,startColumn:n.colorInfo.range.startColumn,endLineNumber:n.colorInfo.range.endLineNumber,endColumn:n.colorInfo.range.endColumn},options:Jt.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((o,r)=>this._colorDatas.set(o,e[r]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],n=this._editor.getOption(21);for(let r=0;rthis._colorDatas.has(o.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Ov.ID="editor.contrib.colorDetector";Ov.RECOMPUTE_TIME=1e3;Ov=yz=P0t([n7(1,En),n7(2,pt),n7(3,qc)],Ov);class O0t{constructor(){this._onDidChange=new le,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}Un(Ov.ID,Ov,1);class F0t{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,n){this.presentationIndex=n,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new le,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new le,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 n=-1;for(let o=0;o{this.backgroundColor=s.getColor(lP)||ve.white})),this._register(ke(this._pickedColorNode,et.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ke(this._originalColorNode,et.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=ve.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 W0t(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ve.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 W0t extends _e{constructor(e){super(),this._onClicked=this._register(new le),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Ae(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Ae(this._button,t),Ae(t,Bl(".button"+Mt.asCSSSelector(Eo("color-picker-close",Xe.close,C("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class V0t extends _e{constructor(e,t,n,o=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=Bl(".colorpicker-body"),Ae(e,this._domNode),this._saturationBox=new H0t(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 $0t(this._domNode,this.model,o),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new z0t(this._domNode,this.model,o),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),o&&(this._insertButton=this._register(new U0t(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new ve(new qh(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new ve(new qh(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new ve(new qh(n===360?0:n,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 H0t extends _e{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Bl(".saturation-wrap"),Ae(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Ae(this._domNode,this._canvas),this.selection=Bl(".saturation-selection"),Ae(this._domNode,this.selection),this.layout(),this._register(ke(this._domNode,et.POINTER_DOWN,o=>this.onPointerDown(o))),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 SS);const t=Yo(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangePosition(o.pageX-t.left,o.pageY-t.top),()=>null);const n=ke(e.target.ownerDocument,et.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),o=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,o),this._onDidChange.fire({s:n,v:o})}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 ve(new qh(e.h,1,1,1)),n=this._canvas.getContext("2d"),o=n.createLinearGradient(0,0,this._canvas.width,0);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)");const r=n.createLinearGradient(0,0,0,this._canvas.height);r.addColorStop(0,"rgba(0, 0, 0, 0)"),r.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=ve.Format.CSS.format(t),n.fill(),n.fillStyle=o,n.fill(),n.fillStyle=r,n.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${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 Jye extends _e{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=Ae(e,Bl(".standalone-strip")),this.overlay=Ae(this.domNode,Bl(".standalone-overlay"))):(this.domNode=Ae(e,Bl(".strip")),this.overlay=Ae(this.domNode,Bl(".overlay"))),this.slider=Ae(this.domNode,Bl(".slider")),this.slider.style.top="0px",this._register(ke(this.domNode,et.POINTER_DOWN,o=>this.onPointerDown(o))),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 SS),n=Yo(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangeTop(r.pageY-n.top),()=>null);const o=ke(e.target.ownerDocument,et.POINTER_UP,()=>{this._onColorFlushed.fire(),o.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class $0t extends Jye{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:o}=e.rgba,r=new ve(new Tn(t,n,o,1)),s=new ve(new Tn(t,n,o,0));this.overlay.style.background=`linear-gradient(to bottom, ${r} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class z0t extends Jye{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class U0t extends _e{constructor(e){super(),this._onClicked=this._register(new le),this.onClicked=this._onClicked.event,this._button=Ae(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 j0t extends Ud{constructor(e,t,n,o,r=!1){super(),this.model=t,this.pixelRatio=n,this._register(PD.onDidChange(()=>this.layout()));const s=Bl(".colorpicker-widget");e.appendChild(s),this.header=this._register(new B0t(s,this.model,o,r)),this.body=this._register(new V0t(s,this.model,this.pixelRatio,r))}layout(){this.body.layout()}}var ewe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},twe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class K0t{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let hO=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,n){return Wo.fromPromise(this._computeAsync(e,t,n))}_computeAsync(e,t,n){return zw(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const o=Ov.get(this._editor);if(!o)return[];for(const r of t){if(!o.isColorDecoration(r))continue;const s=o.getColorData(r.range.getStartPosition());if(s)return[yield nwe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}renderHoverParts(e,t){return iwe(this,this._editor,this._themeService,t,e)}};hO=ewe([twe(1,vr)],hO);class q0t{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o}}let Pk=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,n){return zw(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!Ov.get(this._editor))return null;const r=yield Xye(n,this._editor.getModel(),_n.None);let s=null,a=null;for(const u of r){const h=u.colorInfo;V.containsRange(h.range,e.range)&&(s=h,a=u.provider)}const l=s!=null?s:e,c=a!=null?a:t,d=!!s;return{colorHover:yield nwe(this,this._editor.getModel(),l,c),foundInEditor:d}})}updateEditorModel(e){return zw(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let n=new V(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield DM(this._editor.getModel(),t,this._color,n,e),n=owe(this._editor,n,t))})}renderHoverParts(e,t){return iwe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};Pk=ewe([twe(1,vr)],Pk);function nwe(i,e,t,n){return zw(this,void 0,void 0,function*(){const o=e.getValueInRange(t.range),{red:r,green:s,blue:a,alpha:l}=t.color,c=new Tn(Math.round(r*255),Math.round(s*255),Math.round(a*255),l),d=new ve(c),u=yield Yye(e,t,n,_n.None),h=new F0t(d,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(d,o),i instanceof hO?new K0t(i,V.lift(t.range),h,n):new q0t(i,V.lift(t.range),h,n)})}function iwe(i,e,t,n,o){if(n.length===0||!e.hasModel())return _e.None;if(o.setMinimumDimensions){const h=e.getOption(66)+8;o.setMinimumDimensions(new Kn(302,h))}const r=new Be,s=n[0],a=e.getModel(),l=s.model,c=r.add(new j0t(o.fragment,l,e.getOption(141),t,i instanceof Pk));o.setColorPicker(c);let d=!1,u=new V(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(i instanceof Pk){const h=n[0].model.color;i.color=h,DM(a,l,h,u,s),r.add(l.onColorFlushed(f=>{i.color=f}))}else r.add(l.onColorFlushed(h=>zw(this,void 0,void 0,function*(){yield DM(a,l,h,u,s),d=!0,u=owe(e,u,l,o)})));return r.add(l.onDidChangeColor(h=>{DM(a,l,h,u,s)})),r.add(e.onDidChangeModelContent(h=>{d?d=!1:(o.hide(),e.focus())})),r}function owe(i,e,t,n){let o,r;if(t.presentation.textEdit){o=[t.presentation.textEdit],r=new V(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const s=i.getModel()._setTrackedRange(null,r,3);i.pushUndoStop(),i.executeEdits("colorpicker",o),r=i.getModel()._getTrackedRange(s)||r}else o=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],r=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),i.pushUndoStop(),i.executeEdits("colorpicker",o);return t.presentation.additionalTextEdits&&(o=[...t.presentation.additionalTextEdits],i.executeEdits("colorpicker",o),n&&n.hide()),i.pushUndoStop(),r}function DM(i,e,t,n,o){return zw(this,void 0,void 0,function*(){const r=yield Yye(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},o.provider,_n.None);e.colorPresentations=r||[]})}function wz(i,e){return!!i[e]}class i7{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=wz(e.event,t.triggerModifier),this.hasSideBySideModifier=wz(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Ble{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=wz(e,t.triggerModifier)}}class K2{constructor(e,t,n,o){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=o}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Wle(i){return i==="altKey"?Nn?new K2(57,"metaKey",6,"altKey"):new K2(5,"ctrlKey",6,"altKey"):Nn?new K2(6,"altKey",57,"metaKey"):new K2(6,"altKey",5,"ctrlKey")}class dF extends _e{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new le),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new le),this.onExecute=this._onExecute.event,this._onCancel=this._register(new le),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:o=>o.target.position?o.target.position.lineNumber:0,this._opts=Wle(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(o=>{if(o.hasChanged(77)){const r=Wle(this._editor.getOption(77));if(this._opts.equals(r))return;this._opts=r,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(o=>this._onEditorMouseMove(new i7(o,this._opts)))),this._register(this._editor.onMouseDown(o=>this._onEditorMouseDown(new i7(o,this._opts)))),this._register(this._editor.onMouseUp(o=>this._onEditorMouseUp(new i7(o,this._opts)))),this._register(this._editor.onKeyDown(o=>this._onEditorKeyDown(new Ble(o,this._opts)))),this._register(this._editor.onKeyUp(o=>this._onEditorKeyUp(new Ble(o,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(o=>this._onDidChangeCursorSelection(o))),this._register(this._editor.onDidChangeModel(o=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(o=>{(o.scrollTopChanged||o.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 G0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Fv=class extends Nw{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f){super(e,Object.assign(Object.assign({},o.getRawOptions()),{overflowWidgetsDomNode:o.getOverflowWidgetsDomNode()}),n,r,s,a,l,c,d,u,h,f),this._parentEditor=o,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(o.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){V4(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Fv=G0t([tg(4,$t),tg(5,Jn),tg(6,_o),tg(7,Ut),tg(8,vr),tg(9,Ao),tg(10,_p),tg(11,Ti),tg(12,pt)],Fv);const Vle=new ve(new Tn(0,122,204)),X0t={showArrow:!0,showFrame:!0,className:"",frameColor:Vle,arrowColor:Vle,keepEditorSelection:!1},Y0t="vs.editor.contrib.zoneWidget";class Z0t{constructor(e,t,n,o,r,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=o,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=r,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Q0t{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class uF{constructor(e){this._editor=e,this._ruleName=uF._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),Noe(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(){Noe(this._ruleName),YV(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:V.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}uF._IdGenerator=new vX(".arrow-decoration-");class J0t{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=gg(t),V4(this.options,X0t,!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(n=>{const o=this._getWidth(n);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(n)+"px",this._onWidth(o)}))}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 uF(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const o=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(o))}(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 n=V.isIRange(e)?V.lift(e):V.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:Jt.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 n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),o=this.editor.getLayoutInfo(),r=this._getWidth(o);this.domNode.style.width=`${r}px`,this.domNode.style.left=this._getLeft(o)+"px";const s=document.createElement("div");s.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(n)),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 Z0t(s,n.lineNumber,n.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 Q0t(Y0t+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,r),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const h=u.validateRange(new V(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 gs(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 n=(t.currentY-e.startY)/this.editor.getOption(66),o=n<0?Math.ceil(n):Math.floor(n),r=e.heightInLines+o;r>5&&r<35&&this._relayout(r)}}))}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 rwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},swe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const awe=yn("IPeekViewService");Mn(awe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const o=this._widgets.get(i);o&&o.widget===e&&(o.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var Ha;(function(i){i.inPeekEditor=new lt("inReferenceSearchEditor",!0,C("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(Ha||(Ha={}));let Ok=class{constructor(e,t){e instanceof Fv&&Ha.inPeekEditor.bindTo(t)}dispose(){}};Ok.ID="editor.contrib.referenceController";Ok=rwe([swe(1,Ut)],Ok);Un(Ok.ID,Ok,0);function ebt(i){const e=i.get(Jn).getFocusedCodeEditor();return e instanceof Fv?e.getParentEditor():e}const tbt={headerBackgroundColor:ve.white,primaryHeadingColor:ve.fromHex("#333333"),secondaryHeadingColor:ve.fromHex("#6c6c6cb3")};let fO=class extends J0t{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new le,this.onDidClose=this._onDidClose.event,V4(this.options,tbt,!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=He(".head"),this._bodyElement=He(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=He(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),No(this._titleElement,"click",r=>this._onTitleClick(r))),Ae(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=He("span.filename"),this._secondaryHeading=He("span.dirname"),this._metaHeading=He("span.meta"),Ae(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=He(".peekview-actions");Ae(this._headElement,n);const o=this._getActionBarOptions();this._actionbarWidget=new zc(n,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new ca("peekview.close",C("label.close","Close"),Mt.asClassName(Xe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Jut.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:Ur(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,nl(this._metaHeading)):Js(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const n=Math.ceil(this.editor.getOption(66)*1.2),o=Math.round(e-(n+2));this._doLayoutHead(n,t),this._doLayoutBody(o,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};fO=rwe([swe(2,$t)],fO);const nbt=J("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ve.black,hcLight:ve.white},C("peekViewTitleBackground","Background color of the peek view title area.")),lwe=J("peekViewTitleLabel.foreground",{dark:ve.white,light:ve.black,hcDark:ve.white,hcLight:Sd},C("peekViewTitleForeground","Color of the peek view title.")),cwe=J("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},C("peekViewTitleInfoForeground","Color of the peek view title info.")),ibt=J("peekView.border",{dark:Ma,light:Ma,hcDark:Ln,hcLight:Ln},C("peekViewBorder","Color of the peek view borders and arrow.")),obt=J("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ve.black,hcLight:ve.white},C("peekViewResultsBackground","Background color of the peek view result list."));J("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ve.white,hcLight:Sd},C("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));J("peekViewResult.fileForeground",{dark:ve.white,light:"#1E1E1E",hcDark:ve.white,hcLight:Sd},C("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));J("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},C("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));J("peekViewResult.selectionForeground",{dark:ve.white,light:"#6C6C6C",hcDark:ve.white,hcLight:Sd},C("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Nm=J("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ve.black,hcLight:ve.white},C("peekViewEditorBackground","Background color of the peek view editor."));J("peekViewEditorGutter.background",{dark:Nm,light:Nm,hcDark:Nm,hcLight:Nm},C("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));J("peekViewEditorStickyScroll.background",{dark:Nm,light:Nm,hcDark:Nm,hcLight:Nm},C("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));J("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},C("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));J("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},C("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));J("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var rbt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Bv{constructor(e,t,n,o){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=o,this.id=s$.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?C({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,$c(this.uri),this.range.startLineNumber,this.range.startColumn):C("aria.oneReference","in {0} on line {1} at column {2}",$c(this.uri),this.range.startLineNumber,this.range.startColumn)}}class sbt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:o,startColumn:r,endLineNumber:s,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:o,column:r-t}),c=new V(o,l.startColumn,o,r),d=new V(s,a,s,1073741824),u=n.getValueInRange(c).replace(/^\s+/,""),h=n.getValueInRange(e),f=n.getValueInRange(d).replace(/\s+$/,"");return{value:u+h+f,highlight:{start:u.length,end:u.length+h.length}}}}class Fk{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new _s}dispose(){si(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?C("aria.fileReferences.1","1 symbol in {0}, full path {1}",$c(this.uri),this.uri.fsPath):C("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,$c(this.uri),this.uri.fsPath)}resolve(e){return rbt(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 n=yield e.createModelReference(t.uri);this._previews.set(t.uri,new sbt(n))}catch(n){en(n)}return this})}}class dl{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new le,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(dl._compareReferences);let o;for(const r of e)if((!o||!Vi.isEqual(o.uri,r.uri,!0))&&(o=new Fk(this,r.uri),this.groups.push(o)),o.children.length===0||dl._compareReferences(r,o.children[o.children.length-1])!==0){const s=new Bv(n===r,o,r,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),o.children.push(s)}}dispose(){si(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new dl(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?C("aria.result.0","No results found"):this.references.length===1?C("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?C("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):C("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:n}=e;let o=n.children.indexOf(e);const r=n.children.length,s=n.parent.groups.length;return s===1||t&&o+10?(t?o=(o+1)%r:o=(o+r-1)%r,n.children[o]):(o=n.parent.groups.indexOf(n),t?(o=(o+1)%s,n.parent.groups[o].children[0]):(o=(o+s-1)%s,n.parent.groups[o].children[n.parent.groups[o].children.length-1]))}nearestReference(e,t){const n=this.references.map((o,r)=>({idx:r,prefixLen:Q0(o.uri.toString(),e.toString()),offsetDist:Math.abs(o.range.startLineNumber-t.lineNumber)*100+Math.abs(o.range.startColumn-t.column)})).sort((o,r)=>o.prefixLen>r.prefixLen?-1:o.prefixLenr.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&V.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Vi.compare(e.uri,t.uri)||V.compareRangesUsingStarts(e.range,t.range)}}var hF=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fF=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Sz;let xz=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof dl||e instanceof Fk}getChildren(e){if(e instanceof dl)return e.groups;if(e instanceof Fk)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};xz=hF([fF(0,za)],xz);class abt{getHeight(){return 23}getTemplateId(e){return e instanceof Fk?Bk.id:CT.id}}let Lz=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Bv){const n=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(n)return n.value}return $c(e.uri)}};Lz=hF([fF(0,xi)],Lz);class lbt{getId(e){return e instanceof Bv?e.id:e.uri}}let Ez=class extends _e{constructor(e,t){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new ZP(n,{supportHighlights:!0})),this.badge=new T$(Ae(n,He(".count")),{},X1e),e.appendChild(n)}set(e,t){const n=x5(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(n,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const o=e.children.length;this.badge.setCount(o),o>1?this.badge.setTitleFormat(C("referencesCount","{0} references",o)):this.badge.setTitleFormat(C("referenceCount","{0} reference",o))}};Ez=hF([fF(1,Rw)],Ez);let Bk=Sz=class{constructor(e){this._instantiationService=e,this.templateId=Sz.id}renderTemplate(e){return this._instantiationService.createInstance(Ez,e)}renderElement(e,t,n){n.set(e.element,rT(e.filterData))}disposeTemplate(e){e.dispose()}};Bk.id="FileReferencesRenderer";Bk=Sz=hF([fF(0,$t)],Bk);class cbt{constructor(e){this.label=new tv(e)}set(e,t){var n;const o=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!o||!o.value)this.label.set(`${$c(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:r,highlight:s}=o;t&&!$u.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(r,rT(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(r,[s]))}}}class CT{constructor(){this.templateId=CT.id}renderTemplate(e){return new cbt(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}CT.id="OneReferenceRenderer";class dbt{getWidgetAriaLabel(){return C("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var ubt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ng=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Hle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class gF{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=[],n=[];for(let o=0,r=e.children.length;o{const r=o.deltaDecorations([],t);for(let s=0;s{r.equals(9)&&(this._keybindingService.dispatchEvent(r,r.target),r.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(fbt,"ReferencesWidget",this._treeContainer,new abt,[this._instantiationService.createInstance(Bk),this._instantiationService.createInstance(CT)],this._instantiationService.createInstance(xz),n),this._splitView.addView({onDidChange:st.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:r=>{this._preview.layout({height:this._dim.height,width:r})}},qP.Distribute),this._splitView.addView({onDidChange:st.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:r=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${r}px`,this._tree.layout(this._dim.height,r)}},qP.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const o=(r,s)=>{r instanceof Bv&&(s==="show"&&this._revealReference(r,!1),this._onDidSelectReference.fire({element:r,kind:s,source:"tree"}))};this._tree.onDidOpen(r=>{r.sideBySide?o(r.element,"side"):r.editorOptions.pinned?o(r.element,"goto"):o(r.element,"show")}),Js(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Kn(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=C("noResults","No results"),nl(this._messageContainer),Promise.resolve(void 0)):(Js(this._messageContainer),this._decorationsManager=new gF(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:n}=e;if(t.detail!==2)return;const o=this._getFocusedReference();!o||this._onDidSelectReference.fire({element:{uri:o.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),nl(this._treeContainer),nl(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 Bv)return e;if(e instanceof Fk&&e.children.length>0)return e.children[0]}revealReference(e){return Hle(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return Hle(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==hn.inMemory?this.setTitle(Hst(e.uri),this._uriLabel.getUriLabel(x5(e.uri))):this.setTitle(C("peekView.alternateTitle","References"));const n=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 o=yield n;if(!this._model){o.dispose();return}si(this._previewModelReference);const r=o.object;if(r){const s=this._preview.getModel()===r.textEditorModel?0:1,a=V.lift(e.range).collapseToStart();this._previewModelReference=o,this._preview.setModel(r.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),o.dispose()})}};Dz=ubt([ng(3,vr),ng(4,za),ng(5,$t),ng(6,awe),ng(7,Rw),ng(8,L5),ng(9,xi),ng(10,Ki),ng(11,Ti)],Dz);var gbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Z1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$le=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},kM;const e1=new lt("referenceSearchVisible",!1,C("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Wv=kM=class{static get(e){return e.getContribution(kM.ID)}constructor(e,t,n,o,r,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=o,this._notificationService=r,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new Be,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=e1.bindTo(n)}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,n){let o;if(this._widget&&(o=this._widget.position),this.closeWidget(),!!o&&e.containsPosition(o))return;this._peekMode=n,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const r="peekViewLayout",s=hbt.fromJSON(this._storageService.get(r,0,"{}"));this._widget=this._instantiationService.createInstance(Dz,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(C("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(r,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":n?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(C("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,u=new ae(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 $le(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const o=this._model.nextOrPreviousReference(n,e),r=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(o),yield this._gotoReference(o,!1),r?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()})}revealReference(e){return $le(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,n;(t=this._widget)===null||t===void 0||t.dispose(),(n=this._model)===null||n===void 0||n.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 n;(n=this._widget)===null||n===void 0||n.hide(),this._ignoreModelChangeEvent=!0;const o=V.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:o,selectionSource:"code.jump",pinned:t}},this._editor).then(r=>{var s;if(this._ignoreModelChangeEvent=!1,!r||!this._widget){this.closeWidget();return}if(this._editor===r)this._widget.show(o),this._widget.focusOnReferenceTree();else{const a=kM.get(r),l=this._model.clone();this.closeWidget(),r.focus(),a==null||a.toggleWidget(o,sr(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},r=>{this._ignoreModelChangeEvent=!1,en(r)})}openReference(e,t,n){t||this.closeWidget();const{uri:o,range:r}=e;this._editorService.openCodeEditor({resource:o,options:{selection:r,selectionSource:"code.jump",pinned:n}},this._editor,t)}};Wv.ID="editor.contrib.referencesController";Wv=kM=gbt([Z1(2,Ut),Z1(3,Jn),Z1(4,Ao),Z1(5,$t),Z1(6,Gd),Z1(7,En)],Wv);function t1(i,e){const t=ebt(i);if(!t)return;const n=Wv.get(t);n&&e(n)}Va.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Zo(2089,60),when:Me.or(e1,Ha.inPeekEditor),handler(i){t1(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Va.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:Me.or(e1,Ha.inPeekEditor),handler(i){t1(i,e=>{e.goToNextOrPreviousReference(!0)})}});Va.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:Me.or(e1,Ha.inPeekEditor),handler(i){t1(i,e=>{e.goToNextOrPreviousReference(!1)})}});Rn.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Rn.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Rn.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Rn.registerCommand("closeReferenceSearch",i=>t1(i,e=>e.closeWidget()));Va.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:Me.and(Ha.inPeekEditor,Me.not("config.editor.stablePeek"))});Va.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:Me.and(e1,Me.not("config.editor.stablePeek"))});Va.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Me.and(e1,mCe,MX.negate(),AX.negate()),handler(i){var e;const n=(e=i.get(Xc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Bv&&t1(i,o=>o.revealReference(n[0]))}});Va.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Me.and(e1,mCe,MX.negate(),AX.negate()),handler(i){var e;const n=(e=i.get(Xc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Bv&&t1(i,o=>o.openReference(n[0],!0,!0))}});Rn.registerCommand("openReference",i=>{var e;const n=(e=i.get(Xc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Bv&&t1(i,o=>o.openReference(n[0],!1,!0))});var dwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},PL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const hY=new lt("hasSymbols",!1,C("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),pF=yn("ISymbolNavigationService");let kz=class{constructor(e,t,n,o){this._editorService=t,this._notificationService=n,this._keybindingService=o,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=hY.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 n=new Iz(this._editorService),o=n.onDidChange(r=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const u of t.references)if($G(u.uri,a.uri))c=!0,d=d||V.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=Td(n,o)}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:V.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"),n=t?C("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):C("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};kz=dwe([PL(0,Ut),PL(1,Jn),PL(2,Ao),PL(3,xi)],kz);Mn(pF,kz,1);Ye(new class extends Ir{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:hY,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(pF).revealNext(e)}});Va.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:hY,primary:9,handler(i){i.get(pF).reset()}});let Iz=class{constructor(e){this._listener=new Map,this._disposables=new Be,this._onDidChange=new le,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(),si(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Td(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)}};Iz=dwe([PL(0,Jn)],Iz);var fY=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function yT(i,e,t,n){return fY(this,void 0,void 0,function*(){const r=t.ordered(i).map(a=>Promise.resolve(n(a,i,e)).then(void 0,l=>{$o(l)})),s=yield Promise.all(r);return hf(s.flat())})}function mF(i,e,t,n){return yT(e,t,i,(o,r,s)=>o.provideDefinition(r,s,n))}function uwe(i,e,t,n){return yT(e,t,i,(o,r,s)=>o.provideDeclaration(r,s,n))}function hwe(i,e,t,n){return yT(e,t,i,(o,r,s)=>o.provideImplementation(r,s,n))}function fwe(i,e,t,n){return yT(e,t,i,(o,r,s)=>o.provideTypeDefinition(r,s,n))}function vF(i,e,t,n,o){return yT(e,t,i,(r,s,a)=>fY(this,void 0,void 0,function*(){const l=yield r.provideReferences(s,a,{includeDeclaration:!0},o);if(!n||!l||l.length!==2)return l;const c=yield r.provideReferences(s,a,{includeDeclaration:!1},o);return c&&c.length===1?c:l}))}function wT(i){return fY(this,void 0,void 0,function*(){const e=yield i(),t=new dl(e,""),n=t.references.map(o=>o.link);return t.dispose(),n})}Nf("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(pt),o=mF(n.definitionProvider,e,t,_n.None);return wT(()=>o)});Nf("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(pt),o=fwe(n.typeDefinitionProvider,e,t,_n.None);return wT(()=>o)});Nf("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(pt),o=uwe(n.declarationProvider,e,t,_n.None);return wT(()=>o)});Nf("_executeReferenceProvider",(i,e,t)=>{const n=i.get(pt),o=vF(n.referenceProvider,e,t,!1,_n.None);return wT(()=>o)});Nf("_executeImplementationProvider",(i,e,t)=>{const n=i.get(pt),o=hwe(n.implementationProvider,e,t,_n.None);return wT(()=>o)});var Md=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Zx,Qx,Jx,q2,G2,X2,Y2,Z2;Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextPeek,title:C("peek.submenu","Peek"),group:"navigation",order:100});class Uw{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Uw||ae.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Bs extends lh{static all(){return Bs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const n of vn.wrap(t.menu))(n.id===Z.EditorContext||n.id===Z.EditorContextPeek)&&(n.when=Me.and(e.precondition,n.when));return t}constructor(e,t){super(Bs._patchConfig(t)),this.configuration=e,Bs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,o){if(!t.hasModel())return Promise.resolve(void 0);const r=e.get(Ao),s=e.get(Jn),a=e.get(t_),l=e.get(pF),c=e.get(pt),d=e.get($t),u=t.getModel(),h=t.getPosition(),f=Uw.is(n)?n:new Uw(u,h),g=new Av(t,5),p=n5(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(v=>Md(this,void 0,void 0,function*(){var m;if(!v||g.token.isCancellationRequested)return;Cs(v.ariaMessage);let _;if(v.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!Bs._activeAlternativeCommands.has(w)&&Bs._allSymbolNavigationCommands.has(w)&&(_=Bs._allSymbolNavigationCommands.get(w))}const y=v.references.length;if(y===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(m=cl.get(t))===null||m===void 0||m.showMessage(this._getNoResultFoundMessage(w),h)}}else if(y===1&&_)Bs._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(w=>_.runEditorCommand(w,t,n,o).finally(()=>{Bs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,o)}),v=>{r.error(v)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}_onResult(e,t,n,o,r){return Md(this,void 0,void 0,function*(){const s=this._getGoToPreference(n);if(!(n instanceof Fv)&&(this.configuration.openInPeek||s==="peek"&&o.references.length>1))this._openInPeek(n,o,r);else{const a=o.firstReference(),l=o.references.length>1&&s==="gotoAndPeek",c=yield this._openReference(n,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,o,r):o.dispose(),s==="goto"&&t.put(a)}})}_openReference(e,t,n,o,r){return Md(this,void 0,void 0,function*(){let s;if(rZe(n)&&(s=n.targetSelectionRange),s||(s=n.range),!s)return;const a=yield t.openCodeEditor({resource:n.uri,options:{selection:V.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,o);if(!!a){if(r){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,n){const o=Wv.get(e);o&&e.hasModel()?o.toggleWidget(n!=null?n:e.getSelection(),sr(r=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Bs._allSymbolNavigationCommands=new Map;Bs._activeAlternativeCommands=new Set;class ST extends Bs{_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield mF(e.definitionProvider,t,n,o),C("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?C("noResultWord","No definition found for '{0}'",e.word):C("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}$i((Zx=class extends ST{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Zx.id,title:{value:C("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:C({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:Me.and(Q.hasDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Q.editorTextFocus,primary:70,weight:100},{when:Me.and(Q.editorTextFocus,fCe),primary:2118,weight:100}],menu:[{id:Z.EditorContext,group:"navigation",order:1.1},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Rn.registerCommandAlias("editor.action.goToDeclaration",Zx.id)}},Zx.id="editor.action.revealDefinition",Zx));$i((Qx=class extends ST{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Qx.id,title:{value:C("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:Me.and(Q.hasDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Q.editorTextFocus,primary:Zo(2089,70),weight:100},{when:Me.and(Q.editorTextFocus,fCe),primary:Zo(2089,2118),weight:100}]}),Rn.registerCommandAlias("editor.action.openDeclarationToTheSide",Qx.id)}},Qx.id="editor.action.revealDefinitionAside",Qx));$i((Jx=class extends ST{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Jx.id,title:{value:C("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:Me.and(Q.hasDefinitionProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:Z.EditorContextPeek,group:"peek",order:2}}),Rn.registerCommandAlias("editor.action.previewDeclaration",Jx.id)}},Jx.id="editor.action.peekDefinition",Jx));class gwe extends Bs{_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield uwe(e.declarationProvider,t,n,o),C("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?C("decl.noResultWord","No declaration found for '{0}'",e.word):C("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}$i((q2=class extends gwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:q2.id,title:{value:C("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:C({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Me.and(Q.hasDeclarationProvider,Q.isInWalkThroughSnippet.toNegated()),menu:[{id:Z.EditorContext,group:"navigation",order:1.3},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?C("decl.noResultWord","No declaration found for '{0}'",e.word):C("decl.generic.noResults","No declaration found")}},q2.id="editor.action.revealDeclaration",q2));$i(class extends gwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:C("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:Me.and(Q.hasDeclarationProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:3}})}});class pwe extends Bs{_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield fwe(e.typeDefinitionProvider,t,n,o),C("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?C("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):C("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}$i((G2=class extends pwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:G2.ID,title:{value:C("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:C({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:Me.and(Q.hasTypeDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:0,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.4},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},G2.ID="editor.action.goToTypeDefinition",G2));$i((X2=class extends pwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:X2.ID,title:{value:C("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:Me.and(Q.hasTypeDefinitionProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:4}})}},X2.ID="editor.action.peekTypeDefinition",X2));class mwe extends Bs{_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield hwe(e.implementationProvider,t,n,o),C("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?C("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):C("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}$i((Y2=class extends mwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Y2.ID,title:{value:C("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:C({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:Me.and(Q.hasImplementationProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:2118,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.45},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},Y2.ID="editor.action.goToImplementation",Y2));$i((Z2=class extends mwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Z2.ID,title:{value:C("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:Me.and(Q.hasImplementationProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:3142,weight:100},menu:{id:Z.EditorContextPeek,group:"peek",order:5}})}},Z2.ID="editor.action.peekImplementation",Z2));class vwe extends Bs{_getNoResultFoundMessage(e){return e?C("references.no","No references found for '{0}'",e.word):C("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}$i(class extends vwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:C("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:C({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Me.and(Q.hasReferenceProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:1094,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.45},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield vF(e.referenceProvider,t,n,!0,o),C("ref.title","References"))})}});$i(class extends vwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:C("references.action.label","Peek References"),original:"Peek References"},precondition:Me.and(Q.hasReferenceProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield vF(e.referenceProvider,t,n,!1,o),C("ref.title","References"))})}});class pbt extends Bs{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:{value:C("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:Me.and(Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(this._references,C("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&C("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""}}Rn.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:Rt},{name:"position",description:"The position at which to start",constraint:ae.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:(i,e,t,n,o,r,s)=>Md(void 0,void 0,void 0,function*(){fi(Rt.isUri(e)),fi(ae.isIPosition(t)),fi(Array.isArray(n)),fi(typeof o=="undefined"||typeof o=="string"),fi(typeof s=="undefined"||typeof s=="boolean");const a=i.get(Jn),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Sf(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends pbt{_getNoResultFoundMessage(u){return r||super._getNoResultFoundMessage(u)}}({muteMessage:!Boolean(r),openInPeek:Boolean(s),openToSide:!1},n,o);c.get($t).invokeFunction(d.run.bind(d),l)})})});Rn.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:Rt},{name:"position",description:"The position at which to start",constraint:ae.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:(i,e,t,n,o)=>Md(void 0,void 0,void 0,function*(){i.get(_o).executeCommand("editor.action.goToLocations",e,t,n,o,void 0,!0)})});Rn.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{fi(Rt.isUri(e)),fi(ae.isIPosition(t));const n=i.get(pt),o=i.get(Jn);return o.openCodeEditor({resource:e},o.getFocusedCodeEditor()).then(r=>{if(!Sf(r)||!r.hasModel())return;const s=Wv.get(r);if(!s)return;const a=sr(c=>vF(n.referenceProvider,r.getModel(),ae.lift(t),!1,c).then(d=>new dl(d,C("ref.title","References")))),l=new V(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});Rn.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var mbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},o7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},OL;let vb=OL=class{constructor(e,t,n,o){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=o,this.toUnhook=new Be,this.toUnhookForKeyboard=new Be,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const r=new dF(e);this.toUnhook.add(r),this.toUnhook.add(r.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a!=null?a:void 0)})),this.toUnhook.add(r.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{en(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(r.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(OL.ID)}startFindDefinitionFromCursor(e){return zle(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 n=e.target.position;this.startFindDefinition(n)}startFindDefinition(e){var t;return zle(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const n=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const o=new Ak(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=sr(a=>this.findDefinition(e,a));let r;try{r=yield this.previousPromise}catch(a){en(a);return}if(!r||!r.length||!o.validate(this.editor)){this.removeLinkDecorations();return}const s=r[0].originSelectionRange?V.lift(r[0].originSelectionRange):new V(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);if(r.length>1){let a=s;for(const{originSelectionRange:l}of r)l&&(a=V.plusRange(a,l));this.addDecoration(a,new os().appendText(C("multipleResults","Click to show {0} definitions.",r.length)))}else{const a=r[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(s,u?new os().appendCodeblock(h||"",u):void 0),l.dispose()})}})}getPreviewValue(e,t,n){let o=n.range;return o.endLineNumber-o.startLineNumber>=OL.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,o)}stripIndentationFromPreviewRange(e,t,n){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const o=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(n);return new ST({openToSide:t,openInPeek:o,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(n)})}isInPeekEditor(e){const t=e.get(Ut);return Ha.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};vb.ID="editor.contrib.gotodefinitionatposition";vb.MAX_SOURCE_PREVIEW_LINES=8;vb=OL=mbt([o7(1,za),o7(2,Ki),o7(3,pt)],vb);Un(vb.ID,vb,2);const Q2=He;class _we extends _e{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 QI(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class gY extends _e{static render(e,t,n){return new gY(e,t,n)}constructor(e,t,n){super(),this.actionContainer=Ae(e,Q2("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ae(this.actionContainer,Q2("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ae(this.action,Q2(`span.icon.${t.iconClass}`));const o=Ae(this.action,Q2("span"));o.textContent=n?`${t.label} (${n})`:t.label,this._register(ke(this.actionContainer,et.CLICK,r=>{r.stopPropagation(),r.preventDefault(),t.run(this.actionContainer)})),this._register(ke(this.actionContainer,et.KEY_DOWN,r=>{const s=new Pi(r);(s.equals(3)||s.equals(10))&&(r.stopPropagation(),r.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 vbt(i,e){return i&&e?C("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?C("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var _bt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},bbt=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};class Cbt{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}}class bwe extends _e{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new le),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new bi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new bi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new bi(()=>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=aJe(e=>this._computer.computeAsync(e)),_bt(this,void 0,void 0,function*(){var e,t,n,o;try{try{for(var r=!0,s=bbt(this._asyncIterable),a;a=yield s.next(),e=a.done,!e;r=!0){o=a.value,r=!1;const l=o;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!r&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){en(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 Cbt(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 r7{constructor(e,t,n,o){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=o,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 IM{constructor(e,t,n,o,r,s){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=o,this.initialMousePosY=r,this.supportsMarkerHover=s,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 n1=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class pY{constructor(){this._onDidWillResize=new le,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new le,this.onDidResize=this._onDidResize.event,this._sashListener=new Be,this._size=new Kn(0,0),this._minSize=new Kn(0,0),this._maxSize=new Kn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new gs(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new gs(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new gs(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:jP.North}),this._southSash=new gs(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:jP.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,n=0;this._sashListener.add(st.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(st.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(o=>{e&&(n=o.currentX-o.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(o=>{e&&(n=-(o.currentX-o.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(o=>{e&&(t=-(o.currentY-o.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(o=>{e&&(t=o.currentY-o.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(st.any(this._eastSash.onDidReset,this._westSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(st.any(this._northSash.onDidReset,this._southSash.onDidReset)(o=>{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,n,o){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=o?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:o}=this._minSize,{height:r,width:s}=this._maxSize;e=Math.max(n,Math.min(r,e)),t=Math.max(o,Math.min(s,t));const a=new Kn(t,e);Kn.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 ybt=30,wbt=24;class Sbt extends _e{constructor(e,t=new Kn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new pY),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Kn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new Kn(n.dimension.width,n.dimension.height)),n.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?ae.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:Yo(t).top+n.top-ybt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const o=Yo(t),r=bS(t.ownerDocument.body),s=o.top+n.top+n.height;return r.height-s-wbt}_findPositionPreference(e,t){var n,o;const r=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),s=Math.min((o=this._availableVerticalSpaceAbove(t))!==null&&o!==void 0?o:1/0,e),a=Math.min(Math.max(s,r),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=r?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 mY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},C0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},TM,wh;const Ule=He;let gO=TM=class extends _e{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(ov,this._editor)),this._participants=[];for(const o of n1.getAll())this._participants.push(this._instantiationService.createInstance(o,this._editor));this._participants.sort((o,r)=>o.hoverOrdinal-r.hoverOrdinal),this._computer=new mO(this._editor,this._participants),this._hoverOperation=this._register(new bwe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{if(!this._computer.anchor)return;const r=o.hasLoadingMessage?this._addLoadingMessage(o.value):o.value;this._withResult(new Cwe(this._computer.anchor,r,o.isComplete))})),this._register(No(this._widget.getDomNode(),"keydown",o=>{o.equals(9)&&this.hide()})),this._register(oo.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 o of this._participants)if(o.suggestHoverAnchor){const r=o.suggestHoverAnchor(e);r&&t.push(r)}const n=e.target;if(n.type===6&&t.push(new r7(0,n.range,e.event.posx,e.event.posy)),n.type===7){const o=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&typeof n.detail.horizontalDistanceToText=="number"&&n.detail.horizontalDistanceToTextr.priority-o.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,n,o){this._startShowingOrUpdateHover(new r7(0,e,void 0,void 0),t,n,o,null)}_startShowingOrUpdateHover(e,t,n,o,r){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):!1:this._editor.getOption(60).sticky&&r&&this._widget.isMouseGettingCloser(r.event.posx,r.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,n,o,!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,n,o,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,n,o,r){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=o,this._computer.source=n,this._computer.insistOnKeepingHoverVisible=r,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 n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}}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:n,showAtSecondaryPosition:o,highlightRange:r}=TM.computeHoverRanges(this._editor,e.range,t),s=new Be,a=s.add(new pO(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&&s.add(h.renderHoverParts(d,f))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(r){const h=this._editor.createDecorationsCollection();h.set([{range:r,options:TM._DECORATION_OPTIONS}]),s.add(zt(()=>{h.clear()}))}this._widget.showAt(l,new Lbt(c,n,o,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(e,t,n){let o=1;if(e.hasModel()){const c=e._getViewModel(),d=c.coordinatesConverter,u=d.convertModelRangeToViewRange(t),h=new ae(u.startLineNumber,c.getLineMinColumn(u.startLineNumber));o=d.convertViewPositionToModelPosition(h).column}const r=t.startLineNumber;let s=t.startColumn,a=n[0].range,l=null;for(const c of n)a=V.plusRange(a,c.range),c.range.startLineNumber===r&&c.range.endLineNumber===r&&(s=Math.max(Math.min(s,c.range.startColumn),o)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new ae(r,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new ae(r,s),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()}};gO._DECORATION_OPTIONS=Jt.register({description:"content-hover-highlight",className:"hoverHighlight"});gO=TM=mY([C0(1,$t),C0(2,xi)],gO);class Cwe{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new xbt(this,this.anchor,t,this.isComplete)}}class xbt extends Cwe{constructor(e,t,n,o){super(t,n,o),this.original=e}filter(e){return this.original.filter(e)}}class Lbt{constructor(e,t,n,o,r,s,a,l,c,d){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=n,this.preferAbove=o,this.stoleFocus=r,this.source=s,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=d,this.closestMouseDistance=void 0}}const jle=30,s7=10,Ebt=6;let ov=wh=class extends Sbt{get isColorPickerVisible(){var e;return Boolean((e=this._visibleData)===null||e===void 0?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,n,o,r){const s=e.getOption(66)+8,a=150,l=new Kn(a,s);super(e,l),this._configurationService=n,this._accessibilityService=o,this._keybindingService=r,this._hover=this._register(new _we),this._minimumSize=l,this._hoverVisibleKey=Q.hoverVisible.bindTo(t),this._hoverFocusedKey=Q.hoverFocused.bindTo(t),Ae(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(pf(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 wh.ID}static _applyDimensions(e,t,n){const o=typeof t=="number"?`${t}px`:t,r=typeof n=="number"?`${n}px`:n;e.style.width=o,e.style.height=r}_setContentsDomNodeDimensions(e,t){const n=this._hover.contentsDomNode;return wh._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){const n=this._hover.containerDomNode;return wh._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){const o=typeof t=="number"?`${t}px`:t,r=typeof n=="number"?`${n}px`:n;e.style.maxWidth=o,e.style.maxHeight=r}_setHoverWidgetMaxDimensions(e,t){wh._applyMaxDimensions(this._hover.contentsDomNode,e,t),wh._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,n=e.height;this._setHoverWidgetDimensions(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,n-s7))}_updateResizableNodeMaxDimensions(){var e,t;const n=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Kn(n,o),this._setHoverWidgetMaxDimensions(n,o)}_resize(e){var t,n;wh._lastDimensions=new Kn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(n=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||n===void 0||n.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=Ebt;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{t+=n.clientHeight}),this._hasHorizontalScrollbar()&&(t+=s7),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=="undefined"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidththis._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,o),!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),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,wh._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,wh._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 n,o,r,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=h0(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(n=this._findPositionPreference(a,l))!==null&&n!==void 0?n:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(o=t.colorPicker)===null||o===void 0||o.layout();const c=vbt(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(r=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||r===void 0?void 0:r.getAriaLabel())!==null&&s!==void 0?s:"");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 Kn(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 n=this._hover.containerDomNode,o=this._hover.contentsDomNode,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(Ea(n),Math.min(r,e)),this._setContentsDomNodeDimensions(Ea(o),Math.min(r,e-s7))}setMinimumDimensions(e){this._minimumSize=new Kn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth=="undefined"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Kn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let n=h0(t),o=Ea(t);if(this._resizableNode.layout(n,o),this._setHoverWidgetDimensions(o,n),n=h0(t),o=Ea(t),this._contentWidth=o,this._updateMinimumWidth(),this._resizableNode.layout(n,o),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(n)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const r=h0(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(r,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-jle})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+jle})}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})}};ov.ID="editor.contrib.resizableContentHoverWidget";ov._lastDimensions=new Kn(0,0);ov=wh=mY([C0(1,Ut),C0(2,En),C0(3,_p),C0(4,xi)],ov);let pO=class extends _e{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Ule("div.hover-row.status-bar"),this.actionsElement=Ae(this.hoverElement,Ule("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(gY.render(this.actionsElement,e,n))}append(e){const t=Ae(this.actionsElement,e);return this._hasContent=!0,t}};pO=mY([C0(0,xi)],pO);class mO{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 n=e.getModel(),o=t.range.startLineNumber;if(o>n.getLineCount())return[];const r=n.getLineMaxColumn(o);return e.getLineDecorations(o).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===o?s.range.startColumn:1,l=s.range.endLineNumber===o?s.range.endColumn:r;if(s.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 Wo.EMPTY;const n=mO._getLineDecorations(this._editor,t);return Wo.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(t,n,e):Wo.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=mO._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return hf(t)}}function Kle(i,e,t,n,o,r){const s=t+o/2,a=n+r/2,l=Math.max(Math.abs(i-s)-o/2,0),c=Math.max(Math.abs(e-a)-r/2,0);return Math.sqrt(l*l+c*c)}const qle=He;class Vy extends _e{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Be),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new _we),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new up({editor:this._editor},t,n)),this._computer=new Dbt(this._editor),this._hoverOperation=this._register(new bwe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{this._withResult(o.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Vy.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 n=document.createDocumentFragment();for(const o of t){const r=qle("div.hover-row.markdown-hover"),s=Ae(r,qle("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(o.value));s.appendChild(a.element),n.appendChild(r)}this._updateContents(n),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(),n=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),r=this._editor.getOption(66),s=this._hover.containerDomNode.clientHeight,a=n-o-(s-r)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Vy.ID="editor.contrib.modesGlyphHoverWidget";class Dbt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),n=[];if(!t)return n;for(const o of t){if(!o.options.glyphMarginClassName)continue;const r=o.options.glyphMarginHoverMessage;!r||Pw(r)||n.push(...Pq(r).map(e))}return n}}var kbt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Ibt{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}function Tbt(i,e,t,n,o){return kbt(this,void 0,void 0,function*(){try{const r=yield Promise.resolve(i.provideHover(t,n,o));if(r&&Rbt(r))return new Ibt(i,r,e)}catch(r){$o(r)}})}function vY(i,e,t,n){const r=i.ordered(e).map((s,a)=>Tbt(s,a,e,t,n));return Wo.fromPromises(r).coalesce()}function Nbt(i,e,t,n){return vY(i,e,t,n).map(o=>o.hover).toPromise()}Nf("_executeHoverProvider",(i,e,t)=>{const n=i.get(pt);return Nbt(n.hoverProvider,e,t,_n.None)});function Rbt(i){const e=typeof i.range!="undefined",t=typeof i.contents!="undefined"&&i.contents&&i.contents.length>0;return e&&t}var Mbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},J2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Gle=He;class Du{constructor(e,t,n,o,r){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=o,this.ordinal=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let vO=class{constructor(e,t,n,o,r){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=o,this._languageFeaturesService=r,this.hoverOrdinal=3}createLoadingMessage(e){return new Du(this,e.range,[new os().appendText(C("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),o=e.range.startLineNumber,r=n.getLineMaxColumn(o),s=[];let a=1e3;const l=n.getLineLength(o),c=n.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,s.push(new Du(this,e.range,[{value:C("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&&s.push(new Du(this,e.range,[{value:C("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===o?g.range.startColumn:1,v=g.range.endLineNumber===o?g.range.endColumn:r,m=g.options.hoverMessage;if(!m||Pw(m))continue;g.options.beforeContentClassName&&(f=!0);const _=new V(e.range.startLineNumber,p,e.range.startLineNumber,v);s.push(new Du(this,_,Pq(m),f,a++))}return s}computeAsync(e,t,n){if(!this._editor.hasModel()||e.type!==1)return Wo.EMPTY;const o=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(o))return Wo.EMPTY;const r=new ae(e.range.startLineNumber,e.range.startColumn);return vY(this._languageFeaturesService.hoverProvider,o,r,n).filter(s=>!Pw(s.hover.contents)).map(s=>{const a=s.hover.range?V.lift(s.hover.range):e.range;return new Du(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return ywe(e,t,this._editor,this._languageService,this._openerService)}};vO=Mbt([J2(1,Ki),J2(2,ml),J2(3,En),J2(4,pt)],vO);function ywe(i,e,t,n,o){e.sort((s,a)=>s.ordinal-a.ordinal);const r=new Be;for(const s of e)for(const a of s.contents){if(Pw(a))continue;const l=Gle("div.hover-row.markdown-hover"),c=Ae(l,Gle("div.hover-contents")),d=r.add(new up({editor:t},n,o));r.add(d.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",i.onContentsChanged()}));const u=r.add(d.render(a));c.appendChild(u.element),i.fragment.appendChild(l)}return r}var wwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_O=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Xle{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let Tz=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._dispoables=new Be,this._markers=[],this._nextIdx=-1,Rt.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const o=this._configService.getValue("problems.sortOrder"),r=(a,l)=>{let c=AD(a.resource.toString(),l.resource.toString());return c===0&&(o==="position"?c=V.compareRangesUsingStarts(a,l)||ao.compare(a.severity,l.severity):c=ao.compare(a.severity,l.severity)||V.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:Rt.isUri(e)?e:void 0,severities:ao.Error|ao.Warning|ao.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(r)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),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 Xle(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let o=!1,r=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());r<0&&(r=ED(this._markers,{resource:e.uri},(s,a)=>AD(s.resource.toString(),a.resource.toString())),r<0&&(r=~r));for(let s=r;so.resource.toString()===e.toString());if(!(n<0)){for(;n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Q1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Mz;class Pbt{constructor(e,t,n,o,r){this._openerService=o,this._labelService=r,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Be,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(No(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new bbe(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){si(this._disposables)}update(e){const{source:t,message:n,relatedInformation:o,code:r}=e;let s=((t==null?void 0:t.length)||0)+2;r&&(typeof r=="string"?s+=r.length:s+=r.value.length);const a=gf(n);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ur(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||r){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(r)if(typeof r=="string"){const f=document.createElement("span");f.innerText=`(${r})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=He("a.code-link"),this._codeLink.setAttribute("href",`${r.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(r.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=Ae(this._codeLink,He("span"));f.innerText=r.value,h.appendChild(this._codeLink)}}if(Ur(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ws(o)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of o){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(p),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:u})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case ao.Error:t=C("Error","Error");break;case ao.Warning:t=C("Warning","Warning");break;case ao.Info:t=C("Info","Info");break;case ao.Hint:t=C("Hint","Hint");break}let n=C("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const o=this._editor.getModel();return o&&e.startLineNumber<=o.getLineCount()&&e.startLineNumber>=1&&(n=`${o.getLineContent(e.startLineNumber)}, ${n}`),n}}let jw=Mz=class extends fO{constructor(e,t,n,o,r,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},r),this._themeService=t,this._openerService=n,this._menuService=o,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new Be,this._onDidSelectRelatedInformation=new le,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ao.Warning,this._backgroundColor=ve.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Wbt);let t=Az,n=Obt;this._severity===ao.Warning?(t=NM,n=Fbt):this._severity===ao.Info&&(t=Pz,n=Bbt);const o=e.getColor(t),r=e.getColor(n);this.style({arrowColor:o,frameColor:o,headerBackgroundColor:r,primaryHeadingColor:e.getColor(lwe),secondaryHeadingColor:e.getColor(cwe)})}_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(o=>this.editor.focus()));const t=[],n=this._menuService.createMenu(Mz.TitleMenu,this._contextKeyService);Z1e(n,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=Ae(e,He(""))}_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 Pbt(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,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const o=V.lift(e),r=this.editor.getPosition(),s=r&&o.containsPosition(r)?r:o.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=n>1?C("problems","{0} of {1} problems",t,n):C("change","{0} of {1} problem",t,n);this.setTitle($c(a.uri),l)}this._icon.className=`codicon ${Rz.className(ao.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};jw.TitleMenu=new Z("gotoErrorTitleMenu");jw=Mz=Abt([Q1(1,vr),Q1(2,ml),Q1(3,If),Q1(4,$t),Q1(5,Ut),Q1(6,Rw)],jw);const Yle=QD(Yh,wnt),Zle=QD($l,YD),Qle=QD(Ma,ZD),Az=J("editorMarkerNavigationError.background",{dark:Yle,light:Yle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationError","Editor marker navigation widget error color.")),Obt=J("editorMarkerNavigationError.headerBackground",{dark:St(Az,.1),light:St(Az,.1),hcDark:null,hcLight:null},C("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),NM=J("editorMarkerNavigationWarning.background",{dark:Zle,light:Zle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Fbt=J("editorMarkerNavigationWarning.headerBackground",{dark:St(NM,.1),light:St(NM,.1),hcDark:"#0C141F",hcLight:St(NM,.2)},C("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),Pz=J("editorMarkerNavigationInfo.background",{dark:Qle,light:Qle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Bbt=J("editorMarkerNavigationInfo.headerBackground",{dark:St(Pz,.1),light:St(Pz,.1),hcDark:null,hcLight:null},C("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Wbt=J("editorMarkerNavigation.background",{dark:mr,light:mr,hcDark:mr,hcLight:mr},C("editorMarkerNavigationBackground","Editor marker navigation widget background."));var Vbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},xwe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},FL;let Vv=FL=class{static get(e){return e.getContribution(FL.ID)}constructor(e,t,n,o,r){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=o,this._instantiationService=r,this._sessionDispoables=new Be,this._editor=e,this._widgetVisible=Lwe.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(jw,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(n=>{var o,r,s;(!(!((o=this._model)===null||o===void 0)&&o.selected)||!V.containsPosition((r=this._model)===null||r===void 0?void 0:r.selected.marker,n.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const n=this._model.find(this._editor.getModel().uri,this._widget.position);n?this._widget.updateMarker(n.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(n=>{this._editorService.openCodeEditor({resource:n.resource,options:{pinned:!0,revealIfOpened:!0,selection:V.lift(n).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 ae(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var n,o;return xwe(this,void 0,void 0,function*(){if(this._editor.hasModel()){const r=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(r.move(e,this._editor.getModel(),this._editor.getPosition()),!r.selected)return;if(r.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:r.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:r.selected.marker}},this._editor);s&&((n=FL.get(s))===null||n===void 0||n.close(),(o=FL.get(s))===null||o===void 0||o.nagivate(e,t))}else this._widget.showAtMarker(r.selected.marker,r.selected.index,r.selected.total)}})}};Vv.ID="editor.contrib.markerController";Vv=FL=Vbt([eR(1,Swe),eR(2,Ut),eR(3,Jn),eR(4,$t)],Vv);class _F extends ft{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}run(e,t){var n;return xwe(this,void 0,void 0,function*(){t.hasModel()&&((n=Vv.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))})}}class rv extends _F{constructor(){super(!0,!1,{id:rv.ID,label:rv.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:578,weight:100},menuOpts:{menuId:jw.TitleMenu,title:rv.LABEL,icon:Eo("marker-navigation-next",Xe.arrowDown,C("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}rv.ID="editor.action.marker.next";rv.LABEL=C("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class O0 extends _F{constructor(){super(!1,!1,{id:O0.ID,label:O0.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:1602,weight:100},menuOpts:{menuId:jw.TitleMenu,title:O0.LABEL,icon:Eo("marker-navigation-previous",Xe.arrowUp,C("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}O0.ID="editor.action.marker.prev";O0.LABEL=C("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Hbt extends _F{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:C("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:Q.focus,primary:66,weight:100},menuOpts:{menuId:Z.MenubarGoMenu,title:C({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class $bt extends _F{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:C("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:Q.focus,primary:1090,weight:100},menuOpts:{menuId:Z.MenubarGoMenu,title:C({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Un(Vv.ID,Vv,4);ze(rv);ze(O0);ze(Hbt);ze($bt);const Lwe=new lt("markersNavigationVisible",!1),zbt=Ir.bindToContribution(Vv.get);Ye(new zbt({id:"closeMarkersNavigation",precondition:Lwe,handler:i=>i.close(),kbOpts:{weight:100+50,kbExpr:Q.focus,primary:9,secondary:[1033]}}));var Ubt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},a7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const ud=He;class jbt{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const Jle={type:1,filter:{include:Wt.QuickFix},triggerAction:fl.QuickFixHover};let Oz=class{constructor(e,t,n,o){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=o,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const n=this._editor.getModel(),o=e.range.startLineNumber,r=n.getLineMaxColumn(o),s=[];for(const a of t){const l=a.range.startLineNumber===o?a.range.startColumn:1,c=a.range.endLineNumber===o?a.range.endColumn:r,d=this._markerDecorationsService.getMarker(n.uri,a);if(!d)continue;const u=new V(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new jbt(this,u,d))}return s}renderHoverParts(e,t){if(!t.length)return _e.None;const n=new Be;t.forEach(r=>e.fragment.appendChild(this.renderMarkerHover(r,n)));const o=t.length===1?t[0]:t.sort((r,s)=>ao.compare(r.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,o,n),n}renderMarkerHover(e,t){const n=ud("div.hover-row"),o=Ae(n,ud("div.marker.hover-contents")),{source:r,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(o);const c=Ae(o,ud("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,r||a)if(a&&typeof a!="string"){const d=ud("span");if(r){const g=Ae(d,ud("span"));g.innerText=r}const u=Ae(d,ud("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(ke(u,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=Ae(u,ud("span"));h.innerText=a.value;const f=Ae(o,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=Ae(o,ud("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=r&&a?`${r}(${a})`:r||`(${a})`}if(ws(l))for(const{message:d,resource:u,startLineNumber:h,startColumn:f}of l){const g=Ae(o,ud("div"));g.style.marginTop="8px";const p=Ae(g,ud("a"));p.innerText=`${$c(u)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(ke(p,"click",m=>{m.stopPropagation(),m.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(en)}));const v=Ae(g,ud("span"));v.innerText=d,this._editor.applyFontInfo(v)}return n}renderMarkerStatusbar(e,t,n){if((t.marker.severity===ao.Error||t.marker.severity===ao.Warning||t.marker.severity===ao.Info)&&e.statusBar.addAction({label:C("view problem","View Problem"),commandId:rv.ID,run:()=>{var o;e.hide(),(o=Vv.get(this._editor))===null||o===void 0||o.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const o=e.statusBar.append(ud("div"));this.recentMarkerCodeActionsInfo&&(zP.makeKey(this.recentMarkerCodeActionsInfo.marker)===zP.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(o.textContent=C("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const r=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?_e.None:n.add(Lv(()=>o.textContent=C("checkingForQuickFixes","Checking for quick fixes..."),200));o.textContent||(o.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);n.add(zt(()=>s.cancel())),s.then(a=>{if(r.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),o.textContent=C("noQuickFixes","No quick fixes available");return}o.style.display="none";let l=!1;n.add(zt(()=>{l||a.dispose()})),e.statusBar.addAction({label:C("quick fixes","Quick Fix..."),commandId:sY,run:c=>{l=!0;const d=Pv.get(this._editor),u=Yo(c);e.hide(),d==null||d.showCodeActions(Jle,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},en)}}getCodeActions(e){return sr(t=>RE(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new V(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Jle,Xg.None,t))}};Oz=Ubt([a7(1,yG),a7(2,ml),a7(3,pt)],Oz);const Ewe="editor.action.inlineSuggest.commit",Dwe="editor.action.inlineSuggest.showPrevious",kwe="editor.action.inlineSuggest.showNext";var Kbt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class qbt extends _e{constructor(e,t,n={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new PYe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Be),this.options=n,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Wk(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},n.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new zc(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,actionViewItemProvider:(o,r)=>{var s;if(o.id===Wk.ID)return this.toggleMenuActionViewItem=new OP(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Mt.asClassNameArray((s=n.moreIcon)!==null&&s!==void 0?s:Xe.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(n.actionViewItemProvider){const a=n.actionViewItemProvider(o,r);if(a)return a}if(o instanceof _w){const a=new OP(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.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 n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(o=>{this.actionBar.push(o,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(o)})})}getKeybindingLabel(e){var t,n,o;const r=this.lookupKeybindings?(n=(t=this.options).getKeyBinding)===null||n===void 0?void 0:n.call(t,e):void 0;return(o=r==null?void 0:r.getLabel())!==null&&o!==void 0?o:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Wk extends ca{constructor(e,t){t=t||C("moreActions","More Actions..."),super(Wk.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return Kbt(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Wk.ID="toolbar.toggle.more";var Gbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Fz=class extends qbt{constructor(e,t,n,o,r,s,a){super(e,r,Object.assign(Object.assign({getKeyBinding:c=>{var d;return(d=s.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=n,this._contextKeyService=o,this._contextMenuService=r,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=[],n){var o,r,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let d=0;const u=[];let h=!1;if(((o=this._options)===null||o===void 0?void 0:o.hiddenItemStrategy)!==-1)for(let f=0;fv==null?void 0:v.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let v=0;v=g&&(a[v]=void 0,u[v]=m))}}ioe(a),ioe(u),super.setActions(a,kr.join(u,l)),c.length>0&&this._sessionDisposables.add(ke(this.getElement(),"contextmenu",f=>{var g,p,v,m,_;const y=new kc(f),w=this.getItemAction(y.target);if(!w)return;y.preventDefault(),y.stopPropagation();let L=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){L=!0;for(let I=0;Ithis._menuService.resetHiddenStates(n)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>E,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(m=this._options)===null||m===void 0?void 0:m.menuOptions),skipTelemetry:typeof((_=this._options)===null||_===void 0?void 0:_.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};Fz=Gbt([eL(2,If),eL(3,Ut),eL(4,Kd),eL(5,xi),eL(6,tc)],Fz);var _Y=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ku=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},RM;let Bz=class extends _e{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=$r(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=In(this,o=>{var r,s,a;const l=(r=this.model.read(o))===null||r===void 0?void 0:r.ghostText.read(o);if(!this.alwaysShowToolbar.read(o)||!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 ae(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=d,d}),this._register(Ja((o,r)=>{const s=this.model.read(o);if(!s||!this.alwaysShowToolbar.read(o))return;const a=r.add(this.instantiationService.createInstance(Hv,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),r.add(zt(()=>e.removeContentWidget(a))),r.add(Ii(l=>{!this.position.read(l)||s.lastTriggerKind.read(l)!==Kg.Explicit&&s.triggerExplicitly()}))}))}};Bz=_Y([ku(2,$t)],Bz);const Xbt=Eo("inline-suggestion-hints-next",Xe.chevronRight,C("parameterHintsNextIcon","Icon for show next parameter hint.")),Ybt=Eo("inline-suggestion-hints-previous",Xe.chevronLeft,C("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Hv=RM=class extends _e{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){const o=new ca(e,t,n,!0,()=>this._commandService.executeCommand(e)),r=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return r&&(s=C({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,r.getLabel())),o.tooltip=s,o}constructor(e,t,n,o,r,s,a,l,c,d,u){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=o,this._suggestionCount=r,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=d,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${RM.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Or("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Or("div@toolBar")]),this.previousAction=this.createCommandAction(Dwe,C("previous","Previous"),Mt.asClassName(Ybt)),this.availableSuggestionCountAction=new ca("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(kwe,C("next","Next"),Mt.asClassName(Xbt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Z.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new bi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new bi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(Wz,this.nodes.toolBar,Z.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof Fd)return l.createInstance(Qbt,h,void 0);if(h===this.availableSuggestionCountAction){const g=new Zbt(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=>{RM._dropDownVisible=h})),this._register(Ii(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(Ii(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Ii(h=>{const f=this._extraCommands.read(h);if(Lo(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:v=>this._commandService.executeCommand(p.id)}));for(const[p,v]of this.inlineCompletionsActionsMenus.getActions())for(const m of v)m instanceof Fd&&g.push(m);g.length>0&&g.unshift(new kr),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Hv._dropDownVisible=!1;Hv.id=0;Hv=RM=_Y([ku(6,_o),ku(7,$t),ku(8,xi),ku(9,Ut),ku(10,If)],Hv);class Zbt extends Ow{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class Qbt extends ab{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Or("div.keybinding").root;new cT(t,Vl,Object.assign({disableTitle:!0},xft)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let Wz=class extends Fz{constructor(e,t,n,o,r,s,a,l){super(e,Object.assign({resetMenu:t},n),o,r,s,a,l),this.menuId=t,this.options2=n,this.menuService=o,this.contextKeyService=r,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,n,o,r,s,a;const l=[],c=[];Z1e(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(r=(o=this.options2)===null||o===void 0?void 0:o.toolbarOptions)===null||r===void 0?void 0:r.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Lo(this.prependedPrimaryActions,e,(t,n)=>t===n)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Lo(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};Wz=_Y([ku(3,If),ku(4,Ut),ku(5,Kd),ku(6,xi),ku(7,tc)],Wz);var Jbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Vz;const e1t=!1;let $a=Vz=class extends _e{static get(e){return e.getContribution(Vz.ID)}constructor(e,t,n,o,r){super(),this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=o,this._keybindingService=r,this._toUnhook=new Be,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new bi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(s=>{s.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(n=>this._onEditorMouseDown(n))),this._toUnhook.add(this._editor.onMouseUp(n=>this._onEditorMouseUp(n))),this._toUnhook.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._toUnhook.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))):(this._toUnhook.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._toUnhook.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))),this._toUnhook.add(this._editor.onMouseLeave(n=>this._onEditorMouseLeave(n))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(n=>this._onEditorScrollChanged(n)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const n=e.target;if(n.type===9&&n.detail===ov.ID){this._hoverClicked=!0;return}n.type===12&&n.detail===Vy.ID||(n.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,n;const o=e.event.browserEvent.relatedTarget;((t=this._contentWidget)===null||t===void 0?void 0:t.widget.isResizing)||((n=this._contentWidget)===null||n===void 0?void 0:n.containsNode(o))||this._hideWidgets()}_isMouseOverWidget(e){var t,n,o,r,s;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===ov.ID||this._isHoverSticky&&((t=this._contentWidget)===null||t===void 0?void 0:t.containsNode((n=e.event.browserEvent.view)===null||n===void 0?void 0:n.document.activeElement))&&!(!((r=(o=e.event.browserEvent.view)===null||o===void 0?void 0:o.getSelection())===null||r===void 0)&&r.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===ov.ID&&((s=this._contentWidget)===null||s===void 0?void 0:s.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===Vy.ID)}_onEditorMouseMove(e){var t,n,o,r;if(this._mouseMoveEvent=e,((t=this._contentWidget)===null||t===void 0?void 0:t.isFocused)||((n=this._contentWidget)===null||n===void 0?void 0:n.isResizing)||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&((o=this._contentWidget)===null||o===void 0?void 0:o.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(((r=this._contentWidget)===null||r===void 0?void 0:r.isVisible)&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,n,o;if(!e)return;const r=e.target,s=(t=r.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(s&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!e1t||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!s&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(n=this._glyphWidget)===null||n===void 0||n.hide();return}if(r.type===2&&r.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._glyphWidget||(this._glyphWidget=new Vy(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(r.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const n=this._keybindingService.softDispatch(e,this._editor.getDomNode()),o=n.kind===1||n.kind===2&&n.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&&!o&&this._hideWidgets()}_hideWidgets(){var e,t,n;this._isMouseDown&&this._hoverClicked&&((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible)||Hv.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(n=this._contentWidget)===null||n===void 0||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(gO,this._editor)),this._contentWidget}showContentHover(e,t,n,o,r=!1){this._hoverActivatedByColorDecoratorClick=r,this._getOrCreateContentWidget().startShowingAtRange(e,t,n,o)}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()}};$a.ID="editor.contrib.hover";$a=Vz=Jbt([tR(1,$t),tR(2,ml),tR(3,Ki),tR(4,xi)],$a);class t1t extends ft{constructor(){super({id:"editor.action.showHover",label:C({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:Q.editorTextFocus,primary:Zo(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const o=$a.get(t);if(!o)return;const r=t.getPosition(),s=new V(r.lineNumber,r.column,r.lineNumber,r.column),a=t.getOption(2)===2||!!(n!=null&&n.focus);o.isHoverVisible?o.focus():o.showContentHover(s,1,1,a)}}class n1t extends ft{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:C({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 n=$a.get(t);if(!n)return;const o=t.getPosition();if(!o)return;const r=new V(o.lineNumber,o.column,o.lineNumber,o.column),s=vb.get(t);if(!s)return;s.startFindDefinitionFromCursor(o).then(()=>{n.showContentHover(r,1,1,!0)})}}class i1t extends ft{constructor(){super({id:"editor.action.scrollUpHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:16,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollUp()}}class o1t extends ft{constructor(){super({id:"editor.action.scrollDownHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:18,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollDown()}}class r1t extends ft{constructor(){super({id:"editor.action.scrollLeftHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:15,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollLeft()}}class s1t extends ft{constructor(){super({id:"editor.action.scrollRightHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:17,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollRight()}}class a1t extends ft{constructor(){super({id:"editor.action.pageUpHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=$a.get(t);!n||n.pageUp()}}class l1t extends ft{constructor(){super({id:"editor.action.pageDownHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=$a.get(t);!n||n.pageDown()}}class c1t extends ft{constructor(){super({id:"editor.action.goToTopHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=$a.get(t);!n||n.goToTop()}}class d1t extends ft{constructor(){super({id:"editor.action.goToBottomHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=$a.get(t);!n||n.goToBottom()}}Un($a.ID,$a,2);ze(t1t);ze(n1t);ze(i1t);ze(o1t);ze(r1t);ze(s1t);ze(a1t);ze(l1t);ze(c1t);ze(d1t);n1.register(vO);n1.register(Oz);jd((i,e)=>{const t=i.getColor(Fnt);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class Hz extends _e{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 n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==Qye||!n.range)return;const o=this._editor.getContribution($a.ID);if(!!o&&!o.isColorPickerVisible){const r=new V(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);o.showContentHover(r,1,0,!1,!0)}}}Hz.ID="editor.contrib.colorContribution";Un(Hz.ID,Hz,2);n1.register(hO);var Iwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Su=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ece=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},$z,zz;let $v=$z=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editor=e,this._modelService=n,this._keybindingService=o,this._instantiationService=r,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=Q.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=Q.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 bO(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($z.ID)}};$v.ID="editor.contrib.standaloneColorPickerController";$v=$z=Iwe([Su(1,Ut),Su(2,Yi),Su(3,xi),Su(4,$t),Su(5,pt),Su(6,Ti)],$v);Un($v.ID,$v,1);const tce=8,u1t=22;let bO=zz=class extends _e{constructor(e,t,n,o,r,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=n,this._modelService=r,this._keybindingService=s,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 le),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=o.createInstance(Pk,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(pf(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 zz.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 ece(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);!t||this._onResult.fire(new h1t(t.result,t.foundInEditor))})}_computeAsync(e){return ece(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}},n=yield this._standaloneColorPickerParticipant.createColorHover(t,new dY(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return n?{result:n.colorHover,foundInEditor:n.foundInEditor}:null})}_render(e,t){const n=document.createDocumentFragment(),o=this._register(new pO(this._keybindingService));let r;const s={fragment:n,statusBar:o,setColorPicker:p=>r=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),r===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(n),r.layout();const a=r.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-u1t-tce,d=r.body.enterButton;d==null||d.onClicked(()=>{this.updateEditor(),this.hide()});const u=r.header,h=u.pickedColorNode;h.style.width=l+tce+"px";const f=u.originalColorNode;f.style.width=c+"px";const g=r.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)}};bO.ID="editor.contrib.standaloneColorPickerWidget";bO=zz=Iwe([Su(3,$t),Su(4,Yi),Su(5,xi),Su(6,pt),Su(7,Ti)],bO);class h1t{constructor(e,t){this.value=e,this.foundInEditor=t}}class f1t extends lh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:C("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:C({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:Z.CommandPalette}]})}runEditorCommand(e,t){var n;(n=$v.get(t))===null||n===void 0||n.showOrFocus()}}class g1t extends ft{constructor(){super({id:"editor.action.hideColorPicker",label:C({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:Q.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=$v.get(t))===null||n===void 0||n.hide()}}class p1t extends ft{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:C({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:Q.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=$v.get(t))===null||n===void 0||n.insertColor()}}ze(g1t);ze(p1t);$i(f1t);class Rm{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const o=t.length,r=e.length;if(n+o>r)return!1;for(let s=0;s=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,n,o,r,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,u=r.getLineContent(a),h=r.getLineContent(c);let f=u.lastIndexOf(t,l-1+t.length),g=h.indexOf(n,d-1-n.length);if(f!==-1&&g!==-1)if(a===c)u.substring(f+t.length,g).indexOf(n)>=0&&(f=-1,g=-1);else{const v=u.substring(f+t.length),m=h.substring(0,g);(v.indexOf(n)>=0||m.indexOf(n)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(o&&f+t.length0&&h.charCodeAt(g-1)===32&&(n=" "+n,g-=1),p=Rm._createRemoveBlockCommentOperations(new V(a,f+t.length+1,c,g+1),t,n)):(p=Rm._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=p.length===1?n:null);for(const v of p)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,n){const o=[];return V.isEmpty(e)?o.push(Gi.delete(new V(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(o.push(Gi.delete(new V(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),o.push(Gi.delete(new V(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),o}static _createAddBlockCommentOperations(e,t,n,o){const r=[];return V.isEmpty(e)?r.push(Gi.replace(new V(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(r.push(Gi.insert(new ae(e.startLineNumber,e.startColumn),t+(o?" ":""))),r.push(Gi.insert(new ae(e.endLineNumber,e.endColumn),(o?" ":"")+n))),r}getEditOperations(e,t){const n=this._selection.startLineNumber,o=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const r=e.getLanguageIdAtPosition(n,o),s=this.languageConfigurationService.getLanguageConfiguration(r).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(n.length===2){const o=n[0],r=n[1];return new gt(o.range.endLineNumber,o.range.endColumn,r.range.startLineNumber,r.range.startColumn)}else{const o=n[0].range,r=this._usedEndToken?-this._usedEndToken.length-1:0;return new gt(o.endLineNumber,o.endColumn+r,o.endLineNumber,o.endColumn+r)}}}class ug{constructor(e,t,n,o,r,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=o,this._insertSpace=r,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,o){e.tokenization.tokenizeIfCheap(t);const r=e.getLanguageIdAtPosition(t,1),s=o.getLanguageConfiguration(r).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=n-t+1;cr?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class bY extends ft{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Ti);if(!t.hasModel())return;const o=t.getModel(),r=[],s=o.getOptions(),a=t.getOption(23),l=t.getSelections().map((d,u)=>({selection:d,index:u,ignoreFirstLine:!1}));l.sort((d,u)=>V.compareRangesUsingStarts(d.selection,u.selection));let c=l[0];for(let d=1;d=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},S_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Uz;let Kw=Uz=class{static get(e){return e.getContribution(Uz.ID)}constructor(e,t,n,o,r,s,a,l){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=o,this._keybindingService=r,this._menuService=s,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&&nb(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 n=!1;for(const o of this._editor.getSelections())if(o.containsPosition(e.target.position)){n=!0;break}n||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?Z.SimpleEditorContext:Z.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],o=this._menuService.createMenu(t,this._contextKeyService),r=o.getActions({arg:e.uri});o.dispose();for(const s of r){const[,a]=s;let l=0;for(const c of a)if(c instanceof BD){const d=this._getMenuActions(e,c.item.submenu);d.length>0&&(n.push(new _w(c.id,c.label,d)),l++)}else n.push(c),l++;l&&n.push(new kr)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let o=t;if(!o){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Yo(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;o={x:l,y:c}}const r=this._editor.getOption(126)&&!Ku;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>o,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new Ow(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new Ow(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:n})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||idt(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let n=0;const o=c=>({id:`menu-action-${++n}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled=="undefined"?!0:c.enabled,checked:c.checked,run:c.run}),r=(c,d)=>new _w(`menu-action-${++n}`,c,d,void 0),s=(c,d,u,h,f)=>{if(!d)return o({label:c,enabled:d,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(u,v)},p=[];for(const v of f)p.push(o({label:v.label,checked:h===v.value,run:g(v.value)}));return r(c,p)},a=[];a.push(o({label:C("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new kr),a.push(o({label:C("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(C("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:C("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:C("context.minimap.size.fill","Fill"),value:"fill"},{label:C("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(C("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:C("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:C("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!Ku;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()}};Kw.ID="editor.contrib.contextmenu";Kw=Uz=C1t([S_(1,Kd),S_(2,bp),S_(3,Ut),S_(4,xi),S_(5,If),S_(6,En),S_(7,rb)],Kw);class y1t extends ft{constructor(){super({id:"editor.action.showContextMenu",label:C("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=Kw.get(t))===null||n===void 0||n.showContextMenu()}}Un(Kw.ID,Kw,2);ze(y1t);class l7{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let o=0;o{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 n=new l7(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new c7(n,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 c7(new l7(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 c7(new l7(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}}_b.ID="editor.contrib.cursorUndoRedoController";class w1t extends ft{constructor(){super({id:"cursorUndo",label:C("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var o;(o=_b.get(t))===null||o===void 0||o.cursorUndo()}}class S1t extends ft{constructor(){super({id:"cursorRedo",label:C("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var o;(o=_b.get(t))===null||o===void 0||o.cursorRedo()}}Un(_b.ID,_b,0);ze(w1t);ze(S1t);class x1t{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new V(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),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 gt(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 gt(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)||(J1(e)&&(this._modifierPressed=!0),this._mouseDown&&J1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(J1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Qg.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 o=(this._editor.getSelections()||[]).filter(r=>t.position&&r.containsPosition(t.position));if(o.length===1)this._dragSelection=o[0];else return}J1(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 ae(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const o=this._editor.getSelection();if(o){const{selectionStartLineNumber:r,selectionStartColumn:s}=o;n=[new gt(r,s,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(o=>o.containsPosition(t)?new gt(t.lineNumber,t.column,t.lineNumber,t.column):o);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(J1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Qg.ID,new x1t(this._dragSelection,t,J1(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 V(e.lineNumber,e.column,e.lineNumber,e.column),options:Qg._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()}}Qg.ID="editor.contrib.dragAndDrop";Qg.TRIGGER_KEY_VALUE=Nn?6:5;Qg._DECORATION_OPTIONS=Jt.register({description:"dnd-target",className:"dnd-target"});Un(Qg.ID,Qg,2);const bF=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let o=0;oTwe(this,void 0,void 0,function*(){return i}),asFile:()=>{},value:typeof i=="string"?i:void 0}}function L1t(i,e,t){const n={id:bF(),name:i,uri:e,data:t};return{asString:()=>Twe(this,void 0,void 0,function*(){return""}),asFile:()=>n,value:void 0}}class Nwe{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 vn.some(this,([n,o])=>o.asFile())&&t.push("files"),Mwe(CO(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 n=this._entries.get(e);n?n.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 n of t)yield[e,n]}toKey(e){return CO(e)}}function CO(i){return i.toLowerCase()}function Rwe(i,e){return Mwe(CO(i),e.map(CO))}function Mwe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,o,r]=t;return r==="*"?e.some(s=>s.startsWith(o+"/")):!1}const CF=Object.freeze({create:i=>bv(i.map(e=>e.toString())).join(`\r + *-----------------------------------------------------------------------------*/var d_t=Object.defineProperty,u_t=Object.getOwnPropertyDescriptor,h_t=Object.getOwnPropertyNames,f_t=Object.prototype.hasOwnProperty,kle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of h_t(e))!f_t.call(i,o)&&o!==t&&d_t(i,o,{get:()=>e[o],enumerable:!(n=u_t(e,o))||n.enumerable});return i},g_t=(i,e,t)=>(kle(i,e,"default"),t&&kle(t,e,"default")),p_t="5.0.2",Hw={};g_t(Hw,gT);var vye=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(vye||{}),_ye=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(_ye||{}),bye=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(bye||{}),Cye=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(Cye||{}),yye=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(yye||{}),wye=class{constructor(i,e,t,n,o){bt(this,"_onDidChange",new Hw.Emitter);bt(this,"_onDidExtraLibsChange",new Hw.Emitter);bt(this,"_extraLibs");bt(this,"_removedExtraLibs");bt(this,"_eagerModelSync");bt(this,"_compilerOptions");bt(this,"_diagnosticsOptions");bt(this,"_workerOptions");bt(this,"_onDidExtraLibsChangeTimeout");bt(this,"_inlayHintsOptions");bt(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(o),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(i,e){let t;if(typeof e=="undefined"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let o=this._extraLibs[t];!o||o.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let o=1;this._removedExtraLibs[t]&&(o=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:o}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},m_t=p_t,Sye={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},xye=new wye({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Sye),Lye=new wye({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Sye),v_t=()=>sF().then(i=>i.getTypeScriptWorker()),__t=()=>sF().then(i=>i.getJavaScriptWorker());Hw.languages.typescript={ModuleKind:vye,JsxEmit:_ye,NewLineKind:bye,ScriptTarget:Cye,ModuleResolutionKind:yye,typescriptVersion:m_t,typescriptDefaults:xye,javascriptDefaults:Lye,getTypeScriptWorker:v_t,getJavaScriptWorker:__t};function sF(){return wt(()=>import("./tsMode.ec11a955.js"),[])}Hw.languages.onLanguage("typescript",()=>sF().then(i=>i.setupTypeScript(xye)));Hw.languages.onLanguage("javascript",()=>sF().then(i=>i.setupJavaScript(Lye)));class b_t extends ec{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:C("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Xe.map,toggled:Me.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Me.has("isInDiffEditor"),menu:{when:Me.has("isInDiffEditor"),id:Z.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}}$i(b_t);class Eye extends ec{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:C("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:Me.has("isInDiffEditor")})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",o)}}$i(Eye);class Dye extends ec{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:C("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:Me.has("isInDiffEditor")})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}}$i(Dye);Hr.appendMenuItem(Z.EditorTitle,{command:{id:new Dye().desc.id,title:C("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Me.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Me.has("isInDiffEditor")},order:11,group:"1_diff",when:Me.and(Q.diffEditorRenderSideBySideInlineBreakpointReached,Me.has("isInDiffEditor"))});Hr.appendMenuItem(Z.EditorTitle,{command:{id:new Eye().desc.id,title:C("showMoves","Show Moved Code Blocks"),icon:Xe.move,toggled:_S.create("config.diffEditor.experimental.showMoves",!0),precondition:Me.has("isInDiffEditor")},order:10,group:"1_diff",when:Me.has("isInDiffEditor")});const aF={value:C("diffEditor","Diff Editor"),original:"Diff Editor"};class C_t extends lh{constructor(){super({id:"diffEditor.switchSide",title:{value:C("switchSide","Switch Side"),original:"Switch Side"},icon:Xe.arrowSwap,precondition:Me.has("isInDiffEditor"),f1:!0,category:aF})}runEditorCommand(e,t,n){const o=NS(e);if(o instanceof ub){if(n&&n.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}}$i(C_t);class y_t extends lh{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:C("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:Xe.close,precondition:Q.comparingMovedCode,f1:!1,category:aF,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const o=NS(e);o instanceof ub&&o.exitCompareMove()}}$i(y_t);class w_t extends lh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:C("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Xe.fold,precondition:Me.has("isInDiffEditor"),f1:!0,category:aF})}runEditorCommand(e,t,...n){const o=NS(e);o instanceof ub&&o.collapseAllUnchangedRegions()}}$i(w_t);class S_t extends lh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:C("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Xe.unfold,precondition:Me.has("isInDiffEditor"),f1:!0,category:aF})}runEditorCommand(e,t,...n){const o=NS(e);o instanceof ub&&o.showAllUnchangedRegions()}}$i(S_t);const kye={value:C("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class TS extends ec{constructor(){super({id:TS.id,title:{value:C("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:kye,precondition:Me.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=NS(e);t==null||t.accessibleDiffViewerNext()}}TS.id="editor.action.accessibleDiffViewer.next";Hr.appendMenuItem(Z.EditorTitle,{command:{id:TS.id,title:C("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Me.has("isInDiffEditor")},order:10,group:"2_diff",when:Me.and(Q.accessibleDiffViewerVisible.negate(),Me.has("isInDiffEditor"))});class mT extends ec{constructor(){super({id:mT.id,title:{value:C("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:kye,precondition:Me.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=NS(e);t==null||t.accessibleDiffViewerPrev()}}mT.id="editor.action.accessibleDiffViewer.prev";function NS(i){var e;const t=i.get(Jn),n=t.listDiffEditors(),o=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!o)return null;for(let s=0,a=n.length;s=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},E_t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lF=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},hz;const cF=new lt("selectionAnchorSet",!1);let up=hz=class{static get(e){return e.getContribution(hz.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=cF.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(gt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new os().appendText(C("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Cs(C("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(gt.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()}};up.ID="editor.contrib.selectionAnchorController";up=hz=L_t([E_t(1,Ut)],up);class D_t extends ft{constructor(){super({id:"editor.action.setSelectionAnchor",label:C("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2080),weight:100}})}run(e,t){var n;return lF(this,void 0,void 0,function*(){(n=up.get(t))===null||n===void 0||n.setSelectionAnchor()})}}class k_t extends ft{constructor(){super({id:"editor.action.goToSelectionAnchor",label:C("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:cF})}run(e,t){var n;return lF(this,void 0,void 0,function*(){(n=up.get(t))===null||n===void 0||n.goToSelectionAnchor()})}}class I_t extends ft{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:C("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:cF,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2089),weight:100}})}run(e,t){var n;return lF(this,void 0,void 0,function*(){(n=up.get(t))===null||n===void 0||n.selectFromAnchorToCursor()})}}class T_t extends ft{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:C("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:cF,kbOpts:{kbExpr:Q.editorTextFocus,primary:9,weight:100}})}run(e,t){var n;return lF(this,void 0,void 0,function*(){(n=up.get(t))===null||n===void 0||n.cancelSelectionAnchor()})}}Un(up.ID,up,4);ze(D_t);ze(k_t);ze(I_t);ze(T_t);const N_t=J("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},C("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class R_t extends ft{constructor(){super({id:"editor.action.jumpToBracket",label:C("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=Rd.get(t))===null||n===void 0||n.jumpToBracket()}}class M_t extends ft{constructor(){super({id:"editor.action.selectToBracket",label:C("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,n){var o;let r=!0;n&&n.selectBrackets===!1&&(r=!1),(o=Rd.get(t))===null||o===void 0||o.selectToBracket(r)}}class A_t extends ft{constructor(){super({id:"editor.action.removeBrackets",label:C("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=Rd.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class P_t{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class Rd extends _e{static get(e){return e.getContribution(Rd.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new bi(()=>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(n=>{const o=n.getStartPosition(),r=e.bracketPairs.matchBracket(o);let s=null;if(r)r[0].containsPosition(o)&&!r[1].containsPosition(o)?s=r[1].getStartPosition():r[1].containsPosition(o)&&(s=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(o);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(o);l&&l.range&&(s=l.range.getStartPosition())}}return s?new gt(s.lineNumber,s.column,s.lineNumber,s.column):new gt(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(o=>{const r=o.getStartPosition();let s=t.bracketPairs.matchBracket(r);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(r),!s)){const c=t.bracketPairs.findNextBracket(r);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(V.compareRangesUsingStarts);const[c,d]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(r)){const u=a;a=l,l=u}}a&&l&&n.push(new gt(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const o=n.getPosition();let r=t.bracketPairs.matchBracket(o);r||(r=t.bracketPairs.findEnclosingBrackets(o)),r&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:r[0],text:""},{range:r[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const n of this._lastBracketsData){const o=n.brackets;o&&(e[t++]={range:o[0],options:n.options},e[t++]={range:o[1],options:n.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(),n=t.getVersionId();let o=[];this._lastVersionId===n&&(o=this._lastBracketsData);const r=[];let s=0;for(let u=0,h=e.length;u1&&r.sort(ae.compare);const a=[];let l=0,c=0;const d=o.length;for(let u=0,h=r.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}}ze(W_t);var V_t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const fb="9_cutcopypaste",H_t=Fu||document.queryCommandSupported("cut"),Tye=Fu||document.queryCommandSupported("copy"),$_t=typeof navigator.clipboard=="undefined"||Fc?document.queryCommandSupported("paste"):!0;function sY(i){return i.register(),i}const z_t=H_t?sY(new CS({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Fu?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:Z.EditorContext,group:fb,title:C("actions.clipboard.cutLabel","Cut"),when:Q.writable,order:1},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.cutLabel","Cut"),order:1},{menuId:Z.SimpleEditorContext,group:fb,title:C("actions.clipboard.cutLabel","Cut"),when:Q.writable,order:1}]})):void 0,U_t=Tye?sY(new CS({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Fu?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:Z.EditorContext,group:fb,title:C("actions.clipboard.copyLabel","Copy"),order:2},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.copyLabel","Copy"),order:1},{menuId:Z.SimpleEditorContext,group:fb,title:C("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Hr.appendMenuItem(Z.MenubarEditMenu,{submenu:Z.MenubarCopy,title:{value:C("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextCopy,title:{value:C("copy as","Copy As"),original:"Copy As"},group:fb,order:3});Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1,when:Me.and(Me.notEquals("resourceScheme","output"),Q.editorTextFocus)});Hr.appendMenuItem(Z.EditorTitleContext,{submenu:Z.EditorTitleContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1});Hr.appendMenuItem(Z.ExplorerContext,{submenu:Z.ExplorerContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1});const J9=$_t?sY(new CS({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Fu?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:Z.EditorContext,group:fb,title:C("actions.clipboard.pasteLabel","Paste"),when:Q.writable,order:4},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:Z.SimpleEditorContext,group:fb,title:C("actions.clipboard.pasteLabel","Paste"),when:Q.writable,order:4}]})):void 0;class j_t extends ft{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:C("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(bH.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),bH.forceCopyWithSyntaxHighlighting=!1)}}function Nye(i,e){!i||(i.addImplementation(1e4,"code-editor",(t,n)=>{const o=t.get(Jn).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const r=o.getOption(37),s=o.getSelection();return s&&s.isEmpty()&&!r||o.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(t5().execCommand(e),!0)))}Nye(z_t,"cut");Nye(U_t,"copy");J9&&(J9.addImplementation(1e4,"code-editor",(i,e)=>{const t=i.get(Jn),n=i.get(Sp),o=t.getFocusedCodeEditor();return o&&o.hasTextFocus()?!o.getContainerDomNode().ownerDocument.execCommand("paste")&&Xv?(()=>V_t(void 0,void 0,void 0,function*(){const s=yield n.readText();if(s!==""){const a=tk.INSTANCE.get(s);let l=!1,c=null,d=null;a&&(l=o.getOption(37)&&!!a.isFromEmptySelection,c=typeof a.multicursorText!="undefined"?a.multicursorText:null,d=a.mode),o.trigger("keyboard","paste",{text:s,pasteOnNewLine:l,multicursorText:c,mode:d})}}))():!0:!1}),J9.addImplementation(0,"generic-dom",(i,e)=>(t5().execCommand("paste"),!0)));Tye&&ze(j_t);var K_t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Wt{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+Wt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Wt(this.value+Wt.sep+e)}}Wt.sep=".";Wt.None=new Wt("@@none@@");Wt.Empty=new Wt("");Wt.QuickFix=new Wt("quickfix");Wt.Refactor=new Wt("refactor");Wt.RefactorExtract=Wt.Refactor.append("extract");Wt.RefactorInline=Wt.Refactor.append("inline");Wt.RefactorMove=Wt.Refactor.append("move");Wt.RefactorRewrite=Wt.Refactor.append("rewrite");Wt.Notebook=new Wt("notebook");Wt.Source=new Wt("source");Wt.SourceOrganizeImports=Wt.Source.append("organizeImports");Wt.SourceFixAll=Wt.Source.append("fixAll");Wt.SurroundWith=Wt.Refactor.append("surround");var fl;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(fl||(fl={}));function q_t(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>Rye(e,t,i.include))||!i.includeSourceActions&&Wt.Source.contains(e))}function G_t(i,e){const t=e.kind?new Wt(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>Rye(t,n,i.include))||!i.includeSourceActions&&t&&Wt.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function Rye(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class Hh{static fromUser(e,t){return!e||typeof e!="object"?new Hh(t.kind,t.apply,!1):new Hh(Hh.getKindFromUser(e,t.kind),Hh.getApplyFromUser(e,t.apply),Hh.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 Wt(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class X_t{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}resolve(e){var t;return K_t(this,void 0,void 0,function*(){if(((t=this.provider)===null||t===void 0?void 0:t.resolveCodeAction)&&!this.action.edit){let n;try{n=yield this.provider.resolveCodeAction(this.action,e)}catch(o){$o(o)}n&&(this.action.edit=n.edit)}return this})}}var cO=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Mye="editor.action.codeAction",aY="editor.action.quickFix",Aye="editor.action.autoFix",Pye="editor.action.refactor",Oye="editor.action.sourceAction",lY="editor.action.organizeImports",cY="editor.action.fixAll";class NE extends _e{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return ws(e.diagnostics)?ws(t.diagnostics)?NE.codeActionsPreferredComparator(e,t):-1:ws(t.diagnostics)?1:NE.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(NE.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Wt.QuickFix.contains(new Wt(e.kind))&&!!e.isPreferred)}}const Ile={actions:[],documentation:void 0};function RE(i,e,t,n,o,r){var s;return cO(this,void 0,void 0,function*(){const a=n.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],Wt.Notebook]}),c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:n.type},d=new eY(e,r),u=n.type===2,h=Y_t(i,e,u?l:a),f=new Be,g=h.map(v=>cO(this,void 0,void 0,function*(){try{o.report(v);const m=yield v.provideCodeActions(e,t,c,d.token);if(m&&f.add(m),d.token.isCancellationRequested)return Ile;const _=((m==null?void 0:m.actions)||[]).filter(w=>w&&G_t(a,w)),y=Q_t(v,_,a.include);return{actions:_.map(w=>new X_t(w,v)),documentation:y}}catch(m){if(sh(m))throw m;return $o(m),Ile}})),p=i.onDidChange(()=>{const v=i.all(e);Lo(v,h)||d.cancel()});try{const v=yield Promise.all(g),m=v.map(y=>y.actions).flat(),_=[...hf(v.map(y=>y.documentation)),...Z_t(i,e,n,m)];return new NE(m,_,f)}finally{p.dispose(),d.dispose()}})}function Y_t(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(o=>q_t(t,new Wt(o))):!0)}function*Z_t(i,e,t,n){var o,r,s;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)===null||o===void 0?void 0:o.call(a,{trigger:t.type,only:(s=(r=t.filter)===null||r===void 0?void 0:r.include)===null||s===void 0?void 0:s.value},n.map(l=>l.action)))}function Q_t(i,e,t){if(!i.documentation)return;const n=i.documentation.map(o=>({kind:new Wt(o.kind),command:o.command}));if(t){let o;for(const r of n)r.kind.contains(t)&&(o?o.kind.contains(r.kind)&&(o=r):o=r);if(o)return o==null?void 0:o.command}for(const o of e)if(!!o.kind){for(const r of n)if(r.kind.contains(new Wt(o.kind)))return r.command}}var dO;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions"})(dO||(dO={}));function J_t(i,e,t,n,o=_n.None){var r;return cO(this,void 0,void 0,function*(){const s=i.get(oT),a=i.get(_o),l=i.get(tc),c=i.get(Ao);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(o),!o.isCancellationRequested&&!(!((r=e.action.edit)===null||r===void 0)&&r.edits.length&&!(yield s.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==dO.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const u=e0t(d);c.error(typeof u=="string"?u:C("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function e0t(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}Rn.registerCommand("_executeCodeActionProvider",function(i,e,t,n,o){return cO(this,void 0,void 0,function*(){if(!(e instanceof Rt))throw Mc();const{codeActionProvider:r}=i.get(pt),s=i.get(Yi).getModel(e);if(!s)throw Mc();const a=gt.isISelection(t)?gt.liftSelection(t):V.isIRange(t)?s.validateRange(t):void 0;if(!a)throw Mc();const l=typeof n=="string"?new Wt(n):void 0,c=yield RE(r,s,a,{type:1,triggerAction:fl.Default,filter:{includeSourceActions:!0,include:l}},Xg.None,_n.None),d=[],u=Math.min(c.validActions.length,typeof o=="number"?o:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}})});var t0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},n0t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fz;let uO=fz=class{constructor(e){this.keybindingService=e}getResolver(){const e=new ah(()=>this.keybindingService.getKeybindings().filter(t=>fz.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let n=t.commandArgs;return t.command===lY?n={kind:Wt.SourceOrganizeImports.value}:t.command===cY&&(n={kind:Wt.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Hh.fromUser(n,{kind:Wt.None,apply:"never"}))}));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.value);return n==null?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new Wt(e.kind);return t.filter(o=>o.kind.contains(n)).filter(o=>o.preferred?e.isPreferred:!0).reduceRight((o,r)=>o?o.kind.contains(r.kind)?r:o:r,void 0)}};uO.codeActionCommands=[Pye,Mye,Oye,lY,cY];uO=fz=t0t([n0t(0,xi)],uO);J("symbolIcon.arrayForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.booleanForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.colorForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.constantForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.fileForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.folderForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.keyForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.keywordForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.moduleForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.namespaceForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.nullForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.numberForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.objectForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.operatorForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.packageForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.propertyForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.referenceForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.snippetForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.stringForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.structForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.textForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.typeParameterForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.unitForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const Fye=Object.freeze({kind:Wt.Empty,title:C("codeAction.widget.id.more","More Actions...")}),i0t=Object.freeze([{kind:Wt.QuickFix,title:C("codeAction.widget.id.quickfix","Quick Fix")},{kind:Wt.RefactorExtract,title:C("codeAction.widget.id.extract","Extract"),icon:Xe.wrench},{kind:Wt.RefactorInline,title:C("codeAction.widget.id.inline","Inline"),icon:Xe.wrench},{kind:Wt.RefactorRewrite,title:C("codeAction.widget.id.convert","Rewrite"),icon:Xe.wrench},{kind:Wt.RefactorMove,title:C("codeAction.widget.id.move","Move"),icon:Xe.wrench},{kind:Wt.SurroundWith,title:C("codeAction.widget.id.surround","Surround With"),icon:Xe.symbolSnippet},{kind:Wt.Source,title:C("codeAction.widget.id.source","Source Action"),icon:Xe.symbolFile},Fye]);function o0t(i,e,t){if(!e)return i.map(r=>{var s;return{kind:"action",item:r,group:Fye,disabled:!!r.action.disabled,label:r.action.disabled||r.action.title,canPreview:!!(!((s=r.action.edit)===null||s===void 0)&&s.edits.length)}});const n=i0t.map(r=>({group:r,actions:[]}));for(const r of i){const s=r.action.kind?new Wt(r.action.kind):Wt.None;for(const a of n)if(a.group.kind.contains(s)){a.actions.push(r);break}}const o=[];for(const r of n)if(r.actions.length){o.push({kind:"header",group:r.group});for(const s of r.actions)o.push({kind:"action",item:s,group:r.group,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}return o}var r0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},s0t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gz,ZC;(function(i){i.Hidden={type:0};class e{constructor(n,o,r,s){this.actions=n,this.trigger=o,this.editorPosition=r,this.widgetPosition=s,this.type=1}}i.Showing=e})(ZC||(ZC={}));let gb=gz=class extends _e{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new le),this.onClick=this._onClick.event,this._state=ZC.Hidden,this._domNode=He("div.lightBulbWidget"),this._register(Ei.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(WQe(this._domNode,n=>{if(this.state.type!==1)return;this._editor.focus(),n.preventDefault();const{top:o,height:r}=Yo(this._domNode),s=this._editor.getOption(66);let a=Math.floor(s/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(n.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(st.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var n,o,r,s;this._preferredKbLabel=(o=(n=t.lookupKeybinding(Aye))===null||n===void 0?void 0:n.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(s=(r=t.lookupKeybinding(aY))===null||r===void 0?void 0:r.getLabel())!==null&&s!==void 0?s: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,n){if(e.validActions.length<=0)return this.hide();const o=this._editor.getOptions();if(!o.get(64).enabled)return this.hide();const r=this._editor.getModel();if(!r)return this.hide();const{lineNumber:s,column:a}=r.validatePosition(n),l=r.getOptions().tabSize,c=o.get(50),d=r.getLineContent(s),u=S5(d,l),h=c.spaceWidth*u>22,f=p=>p>2&&this._editor.getTopForLineNumber(p)===this._editor.getTopForLineNumber(p-1);let g=s;if(!h){if(s>1&&!f(s-1))g-=1;else if(!f(s+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new ZC.Showing(e,t,n,{position:{lineNumber:g,column:1},preference:gz._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==ZC.Hidden&&(this.state=ZC.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(...Mt.asClassNameArray(Xe.lightBulb)),this._domNode.classList.add(...Mt.asClassNameArray(Xe.lightbulbAutofix)),this._preferredKbLabel)){this.title=C("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Mt.asClassNameArray(Xe.lightbulbAutofix)),this._domNode.classList.add(...Mt.asClassNameArray(Xe.lightBulb)),this._quickFixKbLabel?this.title=C("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=C("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};gb.ID="editor.contrib.lightbulbWidget";gb._posPref=[0];gb=gz=r0t([s0t(1,xi)],gb);var a0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Tle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Bye=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},pz;let hp=pz=class{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new le,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const o=new Be,r=o.add(P5(e,Object.assign(Object.assign({},this._getRenderOptions(e,o)),t),n));return r.element.classList.add("rendered-markdown"),{element:r.element,dispose:()=>o.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(n,o)=>Bye(this,void 0,void 0,function*(){var r,s,a;let l;n?l=this._languageService.getLanguageIdByLanguageName(n):this._options.editor&&(l=(r=this._options.editor.getModel())===null||r===void 0?void 0:r.getLanguageId()),l||(l=Gl);const c=yield mlt(this._languageService,o,l),d=document.createElement("span");if(d.innerHTML=(a=(s=pz._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const u=this._options.editor.getOption(50);ss(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:n=>Wye(this._openerService,n,e.isTrusted),disposables:t}}}};hp._ttpTokenizer=_p("tokenizeToString",{createHTML(i){return i}});hp=pz=a0t([Tle(1,Ki),Tle(2,ml)],hp);function Wye(i,e,t){return Bye(this,void 0,void 0,function*(){try{return yield i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:l0t(t)})}catch(n){return en(n),!1}})}function l0t(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var c0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Nle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},LM;let cl=LM=class{static get(e){return e.getContribution(LM.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Kr,this._messageListeners=new Be,this._mouseOverMessage=!1,this._editor=e,this._visible=LM.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){Cs(Jm(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Jm(e)?P5(e,{actionHandler:{callback:o=>Wye(this._openerService,o,Jm(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Rle(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(st.debounce(this._editor.onDidBlurEditorText,(o,r)=>r,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&rs(Nd(),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(ke(this._messageWidget.value.getDomNode(),et.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ke(this._messageWidget.value.getDomNode(),et.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(o=>{!o.target.position||(n?n.containsPosition(o.target.position)||this.closeMessage():n=new V(t.lineNumber-3,1,o.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Rle.fadeOut(this._messageWidget.value))}};cl.ID="editor.contrib.messageController";cl.MESSAGE_VISIBLE=new lt("messageVisible",!1,C("messageVisible","Whether the editor is currently showing an inline message"));cl=LM=c0t([Nle(1,Ut),Nle(2,ml)],cl);const d0t=Ir.bindToContribution(cl.get);Ye(new d0t({id:"leaveEditorMessage",precondition:cl.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:100+30,primary:9}}));class Rle{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener("animationend",t)},n=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:n},o){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const r=document.createElement("div");r.classList.add("anchor","top"),this._domNode.appendChild(r);const s=document.createElement("div");typeof o=="string"?(s.classList.add("message"),s.textContent=o):(o.classList.add("message"),s.appendChild(o)),this._domNode.appendChild(s);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)}}Un(cl.ID,cl,4);var Vye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},mz=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},u0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Hye="acceptSelectedCodeAction",$ye="previewSelectedCodeAction";class h0t{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,n){var o,r;n.text.textContent=(r=(o=e.group)===null||o===void 0?void 0:o.title)!==null&&r!==void 0?r:""}disposeTemplate(e){}}let vz=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 n=document.createElement("span");n.className="title",e.append(n);const o=new cT(e,Vl);return{container:e,icon:t,text:n,keybinding:o}}renderElement(e,t,n){var o,r,s;if(!((o=e.group)===null||o===void 0)&&o.icon?(n.icon.className=Mt.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=ct(e.group.icon.color.id))):(n.icon.className=Mt.asClassName(Xe.lightBulb),n.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;n.text.textContent=zye(e.label),n.keybinding.set(e.keybinding),YQe(!!e.keybinding,n.keybinding.element);const a=(r=this._keybindingService.lookupKeybinding(Hye))===null||r===void 0?void 0:r.getLabel(),l=(s=this._keybindingService.lookupKeybinding($ye))===null||s===void 0?void 0:s.getLabel();n.container.classList.toggle("option-disabled",e.disabled),e.disabled?n.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?n.container.title=C({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):n.container.title=C({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):n.container.title=""}disposeTemplate(e){}};vz=Vye([mz(1,xi)],vz);class f0t extends UIEvent{constructor(){super("acceptSelectedAction")}}class Mle extends UIEvent{constructor(){super("previewSelectedAction")}}function g0t(i){if(i.kind==="action")return i.label}let _z=class extends _e{constructor(e,t,n,o,r,s){super(),this._delegate=o,this._contextViewService=r,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Ro),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 qd(e,this.domNode,a,[new vz(t,this._keybindingService),new h0t],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:g0t},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?zye(l==null?void 0:l.label):"";return l.disabled&&(c=C({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>C({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(qb),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=n,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,o=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(o);const r=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}),s=Math.max(...r,e),a=.7,l=Math.min(o,document.body.clientHeight*a);return this._list.layout(l,s),this.domNode.style.height=`${l}px`,this._list.domFocus(),s}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 n=t[0],o=this._list.element(n);if(!this.focusCondition(o))return;const r=e?new Mle:new f0t;this._list.setSelection([n],r)}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 Mle):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const n=this._list.getFocus();if(n.length===0)return;const o=n[0],r=this._list.element(o);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,r.item)}onListHover(e){return u0t(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 n=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=n?n.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([])}};_z=Vye([mz(4,Cp),mz(5,xi)],_z);function zye(i){return i.replace(/\r\n|\r|\n/g," ")}var p0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},e7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};J("actionBar.toggledBackground",{dark:f0,light:f0,hcDark:f0,hcLight:f0},C("actionBar.toggledBackground","Background color for toggled action items in action bar."));const pb={Visible:new lt("codeActionMenuVisible",!1,C("codeActionMenuVisible","Whether the action widget list is visible"))},Qb=yn("actionWidgetService");let mb=class extends _e{get isVisible(){return pb.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Kr)}show(e,t,n,o,r,s,a){const l=pb.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(_z,e,t,n,o);this._contextViewService.showContextView({getAnchor:()=>r,render:d=>(l.set(!0),this._renderWidget(d,c,a!=null?a:[])),onHide:d=>{l.reset(),this._onWidgetClosed(d)}},s,!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,n){var o;const r=document.createElement("div");if(r.classList.add("action-widget"),e.appendChild(r),this._list.value=t,this._list.value)r.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Be,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(ke(l,et.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),d=e.appendChild(c);d.classList.add("context-view-pointerBlock"),s.add(ke(d,et.POINTER_MOVE,()=>d.remove())),s.add(ke(d,et.MOUSE_DOWN,()=>d.remove()));let u=0;if(n.length){const g=this._createActionBar(".action-widget-action-bar",n);g&&(r.appendChild(g.getContainer().parentElement),s.add(g),u=g.getContainer().offsetWidth)}const h=(o=this._list.value)===null||o===void 0?void 0:o.layout(u);r.style.width=`${h}px`;const f=s.add(pf(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const n=He(e),o=new zc(n);return o.push(t,{icon:!1,label:!0}),o}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};mb=p0t([e7(0,Cp),e7(1,Ut),e7(2,$t)],mb);Mn(Qb,mb,1);const vT=100+1e3;$i(class extends ec{constructor(){super({id:"hideCodeActionWidget",title:{value:C("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:pb.Visible,keybinding:{weight:vT,primary:9,secondary:[1033]}})}run(i){i.get(Qb).hide()}});$i(class extends ec{constructor(){super({id:"selectPrevCodeAction",title:{value:C("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:pb.Visible,keybinding:{weight:vT,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(Qb);e instanceof mb&&e.focusPrevious()}});$i(class extends ec{constructor(){super({id:"selectNextCodeAction",title:{value:C("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:pb.Visible,keybinding:{weight:vT,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(Qb);e instanceof mb&&e.focusNext()}});$i(class extends ec{constructor(){super({id:Hye,title:{value:C("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:pb.Visible,keybinding:{weight:vT,primary:3,secondary:[2137]}})}run(i){const e=i.get(Qb);e instanceof mb&&e.acceptSelected()}});$i(class extends ec{constructor(){super({id:$ye,title:{value:C("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:pb.Visible,keybinding:{weight:vT,primary:2051}})}run(i){const e=i.get(Qb);e instanceof mb&&e.acceptSelected(!0)}});var m0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Uye=new lt("supportedCodeAction","");class v0t extends _e{constructor(e,t,n,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=o,this._autoTriggerTimer=this._register(new zd),this._register(this._markerService.onMarkerChanged(r=>this._onMarkerChanges(r))),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(n=>zG(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:fl.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&e.type===2){const{lineNumber:o,column:r}=n.getPosition(),s=t.getLineContent(o);if(s.length===0)return;if(r===1){if(/\s/.test(s[0]))return}else if(r===t.getLineMaxColumn(o)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[r-2])&&/\s/.test(s[r-1]))return}return n}}var X_;(function(i){i.Empty={type:0};class e{constructor(n,o,r){this.trigger=n,this.position=o,this._cancellablePromise=r,this.type=1,this.actions=r.catch(s=>{if(sh(s))return jye;throw s})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(X_||(X_={}));const jye=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class _0t extends _e{constructor(e,t,n,o,r,s){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=r,this._configurationService=s,this._codeActionOracle=this._register(new Kr),this._state=X_.Empty,this._onDidChangeState=this._register(new le),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Uye.bindTo(o),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(X_.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(X_.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(n=>{var o;return(o=n.providedCodeActionKinds)!==null&&o!==void 0?o:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new v0t(this._editor,this._markerService,n=>{var o;if(!n){this.setState(X_.Empty);return}const r=n.selection.getStartPosition(),s=sr(a=>m0t(this,void 0,void 0,function*(){var l,c,d,u,h,f;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===fl.QuickFix||((c=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0?void 0:c.contains(Wt.QuickFix)))){const g=yield RE(this._registry,e,n.selection,n.trigger,Xg.None,a);if(a.isCancellationRequested)return jye;if(!((d=g.validActions)===null||d===void 0?void 0:d.some(v=>v.action.kind?Wt.QuickFix.contains(new Wt(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const m=n.selection.getPosition();let _=m,y=Number.MAX_VALUE,w=!1;for(const L of v){const D=L.endColumn,E=L.endLineNumber,I=L.startLineNumber;(E===m.lineNumber||I===m.lineNumber)&&Math.abs(m.column-D){k.highlightRange=k.action.isPreferred}),I.push(...E.validActions)),{validActions:I,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return RE(this._registry,e,n.selection,n.trigger,Xg.None,a)}));n.trigger.type===1&&((o=this._progressService)===null||o===void 0||o.showWhile(s,250)),this.setState(new X_.Triggered(n.trigger,r,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:fl.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 b0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Xx=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},EM;const C0t="quickfix-edit-highlight";let Pv=EM=class extends _e{static get(e){return e.getContribution(EM.ID)}constructor(e,t,n,o,r,s,a,l,c,d){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._activeCodeActions=this._register(new Kr),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new _0t(this._editor,r.codeActionProvider,t,n,s,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new ah(()=>{const u=this._editor.getContribution(gb.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=o.createInstance(uO),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,o){var r;if(!this._editor.hasModel())return;(r=cl.get(this._editor))===null||r===void 0||r.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:o,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,n){return Xx(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(J_t,e,dO.FromCodeActions,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:fl.QuickFix,filter:{}})}})}update(e){var t,n,o,r,s,a,l;return Xx(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){en(d);return}if(!this._disposed)if((n=this._lightBulbWidget.value)===null||n===void 0||n.update(c,e.trigger,e.position),e.trigger.type===1){if(!((o=e.trigger.filter)===null||o===void 0)&&o.include){const u=this.tryGetValidActionToApply(e.trigger,c);if(u){try{(r=this._lightBulbWidget.value)===null||r===void 0||r.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){(s=cl.get(this._editor))===null||s===void 0||s.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=cl.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:n})=>n.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,n){return Xx(this,void 0,void 0,function*(){const o=this._editor.createDecorationsCollection(),r=this._editor.getDomNode();if(!r)return;const s=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=ae.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,d)=>Xx(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!d),this._actionWidgetService.hide(),o.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),o.clear()},onHover:(c,d)=>Xx(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:EM.DECORATION}];o.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;kv(C("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else o.clear()}};this._actionWidgetService.show("codeActionWidget",!0,o0t(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,r,this._getActionBarActions(e,t,n))})}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),n=Yo(this._editor.getDomNode()),o=n.left+t.left,r=n.top+t.top+t.height;return{x:o,y:r}}_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,n){if(n.fromLightbulb)return[];const o=e.documentation.map(r=>{var s;return{id:r.id,label:r.title,tooltip:(s=r.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(r.id,...(a=r.arguments)!==null&&a!==void 0?a:[])}}});return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&o.push(this._showDisabled?{id:"hideMoreActions",label:C("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:"showMoreActions",label:C("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),o}};Pv.ID="editor.contrib.codeActionController";Pv.DECORATION=Jt.register({description:"quickfix-highlight",className:C0t});Pv=EM=b0t([eg(1,Rf),eg(2,Ut),eg(3,$t),eg(4,pt),eg(5,t_),eg(6,_o),eg(7,En),eg(8,Qb),eg(9,$t)],Pv);jd((i,e)=>{((o,r)=>{r&&e.addRule(`.monaco-editor ${o} { background-color: ${r}; }`)})(".quickfix-edit-highlight",i.getColor(Jh));const n=i.getColor(Em);n&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Hu(i.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)});function _T(i){return Me.regex(Uye.keys()[0],new RegExp("(\\s|^)"+Xl(i.value)+"\\b"))}const dY={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:C("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:C("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[C("args.schema.apply.first","Always apply the first returned code action."),C("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),C("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:C("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function Jb(i,e,t,n,o=fl.Default){if(i.hasModel()){const r=Pv.get(i);r==null||r.manualTriggerAtCurrentPosition(e,o,t,n)}}class y0t extends ft{constructor(){super({id:aY,label:C("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),kbOpts:{kbExpr:Q.textInputFocus,primary:2137,weight:100}})}run(e,t){return Jb(t,C("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,fl.QuickFix)}}class w0t extends Ir{constructor(){super({id:Mye,precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:dY}]}})}runEditorCommand(e,t,n){const o=Hh.fromUser(n,{kind:Wt.Empty,apply:"ifSingle"});return Jb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):C("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):o.preferred?C("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):C("editor.action.codeAction.noneMessage","No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}}class S0t extends ft{constructor(){super({id:Pye,label:C("refactor.label","Refactor..."),alias:"Refactor...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),kbOpts:{kbExpr:Q.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Me.and(Q.writable,_T(Wt.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:dY}]}})}run(e,t,n){const o=Hh.fromUser(n,{kind:Wt.Refactor,apply:"never"});return Jb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):C("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):o.preferred?C("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):C("editor.action.refactor.noneMessage","No refactorings available"),{include:Wt.Refactor.contains(o.kind)?o.kind:Wt.None,onlyIncludePreferredActions:o.preferred},o.apply,fl.Refactor)}}class x0t extends ft{constructor(){super({id:Oye,label:C("source.label","Source Action..."),alias:"Source Action...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Me.and(Q.writable,_T(Wt.Source))},description:{description:"Source Action...",args:[{name:"args",schema:dY}]}})}run(e,t,n){const o=Hh.fromUser(n,{kind:Wt.Source,apply:"never"});return Jb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):C("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):o.preferred?C("editor.action.source.noneMessage.preferred","No preferred source actions available"):C("editor.action.source.noneMessage","No source actions available"),{include:Wt.Source.contains(o.kind)?o.kind:Wt.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,fl.SourceAction)}}class L0t extends ft{constructor(){super({id:lY,label:C("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:Me.and(Q.writable,_T(Wt.SourceOrganizeImports)),kbOpts:{kbExpr:Q.textInputFocus,primary:1581,weight:100}})}run(e,t){return Jb(t,C("editor.action.organize.noneMessage","No organize imports action available"),{include:Wt.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",fl.OrganizeImports)}}class E0t extends ft{constructor(){super({id:cY,label:C("fixAll.label","Fix All"),alias:"Fix All",precondition:Me.and(Q.writable,_T(Wt.SourceFixAll))})}run(e,t){return Jb(t,C("fixAll.noneMessage","No fix all action available"),{include:Wt.SourceFixAll,includeSourceActions:!0},"ifSingle",fl.FixAll)}}class D0t extends ft{constructor(){super({id:Aye,label:C("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:Me.and(Q.writable,_T(Wt.QuickFix)),kbOpts:{kbExpr:Q.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Jb(t,C("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Wt.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",fl.AutoFix)}}Un(Pv.ID,Pv,3);Un(gb.ID,gb,4);ze(y0t);ze(S0t);ze(x0t);ze(L0t);ze(D0t);ze(E0t);Ye(new w0t);no.as(ch.Configuration).registerConfiguration(Object.assign(Object.assign({},T5),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:C("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));no.as(ch.Configuration).registerConfiguration(Object.assign(Object.assign({},T5),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:C("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var Ale=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class bz{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 n of e.lenses)this.lenses.push({symbol:n,provider:t})}}function Kye(i,e,t){return Ale(this,void 0,void 0,function*(){const n=i.ordered(e),o=new Map,r=new bz,s=n.map((a,l)=>Ale(this,void 0,void 0,function*(){o.set(a,l);try{const c=yield Promise.resolve(a.provideCodeLenses(e,t));c&&r.add(c,a)}catch(c){$o(c)}}));return yield Promise.all(s),r.lenses=r.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:o.get(a.provider)o.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),r})}Rn.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;fi(Rt.isUri(t)),fi(typeof n=="number"||!n);const{codeLensProvider:o}=i.get(pt),r=i.get(Yi).getModel(t);if(!r)throw Mc();const s=[],a=new Be;return Kye(o,r,_n.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)n==null||Boolean(d.symbol.command)?s.push(d.symbol):n-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(r,d.symbol,_n.None)).then(u=>s.push(u||d.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var k0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},I0t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const qye=yn("ICodeLensCache");class Ple{constructor(e,t){this.lineCount=e,this.data=t}}let Cz=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Qv(20,.75);const t="codelens/cache";Ag(()=>e.remove(t,1));const n="codelens/cache2",o=e.get(n,1,"{}");this._deserialize(o),st.once(e.onWillSaveState)(r=>{r.reason===FP.SHUTDOWN&&e.store(n,this._serialize(),1,1)})}put(e,t){const n=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),o=new bz;o.add({lenses:n,dispose:()=>{}},this._fakeProvider);const r=new Ple(e.getLineCount(),o);this._cache.set(e.uri.toString(),r)}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,n]of this._cache){const o=new Set;for(const r of n.data.lenses)o.add(r.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...o.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const n in t){const o=t[n],r=[];for(const a of o.lines)r.push({range:new V(a,1,a,11)});const s=new bz;s.add({lenses:r,dispose(){}},this._fakeProvider),this._cache.set(n,new Ple(o.lineCount,s))}}catch{}}};Cz=k0t([I0t(0,Gd)],Cz);Mn(qye,Cz,1);class T0t{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,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 dF{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${dF._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let o=!1;for(let r=0;r{c.symbol.command&&l.push(c.symbol),n.addDecoration({range:c.symbol.range,options:Ole},u=>this._decorationIds[d]=u),a?a=V.plusRange(a,c.symbol.range):a=V.lift(c.symbol.range)}),this._viewZone=new T0t(a.startLineNumber-1,r,s),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new dF(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 n=this._editor.getModel().getDecorationRange(e),o=this._data[t].symbol;return!!(n&&V.isEmpty(o.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,o)=>{t.addDecoration({range:n.symbol.range,options:Ole},r=>this._decorationIds[o]=r)})}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--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Yx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Gye=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let $w=class{constructor(e,t,n,o,r,s){this._editor=e,this._languageFeaturesService=t,this._commandService=o,this._notificationService=r,this._codeLensCache=s,this._disposables=new Be,this._localToDispose=new Be,this._lenses=[],this._oldCodeLensModels=new Be,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new bi(()=>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(),n=this._editor.getOption(18),o=this._editor.getOption(50),{style:r}=this._editor.getContainerDomNode();r.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),r.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),r.setProperty("--vscode-editorCodeLens-fontFeatureSettings",o.fontFeatureSettings),n&&(r.setProperty("--vscode-editorCodeLens-fontFamily",n),r.setProperty("--vscode-editorCodeLens-fontFamilyDefault",al.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,n;(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(),(n=this._currentCodeLensModel)===null||n===void 0||n.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(Lv(()=>{const o=this._codeLensCache.get(e);t===o&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const o of this._languageFeaturesService.codeLensProvider.all(e))if(typeof o.onDidChange=="function"){const r=o.onDidChange(()=>n.schedule());this._localToDispose.add(r)}const n=new bi(()=>{var o;const r=Date.now();(o=this._getCodeLensModelPromise)===null||o===void 0||o.cancel(),this._getCodeLensModelPromise=sr(s=>Kye(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-r);n.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},en)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(zt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var o;this._editor.changeDecorations(r=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(d=>{!d.isValid()||l===d.getLineNumber()?a.push(d):(d.update(s),l=d.getLineNumber())});const c=new t7;a.forEach(d=>{d.dispose(c,s),this._lenses.splice(this._lenses.indexOf(d),1)}),c.commit(r)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),(o=this._resolveCodeLensesPromise)===null||o===void 0||o.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(o=>{o.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(zt(()=>{if(this._editor.getModel()){const o=Zu.capture(this._editor);this._editor.changeDecorations(r=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(r,s)})}),o.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(o=>{if(o.target.type!==9)return;let r=o.target.element;if((r==null?void 0:r.tagName)==="SPAN"&&(r=r.parentElement),(r==null?void 0:r.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(r);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),n.schedule()}_disposeAllLenses(e,t){const n=new t7;for(const o of this._lenses)o.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),n=[];let o;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(o&&o[o.length-1].symbol.range.startLineNumber===l?o.push(a):(o=[a],n.push(o)))}if(!n.length&&!this._lenses.length)return;const r=Zu.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new t7;let d=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),d++,u++)}for(;dthis._resolveCodeLensesInViewportSoon())),u++;c.commit(a)})}),r.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 n=[],o=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(n.push(l),o.push(a))}),n.length===0)return;const r=Date.now(),s=sr(a=>{const l=n.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},$o):(u[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!o[d].isDisposed()&&o[d].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-r);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{en(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return Gye(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})}};$w.ID="css.editor.codeLens";$w=N0t([Yx(1,pt),Yx(2,qc),Yx(3,_o),Yx(4,Ao),Yx(5,qye)],$w);Un($w.ID,$w,1);ze(class extends ft{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:Q.hasCodeLensProvider,label:C("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return Gye(this,void 0,void 0,function*(){if(!t.hasModel())return;const n=e.get(dh),o=e.get(_o),r=e.get(Ao),s=t.getSelection().positionLineNumber,a=t.getContribution($w.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===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const d=yield n.pick(c,{canPickMany:!1,placeHolder:C("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===s&&((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 o.executeCommand(u.id,...u.arguments||[])}catch(h){r.error(h)}})}});var R0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},n7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},M0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class uY{constructor(e,t){this._editorWorkerClient=new vG(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return M0t(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,n){const o=t.range,r=t.color,s=r.alpha,a=new ve(new Tn(Math.round(255*r.red),Math.round(255*r.green),Math.round(255*r.blue),s)),l=s?ve.Format.CSS.formatRGB(a):ve.Format.CSS.formatRGBA(a),c=s?ve.Format.CSS.formatHSL(a):ve.Format.CSS.formatHSLA(a),d=s?ve.Format.CSS.formatHex(a):ve.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:o,text:l}}),u.push({label:c,textEdit:{range:o,text:c}}),u.push({label:d,textEdit:{range:o,text:d}}),u}}let yz=class extends _e{constructor(e,t,n){super(),this._register(n.colorProvider.register("*",new uY(e,t)))}};yz=R0t([n7(0,Yi),n7(1,Ti),n7(2,pt)],yz);Y5(yz);var bT=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Xye(i,e,t,n=!0){return bT(this,void 0,void 0,function*(){return hY(new A0t,i,e,t,n)})}function Yye(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class A0t{constructor(){}compute(e,t,n,o){return bT(this,void 0,void 0,function*(){const r=yield e.provideDocumentColors(t,n);if(Array.isArray(r))for(const s of r)o.push({colorInfo:s,provider:e});return Array.isArray(r)})}}class P0t{constructor(){}compute(e,t,n,o){return bT(this,void 0,void 0,function*(){const r=yield e.provideDocumentColors(t,n);if(Array.isArray(r))for(const s of r)o.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(r)})}}class O0t{constructor(e){this.colorInfo=e}compute(e,t,n,o){return bT(this,void 0,void 0,function*(){const r=yield e.provideColorPresentations(t,this.colorInfo,_n.None);return Array.isArray(r)&&o.push(...r),Array.isArray(r)})}}function hY(i,e,t,n,o){return bT(this,void 0,void 0,function*(){let r=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d instanceof uY)s=d;else try{(yield i.compute(d,t,n,a))&&(r=!0)}catch(u){$o(u)}}return r?a:s&&o?(yield i.compute(s,t,n,a),a):[]})}function Zye(i,e){const{colorProvider:t}=i.get(pt),n=i.get(Yi).getModel(e);if(!n)throw Mc();const o=i.get(En).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:o}}Rn.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof Rt))throw Mc();const{model:n,colorProviderRegistry:o,isDefaultColorDecoratorsEnabled:r}=Zye(i,t);return hY(new P0t,o,n,_n.None,r)});Rn.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:o,range:r}=n;if(!(o instanceof Rt)||!Array.isArray(t)||t.length!==4||!V.isIRange(r))throw Mc();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=Zye(i,o),[c,d,u,h]=t;return hY(new O0t({range:r,color:{red:c,green:d,blue:u,alpha:h}}),a,s,_n.None,l)});var F0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},i7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ble=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},wz;const Qye=Object.create({});let Ov=wz=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new Be),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new XI(this._editor),this._decoratorLimitReporter=new B0t,this._colorDecorationClassRefs=this._register(new Be),this._debounceInformation=o.for(n.colorProvider,"Document Colors",{min:wz.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(r=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=s!==this._isColorDecoratorsEnabled||r.hasChanged(21),l=r.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(),n=this._configurationService.getValue(t);if(n&&typeof n=="object"){const o=n.colorDecorators;if(o&&o.enable!==void 0&&!o.enable)return o.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 zd,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return Ble(this,void 0,void 0,function*(){this._computePromise=sr(e=>Ble(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const n=new Ls(!1),o=yield Xye(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,n.elapsed()),o}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){en(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(n=>({range:{startLineNumber:n.colorInfo.range.startLineNumber,startColumn:n.colorInfo.range.startColumn,endLineNumber:n.colorInfo.range.endLineNumber,endColumn:n.colorInfo.range.endColumn},options:Jt.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((o,r)=>this._colorDatas.set(o,e[r]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],n=this._editor.getOption(21);for(let r=0;rthis._colorDatas.has(o.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Ov.ID="editor.contrib.colorDetector";Ov.RECOMPUTE_TIME=1e3;Ov=wz=F0t([i7(1,En),i7(2,pt),i7(3,qc)],Ov);class B0t{constructor(){this._onDidChange=new le,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}Un(Ov.ID,Ov,1);class W0t{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,n){this.presentationIndex=n,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new le,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new le,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 n=-1;for(let o=0;o{this.backgroundColor=s.getColor(lP)||ve.white})),this._register(ke(this._pickedColorNode,et.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ke(this._originalColorNode,et.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=ve.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 H0t(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ve.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 H0t extends _e{constructor(e){super(),this._onClicked=this._register(new le),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Ae(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Ae(this._button,t),Ae(t,Bl(".button"+Mt.asCSSSelector(Eo("color-picker-close",Xe.close,C("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class $0t extends _e{constructor(e,t,n,o=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=Bl(".colorpicker-body"),Ae(e,this._domNode),this._saturationBox=new z0t(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 U0t(this._domNode,this.model,o),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new j0t(this._domNode,this.model,o),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),o&&(this._insertButton=this._register(new K0t(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new ve(new qh(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new ve(new qh(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new ve(new qh(n===360?0:n,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 z0t extends _e{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Bl(".saturation-wrap"),Ae(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Ae(this._domNode,this._canvas),this.selection=Bl(".saturation-selection"),Ae(this._domNode,this.selection),this.layout(),this._register(ke(this._domNode,et.POINTER_DOWN,o=>this.onPointerDown(o))),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 SS);const t=Yo(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangePosition(o.pageX-t.left,o.pageY-t.top),()=>null);const n=ke(e.target.ownerDocument,et.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),o=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,o),this._onDidChange.fire({s:n,v:o})}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 ve(new qh(e.h,1,1,1)),n=this._canvas.getContext("2d"),o=n.createLinearGradient(0,0,this._canvas.width,0);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)");const r=n.createLinearGradient(0,0,0,this._canvas.height);r.addColorStop(0,"rgba(0, 0, 0, 0)"),r.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=ve.Format.CSS.format(t),n.fill(),n.fillStyle=o,n.fill(),n.fillStyle=r,n.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${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 Jye extends _e{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=Ae(e,Bl(".standalone-strip")),this.overlay=Ae(this.domNode,Bl(".standalone-overlay"))):(this.domNode=Ae(e,Bl(".strip")),this.overlay=Ae(this.domNode,Bl(".overlay"))),this.slider=Ae(this.domNode,Bl(".slider")),this.slider.style.top="0px",this._register(ke(this.domNode,et.POINTER_DOWN,o=>this.onPointerDown(o))),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 SS),n=Yo(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangeTop(r.pageY-n.top),()=>null);const o=ke(e.target.ownerDocument,et.POINTER_UP,()=>{this._onColorFlushed.fire(),o.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class U0t extends Jye{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:o}=e.rgba,r=new ve(new Tn(t,n,o,1)),s=new ve(new Tn(t,n,o,0));this.overlay.style.background=`linear-gradient(to bottom, ${r} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class j0t extends Jye{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class K0t extends _e{constructor(e){super(),this._onClicked=this._register(new le),this.onClicked=this._onClicked.event,this._button=Ae(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 q0t extends Ud{constructor(e,t,n,o,r=!1){super(),this.model=t,this.pixelRatio=n,this._register(PD.onDidChange(()=>this.layout()));const s=Bl(".colorpicker-widget");e.appendChild(s),this.header=this._register(new V0t(s,this.model,o,r)),this.body=this._register(new $0t(s,this.model,this.pixelRatio,r))}layout(){this.body.layout()}}var ewe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},twe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class G0t{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let hO=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,n){return Wo.fromPromise(this._computeAsync(e,t,n))}_computeAsync(e,t,n){return zw(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const o=Ov.get(this._editor);if(!o)return[];for(const r of t){if(!o.isColorDecoration(r))continue;const s=o.getColorData(r.range.getStartPosition());if(s)return[yield nwe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}renderHoverParts(e,t){return iwe(this,this._editor,this._themeService,t,e)}};hO=ewe([twe(1,vr)],hO);class X0t{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o}}let Pk=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,n){return zw(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!Ov.get(this._editor))return null;const r=yield Xye(n,this._editor.getModel(),_n.None);let s=null,a=null;for(const u of r){const h=u.colorInfo;V.containsRange(h.range,e.range)&&(s=h,a=u.provider)}const l=s!=null?s:e,c=a!=null?a:t,d=!!s;return{colorHover:yield nwe(this,this._editor.getModel(),l,c),foundInEditor:d}})}updateEditorModel(e){return zw(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let n=new V(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield DM(this._editor.getModel(),t,this._color,n,e),n=owe(this._editor,n,t))})}renderHoverParts(e,t){return iwe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};Pk=ewe([twe(1,vr)],Pk);function nwe(i,e,t,n){return zw(this,void 0,void 0,function*(){const o=e.getValueInRange(t.range),{red:r,green:s,blue:a,alpha:l}=t.color,c=new Tn(Math.round(r*255),Math.round(s*255),Math.round(a*255),l),d=new ve(c),u=yield Yye(e,t,n,_n.None),h=new W0t(d,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(d,o),i instanceof hO?new G0t(i,V.lift(t.range),h,n):new X0t(i,V.lift(t.range),h,n)})}function iwe(i,e,t,n,o){if(n.length===0||!e.hasModel())return _e.None;if(o.setMinimumDimensions){const h=e.getOption(66)+8;o.setMinimumDimensions(new Kn(302,h))}const r=new Be,s=n[0],a=e.getModel(),l=s.model,c=r.add(new q0t(o.fragment,l,e.getOption(141),t,i instanceof Pk));o.setColorPicker(c);let d=!1,u=new V(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(i instanceof Pk){const h=n[0].model.color;i.color=h,DM(a,l,h,u,s),r.add(l.onColorFlushed(f=>{i.color=f}))}else r.add(l.onColorFlushed(h=>zw(this,void 0,void 0,function*(){yield DM(a,l,h,u,s),d=!0,u=owe(e,u,l,o)})));return r.add(l.onDidChangeColor(h=>{DM(a,l,h,u,s)})),r.add(e.onDidChangeModelContent(h=>{d?d=!1:(o.hide(),e.focus())})),r}function owe(i,e,t,n){let o,r;if(t.presentation.textEdit){o=[t.presentation.textEdit],r=new V(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const s=i.getModel()._setTrackedRange(null,r,3);i.pushUndoStop(),i.executeEdits("colorpicker",o),r=i.getModel()._getTrackedRange(s)||r}else o=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],r=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),i.pushUndoStop(),i.executeEdits("colorpicker",o);return t.presentation.additionalTextEdits&&(o=[...t.presentation.additionalTextEdits],i.executeEdits("colorpicker",o),n&&n.hide()),i.pushUndoStop(),r}function DM(i,e,t,n,o){return zw(this,void 0,void 0,function*(){const r=yield Yye(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},o.provider,_n.None);e.colorPresentations=r||[]})}function Sz(i,e){return!!i[e]}class o7{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Sz(e.event,t.triggerModifier),this.hasSideBySideModifier=Sz(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Wle{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Sz(e,t.triggerModifier)}}class K2{constructor(e,t,n,o){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=o}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Vle(i){return i==="altKey"?Nn?new K2(57,"metaKey",6,"altKey"):new K2(5,"ctrlKey",6,"altKey"):Nn?new K2(6,"altKey",57,"metaKey"):new K2(6,"altKey",5,"ctrlKey")}class uF extends _e{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new le),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new le),this.onExecute=this._onExecute.event,this._onCancel=this._register(new le),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:o=>o.target.position?o.target.position.lineNumber:0,this._opts=Vle(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(o=>{if(o.hasChanged(77)){const r=Vle(this._editor.getOption(77));if(this._opts.equals(r))return;this._opts=r,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(o=>this._onEditorMouseMove(new o7(o,this._opts)))),this._register(this._editor.onMouseDown(o=>this._onEditorMouseDown(new o7(o,this._opts)))),this._register(this._editor.onMouseUp(o=>this._onEditorMouseUp(new o7(o,this._opts)))),this._register(this._editor.onKeyDown(o=>this._onEditorKeyDown(new Wle(o,this._opts)))),this._register(this._editor.onKeyUp(o=>this._onEditorKeyUp(new Wle(o,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(o=>this._onDidChangeCursorSelection(o))),this._register(this._editor.onDidChangeModel(o=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(o=>{(o.scrollTopChanged||o.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 Y0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Fv=class extends Nw{constructor(e,t,n,o,r,s,a,l,c,d,u,h,f){super(e,Object.assign(Object.assign({},o.getRawOptions()),{overflowWidgetsDomNode:o.getOverflowWidgetsDomNode()}),n,r,s,a,l,c,d,u,h,f),this._parentEditor=o,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(o.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){H4(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Fv=Y0t([tg(4,$t),tg(5,Jn),tg(6,_o),tg(7,Ut),tg(8,vr),tg(9,Ao),tg(10,bp),tg(11,Ti),tg(12,pt)],Fv);const Hle=new ve(new Tn(0,122,204)),Z0t={showArrow:!0,showFrame:!0,className:"",frameColor:Hle,arrowColor:Hle,keepEditorSelection:!1},Q0t="vs.editor.contrib.zoneWidget";class J0t{constructor(e,t,n,o,r,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=o,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=r,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class ebt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class hF{constructor(e){this._editor=e,this._ruleName=hF._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),Roe(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(){Roe(this._ruleName),ZV(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:V.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}hF._IdGenerator=new _X(".arrow-decoration-");class tbt{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=gg(t),H4(this.options,Z0t,!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(n=>{const o=this._getWidth(n);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(n)+"px",this._onWidth(o)}))}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 hF(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const o=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(o))}(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 n=V.isIRange(e)?V.lift(e):V.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:Jt.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 n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),o=this.editor.getLayoutInfo(),r=this._getWidth(o);this.domNode.style.width=`${r}px`,this.domNode.style.left=this._getLeft(o)+"px";const s=document.createElement("div");s.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(n)),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 J0t(s,n.lineNumber,n.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 ebt(Q0t+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,r),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const h=u.validateRange(new V(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 gs(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 n=(t.currentY-e.startY)/this.editor.getOption(66),o=n<0?Math.ceil(n):Math.floor(n),r=e.heightInLines+o;r>5&&r<35&&this._relayout(r)}}))}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 rwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},swe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const awe=yn("IPeekViewService");Mn(awe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const o=this._widgets.get(i);o&&o.widget===e&&(o.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var Ha;(function(i){i.inPeekEditor=new lt("inReferenceSearchEditor",!0,C("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(Ha||(Ha={}));let Ok=class{constructor(e,t){e instanceof Fv&&Ha.inPeekEditor.bindTo(t)}dispose(){}};Ok.ID="editor.contrib.referenceController";Ok=rwe([swe(1,Ut)],Ok);Un(Ok.ID,Ok,0);function nbt(i){const e=i.get(Jn).getFocusedCodeEditor();return e instanceof Fv?e.getParentEditor():e}const ibt={headerBackgroundColor:ve.white,primaryHeadingColor:ve.fromHex("#333333"),secondaryHeadingColor:ve.fromHex("#6c6c6cb3")};let fO=class extends tbt{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new le,this.onDidClose=this._onDidClose.event,H4(this.options,ibt,!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=He(".head"),this._bodyElement=He(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=He(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),No(this._titleElement,"click",r=>this._onTitleClick(r))),Ae(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=He("span.filename"),this._secondaryHeading=He("span.dirname"),this._metaHeading=He("span.meta"),Ae(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=He(".peekview-actions");Ae(this._headElement,n);const o=this._getActionBarOptions();this._actionbarWidget=new zc(n,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new ca("peekview.close",C("label.close","Close"),Mt.asClassName(Xe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:tht.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:Ur(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,nl(this._metaHeading)):Js(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const n=Math.ceil(this.editor.getOption(66)*1.2),o=Math.round(e-(n+2));this._doLayoutHead(n,t),this._doLayoutBody(o,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};fO=rwe([swe(2,$t)],fO);const obt=J("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ve.black,hcLight:ve.white},C("peekViewTitleBackground","Background color of the peek view title area.")),lwe=J("peekViewTitleLabel.foreground",{dark:ve.white,light:ve.black,hcDark:ve.white,hcLight:Sd},C("peekViewTitleForeground","Color of the peek view title.")),cwe=J("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},C("peekViewTitleInfoForeground","Color of the peek view title info.")),rbt=J("peekView.border",{dark:Ma,light:Ma,hcDark:Ln,hcLight:Ln},C("peekViewBorder","Color of the peek view borders and arrow.")),sbt=J("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ve.black,hcLight:ve.white},C("peekViewResultsBackground","Background color of the peek view result list."));J("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ve.white,hcLight:Sd},C("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));J("peekViewResult.fileForeground",{dark:ve.white,light:"#1E1E1E",hcDark:ve.white,hcLight:Sd},C("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));J("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},C("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));J("peekViewResult.selectionForeground",{dark:ve.white,light:"#6C6C6C",hcDark:ve.white,hcLight:Sd},C("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Rm=J("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ve.black,hcLight:ve.white},C("peekViewEditorBackground","Background color of the peek view editor."));J("peekViewEditorGutter.background",{dark:Rm,light:Rm,hcDark:Rm,hcLight:Rm},C("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));J("peekViewEditorStickyScroll.background",{dark:Rm,light:Rm,hcDark:Rm,hcLight:Rm},C("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));J("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},C("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));J("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},C("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));J("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var abt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Bv{constructor(e,t,n,o){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=o,this.id=a$.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?C({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,$c(this.uri),this.range.startLineNumber,this.range.startColumn):C("aria.oneReference","in {0} on line {1} at column {2}",$c(this.uri),this.range.startLineNumber,this.range.startColumn)}}class lbt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:o,startColumn:r,endLineNumber:s,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:o,column:r-t}),c=new V(o,l.startColumn,o,r),d=new V(s,a,s,1073741824),u=n.getValueInRange(c).replace(/^\s+/,""),h=n.getValueInRange(e),f=n.getValueInRange(d).replace(/\s+$/,"");return{value:u+h+f,highlight:{start:u.length,end:u.length+h.length}}}}class Fk{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new _s}dispose(){si(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?C("aria.fileReferences.1","1 symbol in {0}, full path {1}",$c(this.uri),this.uri.fsPath):C("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,$c(this.uri),this.uri.fsPath)}resolve(e){return abt(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 n=yield e.createModelReference(t.uri);this._previews.set(t.uri,new lbt(n))}catch(n){en(n)}return this})}}class dl{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new le,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(dl._compareReferences);let o;for(const r of e)if((!o||!Vi.isEqual(o.uri,r.uri,!0))&&(o=new Fk(this,r.uri),this.groups.push(o)),o.children.length===0||dl._compareReferences(r,o.children[o.children.length-1])!==0){const s=new Bv(n===r,o,r,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),o.children.push(s)}}dispose(){si(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new dl(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?C("aria.result.0","No results found"):this.references.length===1?C("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?C("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):C("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:n}=e;let o=n.children.indexOf(e);const r=n.children.length,s=n.parent.groups.length;return s===1||t&&o+10?(t?o=(o+1)%r:o=(o+r-1)%r,n.children[o]):(o=n.parent.groups.indexOf(n),t?(o=(o+1)%s,n.parent.groups[o].children[0]):(o=(o+s-1)%s,n.parent.groups[o].children[n.parent.groups[o].children.length-1]))}nearestReference(e,t){const n=this.references.map((o,r)=>({idx:r,prefixLen:Q0(o.uri.toString(),e.toString()),offsetDist:Math.abs(o.range.startLineNumber-t.lineNumber)*100+Math.abs(o.range.startColumn-t.column)})).sort((o,r)=>o.prefixLen>r.prefixLen?-1:o.prefixLenr.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&V.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Vi.compare(e.uri,t.uri)||V.compareRangesUsingStarts(e.range,t.range)}}var fF=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},gF=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},xz;let Lz=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof dl||e instanceof Fk}getChildren(e){if(e instanceof dl)return e.groups;if(e instanceof Fk)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};Lz=fF([gF(0,za)],Lz);class cbt{getHeight(){return 23}getTemplateId(e){return e instanceof Fk?Bk.id:CT.id}}let Ez=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Bv){const n=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(n)return n.value}return $c(e.uri)}};Ez=fF([gF(0,xi)],Ez);class dbt{getId(e){return e instanceof Bv?e.id:e.uri}}let Dz=class extends _e{constructor(e,t){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new ZP(n,{supportHighlights:!0})),this.badge=new N$(Ae(n,He(".count")),{},X1e),e.appendChild(n)}set(e,t){const n=L5(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(n,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const o=e.children.length;this.badge.setCount(o),o>1?this.badge.setTitleFormat(C("referencesCount","{0} references",o)):this.badge.setTitleFormat(C("referenceCount","{0} reference",o))}};Dz=fF([gF(1,Rw)],Dz);let Bk=xz=class{constructor(e){this._instantiationService=e,this.templateId=xz.id}renderTemplate(e){return this._instantiationService.createInstance(Dz,e)}renderElement(e,t,n){n.set(e.element,rT(e.filterData))}disposeTemplate(e){e.dispose()}};Bk.id="FileReferencesRenderer";Bk=xz=fF([gF(0,$t)],Bk);class ubt{constructor(e){this.label=new nv(e)}set(e,t){var n;const o=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!o||!o.value)this.label.set(`${$c(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:r,highlight:s}=o;t&&!$u.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(r,rT(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(r,[s]))}}}class CT{constructor(){this.templateId=CT.id}renderTemplate(e){return new ubt(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}CT.id="OneReferenceRenderer";class hbt{getWidgetAriaLabel(){return C("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var fbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ng=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$le=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class pF{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=[],n=[];for(let o=0,r=e.children.length;o{const r=o.deltaDecorations([],t);for(let s=0;s{r.equals(9)&&(this._keybindingService.dispatchEvent(r,r.target),r.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(pbt,"ReferencesWidget",this._treeContainer,new cbt,[this._instantiationService.createInstance(Bk),this._instantiationService.createInstance(CT)],this._instantiationService.createInstance(Lz),n),this._splitView.addView({onDidChange:st.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:r=>{this._preview.layout({height:this._dim.height,width:r})}},qP.Distribute),this._splitView.addView({onDidChange:st.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:r=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${r}px`,this._tree.layout(this._dim.height,r)}},qP.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const o=(r,s)=>{r instanceof Bv&&(s==="show"&&this._revealReference(r,!1),this._onDidSelectReference.fire({element:r,kind:s,source:"tree"}))};this._tree.onDidOpen(r=>{r.sideBySide?o(r.element,"side"):r.editorOptions.pinned?o(r.element,"goto"):o(r.element,"show")}),Js(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Kn(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=C("noResults","No results"),nl(this._messageContainer),Promise.resolve(void 0)):(Js(this._messageContainer),this._decorationsManager=new pF(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:n}=e;if(t.detail!==2)return;const o=this._getFocusedReference();!o||this._onDidSelectReference.fire({element:{uri:o.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),nl(this._treeContainer),nl(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 Bv)return e;if(e instanceof Fk&&e.children.length>0)return e.children[0]}revealReference(e){return $le(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return $le(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==hn.inMemory?this.setTitle(zst(e.uri),this._uriLabel.getUriLabel(L5(e.uri))):this.setTitle(C("peekView.alternateTitle","References"));const n=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 o=yield n;if(!this._model){o.dispose();return}si(this._previewModelReference);const r=o.object;if(r){const s=this._preview.getModel()===r.textEditorModel?0:1,a=V.lift(e.range).collapseToStart();this._previewModelReference=o,this._preview.setModel(r.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),o.dispose()})}};kz=fbt([ng(3,vr),ng(4,za),ng(5,$t),ng(6,awe),ng(7,Rw),ng(8,E5),ng(9,xi),ng(10,Ki),ng(11,Ti)],kz);var mbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Z1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},kM;const e1=new lt("referenceSearchVisible",!1,C("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Wv=kM=class{static get(e){return e.getContribution(kM.ID)}constructor(e,t,n,o,r,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=o,this._notificationService=r,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new Be,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=e1.bindTo(n)}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,n){let o;if(this._widget&&(o=this._widget.position),this.closeWidget(),!!o&&e.containsPosition(o))return;this._peekMode=n,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const r="peekViewLayout",s=gbt.fromJSON(this._storageService.get(r,0,"{}"));this._widget=this._instantiationService.createInstance(kz,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(C("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(r,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":n?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(C("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,u=new ae(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 zle(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const o=this._model.nextOrPreviousReference(n,e),r=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(o),yield this._gotoReference(o,!1),r?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()})}revealReference(e){return zle(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,n;(t=this._widget)===null||t===void 0||t.dispose(),(n=this._model)===null||n===void 0||n.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 n;(n=this._widget)===null||n===void 0||n.hide(),this._ignoreModelChangeEvent=!0;const o=V.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:o,selectionSource:"code.jump",pinned:t}},this._editor).then(r=>{var s;if(this._ignoreModelChangeEvent=!1,!r||!this._widget){this.closeWidget();return}if(this._editor===r)this._widget.show(o),this._widget.focusOnReferenceTree();else{const a=kM.get(r),l=this._model.clone();this.closeWidget(),r.focus(),a==null||a.toggleWidget(o,sr(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},r=>{this._ignoreModelChangeEvent=!1,en(r)})}openReference(e,t,n){t||this.closeWidget();const{uri:o,range:r}=e;this._editorService.openCodeEditor({resource:o,options:{selection:r,selectionSource:"code.jump",pinned:n}},this._editor,t)}};Wv.ID="editor.contrib.referencesController";Wv=kM=mbt([Z1(2,Ut),Z1(3,Jn),Z1(4,Ao),Z1(5,$t),Z1(6,Gd),Z1(7,En)],Wv);function t1(i,e){const t=nbt(i);if(!t)return;const n=Wv.get(t);n&&e(n)}Va.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Zo(2089,60),when:Me.or(e1,Ha.inPeekEditor),handler(i){t1(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Va.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:Me.or(e1,Ha.inPeekEditor),handler(i){t1(i,e=>{e.goToNextOrPreviousReference(!0)})}});Va.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:Me.or(e1,Ha.inPeekEditor),handler(i){t1(i,e=>{e.goToNextOrPreviousReference(!1)})}});Rn.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Rn.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Rn.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Rn.registerCommand("closeReferenceSearch",i=>t1(i,e=>e.closeWidget()));Va.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:Me.and(Ha.inPeekEditor,Me.not("config.editor.stablePeek"))});Va.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:Me.and(e1,Me.not("config.editor.stablePeek"))});Va.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Me.and(e1,mCe,AX.negate(),PX.negate()),handler(i){var e;const n=(e=i.get(Xc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Bv&&t1(i,o=>o.revealReference(n[0]))}});Va.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Me.and(e1,mCe,AX.negate(),PX.negate()),handler(i){var e;const n=(e=i.get(Xc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Bv&&t1(i,o=>o.openReference(n[0],!0,!0))}});Rn.registerCommand("openReference",i=>{var e;const n=(e=i.get(Xc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Bv&&t1(i,o=>o.openReference(n[0],!1,!0))});var dwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},PL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const fY=new lt("hasSymbols",!1,C("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),mF=yn("ISymbolNavigationService");let Iz=class{constructor(e,t,n,o){this._editorService=t,this._notificationService=n,this._keybindingService=o,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=fY.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 n=new Tz(this._editorService),o=n.onDidChange(r=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const u of t.references)if(zG(u.uri,a.uri))c=!0,d=d||V.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=Td(n,o)}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:V.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"),n=t?C("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):C("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};Iz=dwe([PL(0,Ut),PL(1,Jn),PL(2,Ao),PL(3,xi)],Iz);Mn(mF,Iz,1);Ye(new class extends Ir{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:fY,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(mF).revealNext(e)}});Va.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:fY,primary:9,handler(i){i.get(mF).reset()}});let Tz=class{constructor(e){this._listener=new Map,this._disposables=new Be,this._onDidChange=new le,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(),si(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Td(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)}};Tz=dwe([PL(0,Jn)],Tz);var gY=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function yT(i,e,t,n){return gY(this,void 0,void 0,function*(){const r=t.ordered(i).map(a=>Promise.resolve(n(a,i,e)).then(void 0,l=>{$o(l)})),s=yield Promise.all(r);return hf(s.flat())})}function vF(i,e,t,n){return yT(e,t,i,(o,r,s)=>o.provideDefinition(r,s,n))}function uwe(i,e,t,n){return yT(e,t,i,(o,r,s)=>o.provideDeclaration(r,s,n))}function hwe(i,e,t,n){return yT(e,t,i,(o,r,s)=>o.provideImplementation(r,s,n))}function fwe(i,e,t,n){return yT(e,t,i,(o,r,s)=>o.provideTypeDefinition(r,s,n))}function _F(i,e,t,n,o){return yT(e,t,i,(r,s,a)=>gY(this,void 0,void 0,function*(){const l=yield r.provideReferences(s,a,{includeDeclaration:!0},o);if(!n||!l||l.length!==2)return l;const c=yield r.provideReferences(s,a,{includeDeclaration:!1},o);return c&&c.length===1?c:l}))}function wT(i){return gY(this,void 0,void 0,function*(){const e=yield i(),t=new dl(e,""),n=t.references.map(o=>o.link);return t.dispose(),n})}Nf("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(pt),o=vF(n.definitionProvider,e,t,_n.None);return wT(()=>o)});Nf("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(pt),o=fwe(n.typeDefinitionProvider,e,t,_n.None);return wT(()=>o)});Nf("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(pt),o=uwe(n.declarationProvider,e,t,_n.None);return wT(()=>o)});Nf("_executeReferenceProvider",(i,e,t)=>{const n=i.get(pt),o=_F(n.referenceProvider,e,t,!1,_n.None);return wT(()=>o)});Nf("_executeImplementationProvider",(i,e,t)=>{const n=i.get(pt),o=hwe(n.implementationProvider,e,t,_n.None);return wT(()=>o)});var Md=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Zx,Qx,Jx,q2,G2,X2,Y2,Z2;Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextPeek,title:C("peek.submenu","Peek"),group:"navigation",order:100});class Uw{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Uw||ae.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Bs extends lh{static all(){return Bs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const n of vn.wrap(t.menu))(n.id===Z.EditorContext||n.id===Z.EditorContextPeek)&&(n.when=Me.and(e.precondition,n.when));return t}constructor(e,t){super(Bs._patchConfig(t)),this.configuration=e,Bs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,o){if(!t.hasModel())return Promise.resolve(void 0);const r=e.get(Ao),s=e.get(Jn),a=e.get(t_),l=e.get(mF),c=e.get(pt),d=e.get($t),u=t.getModel(),h=t.getPosition(),f=Uw.is(n)?n:new Uw(u,h),g=new Av(t,5),p=i5(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(v=>Md(this,void 0,void 0,function*(){var m;if(!v||g.token.isCancellationRequested)return;Cs(v.ariaMessage);let _;if(v.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!Bs._activeAlternativeCommands.has(w)&&Bs._allSymbolNavigationCommands.has(w)&&(_=Bs._allSymbolNavigationCommands.get(w))}const y=v.references.length;if(y===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(m=cl.get(t))===null||m===void 0||m.showMessage(this._getNoResultFoundMessage(w),h)}}else if(y===1&&_)Bs._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(w=>_.runEditorCommand(w,t,n,o).finally(()=>{Bs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,o)}),v=>{r.error(v)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}_onResult(e,t,n,o,r){return Md(this,void 0,void 0,function*(){const s=this._getGoToPreference(n);if(!(n instanceof Fv)&&(this.configuration.openInPeek||s==="peek"&&o.references.length>1))this._openInPeek(n,o,r);else{const a=o.firstReference(),l=o.references.length>1&&s==="gotoAndPeek",c=yield this._openReference(n,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,o,r):o.dispose(),s==="goto"&&t.put(a)}})}_openReference(e,t,n,o,r){return Md(this,void 0,void 0,function*(){let s;if(aZe(n)&&(s=n.targetSelectionRange),s||(s=n.range),!s)return;const a=yield t.openCodeEditor({resource:n.uri,options:{selection:V.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,o);if(!!a){if(r){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,n){const o=Wv.get(e);o&&e.hasModel()?o.toggleWidget(n!=null?n:e.getSelection(),sr(r=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Bs._allSymbolNavigationCommands=new Map;Bs._activeAlternativeCommands=new Set;class ST extends Bs{_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield vF(e.definitionProvider,t,n,o),C("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?C("noResultWord","No definition found for '{0}'",e.word):C("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}$i((Zx=class extends ST{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Zx.id,title:{value:C("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:C({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:Me.and(Q.hasDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Q.editorTextFocus,primary:70,weight:100},{when:Me.and(Q.editorTextFocus,fCe),primary:2118,weight:100}],menu:[{id:Z.EditorContext,group:"navigation",order:1.1},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Rn.registerCommandAlias("editor.action.goToDeclaration",Zx.id)}},Zx.id="editor.action.revealDefinition",Zx));$i((Qx=class extends ST{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Qx.id,title:{value:C("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:Me.and(Q.hasDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Q.editorTextFocus,primary:Zo(2089,70),weight:100},{when:Me.and(Q.editorTextFocus,fCe),primary:Zo(2089,2118),weight:100}]}),Rn.registerCommandAlias("editor.action.openDeclarationToTheSide",Qx.id)}},Qx.id="editor.action.revealDefinitionAside",Qx));$i((Jx=class extends ST{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Jx.id,title:{value:C("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:Me.and(Q.hasDefinitionProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:Z.EditorContextPeek,group:"peek",order:2}}),Rn.registerCommandAlias("editor.action.previewDeclaration",Jx.id)}},Jx.id="editor.action.peekDefinition",Jx));class gwe extends Bs{_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield uwe(e.declarationProvider,t,n,o),C("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?C("decl.noResultWord","No declaration found for '{0}'",e.word):C("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}$i((q2=class extends gwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:q2.id,title:{value:C("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:C({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Me.and(Q.hasDeclarationProvider,Q.isInWalkThroughSnippet.toNegated()),menu:[{id:Z.EditorContext,group:"navigation",order:1.3},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?C("decl.noResultWord","No declaration found for '{0}'",e.word):C("decl.generic.noResults","No declaration found")}},q2.id="editor.action.revealDeclaration",q2));$i(class extends gwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:C("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:Me.and(Q.hasDeclarationProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:3}})}});class pwe extends Bs{_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield fwe(e.typeDefinitionProvider,t,n,o),C("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?C("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):C("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}$i((G2=class extends pwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:G2.ID,title:{value:C("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:C({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:Me.and(Q.hasTypeDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:0,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.4},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},G2.ID="editor.action.goToTypeDefinition",G2));$i((X2=class extends pwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:X2.ID,title:{value:C("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:Me.and(Q.hasTypeDefinitionProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:4}})}},X2.ID="editor.action.peekTypeDefinition",X2));class mwe extends Bs{_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield hwe(e.implementationProvider,t,n,o),C("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?C("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):C("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}$i((Y2=class extends mwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Y2.ID,title:{value:C("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:C({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:Me.and(Q.hasImplementationProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:2118,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.45},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},Y2.ID="editor.action.goToImplementation",Y2));$i((Z2=class extends mwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Z2.ID,title:{value:C("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:Me.and(Q.hasImplementationProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:3142,weight:100},menu:{id:Z.EditorContextPeek,group:"peek",order:5}})}},Z2.ID="editor.action.peekImplementation",Z2));class vwe extends Bs{_getNoResultFoundMessage(e){return e?C("references.no","No references found for '{0}'",e.word):C("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}$i(class extends vwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:C("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:C({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Me.and(Q.hasReferenceProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:1094,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.45},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield _F(e.referenceProvider,t,n,!0,o),C("ref.title","References"))})}});$i(class extends vwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:C("references.action.label","Peek References"),original:"Peek References"},precondition:Me.and(Q.hasReferenceProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(yield _F(e.referenceProvider,t,n,!1,o),C("ref.title","References"))})}});class vbt extends Bs{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:{value:C("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:Me.and(Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}_getLocationModel(e,t,n,o){return Md(this,void 0,void 0,function*(){return new dl(this._references,C("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&C("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""}}Rn.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:Rt},{name:"position",description:"The position at which to start",constraint:ae.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:(i,e,t,n,o,r,s)=>Md(void 0,void 0,void 0,function*(){fi(Rt.isUri(e)),fi(ae.isIPosition(t)),fi(Array.isArray(n)),fi(typeof o=="undefined"||typeof o=="string"),fi(typeof s=="undefined"||typeof s=="boolean");const a=i.get(Jn),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Sf(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends vbt{_getNoResultFoundMessage(u){return r||super._getNoResultFoundMessage(u)}}({muteMessage:!Boolean(r),openInPeek:Boolean(s),openToSide:!1},n,o);c.get($t).invokeFunction(d.run.bind(d),l)})})});Rn.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:Rt},{name:"position",description:"The position at which to start",constraint:ae.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:(i,e,t,n,o)=>Md(void 0,void 0,void 0,function*(){i.get(_o).executeCommand("editor.action.goToLocations",e,t,n,o,void 0,!0)})});Rn.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{fi(Rt.isUri(e)),fi(ae.isIPosition(t));const n=i.get(pt),o=i.get(Jn);return o.openCodeEditor({resource:e},o.getFocusedCodeEditor()).then(r=>{if(!Sf(r)||!r.hasModel())return;const s=Wv.get(r);if(!s)return;const a=sr(c=>_F(n.referenceProvider,r.getModel(),ae.lift(t),!1,c).then(d=>new dl(d,C("ref.title","References")))),l=new V(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});Rn.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var _bt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},r7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ule=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},OL;let vb=OL=class{constructor(e,t,n,o){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=o,this.toUnhook=new Be,this.toUnhookForKeyboard=new Be,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const r=new uF(e);this.toUnhook.add(r),this.toUnhook.add(r.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a!=null?a:void 0)})),this.toUnhook.add(r.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{en(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(r.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(OL.ID)}startFindDefinitionFromCursor(e){return Ule(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 n=e.target.position;this.startFindDefinition(n)}startFindDefinition(e){var t;return Ule(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const n=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const o=new Ak(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=sr(a=>this.findDefinition(e,a));let r;try{r=yield this.previousPromise}catch(a){en(a);return}if(!r||!r.length||!o.validate(this.editor)){this.removeLinkDecorations();return}const s=r[0].originSelectionRange?V.lift(r[0].originSelectionRange):new V(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);if(r.length>1){let a=s;for(const{originSelectionRange:l}of r)l&&(a=V.plusRange(a,l));this.addDecoration(a,new os().appendText(C("multipleResults","Click to show {0} definitions.",r.length)))}else{const a=r[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(s,u?new os().appendCodeblock(h||"",u):void 0),l.dispose()})}})}getPreviewValue(e,t,n){let o=n.range;return o.endLineNumber-o.startLineNumber>=OL.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,o)}stripIndentationFromPreviewRange(e,t,n){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const o=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(n);return new ST({openToSide:t,openInPeek:o,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(n)})}isInPeekEditor(e){const t=e.get(Ut);return Ha.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};vb.ID="editor.contrib.gotodefinitionatposition";vb.MAX_SOURCE_PREVIEW_LINES=8;vb=OL=_bt([r7(1,za),r7(2,Ki),r7(3,pt)],vb);Un(vb.ID,vb,2);const Q2=He;class _we extends _e{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 QI(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class pY extends _e{static render(e,t,n){return new pY(e,t,n)}constructor(e,t,n){super(),this.actionContainer=Ae(e,Q2("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ae(this.actionContainer,Q2("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ae(this.action,Q2(`span.icon.${t.iconClass}`));const o=Ae(this.action,Q2("span"));o.textContent=n?`${t.label} (${n})`:t.label,this._register(ke(this.actionContainer,et.CLICK,r=>{r.stopPropagation(),r.preventDefault(),t.run(this.actionContainer)})),this._register(ke(this.actionContainer,et.KEY_DOWN,r=>{const s=new Pi(r);(s.equals(3)||s.equals(10))&&(r.stopPropagation(),r.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 bbt(i,e){return i&&e?C("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?C("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var Cbt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},ybt=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};class wbt{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}}class bwe extends _e{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new le),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new bi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new bi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new bi(()=>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=cJe(e=>this._computer.computeAsync(e)),Cbt(this,void 0,void 0,function*(){var e,t,n,o;try{try{for(var r=!0,s=ybt(this._asyncIterable),a;a=yield s.next(),e=a.done,!e;r=!0){o=a.value,r=!1;const l=o;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!r&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){en(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 wbt(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 s7{constructor(e,t,n,o){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=o,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 IM{constructor(e,t,n,o,r,s){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=o,this.initialMousePosY=r,this.supportsMarkerHover=s,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 n1=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class mY{constructor(){this._onDidWillResize=new le,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new le,this.onDidResize=this._onDidResize.event,this._sashListener=new Be,this._size=new Kn(0,0),this._minSize=new Kn(0,0),this._maxSize=new Kn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new gs(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new gs(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new gs(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:jP.North}),this._southSash=new gs(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:jP.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,n=0;this._sashListener.add(st.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(st.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(o=>{e&&(n=o.currentX-o.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(o=>{e&&(n=-(o.currentX-o.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(o=>{e&&(t=-(o.currentY-o.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(o=>{e&&(t=o.currentY-o.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(st.any(this._eastSash.onDidReset,this._westSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(st.any(this._northSash.onDidReset,this._southSash.onDidReset)(o=>{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,n,o){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=o?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:o}=this._minSize,{height:r,width:s}=this._maxSize;e=Math.max(n,Math.min(r,e)),t=Math.max(o,Math.min(s,t));const a=new Kn(t,e);Kn.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 Sbt=30,xbt=24;class Lbt extends _e{constructor(e,t=new Kn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new mY),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Kn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new Kn(n.dimension.width,n.dimension.height)),n.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?ae.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:Yo(t).top+n.top-Sbt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const o=Yo(t),r=bS(t.ownerDocument.body),s=o.top+n.top+n.height;return r.height-s-xbt}_findPositionPreference(e,t){var n,o;const r=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),s=Math.min((o=this._availableVerticalSpaceAbove(t))!==null&&o!==void 0?o:1/0,e),a=Math.min(Math.max(s,r),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=r?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 vY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},C0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},TM,wh;const jle=He;let gO=TM=class extends _e{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(rv,this._editor)),this._participants=[];for(const o of n1.getAll())this._participants.push(this._instantiationService.createInstance(o,this._editor));this._participants.sort((o,r)=>o.hoverOrdinal-r.hoverOrdinal),this._computer=new mO(this._editor,this._participants),this._hoverOperation=this._register(new bwe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{if(!this._computer.anchor)return;const r=o.hasLoadingMessage?this._addLoadingMessage(o.value):o.value;this._withResult(new Cwe(this._computer.anchor,r,o.isComplete))})),this._register(No(this._widget.getDomNode(),"keydown",o=>{o.equals(9)&&this.hide()})),this._register(oo.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 o of this._participants)if(o.suggestHoverAnchor){const r=o.suggestHoverAnchor(e);r&&t.push(r)}const n=e.target;if(n.type===6&&t.push(new s7(0,n.range,e.event.posx,e.event.posy)),n.type===7){const o=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&typeof n.detail.horizontalDistanceToText=="number"&&n.detail.horizontalDistanceToTextr.priority-o.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,n,o){this._startShowingOrUpdateHover(new s7(0,e,void 0,void 0),t,n,o,null)}_startShowingOrUpdateHover(e,t,n,o,r){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):!1:this._editor.getOption(60).sticky&&r&&this._widget.isMouseGettingCloser(r.event.posx,r.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,n,o,!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,n,o,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,n,o,r){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=o,this._computer.source=n,this._computer.insistOnKeepingHoverVisible=r,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 n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}}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:n,showAtSecondaryPosition:o,highlightRange:r}=TM.computeHoverRanges(this._editor,e.range,t),s=new Be,a=s.add(new pO(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&&s.add(h.renderHoverParts(d,f))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(r){const h=this._editor.createDecorationsCollection();h.set([{range:r,options:TM._DECORATION_OPTIONS}]),s.add(zt(()=>{h.clear()}))}this._widget.showAt(l,new Dbt(c,n,o,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(e,t,n){let o=1;if(e.hasModel()){const c=e._getViewModel(),d=c.coordinatesConverter,u=d.convertModelRangeToViewRange(t),h=new ae(u.startLineNumber,c.getLineMinColumn(u.startLineNumber));o=d.convertViewPositionToModelPosition(h).column}const r=t.startLineNumber;let s=t.startColumn,a=n[0].range,l=null;for(const c of n)a=V.plusRange(a,c.range),c.range.startLineNumber===r&&c.range.endLineNumber===r&&(s=Math.max(Math.min(s,c.range.startColumn),o)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new ae(r,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new ae(r,s),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()}};gO._DECORATION_OPTIONS=Jt.register({description:"content-hover-highlight",className:"hoverHighlight"});gO=TM=vY([C0(1,$t),C0(2,xi)],gO);class Cwe{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new Ebt(this,this.anchor,t,this.isComplete)}}class Ebt extends Cwe{constructor(e,t,n,o){super(t,n,o),this.original=e}filter(e){return this.original.filter(e)}}class Dbt{constructor(e,t,n,o,r,s,a,l,c,d){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=n,this.preferAbove=o,this.stoleFocus=r,this.source=s,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=d,this.closestMouseDistance=void 0}}const Kle=30,a7=10,kbt=6;let rv=wh=class extends Lbt{get isColorPickerVisible(){var e;return Boolean((e=this._visibleData)===null||e===void 0?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,n,o,r){const s=e.getOption(66)+8,a=150,l=new Kn(a,s);super(e,l),this._configurationService=n,this._accessibilityService=o,this._keybindingService=r,this._hover=this._register(new _we),this._minimumSize=l,this._hoverVisibleKey=Q.hoverVisible.bindTo(t),this._hoverFocusedKey=Q.hoverFocused.bindTo(t),Ae(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(pf(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 wh.ID}static _applyDimensions(e,t,n){const o=typeof t=="number"?`${t}px`:t,r=typeof n=="number"?`${n}px`:n;e.style.width=o,e.style.height=r}_setContentsDomNodeDimensions(e,t){const n=this._hover.contentsDomNode;return wh._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){const n=this._hover.containerDomNode;return wh._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){const o=typeof t=="number"?`${t}px`:t,r=typeof n=="number"?`${n}px`:n;e.style.maxWidth=o,e.style.maxHeight=r}_setHoverWidgetMaxDimensions(e,t){wh._applyMaxDimensions(this._hover.contentsDomNode,e,t),wh._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,n=e.height;this._setHoverWidgetDimensions(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,n-a7))}_updateResizableNodeMaxDimensions(){var e,t;const n=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Kn(n,o),this._setHoverWidgetMaxDimensions(n,o)}_resize(e){var t,n;wh._lastDimensions=new Kn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(n=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||n===void 0||n.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=kbt;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{t+=n.clientHeight}),this._hasHorizontalScrollbar()&&(t+=a7),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=="undefined"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidththis._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,o),!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),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,wh._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,wh._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 n,o,r,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=h0(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(n=this._findPositionPreference(a,l))!==null&&n!==void 0?n:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(o=t.colorPicker)===null||o===void 0||o.layout();const c=bbt(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(r=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||r===void 0?void 0:r.getAriaLabel())!==null&&s!==void 0?s:"");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 Kn(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 n=this._hover.containerDomNode,o=this._hover.contentsDomNode,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(Ea(n),Math.min(r,e)),this._setContentsDomNodeDimensions(Ea(o),Math.min(r,e-a7))}setMinimumDimensions(e){this._minimumSize=new Kn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth=="undefined"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Kn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let n=h0(t),o=Ea(t);if(this._resizableNode.layout(n,o),this._setHoverWidgetDimensions(o,n),n=h0(t),o=Ea(t),this._contentWidth=o,this._updateMinimumWidth(),this._resizableNode.layout(n,o),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(n)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const r=h0(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(r,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-Kle})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+Kle})}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})}};rv.ID="editor.contrib.resizableContentHoverWidget";rv._lastDimensions=new Kn(0,0);rv=wh=vY([C0(1,Ut),C0(2,En),C0(3,bp),C0(4,xi)],rv);let pO=class extends _e{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=jle("div.hover-row.status-bar"),this.actionsElement=Ae(this.hoverElement,jle("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(pY.render(this.actionsElement,e,n))}append(e){const t=Ae(this.actionsElement,e);return this._hasContent=!0,t}};pO=vY([C0(0,xi)],pO);class mO{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 n=e.getModel(),o=t.range.startLineNumber;if(o>n.getLineCount())return[];const r=n.getLineMaxColumn(o);return e.getLineDecorations(o).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===o?s.range.startColumn:1,l=s.range.endLineNumber===o?s.range.endColumn:r;if(s.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 Wo.EMPTY;const n=mO._getLineDecorations(this._editor,t);return Wo.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(t,n,e):Wo.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=mO._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return hf(t)}}function qle(i,e,t,n,o,r){const s=t+o/2,a=n+r/2,l=Math.max(Math.abs(i-s)-o/2,0),c=Math.max(Math.abs(e-a)-r/2,0);return Math.sqrt(l*l+c*c)}const Gle=He;class Vy extends _e{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Be),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new _we),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new hp({editor:this._editor},t,n)),this._computer=new Ibt(this._editor),this._hoverOperation=this._register(new bwe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{this._withResult(o.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Vy.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 n=document.createDocumentFragment();for(const o of t){const r=Gle("div.hover-row.markdown-hover"),s=Ae(r,Gle("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(o.value));s.appendChild(a.element),n.appendChild(r)}this._updateContents(n),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(),n=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),r=this._editor.getOption(66),s=this._hover.containerDomNode.clientHeight,a=n-o-(s-r)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Vy.ID="editor.contrib.modesGlyphHoverWidget";class Ibt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),n=[];if(!t)return n;for(const o of t){if(!o.options.glyphMarginClassName)continue;const r=o.options.glyphMarginHoverMessage;!r||Pw(r)||n.push(...Oq(r).map(e))}return n}}var Tbt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Nbt{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}function Rbt(i,e,t,n,o){return Tbt(this,void 0,void 0,function*(){try{const r=yield Promise.resolve(i.provideHover(t,n,o));if(r&&Abt(r))return new Nbt(i,r,e)}catch(r){$o(r)}})}function _Y(i,e,t,n){const r=i.ordered(e).map((s,a)=>Rbt(s,a,e,t,n));return Wo.fromPromises(r).coalesce()}function Mbt(i,e,t,n){return _Y(i,e,t,n).map(o=>o.hover).toPromise()}Nf("_executeHoverProvider",(i,e,t)=>{const n=i.get(pt);return Mbt(n.hoverProvider,e,t,_n.None)});function Abt(i){const e=typeof i.range!="undefined",t=typeof i.contents!="undefined"&&i.contents&&i.contents.length>0;return e&&t}var Pbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},J2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Xle=He;class Du{constructor(e,t,n,o,r){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=o,this.ordinal=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let vO=class{constructor(e,t,n,o,r){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=o,this._languageFeaturesService=r,this.hoverOrdinal=3}createLoadingMessage(e){return new Du(this,e.range,[new os().appendText(C("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),o=e.range.startLineNumber,r=n.getLineMaxColumn(o),s=[];let a=1e3;const l=n.getLineLength(o),c=n.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,s.push(new Du(this,e.range,[{value:C("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&&s.push(new Du(this,e.range,[{value:C("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===o?g.range.startColumn:1,v=g.range.endLineNumber===o?g.range.endColumn:r,m=g.options.hoverMessage;if(!m||Pw(m))continue;g.options.beforeContentClassName&&(f=!0);const _=new V(e.range.startLineNumber,p,e.range.startLineNumber,v);s.push(new Du(this,_,Oq(m),f,a++))}return s}computeAsync(e,t,n){if(!this._editor.hasModel()||e.type!==1)return Wo.EMPTY;const o=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(o))return Wo.EMPTY;const r=new ae(e.range.startLineNumber,e.range.startColumn);return _Y(this._languageFeaturesService.hoverProvider,o,r,n).filter(s=>!Pw(s.hover.contents)).map(s=>{const a=s.hover.range?V.lift(s.hover.range):e.range;return new Du(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return ywe(e,t,this._editor,this._languageService,this._openerService)}};vO=Pbt([J2(1,Ki),J2(2,ml),J2(3,En),J2(4,pt)],vO);function ywe(i,e,t,n,o){e.sort((s,a)=>s.ordinal-a.ordinal);const r=new Be;for(const s of e)for(const a of s.contents){if(Pw(a))continue;const l=Xle("div.hover-row.markdown-hover"),c=Ae(l,Xle("div.hover-contents")),d=r.add(new hp({editor:t},n,o));r.add(d.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",i.onContentsChanged()}));const u=r.add(d.render(a));c.appendChild(u.element),i.fragment.appendChild(l)}return r}var wwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_O=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Yle{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let Nz=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._dispoables=new Be,this._markers=[],this._nextIdx=-1,Rt.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const o=this._configService.getValue("problems.sortOrder"),r=(a,l)=>{let c=AD(a.resource.toString(),l.resource.toString());return c===0&&(o==="position"?c=V.compareRangesUsingStarts(a,l)||ao.compare(a.severity,l.severity):c=ao.compare(a.severity,l.severity)||V.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:Rt.isUri(e)?e:void 0,severities:ao.Error|ao.Warning|ao.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(r)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),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 Yle(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let o=!1,r=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());r<0&&(r=ED(this._markers,{resource:e.uri},(s,a)=>AD(s.resource.toString(),a.resource.toString())),r<0&&(r=~r));for(let s=r;so.resource.toString()===e.toString());if(!(n<0)){for(;n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Q1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Az;class Fbt{constructor(e,t,n,o,r){this._openerService=o,this._labelService=r,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Be,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(No(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new bbe(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){si(this._disposables)}update(e){const{source:t,message:n,relatedInformation:o,code:r}=e;let s=((t==null?void 0:t.length)||0)+2;r&&(typeof r=="string"?s+=r.length:s+=r.value.length);const a=gf(n);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ur(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||r){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(r)if(typeof r=="string"){const f=document.createElement("span");f.innerText=`(${r})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=He("a.code-link"),this._codeLink.setAttribute("href",`${r.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(r.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=Ae(this._codeLink,He("span"));f.innerText=r.value,h.appendChild(this._codeLink)}}if(Ur(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ws(o)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of o){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(p),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:u})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case ao.Error:t=C("Error","Error");break;case ao.Warning:t=C("Warning","Warning");break;case ao.Info:t=C("Info","Info");break;case ao.Hint:t=C("Hint","Hint");break}let n=C("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const o=this._editor.getModel();return o&&e.startLineNumber<=o.getLineCount()&&e.startLineNumber>=1&&(n=`${o.getLineContent(e.startLineNumber)}, ${n}`),n}}let jw=Az=class extends fO{constructor(e,t,n,o,r,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},r),this._themeService=t,this._openerService=n,this._menuService=o,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new Be,this._onDidSelectRelatedInformation=new le,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ao.Warning,this._backgroundColor=ve.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Hbt);let t=Pz,n=Bbt;this._severity===ao.Warning?(t=NM,n=Wbt):this._severity===ao.Info&&(t=Oz,n=Vbt);const o=e.getColor(t),r=e.getColor(n);this.style({arrowColor:o,frameColor:o,headerBackgroundColor:r,primaryHeadingColor:e.getColor(lwe),secondaryHeadingColor:e.getColor(cwe)})}_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(o=>this.editor.focus()));const t=[],n=this._menuService.createMenu(Az.TitleMenu,this._contextKeyService);Z1e(n,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=Ae(e,He(""))}_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 Fbt(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,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const o=V.lift(e),r=this.editor.getPosition(),s=r&&o.containsPosition(r)?r:o.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=n>1?C("problems","{0} of {1} problems",t,n):C("change","{0} of {1} problem",t,n);this.setTitle($c(a.uri),l)}this._icon.className=`codicon ${Mz.className(ao.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};jw.TitleMenu=new Z("gotoErrorTitleMenu");jw=Az=Obt([Q1(1,vr),Q1(2,ml),Q1(3,If),Q1(4,$t),Q1(5,Ut),Q1(6,Rw)],jw);const Zle=QD(Yh,xnt),Qle=QD($l,YD),Jle=QD(Ma,ZD),Pz=J("editorMarkerNavigationError.background",{dark:Zle,light:Zle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationError","Editor marker navigation widget error color.")),Bbt=J("editorMarkerNavigationError.headerBackground",{dark:St(Pz,.1),light:St(Pz,.1),hcDark:null,hcLight:null},C("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),NM=J("editorMarkerNavigationWarning.background",{dark:Qle,light:Qle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Wbt=J("editorMarkerNavigationWarning.headerBackground",{dark:St(NM,.1),light:St(NM,.1),hcDark:"#0C141F",hcLight:St(NM,.2)},C("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),Oz=J("editorMarkerNavigationInfo.background",{dark:Jle,light:Jle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Vbt=J("editorMarkerNavigationInfo.headerBackground",{dark:St(Oz,.1),light:St(Oz,.1),hcDark:null,hcLight:null},C("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Hbt=J("editorMarkerNavigation.background",{dark:mr,light:mr,hcDark:mr,hcLight:mr},C("editorMarkerNavigationBackground","Editor marker navigation widget background."));var $bt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},xwe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},FL;let Vv=FL=class{static get(e){return e.getContribution(FL.ID)}constructor(e,t,n,o,r){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=o,this._instantiationService=r,this._sessionDispoables=new Be,this._editor=e,this._widgetVisible=Lwe.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(jw,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(n=>{var o,r,s;(!(!((o=this._model)===null||o===void 0)&&o.selected)||!V.containsPosition((r=this._model)===null||r===void 0?void 0:r.selected.marker,n.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const n=this._model.find(this._editor.getModel().uri,this._widget.position);n?this._widget.updateMarker(n.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(n=>{this._editorService.openCodeEditor({resource:n.resource,options:{pinned:!0,revealIfOpened:!0,selection:V.lift(n).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 ae(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var n,o;return xwe(this,void 0,void 0,function*(){if(this._editor.hasModel()){const r=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(r.move(e,this._editor.getModel(),this._editor.getPosition()),!r.selected)return;if(r.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:r.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:r.selected.marker}},this._editor);s&&((n=FL.get(s))===null||n===void 0||n.close(),(o=FL.get(s))===null||o===void 0||o.nagivate(e,t))}else this._widget.showAtMarker(r.selected.marker,r.selected.index,r.selected.total)}})}};Vv.ID="editor.contrib.markerController";Vv=FL=$bt([eR(1,Swe),eR(2,Ut),eR(3,Jn),eR(4,$t)],Vv);class bF extends ft{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}run(e,t){var n;return xwe(this,void 0,void 0,function*(){t.hasModel()&&((n=Vv.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))})}}class sv extends bF{constructor(){super(!0,!1,{id:sv.ID,label:sv.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:578,weight:100},menuOpts:{menuId:jw.TitleMenu,title:sv.LABEL,icon:Eo("marker-navigation-next",Xe.arrowDown,C("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}sv.ID="editor.action.marker.next";sv.LABEL=C("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class O0 extends bF{constructor(){super(!1,!1,{id:O0.ID,label:O0.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:1602,weight:100},menuOpts:{menuId:jw.TitleMenu,title:O0.LABEL,icon:Eo("marker-navigation-previous",Xe.arrowUp,C("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}O0.ID="editor.action.marker.prev";O0.LABEL=C("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class zbt extends bF{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:C("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:Q.focus,primary:66,weight:100},menuOpts:{menuId:Z.MenubarGoMenu,title:C({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Ubt extends bF{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:C("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:Q.focus,primary:1090,weight:100},menuOpts:{menuId:Z.MenubarGoMenu,title:C({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Un(Vv.ID,Vv,4);ze(sv);ze(O0);ze(zbt);ze(Ubt);const Lwe=new lt("markersNavigationVisible",!1),jbt=Ir.bindToContribution(Vv.get);Ye(new jbt({id:"closeMarkersNavigation",precondition:Lwe,handler:i=>i.close(),kbOpts:{weight:100+50,kbExpr:Q.focus,primary:9,secondary:[1033]}}));var Kbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},l7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const ud=He;class qbt{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const ece={type:1,filter:{include:Wt.QuickFix},triggerAction:fl.QuickFixHover};let Fz=class{constructor(e,t,n,o){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=o,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const n=this._editor.getModel(),o=e.range.startLineNumber,r=n.getLineMaxColumn(o),s=[];for(const a of t){const l=a.range.startLineNumber===o?a.range.startColumn:1,c=a.range.endLineNumber===o?a.range.endColumn:r,d=this._markerDecorationsService.getMarker(n.uri,a);if(!d)continue;const u=new V(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new qbt(this,u,d))}return s}renderHoverParts(e,t){if(!t.length)return _e.None;const n=new Be;t.forEach(r=>e.fragment.appendChild(this.renderMarkerHover(r,n)));const o=t.length===1?t[0]:t.sort((r,s)=>ao.compare(r.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,o,n),n}renderMarkerHover(e,t){const n=ud("div.hover-row"),o=Ae(n,ud("div.marker.hover-contents")),{source:r,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(o);const c=Ae(o,ud("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,r||a)if(a&&typeof a!="string"){const d=ud("span");if(r){const g=Ae(d,ud("span"));g.innerText=r}const u=Ae(d,ud("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(ke(u,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=Ae(u,ud("span"));h.innerText=a.value;const f=Ae(o,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=Ae(o,ud("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=r&&a?`${r}(${a})`:r||`(${a})`}if(ws(l))for(const{message:d,resource:u,startLineNumber:h,startColumn:f}of l){const g=Ae(o,ud("div"));g.style.marginTop="8px";const p=Ae(g,ud("a"));p.innerText=`${$c(u)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(ke(p,"click",m=>{m.stopPropagation(),m.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(en)}));const v=Ae(g,ud("span"));v.innerText=d,this._editor.applyFontInfo(v)}return n}renderMarkerStatusbar(e,t,n){if((t.marker.severity===ao.Error||t.marker.severity===ao.Warning||t.marker.severity===ao.Info)&&e.statusBar.addAction({label:C("view problem","View Problem"),commandId:sv.ID,run:()=>{var o;e.hide(),(o=Vv.get(this._editor))===null||o===void 0||o.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const o=e.statusBar.append(ud("div"));this.recentMarkerCodeActionsInfo&&(zP.makeKey(this.recentMarkerCodeActionsInfo.marker)===zP.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(o.textContent=C("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const r=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?_e.None:n.add(Lv(()=>o.textContent=C("checkingForQuickFixes","Checking for quick fixes..."),200));o.textContent||(o.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);n.add(zt(()=>s.cancel())),s.then(a=>{if(r.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),o.textContent=C("noQuickFixes","No quick fixes available");return}o.style.display="none";let l=!1;n.add(zt(()=>{l||a.dispose()})),e.statusBar.addAction({label:C("quick fixes","Quick Fix..."),commandId:aY,run:c=>{l=!0;const d=Pv.get(this._editor),u=Yo(c);e.hide(),d==null||d.showCodeActions(ece,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},en)}}getCodeActions(e){return sr(t=>RE(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new V(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),ece,Xg.None,t))}};Fz=Kbt([l7(1,wG),l7(2,ml),l7(3,pt)],Fz);const Ewe="editor.action.inlineSuggest.commit",Dwe="editor.action.inlineSuggest.showPrevious",kwe="editor.action.inlineSuggest.showNext";var Gbt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Xbt extends _e{constructor(e,t,n={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new FYe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Be),this.options=n,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Wk(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},n.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new zc(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,actionViewItemProvider:(o,r)=>{var s;if(o.id===Wk.ID)return this.toggleMenuActionViewItem=new OP(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Mt.asClassNameArray((s=n.moreIcon)!==null&&s!==void 0?s:Xe.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(n.actionViewItemProvider){const a=n.actionViewItemProvider(o,r);if(a)return a}if(o instanceof _w){const a=new OP(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.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 n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(o=>{this.actionBar.push(o,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(o)})})}getKeybindingLabel(e){var t,n,o;const r=this.lookupKeybindings?(n=(t=this.options).getKeyBinding)===null||n===void 0?void 0:n.call(t,e):void 0;return(o=r==null?void 0:r.getLabel())!==null&&o!==void 0?o:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Wk extends ca{constructor(e,t){t=t||C("moreActions","More Actions..."),super(Wk.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return Gbt(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Wk.ID="toolbar.toggle.more";var Ybt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Bz=class extends Xbt{constructor(e,t,n,o,r,s,a){super(e,r,Object.assign(Object.assign({getKeyBinding:c=>{var d;return(d=s.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=n,this._contextKeyService=o,this._contextMenuService=r,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=[],n){var o,r,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let d=0;const u=[];let h=!1;if(((o=this._options)===null||o===void 0?void 0:o.hiddenItemStrategy)!==-1)for(let f=0;fv==null?void 0:v.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let v=0;v=g&&(a[v]=void 0,u[v]=m))}}ooe(a),ooe(u),super.setActions(a,kr.join(u,l)),c.length>0&&this._sessionDisposables.add(ke(this.getElement(),"contextmenu",f=>{var g,p,v,m,_;const y=new kc(f),w=this.getItemAction(y.target);if(!w)return;y.preventDefault(),y.stopPropagation();let L=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){L=!0;for(let I=0;Ithis._menuService.resetHiddenStates(n)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>E,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(m=this._options)===null||m===void 0?void 0:m.menuOptions),skipTelemetry:typeof((_=this._options)===null||_===void 0?void 0:_.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};Bz=Ybt([eL(2,If),eL(3,Ut),eL(4,Kd),eL(5,xi),eL(6,tc)],Bz);var bY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ku=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},RM;let Wz=class extends _e{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=$r(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=In(this,o=>{var r,s,a;const l=(r=this.model.read(o))===null||r===void 0?void 0:r.ghostText.read(o);if(!this.alwaysShowToolbar.read(o)||!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 ae(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=d,d}),this._register(Ja((o,r)=>{const s=this.model.read(o);if(!s||!this.alwaysShowToolbar.read(o))return;const a=r.add(this.instantiationService.createInstance(Hv,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),r.add(zt(()=>e.removeContentWidget(a))),r.add(Ii(l=>{!this.position.read(l)||s.lastTriggerKind.read(l)!==Kg.Explicit&&s.triggerExplicitly()}))}))}};Wz=bY([ku(2,$t)],Wz);const Zbt=Eo("inline-suggestion-hints-next",Xe.chevronRight,C("parameterHintsNextIcon","Icon for show next parameter hint.")),Qbt=Eo("inline-suggestion-hints-previous",Xe.chevronLeft,C("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Hv=RM=class extends _e{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){const o=new ca(e,t,n,!0,()=>this._commandService.executeCommand(e)),r=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return r&&(s=C({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,r.getLabel())),o.tooltip=s,o}constructor(e,t,n,o,r,s,a,l,c,d,u){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=o,this._suggestionCount=r,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=d,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${RM.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Or("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Or("div@toolBar")]),this.previousAction=this.createCommandAction(Dwe,C("previous","Previous"),Mt.asClassName(Qbt)),this.availableSuggestionCountAction=new ca("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(kwe,C("next","Next"),Mt.asClassName(Zbt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Z.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new bi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new bi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(Vz,this.nodes.toolBar,Z.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof Fd)return l.createInstance(e1t,h,void 0);if(h===this.availableSuggestionCountAction){const g=new Jbt(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=>{RM._dropDownVisible=h})),this._register(Ii(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(Ii(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Ii(h=>{const f=this._extraCommands.read(h);if(Lo(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:v=>this._commandService.executeCommand(p.id)}));for(const[p,v]of this.inlineCompletionsActionsMenus.getActions())for(const m of v)m instanceof Fd&&g.push(m);g.length>0&&g.unshift(new kr),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Hv._dropDownVisible=!1;Hv.id=0;Hv=RM=bY([ku(6,_o),ku(7,$t),ku(8,xi),ku(9,Ut),ku(10,If)],Hv);class Jbt extends Ow{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class e1t extends ab{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Or("div.keybinding").root;new cT(t,Vl,Object.assign({disableTitle:!0},Eft)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let Vz=class extends Bz{constructor(e,t,n,o,r,s,a,l){super(e,Object.assign({resetMenu:t},n),o,r,s,a,l),this.menuId=t,this.options2=n,this.menuService=o,this.contextKeyService=r,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,n,o,r,s,a;const l=[],c=[];Z1e(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(r=(o=this.options2)===null||o===void 0?void 0:o.toolbarOptions)===null||r===void 0?void 0:r.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Lo(this.prependedPrimaryActions,e,(t,n)=>t===n)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Lo(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};Vz=bY([ku(3,If),ku(4,Ut),ku(5,Kd),ku(6,xi),ku(7,tc)],Vz);var t1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Hz;const n1t=!1;let $a=Hz=class extends _e{static get(e){return e.getContribution(Hz.ID)}constructor(e,t,n,o,r){super(),this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=o,this._keybindingService=r,this._toUnhook=new Be,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new bi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(s=>{s.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(n=>this._onEditorMouseDown(n))),this._toUnhook.add(this._editor.onMouseUp(n=>this._onEditorMouseUp(n))),this._toUnhook.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._toUnhook.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))):(this._toUnhook.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._toUnhook.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))),this._toUnhook.add(this._editor.onMouseLeave(n=>this._onEditorMouseLeave(n))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(n=>this._onEditorScrollChanged(n)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const n=e.target;if(n.type===9&&n.detail===rv.ID){this._hoverClicked=!0;return}n.type===12&&n.detail===Vy.ID||(n.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,n;const o=e.event.browserEvent.relatedTarget;((t=this._contentWidget)===null||t===void 0?void 0:t.widget.isResizing)||((n=this._contentWidget)===null||n===void 0?void 0:n.containsNode(o))||this._hideWidgets()}_isMouseOverWidget(e){var t,n,o,r,s;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===rv.ID||this._isHoverSticky&&((t=this._contentWidget)===null||t===void 0?void 0:t.containsNode((n=e.event.browserEvent.view)===null||n===void 0?void 0:n.document.activeElement))&&!(!((r=(o=e.event.browserEvent.view)===null||o===void 0?void 0:o.getSelection())===null||r===void 0)&&r.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===rv.ID&&((s=this._contentWidget)===null||s===void 0?void 0:s.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===Vy.ID)}_onEditorMouseMove(e){var t,n,o,r;if(this._mouseMoveEvent=e,((t=this._contentWidget)===null||t===void 0?void 0:t.isFocused)||((n=this._contentWidget)===null||n===void 0?void 0:n.isResizing)||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&((o=this._contentWidget)===null||o===void 0?void 0:o.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(((r=this._contentWidget)===null||r===void 0?void 0:r.isVisible)&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,n,o;if(!e)return;const r=e.target,s=(t=r.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(s&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!n1t||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!s&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(n=this._glyphWidget)===null||n===void 0||n.hide();return}if(r.type===2&&r.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._glyphWidget||(this._glyphWidget=new Vy(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(r.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const n=this._keybindingService.softDispatch(e,this._editor.getDomNode()),o=n.kind===1||n.kind===2&&n.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&&!o&&this._hideWidgets()}_hideWidgets(){var e,t,n;this._isMouseDown&&this._hoverClicked&&((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible)||Hv.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(n=this._contentWidget)===null||n===void 0||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(gO,this._editor)),this._contentWidget}showContentHover(e,t,n,o,r=!1){this._hoverActivatedByColorDecoratorClick=r,this._getOrCreateContentWidget().startShowingAtRange(e,t,n,o)}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()}};$a.ID="editor.contrib.hover";$a=Hz=t1t([tR(1,$t),tR(2,ml),tR(3,Ki),tR(4,xi)],$a);class i1t extends ft{constructor(){super({id:"editor.action.showHover",label:C({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:Q.editorTextFocus,primary:Zo(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const o=$a.get(t);if(!o)return;const r=t.getPosition(),s=new V(r.lineNumber,r.column,r.lineNumber,r.column),a=t.getOption(2)===2||!!(n!=null&&n.focus);o.isHoverVisible?o.focus():o.showContentHover(s,1,1,a)}}class o1t extends ft{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:C({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 n=$a.get(t);if(!n)return;const o=t.getPosition();if(!o)return;const r=new V(o.lineNumber,o.column,o.lineNumber,o.column),s=vb.get(t);if(!s)return;s.startFindDefinitionFromCursor(o).then(()=>{n.showContentHover(r,1,1,!0)})}}class r1t extends ft{constructor(){super({id:"editor.action.scrollUpHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:16,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollUp()}}class s1t extends ft{constructor(){super({id:"editor.action.scrollDownHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:18,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollDown()}}class a1t extends ft{constructor(){super({id:"editor.action.scrollLeftHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:15,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollLeft()}}class l1t extends ft{constructor(){super({id:"editor.action.scrollRightHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:17,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollRight()}}class c1t extends ft{constructor(){super({id:"editor.action.pageUpHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=$a.get(t);!n||n.pageUp()}}class d1t extends ft{constructor(){super({id:"editor.action.pageDownHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=$a.get(t);!n||n.pageDown()}}class u1t extends ft{constructor(){super({id:"editor.action.goToTopHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=$a.get(t);!n||n.goToTop()}}class h1t extends ft{constructor(){super({id:"editor.action.goToBottomHover",label:C({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:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=$a.get(t);!n||n.goToBottom()}}Un($a.ID,$a,2);ze(i1t);ze(o1t);ze(r1t);ze(s1t);ze(a1t);ze(l1t);ze(c1t);ze(d1t);ze(u1t);ze(h1t);n1.register(vO);n1.register(Fz);jd((i,e)=>{const t=i.getColor(Wnt);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class $z extends _e{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 n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==Qye||!n.range)return;const o=this._editor.getContribution($a.ID);if(!!o&&!o.isColorPickerVisible){const r=new V(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);o.showContentHover(r,1,0,!1,!0)}}}$z.ID="editor.contrib.colorContribution";Un($z.ID,$z,2);n1.register(hO);var Iwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Su=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},tce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},zz,Uz;let $v=zz=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editor=e,this._modelService=n,this._keybindingService=o,this._instantiationService=r,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=Q.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=Q.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 bO(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(zz.ID)}};$v.ID="editor.contrib.standaloneColorPickerController";$v=zz=Iwe([Su(1,Ut),Su(2,Yi),Su(3,xi),Su(4,$t),Su(5,pt),Su(6,Ti)],$v);Un($v.ID,$v,1);const nce=8,f1t=22;let bO=Uz=class extends _e{constructor(e,t,n,o,r,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=n,this._modelService=r,this._keybindingService=s,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 le),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=o.createInstance(Pk,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(pf(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 Uz.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 tce(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);!t||this._onResult.fire(new g1t(t.result,t.foundInEditor))})}_computeAsync(e){return tce(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}},n=yield this._standaloneColorPickerParticipant.createColorHover(t,new uY(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return n?{result:n.colorHover,foundInEditor:n.foundInEditor}:null})}_render(e,t){const n=document.createDocumentFragment(),o=this._register(new pO(this._keybindingService));let r;const s={fragment:n,statusBar:o,setColorPicker:p=>r=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),r===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(n),r.layout();const a=r.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-f1t-nce,d=r.body.enterButton;d==null||d.onClicked(()=>{this.updateEditor(),this.hide()});const u=r.header,h=u.pickedColorNode;h.style.width=l+nce+"px";const f=u.originalColorNode;f.style.width=c+"px";const g=r.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)}};bO.ID="editor.contrib.standaloneColorPickerWidget";bO=Uz=Iwe([Su(3,$t),Su(4,Yi),Su(5,xi),Su(6,pt),Su(7,Ti)],bO);class g1t{constructor(e,t){this.value=e,this.foundInEditor=t}}class p1t extends lh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:C("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:C({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:Z.CommandPalette}]})}runEditorCommand(e,t){var n;(n=$v.get(t))===null||n===void 0||n.showOrFocus()}}class m1t extends ft{constructor(){super({id:"editor.action.hideColorPicker",label:C({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:Q.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=$v.get(t))===null||n===void 0||n.hide()}}class v1t extends ft{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:C({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:Q.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=$v.get(t))===null||n===void 0||n.insertColor()}}ze(m1t);ze(v1t);$i(p1t);class Mm{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const o=t.length,r=e.length;if(n+o>r)return!1;for(let s=0;s=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,n,o,r,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,u=r.getLineContent(a),h=r.getLineContent(c);let f=u.lastIndexOf(t,l-1+t.length),g=h.indexOf(n,d-1-n.length);if(f!==-1&&g!==-1)if(a===c)u.substring(f+t.length,g).indexOf(n)>=0&&(f=-1,g=-1);else{const v=u.substring(f+t.length),m=h.substring(0,g);(v.indexOf(n)>=0||m.indexOf(n)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(o&&f+t.length0&&h.charCodeAt(g-1)===32&&(n=" "+n,g-=1),p=Mm._createRemoveBlockCommentOperations(new V(a,f+t.length+1,c,g+1),t,n)):(p=Mm._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=p.length===1?n:null);for(const v of p)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,n){const o=[];return V.isEmpty(e)?o.push(Gi.delete(new V(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(o.push(Gi.delete(new V(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),o.push(Gi.delete(new V(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),o}static _createAddBlockCommentOperations(e,t,n,o){const r=[];return V.isEmpty(e)?r.push(Gi.replace(new V(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(r.push(Gi.insert(new ae(e.startLineNumber,e.startColumn),t+(o?" ":""))),r.push(Gi.insert(new ae(e.endLineNumber,e.endColumn),(o?" ":"")+n))),r}getEditOperations(e,t){const n=this._selection.startLineNumber,o=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const r=e.getLanguageIdAtPosition(n,o),s=this.languageConfigurationService.getLanguageConfiguration(r).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(n.length===2){const o=n[0],r=n[1];return new gt(o.range.endLineNumber,o.range.endColumn,r.range.startLineNumber,r.range.startColumn)}else{const o=n[0].range,r=this._usedEndToken?-this._usedEndToken.length-1:0;return new gt(o.endLineNumber,o.endColumn+r,o.endLineNumber,o.endColumn+r)}}}class ug{constructor(e,t,n,o,r,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=o,this._insertSpace=r,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,o){e.tokenization.tokenizeIfCheap(t);const r=e.getLanguageIdAtPosition(t,1),s=o.getLanguageConfiguration(r).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=n-t+1;cr?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class CY extends ft{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Ti);if(!t.hasModel())return;const o=t.getModel(),r=[],s=o.getOptions(),a=t.getOption(23),l=t.getSelections().map((d,u)=>({selection:d,index:u,ignoreFirstLine:!1}));l.sort((d,u)=>V.compareRangesUsingStarts(d.selection,u.selection));let c=l[0];for(let d=1;d=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},S_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jz;let Kw=jz=class{static get(e){return e.getContribution(jz.ID)}constructor(e,t,n,o,r,s,a,l){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=o,this._keybindingService=r,this._menuService=s,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&&nb(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 n=!1;for(const o of this._editor.getSelections())if(o.containsPosition(e.target.position)){n=!0;break}n||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?Z.SimpleEditorContext:Z.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],o=this._menuService.createMenu(t,this._contextKeyService),r=o.getActions({arg:e.uri});o.dispose();for(const s of r){const[,a]=s;let l=0;for(const c of a)if(c instanceof BD){const d=this._getMenuActions(e,c.item.submenu);d.length>0&&(n.push(new _w(c.id,c.label,d)),l++)}else n.push(c),l++;l&&n.push(new kr)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let o=t;if(!o){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Yo(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;o={x:l,y:c}}const r=this._editor.getOption(126)&&!Ku;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>o,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new Ow(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new Ow(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:n})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||rdt(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let n=0;const o=c=>({id:`menu-action-${++n}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled=="undefined"?!0:c.enabled,checked:c.checked,run:c.run}),r=(c,d)=>new _w(`menu-action-${++n}`,c,d,void 0),s=(c,d,u,h,f)=>{if(!d)return o({label:c,enabled:d,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(u,v)},p=[];for(const v of f)p.push(o({label:v.label,checked:h===v.value,run:g(v.value)}));return r(c,p)},a=[];a.push(o({label:C("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new kr),a.push(o({label:C("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(C("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:C("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:C("context.minimap.size.fill","Fill"),value:"fill"},{label:C("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(C("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:C("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:C("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!Ku;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()}};Kw.ID="editor.contrib.contextmenu";Kw=jz=w1t([S_(1,Kd),S_(2,Cp),S_(3,Ut),S_(4,xi),S_(5,If),S_(6,En),S_(7,rb)],Kw);class S1t extends ft{constructor(){super({id:"editor.action.showContextMenu",label:C("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=Kw.get(t))===null||n===void 0||n.showContextMenu()}}Un(Kw.ID,Kw,2);ze(S1t);class c7{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let o=0;o{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 n=new c7(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new d7(n,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 d7(new c7(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 d7(new c7(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}}_b.ID="editor.contrib.cursorUndoRedoController";class x1t extends ft{constructor(){super({id:"cursorUndo",label:C("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var o;(o=_b.get(t))===null||o===void 0||o.cursorUndo()}}class L1t extends ft{constructor(){super({id:"cursorRedo",label:C("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var o;(o=_b.get(t))===null||o===void 0||o.cursorRedo()}}Un(_b.ID,_b,0);ze(x1t);ze(L1t);class E1t{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new V(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),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 gt(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 gt(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)||(J1(e)&&(this._modifierPressed=!0),this._mouseDown&&J1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(J1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Qg.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 o=(this._editor.getSelections()||[]).filter(r=>t.position&&r.containsPosition(t.position));if(o.length===1)this._dragSelection=o[0];else return}J1(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 ae(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const o=this._editor.getSelection();if(o){const{selectionStartLineNumber:r,selectionStartColumn:s}=o;n=[new gt(r,s,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(o=>o.containsPosition(t)?new gt(t.lineNumber,t.column,t.lineNumber,t.column):o);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(J1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Qg.ID,new E1t(this._dragSelection,t,J1(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 V(e.lineNumber,e.column,e.lineNumber,e.column),options:Qg._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()}}Qg.ID="editor.contrib.dragAndDrop";Qg.TRIGGER_KEY_VALUE=Nn?6:5;Qg._DECORATION_OPTIONS=Jt.register({description:"dnd-target",className:"dnd-target"});Un(Qg.ID,Qg,2);const CF=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let o=0;oTwe(this,void 0,void 0,function*(){return i}),asFile:()=>{},value:typeof i=="string"?i:void 0}}function D1t(i,e,t){const n={id:CF(),name:i,uri:e,data:t};return{asString:()=>Twe(this,void 0,void 0,function*(){return""}),asFile:()=>n,value:void 0}}class Nwe{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 vn.some(this,([n,o])=>o.asFile())&&t.push("files"),Mwe(CO(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 n=this._entries.get(e);n?n.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 n of t)yield[e,n]}toKey(e){return CO(e)}}function CO(i){return i.toLowerCase()}function Rwe(i,e){return Mwe(CO(i),e.map(CO))}function Mwe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,o,r]=t;return r==="*"?e.some(s=>s.startsWith(o+"/")):!1}const yF=Object.freeze({create:i=>bv(i.map(e=>e.toString())).join(`\r `),split:i=>i.split(`\r -`),parse:i=>CF.split(i).filter(e=>!e.startsWith("#"))}),nce={EDITORS:"CodeEditors",FILES:"CodeFiles"};class E1t{}const D1t={DragAndDropContribution:"workbench.contributions.dragAndDrop"};no.add(D1t.DragAndDropContribution,new E1t);class Vk{constructor(){}static getInstance(){return Vk.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}Vk.INSTANCE=new Vk;var k1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Awe(i){const e=new Nwe;for(const t of i.items){const n=t.type;if(t.kind==="string"){const o=new Promise(r=>t.getAsString(r));e.append(n,CY(o))}else if(t.kind==="file"){const o=t.getAsFile();o&&e.append(n,I1t(o))}}return e}function I1t(i){const e=i.path?Rt.parse(i.path):void 0;return L1t(i.name,e,()=>k1t(this,void 0,void 0,function*(){return new Uint8Array(yield i.arrayBuffer())}))}const T1t=Object.freeze([nce.EDITORS,nce.FILES,vk.RESOURCES,vk.INTERNAL_URI_LIST]);function Pwe(i,e=!1){const t=Awe(i),n=t.get(vk.INTERNAL_URI_LIST);if(n)t.replace(xo.uriList,n);else if(e||!t.has(xo.uriList)){const o=[];for(const r of i.items){const s=r.getAsFile();if(s){const a=s.path;try{a?o.push(Rt.file(a).toString()):o.push(Rt.parse(s.name,!0).toString())}catch{}}}o.length&&t.replace(xo.uriList,CY(CF.create(o)))}for(const o of T1t)t.delete(o);return t}function N1t(i,e,t){var n,o;return{edits:[...e.map(r=>new Gg(i,typeof t.insertText=="string"?{range:r,text:t.insertText,insertAsSnippet:!1}:{range:r,text:t.insertText.snippet,insertAsSnippet:!0})),...(o=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&o!==void 0?o:[]]}}function Owe(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of i)if(c!==a&&t(l,c)){let d=n.get(a);d||(d=[],n.set(a,d)),d.push(c)}if(!n.size)return Array.from(i);const o=new Set,r=[];function s(a){if(!a.length)return[];const l=a[0];if(r.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(o.has(l))return s(a.slice(1));let c=[];const d=n.get(l);return d&&(r.push(l),c=s(d),r.pop()),o.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(i))}var R1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},M1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},A1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const P1t=Jt.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:X_e,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class yF extends _e{constructor(e,t,n,o,r){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=r,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(o),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=He(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=He("span.icon");this.domNode.append(t),t.classList.add(...Mt.asClassNameArray(Xe.loading),"codicon-modifier-spin");const n=()=>{const o=this.editor.getOption(66);this.domNode.style.height=`${o}px`,this.domNode.style.width=`${Math.ceil(.8*o)}px`};n(),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(52)||o.hasChanged(66))&&n()})),this._register(ke(this.domNode,et.CLICK,o=>{this.delegate.cancel()}))}getId(){return yF.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)}}yF.baseId="editor.widget.inlineProgressWidget";let yO=class extends _e{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Kr),this._currentWidget=new Kr,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,n){return A1t(this,void 0,void 0,function*(){const o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=Lv(()=>{const r=V.fromPositions(e);this._currentDecorations.set([{range:r,options:P1t}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(yF,this.id,this._editor,r,t,n))},this._showDelay);try{return yield n}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};yO=R1t([M1t(2,$t)],yO);var Fwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ME=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ice=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},jz;let wO=jz=class extends _e{constructor(e,t,n,o,r,s,a,l,c,d){super(),this.typeId=e,this.editor=t,this.showCommand=o,this.range=r,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(zt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(zt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{r.containsPosition(u.position)||this.dispose()})),this._register(st.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?` (${t})`:"")}create(){this.domNode=He(".post-edit-widget"),this.button=this._register(new I$(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ke(this.domNode,et.CLICK,()=>this.showSelector()))}getId(){return jz.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Yo(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>_y({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};wO.baseId="editor.widget.postEditWidget";wO=jz=Fwe([ME(7,Kd),ME(8,Ut),ME(9,xi)],wO);let SO=class extends _e{constructor(e,t,n,o,r,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=o,this._instantiationService=r,this._bulkEditService=s,this._currentWidget=this._register(new Kr),this._register(st.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,n,o){var r,s;return ice(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(v=>new Gg(a.uri,typeof l.insertText=="string"?{range:v,text:l.insertText,insertAsSnippet:!1}:{range:v,text:l.insertText.snippet,insertAsSnippet:!0}));const u={edits:[...c,...(s=(r=l.additionalEdit)===null||r===void 0?void 0:r.edits)!==null&&s!==void 0?s:[]]},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:o}),p=a.getDecorationRange(f[0])}finally{a.deltaDecorations(f,[])}n&&g.isApplied&&t.allEdits.length>1&&this.show(p!=null?p:h,t,v=>ice(this,void 0,void 0,function*(){const m=this._editor.getModel();!m||(yield m.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},n,o))}))})}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(wO,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};SO=Fwe([ME(4,$t),ME(5,oT)],SO);var O1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ig=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Kz;const Bwe="editor.changePasteType",Wwe=new lt("pasteWidgetVisible",!1,C("pasteWidgetVisible","Whether the paste widget is showing")),d7="application/vnd.code.copyMetadata";let bb=Kz=class extends _e{static get(e){return e.getContribution(Kz.ID)}constructor(e,t,n,o,r,s,a){super(),this._bulkEditService=n,this._clipboardService=o,this._languageFeaturesService=r,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(ke(l,"copy",c=>this.handleCopy(c))),this._register(ke(l,"cut",c=>this.handleCopy(c))),this._register(ke(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new yO("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(SO,"pasteIntoEditor",e,Wwe,{id:Bwe,label:C("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},e5().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,n;if(!this._editor.hasTextFocus()||(Xv&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const o=this._editor.getModel(),r=this._editor.getSelections();if(!o||!(r!=null&&r.length))return;const s=this._editor.getOption(37);let a=r;const l=r.length===1&&r[0].isEmpty();if(l){if(!s)return;a=[new V(a[0].startLineNumber,1,a[0].startLineNumber,1+o.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(r,s,ls),u={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(m=>!!m.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:u});return}const f=Awe(e.clipboardData),g=h.flatMap(m=>{var _;return(_=m.copyMimeTypes)!==null&&_!==void 0?_:[]}),p=bF();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:u});const v=sr(m=>ig(this,void 0,void 0,function*(){const _=hf(yield Promise.all(h.map(y=>ig(this,void 0,void 0,function*(){try{return yield y.prepareDocumentPaste(o,a,f,m)}catch(w){console.error(w);return}}))));_.reverse();for(const y of _)for(const[w,L]of y)f.replace(w,L);return f}));(n=this._currentCopyOperation)===null||n===void 0||n.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:v}}handlePaste(e){var t,n;return ig(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 o=this._editor.getModel(),r=this._editor.getSelections();if(!(r!=null&&r.length)||!o||!this.isPasteAsEnabled())return;const s=this.fetchCopyMetadata(e),a=Pwe(e.clipboardData);a.delete(d7);const l=[...e.clipboardData.types,...(n=s==null?void 0:s.providerCopyMimeTypes)!==null&&n!==void 0?n:[],xo.uriList],c=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(d=>{var u;return(u=d.pasteMimeTypes)===null||u===void 0?void 0:u.some(h=>Rwe(h,l))});!c.length||(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,c,r,a,s):this.doPasteInline(c,r,a,s))})}doPasteInline(e,t,n,o){const r=sr(s=>ig(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),c=new Av(a,3,void 0,s);try{if(yield this.mergeInDataFromCopy(n,o,c.token),c.token.isCancellationRequested)return;const d=e.filter(h=>oce(h,n));if(!d.length||d.length===1&&d[0].id==="text"){yield this.applyDefaultPasteHandler(n,o,c.token);return}const u=yield this.getPasteEdits(d,n,l,t,c.token);if(c.token.isCancellationRequested)return;if(u.length===1&&u[0].providerId==="text"){yield this.applyDefaultPasteHandler(n,o,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(n,o,c.token)}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),C("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),r),this._currentPasteOperation=r}showPasteAsPick(e,t,n,o,r){const s=sr(a=>ig(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),d=new Av(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(o,r,d.token),d.token.isCancellationRequested)return;let u=t.filter(p=>oce(p,o));e&&(u=u.filter(p=>p.id===e));const h=yield this.getPasteEdits(u,o,c,n,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(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:C("pasteAsPickerPlaceholder","Select Paste Action")});f=p==null?void 0:p.edit}if(!f)return;const g=N1t(c.uri,n,f);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:C("pasteAsProgress","Running paste handlers")},()=>s)}setCopyMetadata(e,t){e.setData(d7,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const n=e.clipboardData.getData(d7);if(n)try{return JSON.parse(n)}catch{return}const[o,r]=bH.getTextData(e.clipboardData);if(r)return{defaultPastePayload:{mode:r.mode,multicursorText:(t=r.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!r.isFromEmptySelection}}}mergeInDataFromCopy(e,t,n){var o;return ig(this,void 0,void 0,function*(){if((t==null?void 0:t.id)&&((o=this._currentCopyOperation)===null||o===void 0?void 0:o.handle)===t.id){const r=yield this._currentCopyOperation.dataTransferPromise;if(n.isCancellationRequested)return;for(const[s,a]of r)e.replace(s,a)}if(!e.has(xo.uriList)){const r=yield this._clipboardService.readResources();if(n.isCancellationRequested)return;r.length&&e.append(xo.uriList,CY(CF.create(r)))}})}getPasteEdits(e,t,n,o,r){return ig(this,void 0,void 0,function*(){const s=yield n5(Promise.all(e.map(l=>ig(this,void 0,void 0,function*(){var c;try{const d=yield(c=l.provideDocumentPasteEdits)===null||c===void 0?void 0:c.call(l,n,o,t,r);if(d)return Object.assign(Object.assign({},d),{providerId:l.id})}catch(d){console.error(d)}}))),r),a=hf(s!=null?s:[]);return Owe(a)})}applyDefaultPasteHandler(e,t,n){var o,r,s;return ig(this,void 0,void 0,function*(){const a=(o=e.get(xo.text))!==null&&o!==void 0?o:e.get("text");if(!a)return;const l=yield a.asString();if(n.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(r=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&r!==void 0?r:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)})}};bb.ID="editor.contrib.copyPasteActionController";bb=Kz=O1t([eC(1,$t),eC(2,oT),eC(3,wp),eC(4,pt),eC(5,dh),eC(6,L1e)],bb);function oce(i,e){var t;return Boolean((t=i.pasteMimeTypes)===null||t===void 0?void 0:t.some(n=>e.matches(n)))}var yY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Hk=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const wY=C("builtIn","Built-in");class SY{provideDocumentPasteEdits(e,t,n,o){return qw(this,void 0,void 0,function*(){const r=yield this.getEdit(n,o);return r?{insertText:r.insertText,label:r.label,detail:r.detail,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}:void 0})}provideDocumentOnDropEdits(e,t,n,o){return qw(this,void 0,void 0,function*(){const r=yield this.getEdit(n,o);return r?{insertText:r.insertText,label:r.label,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}:void 0})}}class Vwe extends SY{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[xo.text],this.pasteMimeTypes=[xo.text]}getEdit(e,t){return qw(this,void 0,void 0,function*(){const n=e.get(xo.text);if(!n||e.has(xo.uriList))return;const o=yield n.asString();return{handledMimeType:xo.text,label:C("text.label","Insert Plain Text"),detail:wY,insertText:o}})}}class Hwe extends SY{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[xo.uriList],this.pasteMimeTypes=[xo.uriList]}getEdit(e,t){return qw(this,void 0,void 0,function*(){const n=yield $we(e);if(!n.length||t.isCancellationRequested)return;let o=0;const r=n.map(({uri:a,originalText:l})=>a.scheme===hn.file?a.fsPath:(o++,l)).join(" ");let s;return o>0?s=n.length>1?C("defaultDropProvider.uriList.uris","Insert Uris"):C("defaultDropProvider.uriList.uri","Insert Uri"):s=n.length>1?C("defaultDropProvider.uriList.paths","Insert Paths"):C("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:xo.uriList,insertText:r,label:s,detail:wY}})}}let xO=class extends SY{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[xo.uriList],this.pasteMimeTypes=[xo.uriList]}getEdit(e,t){return qw(this,void 0,void 0,function*(){const n=yield $we(e);if(!n.length||t.isCancellationRequested)return;const o=hf(n.map(({uri:r})=>{const s=this._workspaceContextService.getWorkspaceFolder(r);return s?jst(s.uri,r):void 0}));if(!!o.length)return{handledMimeType:xo.uriList,insertText:o.join(" "),label:n.length>1?C("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):C("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:wY}})}};xO=yY([Hk(0,rb)],xO);function $we(i){return qw(this,void 0,void 0,function*(){const e=i.get(xo.uriList);if(!e)return[];const t=yield e.asString(),n=[];for(const o of CF.parse(t))try{n.push({uri:Rt.parse(o),originalText:o})}catch{}return n})}let qz=class extends _e{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new Vwe)),this._register(e.documentOnDropEditProvider.register("*",new Hwe)),this._register(e.documentOnDropEditProvider.register("*",new xO(t)))}};qz=yY([Hk(0,pt),Hk(1,rb)],qz);let Gz=class extends _e{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Vwe)),this._register(e.documentPasteEditProvider.register("*",new Hwe)),this._register(e.documentPasteEditProvider.register("*",new xO(t)))}};Gz=yY([Hk(0,pt),Hk(1,rb)],Gz);Un(bb.ID,bb,0);X5(Gz);Ye(new class extends Ir{constructor(){super({id:Bwe,precondition:Wwe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=bb.get(e))===null||n===void 0?void 0:n.changePasteType()}});ze(class extends ft{constructor(){super({id:"editor.action.pasteAs",label:C("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:C("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const o=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=bb.get(e))===null||n===void 0?void 0:n.pasteAs(o)}});class F1t{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 rce{constructor(e){this.identifier=e}}const zwe=yn("treeViewsDndService");Mn(zwe,F1t,1);var B1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},tL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Xz;const Uwe="editor.experimental.dropIntoEditor.defaultProvider",jwe="editor.changeDropType",Kwe=new lt("dropWidgetVisible",!1,C("dropWidgetVisible","Whether the drop widget is showing"));let Gw=Xz=class extends _e{static get(e){return e.getContribution(Xz.ID)}constructor(e,t,n,o,r){super(),this._configService=n,this._languageFeaturesService=o,this._treeViewsDragAndDropService=r,this.treeItemsTransfer=Vk.getInstance(),this._dropProgressManager=this._register(t.createInstance(yO,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(SO,"dropIntoEditor",e,Kwe,{id:jwe,label:C("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,n){var o;return tL(this,void 0,void 0,function*(){if(!n.dataTransfer||!e.hasModel())return;(o=this._currentOperation)===null||o===void 0||o.cancel(),e.focus(),e.setPosition(t);const r=sr(s=>tL(this,void 0,void 0,function*(){const a=new Av(e,1,void 0,s);try{const l=yield this.extractDataTransferData(n);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([V.fromPositions(t)],{activeEditIndex:h,allEdits:u},f,s)}}finally{a.dispose(),this._currentOperation===r&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,C("dropIntoEditorProgress","Running drop handlers. Click to cancel"),r),this._currentOperation=r})}getDropEdits(e,t,n,o,r){return tL(this,void 0,void 0,function*(){const s=yield n5(Promise.all(e.map(l=>tL(this,void 0,void 0,function*(){try{const c=yield l.provideDocumentOnDropEdits(t,n,o,r.token);if(c)return Object.assign(Object.assign({},c),{providerId:l.id})}catch(c){console.error(c)}}))),r.token),a=hf(s!=null?s:[]);return Owe(a)})}getInitialActiveEditIndex(e,t){const n=this._configService.getValue(Uwe,{resource:e.uri});for(const[o,r]of Object.entries(n)){const s=t.findIndex(a=>r===a.providerId&&a.handledMimeType&&Rwe(o,[a.handledMimeType]));if(s>=0)return s}return 0}extractDataTransferData(e){return tL(this,void 0,void 0,function*(){if(!e.dataTransfer)return new Nwe;const t=Pwe(e.dataTransfer);if(this.treeItemsTransfer.hasData(rce.prototype)){const n=this.treeItemsTransfer.getData(rce.prototype);if(Array.isArray(n))for(const o of n){const r=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(o.identifier);if(r)for(const[s,a]of r)t.replace(s,a)}}return t})}};Gw.ID="editor.contrib.dropIntoEditorController";Gw=Xz=B1t([nR(1,$t),nR(2,En),nR(3,pt),nR(4,zwe)],Gw);Un(Gw.ID,Gw,2);Ye(new class extends Ir{constructor(){super({id:jwe,precondition:Kwe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=Gw.get(e))===null||n===void 0||n.changeDropType()}});X5(qz);no.as(ch.Configuration).registerConfiguration(Object.assign(Object.assign({},I5),{properties:{[Uwe]:{type:"object",scope:5,description:C("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class Os{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&&(o.changeDecorationOptions(this._highlightedDecorationId,Os._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,o.changeDecorationOptions(this._highlightedDecorationId,Os._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(o.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let r=this._editor.getModel().getDecorationRange(t);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){const s=r.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);r=new V(r.startLineNumber,r.startColumn,s,a)}this._rangeHighlightDecorationId=o.addDecoration(r,Os._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let o=Os._FIND_MATCH_DECORATION;const r=[];if(e.length>1e3){o=Os._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):(r.push({range:new V(u,1,h,1),options:Os._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=p.startLineNumber,h=p.endLineNumber)}r.push({range:new V(u,1,h,1),options:Os._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;an.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,Os._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],o=this._editor.getModel().getDecorationRange(n);if(!(!o||o.endLineNumber>e.lineNumber)){if(o.endLineNumbere.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;te.lineNumber)return r;if(!(r.startColumn0){const n=[];for(let s=0;sV.compareRangesUsingStarts(s.range,a.range));const o=[];let r=n[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function sce(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function ace(i,e,t){const n=e.split(t),o=i[0].split(t);let r="";return n.forEach((s,a)=>{r+=qwe([o[a]],s)+t}),r.slice(0,-1)}class lce{constructor(e){this.staticValue=e,this.kind=0}}class V1t{constructor(e){this.pieces=e,this.kind=1}}class Xw{static fromStaticValue(e){return new Xw([F0.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new lce(""):e.length===1&&e[0].staticValue!==null?this._state=new lce(e[0].staticValue):this._state=new V1t(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?qwe(e,this._state.staticValue):this._state.staticValue;let n="";for(let o=0,r=this._state.pieces.length;o0){const l=[],c=s.caseOps.length;let d=0;for(let u=0,h=a.length;u=c){l.push(a.slice(u));break}switch(s.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("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e=o)break;const s=i.charCodeAt(n);switch(s){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(` -`,n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic(" ",n+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(n-1),t.emitStatic("",n+1),e.push(String.fromCharCode(s));break}continue}if(r===36){if(n++,n>=o)break;const s=i.charCodeAt(n);if(s===36){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(s===48||s===38){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(n+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(n=>{(n.reason===3||n.reason===5||n.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(n=>{this._ignoreModelContentChanged||(n.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(n=>this._onStateChanged(n))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,si(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)},z1t)):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 n=null;typeof t!="undefined"?t!==null&&(Array.isArray(t)?n=t:n=[t]):n=this._decorations.getFindScopes(),n!==null&&(n=n.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new V(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const o=this._findMatches(n,!1,Mm);this._decorations.set(o,n);const r=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(r);if(s===0&&o.length>0){const a=UD(o.map(l=>l.range),l=>V.compareRangesUsingStarts(l,r)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,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:n,column:o}=e;const r=this._editor.getModel();return t||o===1?(n===1?n=r.getLineCount():n--,o=r.getLineMaxColumn(n)):o--,new ae(n,o)}_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:n,column:o}=e;const r=this._editor.getModel();return t||o===r.getLineMaxColumn(n)?(n===r.getLineCount()?n=1:n++,o=1):o++,new ae(n,o)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const n=this._decorations.matchBeforePosition(e);n&&this._setCurrentFindMatch(n);return}if(this._decorations.getCount()AE._getSearchRange(this._editor.getModel(),r));return this._editor.getModel().findMatches(this._state.searchString,o,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Mm?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new A_(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!t)return;let n=t.regex;if(!n.multiline){let u="mu";n.ignoreCase&&(u+="i"),n.global&&(u+="g"),n=new RegExp(n.source,u)}const o=this._editor.getModel(),r=o.getValue(1),s=o.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=r.replace(n,function(){return a.buildReplaceString(arguments,c)}):l=r.replace(n,a.buildReplaceString(null,c));const d=new PG(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),o=[];for(let s=0,a=n.length;ss.range),o);this._executeEditorCommand("replaceAll",r)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let n=this._findMatches(e,!1,1073741824).map(r=>new gt(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn));const o=this._editor.getSelection();for(let r=0,s=n.length;rthis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=n,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 o={inputActiveOptionBorder:ct(xG),inputActiveOptionForeground:ct(LG),inputActiveOptionBackground:ct(f0)};this.caseSensitive=this._register(new nCe(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},o))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new iCe(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleWholeWordCommand),isChecked:this._state.wholeWord},o))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new oCe(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleRegexCommand),isChecked:this._state.isRegex},o))),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(r=>{let s=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(ke(this._domNode,et.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(ke(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return SF.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")}}SF.ID="editor.contrib.findOptionsWidget";function lR(i,e){return i===1?!0:i===2?!1:e}class U1t extends _e{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return lR(this._isRegexOverride,this._isRegex)}get wholeWord(){return lR(this._wholeWordOverride,this._wholeWord)}get matchCase(){return lR(this._matchCaseOverride,this._matchCase)}get preserveCase(){return lR(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 le),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,n){const o={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 r=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,o.matchesPosition=!0,r=!0),this._matchesCount!==t&&(this._matchesCount=t,o.matchesCount=!0,r=!0),typeof n!="undefined"&&(V.equalsRange(this._currentMatch,n)||(this._currentMatch=n,o.currentMatch=!0,r=!0)),r&&this._onFindReplaceStateChange.fire(o)}change(e,t,n=!0){var o;const r={moveCursor:t,updateHistory:n,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 s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,d=this.preserveCase;typeof e.searchString!="undefined"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,r.searchString=!0,s=!0),typeof e.replaceString!="undefined"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,r.replaceString=!0,s=!0),typeof e.isRevealed!="undefined"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,r.isRevealed=!0,s=!0),typeof e.isReplaceRevealed!="undefined"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,r.isReplaceRevealed=!0,s=!0),typeof e.isRegex!="undefined"&&(this._isRegex=e.isRegex),typeof e.wholeWord!="undefined"&&(this._wholeWord=e.wholeWord),typeof e.matchCase!="undefined"&&(this._matchCase=e.matchCase),typeof e.preserveCase!="undefined"&&(this._preserveCase=e.preserveCase),typeof e.searchScope!="undefined"&&(!((o=e.searchScope)===null||o===void 0)&&o.every(u=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!V.equalsRange(f,u))})||(this._searchScope=e.searchScope,r.searchScope=!0,s=!0)),typeof e.loop!="undefined"&&this._loop!==e.loop&&(this._loop=e.loop,r.loop=!0,s=!0),typeof e.isSearching!="undefined"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,r.isSearching=!0,s=!0),typeof e.filters!="undefined"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,r.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride!="undefined"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride!="undefined"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride!="undefined"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride!="undefined"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,r.isRegex=!0),l!==this.wholeWord&&(s=!0,r.wholeWord=!0),c!==this.matchCase&&(s=!0,r.matchCase=!0),d!==this.preserveCase&&(s=!0,r.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(r)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Mm}}const j1t=C("defaultLabel","input"),K1t=C("label.preserveCaseToggle","Preserve Case");class q1t extends kS{constructor(e){super({icon:Xe.preserveCase,title:K1t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class G1t extends Ud{constructor(e,t,n,o){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new le),this._onInput=this._register(new le),this._onKeyUp=this._register(new le),this._onPreserveCaseKeyDown=this._register(new le),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=o.placeholder||"",this.validation=o.validation,this.label=o.label||j1t;const r=o.appendPreserveCaseLabel||"",s=o.history||[],a=!!o.flexibleHeight,l=!!o.flexibleWidth,c=o.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new rCe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:o.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:o.inputBoxStyles})),this.preserveCase=this._register(new q1t(Object.assign({appendTitle:r,isChecked:!1},o.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(),un.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 Gwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Xwe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const LY=new lt("suggestWidgetVisible",!1,C("suggestWidgetVisible","Whether suggestion are visible")),EY="historyNavigationWidgetFocus",Ywe="historyNavigationForwardsEnabled",Zwe="historyNavigationBackwardsEnabled";let Jg;const cR=[];function Qwe(i,e){if(cR.includes(e))throw new Error("Cannot register the same widget multiple times");cR.push(e);const t=new Be,n=new lt(EY,!1).bindTo(i),o=new lt(Ywe,!0).bindTo(i),r=new lt(Zwe,!0).bindTo(i),s=()=>{n.set(!0),Jg=e},a=()=>{n.set(!1),Jg===e&&(Jg=void 0)};return e.element===document.activeElement&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(zt(()=>{cR.splice(cR.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:o,historyNavigationBackwardsEnablement:r,dispose(){t.dispose()}}}let Yz=class extends sCe{constructor(e,t,n,o){super(e,t,n);const r=this._register(o.createScoped(this.inputBox.element));this._register(Qwe(r,this.inputBox))}};Yz=Gwe([Xwe(3,Ut)],Yz);let Zz=class extends G1t{constructor(e,t,n,o,r=!1){super(e,t,r,n);const s=this._register(o.createScoped(this.inputBox.element));this._register(Qwe(s,this.inputBox))}};Zz=Gwe([Xwe(3,Ut)],Zz);Va.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Me.and(Me.has(EY),Me.equals(Zwe,!0),Me.not("isComposing"),LY.isEqualTo(!1)),primary:16,secondary:[528],handler:i=>{Jg==null||Jg.showPreviousValue()}});Va.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Me.and(Me.has(EY),Me.equals(Ywe,!0),Me.not("isComposing"),LY.isEqualTo(!1)),primary:18,secondary:[530],handler:i=>{Jg==null||Jg.showNextValue()}});function cce(i){var e,t;return((e=i.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=i.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var X1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Y1t=Eo("find-selection",Xe.selection,C("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),dce=Eo("find-collapsed",Xe.chevronRight,C("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),uce=Eo("find-expanded",Xe.chevronDown,C("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),Z1t=Eo("find-replace",Xe.replace,C("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),Q1t=Eo("find-replace-all",Xe.replaceAll,C("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),J1t=Eo("find-previous-match",Xe.arrowUp,C("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),eCt=Eo("find-next-match",Xe.arrowDown,C("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),tCt=C("label.findDialog","Find / Replace"),nCt=C("label.find","Find"),iCt=C("placeholder.find","Find"),oCt=C("label.previousMatchButton","Previous Match"),rCt=C("label.nextMatchButton","Next Match"),sCt=C("label.toggleSelectionFind","Find in Selection"),aCt=C("label.closeButton","Close"),lCt=C("label.replace","Replace"),cCt=C("placeholder.replace","Replace"),dCt=C("label.replaceButton","Replace"),uCt=C("label.replaceAllButton","Replace All"),hCt=C("label.toggleReplaceButton","Toggle Replace"),fCt=C("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Mm),gCt=C("label.matchesLocation","{0} of {1}"),hce=C("label.noResults","No results"),_h=419,pCt=275,mCt=pCt-54;let nL=69;const vCt=33,fce="ctrlEnterReplaceAll.windows.donotask",gce=Nn?256:2048;class u7{constructor(e){this.afterLineNumber=e,this.heightInPx=vCt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function pce(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionStart>0){i.stopPropagation();return}}function mce(i,e,t){const n=!!e.match(/\n/);if(t&&n&&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 u7(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>X1t(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=wF.bindTo(s),this._findFocusTracker=this._register(pf(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=xY.bindTo(s),this._replaceFocusTracker=this._register(pf(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 u7(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 xF.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=Ea(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,en)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=nL+"px",this._state.matchesCount>=Mm?this._matchesCount.title=fCt: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>=Mm&&(t+="+");let n=String(this._state.matchesPosition);n==="0"&&(n="?"),e=Z0(gCt,n,t)}else e=hce;this._matchesCount.appendChild(document.createTextNode(e)),Cs(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),nL=Math.max(nL,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===hce)return n===""?C("ariaSearchNoResultEmpty","{0} found",e):C("ariaSearchNoResult","{0} found for '{1}'",e,n);if(t){const o=C("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,n,t.startLineNumber+":"+t.startColumn),r=this._codeEditor.getModel();return r&&t.startLineNumber<=r.getLineCount()&&t.startLineNumber>=1?`${r.getLineContent(t.startLineNumber)}, ${o}`:o}return C("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,n)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,n=this._toggleSelectionFind.checked;this._isVisible&&(n||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 n=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&n)}_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 n=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=n;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 n=this._codeEditor.getDomNode();if(n){const o=Yo(n),r=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=o.left+(r?r.left:0),a=r?r.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=g0e(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());o.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 n=this._viewZone;this._viewZoneId!==void 0||!n||this._codeEditor.changeViewZones(o=>{n.heightInPx=this._getHeight(),this._viewZoneId=o.addZone(n),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+n.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new u7(0));const n=this._viewZone;this._codeEditor.changeViewZones(o=>{if(this._viewZoneId!==void 0){const r=this._getHeight();if(r===n.heightInPx)return;const s=r-n.heightInPx;n.heightInPx=r,o.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let r=this._getHeight();if(r-=this._codeEditor.getOption(83).top,r<=0)return;n.heightInPx=r,this._viewZoneId=o.addZone(n),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r)}})}_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||!sG(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 n=e.width,o=e.minimap.minimapWidth;let r=!1,s=!1,a=!1;if(this._resized&&Ea(this._domNode)>_h){this._domNode.style.maxWidth=`${n-28-o-15}px`,this._replaceInput.width=Ea(this._findInput.domNode);return}if(_h+28+o>=n&&(s=!0),_h+28+o-nL>=n&&(a=!0),_h+28+o-nL>=n+50&&(r=!0),this._domNode.classList.toggle("collapsed-find-widget",r),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",s),!a&&!r&&(this._domNode.style.maxWidth=`${n-28-o-15}px`),this._findInput.layout({collapsedFindWidget:r,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=Ea(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(!!this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const n=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!V.equalsRange(t,n)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(gce|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return pce(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return mce(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(gce|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{ls&&Fu&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(C("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(fce,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return pce(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return mce(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new Yz(null,this._contextViewProvider,{width:mCt,label:nCt,placeholder:iCt,appendCaseSensitiveLabel:this._keybindingLabelFor(Ri.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ri.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ri.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:()=>cce(this._keybindingService),inputBoxStyles:WP,toggleStyles:BP},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()})),xs&&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 tC({label:oCt+this._keybindingLabelFor(Ri.PreviousMatchFindAction),icon:J1t,onTrigger:()=>{c0(this._codeEditor.getAction(Ri.PreviousMatchFindAction)).run().then(void 0,en)}})),this._nextBtn=this._register(new tC({label:rCt+this._keybindingLabelFor(Ri.NextMatchFindAction),icon:eCt,onTrigger:()=>{c0(this._codeEditor.getAction(Ri.NextMatchFindAction)).run().then(void 0,en)}}));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",n.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new kS({icon:Y1t,title:sCt+this._keybindingLabelFor(Ri.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:ct(f0),inputActiveOptionBorder:ct(xG),inputActiveOptionForeground:ct(LG)})),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)})),o.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new tC({label:aCt+this._keybindingLabelFor(Ri.CloseFindWidgetCommand),icon:ICe,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 Zz(null,void 0,{label:lCt,placeholder:cCt,appendPreserveCaseLabel:this._keybindingLabelFor(Ri.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>cce(this._keybindingService),inputBoxStyles:WP,toggleStyles:BP},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 tC({label:dCt+this._keybindingLabelFor(Ri.ReplaceOneAction),icon:Z1t,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new tC({label:uCt+this._keybindingLabelFor(Ri.ReplaceAllAction),icon:Q1t,onTrigger:()=>{this._controller.replaceAll()}}));const r=document.createElement("div");r.className="replace-part",r.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",r.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new tC({label:hCt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Ea(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=tCt,this._domNode.role="dialog",this._domNode.style.width=`${_h}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(r),this._resizeSash=new gs(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=_h;this._register(this._resizeSash.onDidStart(()=>{a=Ea(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(c<_h)return;const d=parseFloat(J4(this._domNode).maxWidth)||0;c>d||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=Ea(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=Ea(this._domNode);if(l<_h)return;let c=_h;if(!this._resized||l===_h){const d=this._codeEditor.getLayoutInfo();c=d.width-28-d.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=Ea(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}xF.ID="editor.contrib.findWidget";class tC extends Ud{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+Mt.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=t,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,n=>{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{var o,r;if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}(r=(o=this._opts).onKeyDown)===null||r===void 0||r.call(o,n)})}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(...Mt.asClassNameArray(dce)),this._domNode.classList.add(...Mt.asClassNameArray(uce))):(this._domNode.classList.remove(...Mt.asClassNameArray(uce)),this._domNode.classList.add(...Mt.asClassNameArray(dce)))}}jd((i,e)=>{const t=(p,v)=>{v&&e.addRule(`.monaco-editor ${p} { background-color: ${v}; }`)};t(".findMatch",i.getColor(Jh)),t(".currentFindMatch",i.getColor(Mnt)),t(".findScope",i.getColor(Ant));const n=i.getColor(po);t(".find-widget",n);const o=i.getColor(Gh);o&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${o}; }`);const r=i.getColor(SG);r&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${r}; border-right: 1px solid ${r}; border-bottom: 1px solid ${r}; }`);const s=i.getColor(Lm);s&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Hu(i.type)?"dotted":"solid"} ${s}; box-sizing: border-box; }`);const a=i.getColor(Pnt);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=i.getColor(Ont);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${Hu(i.type)?"dashed":"solid"} ${l}; }`);const c=i.getColor(Ln);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const d=i.getColor(Zh);d&&e.addRule(`.monaco-editor .find-widget { color: ${d}; }`);const u=i.getColor(nnt);u&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${u}; }`);const h=i.getColor(xnt);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const p=i.getColor(Qh);p&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${p}; }`)}const f=i.getColor(vH);f&&e.addRule(` +`),parse:i=>yF.split(i).filter(e=>!e.startsWith("#"))}),ice={EDITORS:"CodeEditors",FILES:"CodeFiles"};class k1t{}const I1t={DragAndDropContribution:"workbench.contributions.dragAndDrop"};no.add(I1t.DragAndDropContribution,new k1t);class Vk{constructor(){}static getInstance(){return Vk.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}Vk.INSTANCE=new Vk;var T1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Awe(i){const e=new Nwe;for(const t of i.items){const n=t.type;if(t.kind==="string"){const o=new Promise(r=>t.getAsString(r));e.append(n,yY(o))}else if(t.kind==="file"){const o=t.getAsFile();o&&e.append(n,N1t(o))}}return e}function N1t(i){const e=i.path?Rt.parse(i.path):void 0;return D1t(i.name,e,()=>T1t(this,void 0,void 0,function*(){return new Uint8Array(yield i.arrayBuffer())}))}const R1t=Object.freeze([ice.EDITORS,ice.FILES,vk.RESOURCES,vk.INTERNAL_URI_LIST]);function Pwe(i,e=!1){const t=Awe(i),n=t.get(vk.INTERNAL_URI_LIST);if(n)t.replace(xo.uriList,n);else if(e||!t.has(xo.uriList)){const o=[];for(const r of i.items){const s=r.getAsFile();if(s){const a=s.path;try{a?o.push(Rt.file(a).toString()):o.push(Rt.parse(s.name,!0).toString())}catch{}}}o.length&&t.replace(xo.uriList,yY(yF.create(o)))}for(const o of R1t)t.delete(o);return t}function M1t(i,e,t){var n,o;return{edits:[...e.map(r=>new Gg(i,typeof t.insertText=="string"?{range:r,text:t.insertText,insertAsSnippet:!1}:{range:r,text:t.insertText.snippet,insertAsSnippet:!0})),...(o=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&o!==void 0?o:[]]}}function Owe(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of i)if(c!==a&&t(l,c)){let d=n.get(a);d||(d=[],n.set(a,d)),d.push(c)}if(!n.size)return Array.from(i);const o=new Set,r=[];function s(a){if(!a.length)return[];const l=a[0];if(r.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(o.has(l))return s(a.slice(1));let c=[];const d=n.get(l);return d&&(r.push(l),c=s(d),r.pop()),o.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(i))}var A1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},P1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},O1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const F1t=Jt.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:X_e,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class wF extends _e{constructor(e,t,n,o,r){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=r,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(o),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=He(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=He("span.icon");this.domNode.append(t),t.classList.add(...Mt.asClassNameArray(Xe.loading),"codicon-modifier-spin");const n=()=>{const o=this.editor.getOption(66);this.domNode.style.height=`${o}px`,this.domNode.style.width=`${Math.ceil(.8*o)}px`};n(),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(52)||o.hasChanged(66))&&n()})),this._register(ke(this.domNode,et.CLICK,o=>{this.delegate.cancel()}))}getId(){return wF.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)}}wF.baseId="editor.widget.inlineProgressWidget";let yO=class extends _e{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Kr),this._currentWidget=new Kr,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,n){return O1t(this,void 0,void 0,function*(){const o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=Lv(()=>{const r=V.fromPositions(e);this._currentDecorations.set([{range:r,options:F1t}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(wF,this.id,this._editor,r,t,n))},this._showDelay);try{return yield n}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};yO=A1t([P1t(2,$t)],yO);var Fwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ME=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},oce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Kz;let wO=Kz=class extends _e{constructor(e,t,n,o,r,s,a,l,c,d){super(),this.typeId=e,this.editor=t,this.showCommand=o,this.range=r,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(zt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(zt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{r.containsPosition(u.position)||this.dispose()})),this._register(st.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?` (${t})`:"")}create(){this.domNode=He(".post-edit-widget"),this.button=this._register(new T$(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ke(this.domNode,et.CLICK,()=>this.showSelector()))}getId(){return Kz.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Yo(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>_y({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};wO.baseId="editor.widget.postEditWidget";wO=Kz=Fwe([ME(7,Kd),ME(8,Ut),ME(9,xi)],wO);let SO=class extends _e{constructor(e,t,n,o,r,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=o,this._instantiationService=r,this._bulkEditService=s,this._currentWidget=this._register(new Kr),this._register(st.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,n,o){var r,s;return oce(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(v=>new Gg(a.uri,typeof l.insertText=="string"?{range:v,text:l.insertText,insertAsSnippet:!1}:{range:v,text:l.insertText.snippet,insertAsSnippet:!0}));const u={edits:[...c,...(s=(r=l.additionalEdit)===null||r===void 0?void 0:r.edits)!==null&&s!==void 0?s:[]]},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:o}),p=a.getDecorationRange(f[0])}finally{a.deltaDecorations(f,[])}n&&g.isApplied&&t.allEdits.length>1&&this.show(p!=null?p:h,t,v=>oce(this,void 0,void 0,function*(){const m=this._editor.getModel();!m||(yield m.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},n,o))}))})}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(wO,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};SO=Fwe([ME(4,$t),ME(5,oT)],SO);var B1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ig=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},qz;const Bwe="editor.changePasteType",Wwe=new lt("pasteWidgetVisible",!1,C("pasteWidgetVisible","Whether the paste widget is showing")),u7="application/vnd.code.copyMetadata";let bb=qz=class extends _e{static get(e){return e.getContribution(qz.ID)}constructor(e,t,n,o,r,s,a){super(),this._bulkEditService=n,this._clipboardService=o,this._languageFeaturesService=r,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(ke(l,"copy",c=>this.handleCopy(c))),this._register(ke(l,"cut",c=>this.handleCopy(c))),this._register(ke(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new yO("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(SO,"pasteIntoEditor",e,Wwe,{id:Bwe,label:C("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},t5().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,n;if(!this._editor.hasTextFocus()||(Xv&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const o=this._editor.getModel(),r=this._editor.getSelections();if(!o||!(r!=null&&r.length))return;const s=this._editor.getOption(37);let a=r;const l=r.length===1&&r[0].isEmpty();if(l){if(!s)return;a=[new V(a[0].startLineNumber,1,a[0].startLineNumber,1+o.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(r,s,ls),u={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(m=>!!m.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:u});return}const f=Awe(e.clipboardData),g=h.flatMap(m=>{var _;return(_=m.copyMimeTypes)!==null&&_!==void 0?_:[]}),p=CF();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:u});const v=sr(m=>ig(this,void 0,void 0,function*(){const _=hf(yield Promise.all(h.map(y=>ig(this,void 0,void 0,function*(){try{return yield y.prepareDocumentPaste(o,a,f,m)}catch(w){console.error(w);return}}))));_.reverse();for(const y of _)for(const[w,L]of y)f.replace(w,L);return f}));(n=this._currentCopyOperation)===null||n===void 0||n.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:v}}handlePaste(e){var t,n;return ig(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 o=this._editor.getModel(),r=this._editor.getSelections();if(!(r!=null&&r.length)||!o||!this.isPasteAsEnabled())return;const s=this.fetchCopyMetadata(e),a=Pwe(e.clipboardData);a.delete(u7);const l=[...e.clipboardData.types,...(n=s==null?void 0:s.providerCopyMimeTypes)!==null&&n!==void 0?n:[],xo.uriList],c=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(d=>{var u;return(u=d.pasteMimeTypes)===null||u===void 0?void 0:u.some(h=>Rwe(h,l))});!c.length||(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,c,r,a,s):this.doPasteInline(c,r,a,s))})}doPasteInline(e,t,n,o){const r=sr(s=>ig(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),c=new Av(a,3,void 0,s);try{if(yield this.mergeInDataFromCopy(n,o,c.token),c.token.isCancellationRequested)return;const d=e.filter(h=>rce(h,n));if(!d.length||d.length===1&&d[0].id==="text"){yield this.applyDefaultPasteHandler(n,o,c.token);return}const u=yield this.getPasteEdits(d,n,l,t,c.token);if(c.token.isCancellationRequested)return;if(u.length===1&&u[0].providerId==="text"){yield this.applyDefaultPasteHandler(n,o,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(n,o,c.token)}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),C("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),r),this._currentPasteOperation=r}showPasteAsPick(e,t,n,o,r){const s=sr(a=>ig(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),d=new Av(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(o,r,d.token),d.token.isCancellationRequested)return;let u=t.filter(p=>rce(p,o));e&&(u=u.filter(p=>p.id===e));const h=yield this.getPasteEdits(u,o,c,n,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(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:C("pasteAsPickerPlaceholder","Select Paste Action")});f=p==null?void 0:p.edit}if(!f)return;const g=M1t(c.uri,n,f);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:C("pasteAsProgress","Running paste handlers")},()=>s)}setCopyMetadata(e,t){e.setData(u7,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const n=e.clipboardData.getData(u7);if(n)try{return JSON.parse(n)}catch{return}const[o,r]=CH.getTextData(e.clipboardData);if(r)return{defaultPastePayload:{mode:r.mode,multicursorText:(t=r.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!r.isFromEmptySelection}}}mergeInDataFromCopy(e,t,n){var o;return ig(this,void 0,void 0,function*(){if((t==null?void 0:t.id)&&((o=this._currentCopyOperation)===null||o===void 0?void 0:o.handle)===t.id){const r=yield this._currentCopyOperation.dataTransferPromise;if(n.isCancellationRequested)return;for(const[s,a]of r)e.replace(s,a)}if(!e.has(xo.uriList)){const r=yield this._clipboardService.readResources();if(n.isCancellationRequested)return;r.length&&e.append(xo.uriList,yY(yF.create(r)))}})}getPasteEdits(e,t,n,o,r){return ig(this,void 0,void 0,function*(){const s=yield i5(Promise.all(e.map(l=>ig(this,void 0,void 0,function*(){var c;try{const d=yield(c=l.provideDocumentPasteEdits)===null||c===void 0?void 0:c.call(l,n,o,t,r);if(d)return Object.assign(Object.assign({},d),{providerId:l.id})}catch(d){console.error(d)}}))),r),a=hf(s!=null?s:[]);return Owe(a)})}applyDefaultPasteHandler(e,t,n){var o,r,s;return ig(this,void 0,void 0,function*(){const a=(o=e.get(xo.text))!==null&&o!==void 0?o:e.get("text");if(!a)return;const l=yield a.asString();if(n.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(r=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&r!==void 0?r:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)})}};bb.ID="editor.contrib.copyPasteActionController";bb=qz=B1t([eC(1,$t),eC(2,oT),eC(3,Sp),eC(4,pt),eC(5,dh),eC(6,L1e)],bb);function rce(i,e){var t;return Boolean((t=i.pasteMimeTypes)===null||t===void 0?void 0:t.some(n=>e.matches(n)))}var wY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Hk=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const SY=C("builtIn","Built-in");class xY{provideDocumentPasteEdits(e,t,n,o){return qw(this,void 0,void 0,function*(){const r=yield this.getEdit(n,o);return r?{insertText:r.insertText,label:r.label,detail:r.detail,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}:void 0})}provideDocumentOnDropEdits(e,t,n,o){return qw(this,void 0,void 0,function*(){const r=yield this.getEdit(n,o);return r?{insertText:r.insertText,label:r.label,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}:void 0})}}class Vwe extends xY{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[xo.text],this.pasteMimeTypes=[xo.text]}getEdit(e,t){return qw(this,void 0,void 0,function*(){const n=e.get(xo.text);if(!n||e.has(xo.uriList))return;const o=yield n.asString();return{handledMimeType:xo.text,label:C("text.label","Insert Plain Text"),detail:SY,insertText:o}})}}class Hwe extends xY{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[xo.uriList],this.pasteMimeTypes=[xo.uriList]}getEdit(e,t){return qw(this,void 0,void 0,function*(){const n=yield $we(e);if(!n.length||t.isCancellationRequested)return;let o=0;const r=n.map(({uri:a,originalText:l})=>a.scheme===hn.file?a.fsPath:(o++,l)).join(" ");let s;return o>0?s=n.length>1?C("defaultDropProvider.uriList.uris","Insert Uris"):C("defaultDropProvider.uriList.uri","Insert Uri"):s=n.length>1?C("defaultDropProvider.uriList.paths","Insert Paths"):C("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:xo.uriList,insertText:r,label:s,detail:SY}})}}let xO=class extends xY{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[xo.uriList],this.pasteMimeTypes=[xo.uriList]}getEdit(e,t){return qw(this,void 0,void 0,function*(){const n=yield $we(e);if(!n.length||t.isCancellationRequested)return;const o=hf(n.map(({uri:r})=>{const s=this._workspaceContextService.getWorkspaceFolder(r);return s?qst(s.uri,r):void 0}));if(!!o.length)return{handledMimeType:xo.uriList,insertText:o.join(" "),label:n.length>1?C("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):C("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:SY}})}};xO=wY([Hk(0,rb)],xO);function $we(i){return qw(this,void 0,void 0,function*(){const e=i.get(xo.uriList);if(!e)return[];const t=yield e.asString(),n=[];for(const o of yF.parse(t))try{n.push({uri:Rt.parse(o),originalText:o})}catch{}return n})}let Gz=class extends _e{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new Vwe)),this._register(e.documentOnDropEditProvider.register("*",new Hwe)),this._register(e.documentOnDropEditProvider.register("*",new xO(t)))}};Gz=wY([Hk(0,pt),Hk(1,rb)],Gz);let Xz=class extends _e{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Vwe)),this._register(e.documentPasteEditProvider.register("*",new Hwe)),this._register(e.documentPasteEditProvider.register("*",new xO(t)))}};Xz=wY([Hk(0,pt),Hk(1,rb)],Xz);Un(bb.ID,bb,0);Y5(Xz);Ye(new class extends Ir{constructor(){super({id:Bwe,precondition:Wwe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=bb.get(e))===null||n===void 0?void 0:n.changePasteType()}});ze(class extends ft{constructor(){super({id:"editor.action.pasteAs",label:C("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:C("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const o=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=bb.get(e))===null||n===void 0?void 0:n.pasteAs(o)}});class W1t{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 sce{constructor(e){this.identifier=e}}const zwe=yn("treeViewsDndService");Mn(zwe,W1t,1);var V1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},tL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Yz;const Uwe="editor.experimental.dropIntoEditor.defaultProvider",jwe="editor.changeDropType",Kwe=new lt("dropWidgetVisible",!1,C("dropWidgetVisible","Whether the drop widget is showing"));let Gw=Yz=class extends _e{static get(e){return e.getContribution(Yz.ID)}constructor(e,t,n,o,r){super(),this._configService=n,this._languageFeaturesService=o,this._treeViewsDragAndDropService=r,this.treeItemsTransfer=Vk.getInstance(),this._dropProgressManager=this._register(t.createInstance(yO,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(SO,"dropIntoEditor",e,Kwe,{id:jwe,label:C("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,n){var o;return tL(this,void 0,void 0,function*(){if(!n.dataTransfer||!e.hasModel())return;(o=this._currentOperation)===null||o===void 0||o.cancel(),e.focus(),e.setPosition(t);const r=sr(s=>tL(this,void 0,void 0,function*(){const a=new Av(e,1,void 0,s);try{const l=yield this.extractDataTransferData(n);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([V.fromPositions(t)],{activeEditIndex:h,allEdits:u},f,s)}}finally{a.dispose(),this._currentOperation===r&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,C("dropIntoEditorProgress","Running drop handlers. Click to cancel"),r),this._currentOperation=r})}getDropEdits(e,t,n,o,r){return tL(this,void 0,void 0,function*(){const s=yield i5(Promise.all(e.map(l=>tL(this,void 0,void 0,function*(){try{const c=yield l.provideDocumentOnDropEdits(t,n,o,r.token);if(c)return Object.assign(Object.assign({},c),{providerId:l.id})}catch(c){console.error(c)}}))),r.token),a=hf(s!=null?s:[]);return Owe(a)})}getInitialActiveEditIndex(e,t){const n=this._configService.getValue(Uwe,{resource:e.uri});for(const[o,r]of Object.entries(n)){const s=t.findIndex(a=>r===a.providerId&&a.handledMimeType&&Rwe(o,[a.handledMimeType]));if(s>=0)return s}return 0}extractDataTransferData(e){return tL(this,void 0,void 0,function*(){if(!e.dataTransfer)return new Nwe;const t=Pwe(e.dataTransfer);if(this.treeItemsTransfer.hasData(sce.prototype)){const n=this.treeItemsTransfer.getData(sce.prototype);if(Array.isArray(n))for(const o of n){const r=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(o.identifier);if(r)for(const[s,a]of r)t.replace(s,a)}}return t})}};Gw.ID="editor.contrib.dropIntoEditorController";Gw=Yz=V1t([nR(1,$t),nR(2,En),nR(3,pt),nR(4,zwe)],Gw);Un(Gw.ID,Gw,2);Ye(new class extends Ir{constructor(){super({id:jwe,precondition:Kwe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=Gw.get(e))===null||n===void 0||n.changeDropType()}});Y5(Gz);no.as(ch.Configuration).registerConfiguration(Object.assign(Object.assign({},T5),{properties:{[Uwe]:{type:"object",scope:5,description:C("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class Os{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&&(o.changeDecorationOptions(this._highlightedDecorationId,Os._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,o.changeDecorationOptions(this._highlightedDecorationId,Os._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(o.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let r=this._editor.getModel().getDecorationRange(t);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){const s=r.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);r=new V(r.startLineNumber,r.startColumn,s,a)}this._rangeHighlightDecorationId=o.addDecoration(r,Os._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let o=Os._FIND_MATCH_DECORATION;const r=[];if(e.length>1e3){o=Os._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):(r.push({range:new V(u,1,h,1),options:Os._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=p.startLineNumber,h=p.endLineNumber)}r.push({range:new V(u,1,h,1),options:Os._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;an.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,Os._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],o=this._editor.getModel().getDecorationRange(n);if(!(!o||o.endLineNumber>e.lineNumber)){if(o.endLineNumbere.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;te.lineNumber)return r;if(!(r.startColumn0){const n=[];for(let s=0;sV.compareRangesUsingStarts(s.range,a.range));const o=[];let r=n[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function ace(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function lce(i,e,t){const n=e.split(t),o=i[0].split(t);let r="";return n.forEach((s,a)=>{r+=qwe([o[a]],s)+t}),r.slice(0,-1)}class cce{constructor(e){this.staticValue=e,this.kind=0}}class $1t{constructor(e){this.pieces=e,this.kind=1}}class Xw{static fromStaticValue(e){return new Xw([F0.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new cce(""):e.length===1&&e[0].staticValue!==null?this._state=new cce(e[0].staticValue):this._state=new $1t(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?qwe(e,this._state.staticValue):this._state.staticValue;let n="";for(let o=0,r=this._state.pieces.length;o0){const l=[],c=s.caseOps.length;let d=0;for(let u=0,h=a.length;u=c){l.push(a.slice(u));break}switch(s.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("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e=o)break;const s=i.charCodeAt(n);switch(s){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(` +`,n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic(" ",n+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(n-1),t.emitStatic("",n+1),e.push(String.fromCharCode(s));break}continue}if(r===36){if(n++,n>=o)break;const s=i.charCodeAt(n);if(s===36){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(s===48||s===38){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(n+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(n=>{(n.reason===3||n.reason===5||n.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(n=>{this._ignoreModelContentChanged||(n.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(n=>this._onStateChanged(n))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,si(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)},j1t)):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 n=null;typeof t!="undefined"?t!==null&&(Array.isArray(t)?n=t:n=[t]):n=this._decorations.getFindScopes(),n!==null&&(n=n.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new V(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const o=this._findMatches(n,!1,Am);this._decorations.set(o,n);const r=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(r);if(s===0&&o.length>0){const a=UD(o.map(l=>l.range),l=>V.compareRangesUsingStarts(l,r)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,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:n,column:o}=e;const r=this._editor.getModel();return t||o===1?(n===1?n=r.getLineCount():n--,o=r.getLineMaxColumn(n)):o--,new ae(n,o)}_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:n,column:o}=e;const r=this._editor.getModel();return t||o===r.getLineMaxColumn(n)?(n===r.getLineCount()?n=1:n++,o=1):o++,new ae(n,o)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const n=this._decorations.matchBeforePosition(e);n&&this._setCurrentFindMatch(n);return}if(this._decorations.getCount()AE._getSearchRange(this._editor.getModel(),r));return this._editor.getModel().findMatches(this._state.searchString,o,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Am?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new A_(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!t)return;let n=t.regex;if(!n.multiline){let u="mu";n.ignoreCase&&(u+="i"),n.global&&(u+="g"),n=new RegExp(n.source,u)}const o=this._editor.getModel(),r=o.getValue(1),s=o.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=r.replace(n,function(){return a.buildReplaceString(arguments,c)}):l=r.replace(n,a.buildReplaceString(null,c));const d=new OG(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),o=[];for(let s=0,a=n.length;ss.range),o);this._executeEditorCommand("replaceAll",r)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let n=this._findMatches(e,!1,1073741824).map(r=>new gt(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn));const o=this._editor.getSelection();for(let r=0,s=n.length;rthis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=n,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 o={inputActiveOptionBorder:ct(LG),inputActiveOptionForeground:ct(EG),inputActiveOptionBackground:ct(f0)};this.caseSensitive=this._register(new nCe(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},o))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new iCe(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleWholeWordCommand),isChecked:this._state.wholeWord},o))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new oCe(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleRegexCommand),isChecked:this._state.isRegex},o))),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(r=>{let s=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(ke(this._domNode,et.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(ke(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return xF.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")}}xF.ID="editor.contrib.findOptionsWidget";function lR(i,e){return i===1?!0:i===2?!1:e}class K1t extends _e{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return lR(this._isRegexOverride,this._isRegex)}get wholeWord(){return lR(this._wholeWordOverride,this._wholeWord)}get matchCase(){return lR(this._matchCaseOverride,this._matchCase)}get preserveCase(){return lR(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 le),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,n){const o={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 r=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,o.matchesPosition=!0,r=!0),this._matchesCount!==t&&(this._matchesCount=t,o.matchesCount=!0,r=!0),typeof n!="undefined"&&(V.equalsRange(this._currentMatch,n)||(this._currentMatch=n,o.currentMatch=!0,r=!0)),r&&this._onFindReplaceStateChange.fire(o)}change(e,t,n=!0){var o;const r={moveCursor:t,updateHistory:n,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 s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,d=this.preserveCase;typeof e.searchString!="undefined"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,r.searchString=!0,s=!0),typeof e.replaceString!="undefined"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,r.replaceString=!0,s=!0),typeof e.isRevealed!="undefined"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,r.isRevealed=!0,s=!0),typeof e.isReplaceRevealed!="undefined"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,r.isReplaceRevealed=!0,s=!0),typeof e.isRegex!="undefined"&&(this._isRegex=e.isRegex),typeof e.wholeWord!="undefined"&&(this._wholeWord=e.wholeWord),typeof e.matchCase!="undefined"&&(this._matchCase=e.matchCase),typeof e.preserveCase!="undefined"&&(this._preserveCase=e.preserveCase),typeof e.searchScope!="undefined"&&(!((o=e.searchScope)===null||o===void 0)&&o.every(u=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!V.equalsRange(f,u))})||(this._searchScope=e.searchScope,r.searchScope=!0,s=!0)),typeof e.loop!="undefined"&&this._loop!==e.loop&&(this._loop=e.loop,r.loop=!0,s=!0),typeof e.isSearching!="undefined"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,r.isSearching=!0,s=!0),typeof e.filters!="undefined"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,r.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride!="undefined"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride!="undefined"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride!="undefined"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride!="undefined"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,r.isRegex=!0),l!==this.wholeWord&&(s=!0,r.wholeWord=!0),c!==this.matchCase&&(s=!0,r.matchCase=!0),d!==this.preserveCase&&(s=!0,r.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(r)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Am}}const q1t=C("defaultLabel","input"),G1t=C("label.preserveCaseToggle","Preserve Case");class X1t extends kS{constructor(e){super({icon:Xe.preserveCase,title:G1t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Y1t extends Ud{constructor(e,t,n,o){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new le),this._onInput=this._register(new le),this._onKeyUp=this._register(new le),this._onPreserveCaseKeyDown=this._register(new le),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=o.placeholder||"",this.validation=o.validation,this.label=o.label||q1t;const r=o.appendPreserveCaseLabel||"",s=o.history||[],a=!!o.flexibleHeight,l=!!o.flexibleWidth,c=o.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new rCe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:o.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:o.inputBoxStyles})),this.preserveCase=this._register(new X1t(Object.assign({appendTitle:r,isChecked:!1},o.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(),un.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 Gwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Xwe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const EY=new lt("suggestWidgetVisible",!1,C("suggestWidgetVisible","Whether suggestion are visible")),DY="historyNavigationWidgetFocus",Ywe="historyNavigationForwardsEnabled",Zwe="historyNavigationBackwardsEnabled";let Jg;const cR=[];function Qwe(i,e){if(cR.includes(e))throw new Error("Cannot register the same widget multiple times");cR.push(e);const t=new Be,n=new lt(DY,!1).bindTo(i),o=new lt(Ywe,!0).bindTo(i),r=new lt(Zwe,!0).bindTo(i),s=()=>{n.set(!0),Jg=e},a=()=>{n.set(!1),Jg===e&&(Jg=void 0)};return e.element===document.activeElement&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(zt(()=>{cR.splice(cR.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:o,historyNavigationBackwardsEnablement:r,dispose(){t.dispose()}}}let Zz=class extends sCe{constructor(e,t,n,o){super(e,t,n);const r=this._register(o.createScoped(this.inputBox.element));this._register(Qwe(r,this.inputBox))}};Zz=Gwe([Xwe(3,Ut)],Zz);let Qz=class extends Y1t{constructor(e,t,n,o,r=!1){super(e,t,r,n);const s=this._register(o.createScoped(this.inputBox.element));this._register(Qwe(s,this.inputBox))}};Qz=Gwe([Xwe(3,Ut)],Qz);Va.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Me.and(Me.has(DY),Me.equals(Zwe,!0),Me.not("isComposing"),EY.isEqualTo(!1)),primary:16,secondary:[528],handler:i=>{Jg==null||Jg.showPreviousValue()}});Va.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Me.and(Me.has(DY),Me.equals(Ywe,!0),Me.not("isComposing"),EY.isEqualTo(!1)),primary:18,secondary:[530],handler:i=>{Jg==null||Jg.showNextValue()}});function dce(i){var e,t;return((e=i.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=i.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var Z1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Q1t=Eo("find-selection",Xe.selection,C("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),uce=Eo("find-collapsed",Xe.chevronRight,C("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),hce=Eo("find-expanded",Xe.chevronDown,C("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),J1t=Eo("find-replace",Xe.replace,C("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),eCt=Eo("find-replace-all",Xe.replaceAll,C("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),tCt=Eo("find-previous-match",Xe.arrowUp,C("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),nCt=Eo("find-next-match",Xe.arrowDown,C("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),iCt=C("label.findDialog","Find / Replace"),oCt=C("label.find","Find"),rCt=C("placeholder.find","Find"),sCt=C("label.previousMatchButton","Previous Match"),aCt=C("label.nextMatchButton","Next Match"),lCt=C("label.toggleSelectionFind","Find in Selection"),cCt=C("label.closeButton","Close"),dCt=C("label.replace","Replace"),uCt=C("placeholder.replace","Replace"),hCt=C("label.replaceButton","Replace"),fCt=C("label.replaceAllButton","Replace All"),gCt=C("label.toggleReplaceButton","Toggle Replace"),pCt=C("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Am),mCt=C("label.matchesLocation","{0} of {1}"),fce=C("label.noResults","No results"),_h=419,vCt=275,_Ct=vCt-54;let nL=69;const bCt=33,gce="ctrlEnterReplaceAll.windows.donotask",pce=Nn?256:2048;class h7{constructor(e){this.afterLineNumber=e,this.heightInPx=bCt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function mce(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionStart>0){i.stopPropagation();return}}function vce(i,e,t){const n=!!e.match(/\n/);if(t&&n&&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 h7(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>Z1t(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=SF.bindTo(s),this._findFocusTracker=this._register(pf(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=LY.bindTo(s),this._replaceFocusTracker=this._register(pf(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 h7(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 LF.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=Ea(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,en)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=nL+"px",this._state.matchesCount>=Am?this._matchesCount.title=pCt: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>=Am&&(t+="+");let n=String(this._state.matchesPosition);n==="0"&&(n="?"),e=Z0(mCt,n,t)}else e=fce;this._matchesCount.appendChild(document.createTextNode(e)),Cs(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),nL=Math.max(nL,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===fce)return n===""?C("ariaSearchNoResultEmpty","{0} found",e):C("ariaSearchNoResult","{0} found for '{1}'",e,n);if(t){const o=C("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,n,t.startLineNumber+":"+t.startColumn),r=this._codeEditor.getModel();return r&&t.startLineNumber<=r.getLineCount()&&t.startLineNumber>=1?`${r.getLineContent(t.startLineNumber)}, ${o}`:o}return C("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,n)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,n=this._toggleSelectionFind.checked;this._isVisible&&(n||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 n=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&n)}_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 n=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=n;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 n=this._codeEditor.getDomNode();if(n){const o=Yo(n),r=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=o.left+(r?r.left:0),a=r?r.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=g0e(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());o.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 n=this._viewZone;this._viewZoneId!==void 0||!n||this._codeEditor.changeViewZones(o=>{n.heightInPx=this._getHeight(),this._viewZoneId=o.addZone(n),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+n.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new h7(0));const n=this._viewZone;this._codeEditor.changeViewZones(o=>{if(this._viewZoneId!==void 0){const r=this._getHeight();if(r===n.heightInPx)return;const s=r-n.heightInPx;n.heightInPx=r,o.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let r=this._getHeight();if(r-=this._codeEditor.getOption(83).top,r<=0)return;n.heightInPx=r,this._viewZoneId=o.addZone(n),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r)}})}_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||!aG(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 n=e.width,o=e.minimap.minimapWidth;let r=!1,s=!1,a=!1;if(this._resized&&Ea(this._domNode)>_h){this._domNode.style.maxWidth=`${n-28-o-15}px`,this._replaceInput.width=Ea(this._findInput.domNode);return}if(_h+28+o>=n&&(s=!0),_h+28+o-nL>=n&&(a=!0),_h+28+o-nL>=n+50&&(r=!0),this._domNode.classList.toggle("collapsed-find-widget",r),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",s),!a&&!r&&(this._domNode.style.maxWidth=`${n-28-o-15}px`),this._findInput.layout({collapsedFindWidget:r,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=Ea(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(!!this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const n=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!V.equalsRange(t,n)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(pce|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return mce(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return vce(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(pce|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{ls&&Fu&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(C("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(gce,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return mce(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return vce(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new Zz(null,this._contextViewProvider,{width:_Ct,label:oCt,placeholder:rCt,appendCaseSensitiveLabel:this._keybindingLabelFor(Ri.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ri.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ri.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:()=>dce(this._keybindingService),inputBoxStyles:WP,toggleStyles:BP},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()})),xs&&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 tC({label:sCt+this._keybindingLabelFor(Ri.PreviousMatchFindAction),icon:tCt,onTrigger:()=>{c0(this._codeEditor.getAction(Ri.PreviousMatchFindAction)).run().then(void 0,en)}})),this._nextBtn=this._register(new tC({label:aCt+this._keybindingLabelFor(Ri.NextMatchFindAction),icon:nCt,onTrigger:()=>{c0(this._codeEditor.getAction(Ri.NextMatchFindAction)).run().then(void 0,en)}}));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",n.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new kS({icon:Q1t,title:lCt+this._keybindingLabelFor(Ri.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:ct(f0),inputActiveOptionBorder:ct(LG),inputActiveOptionForeground:ct(EG)})),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)})),o.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new tC({label:cCt+this._keybindingLabelFor(Ri.CloseFindWidgetCommand),icon:ICe,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 Qz(null,void 0,{label:dCt,placeholder:uCt,appendPreserveCaseLabel:this._keybindingLabelFor(Ri.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>dce(this._keybindingService),inputBoxStyles:WP,toggleStyles:BP},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 tC({label:hCt+this._keybindingLabelFor(Ri.ReplaceOneAction),icon:J1t,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new tC({label:fCt+this._keybindingLabelFor(Ri.ReplaceAllAction),icon:eCt,onTrigger:()=>{this._controller.replaceAll()}}));const r=document.createElement("div");r.className="replace-part",r.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",r.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new tC({label:gCt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Ea(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=iCt,this._domNode.role="dialog",this._domNode.style.width=`${_h}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(r),this._resizeSash=new gs(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=_h;this._register(this._resizeSash.onDidStart(()=>{a=Ea(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(c<_h)return;const d=parseFloat(e5(this._domNode).maxWidth)||0;c>d||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=Ea(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=Ea(this._domNode);if(l<_h)return;let c=_h;if(!this._resized||l===_h){const d=this._codeEditor.getLayoutInfo();c=d.width-28-d.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=Ea(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}LF.ID="editor.contrib.findWidget";class tC extends Ud{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+Mt.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=t,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,n=>{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{var o,r;if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}(r=(o=this._opts).onKeyDown)===null||r===void 0||r.call(o,n)})}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(...Mt.asClassNameArray(uce)),this._domNode.classList.add(...Mt.asClassNameArray(hce))):(this._domNode.classList.remove(...Mt.asClassNameArray(hce)),this._domNode.classList.add(...Mt.asClassNameArray(uce)))}}jd((i,e)=>{const t=(p,v)=>{v&&e.addRule(`.monaco-editor ${p} { background-color: ${v}; }`)};t(".findMatch",i.getColor(Jh)),t(".currentFindMatch",i.getColor(Pnt)),t(".findScope",i.getColor(Ont));const n=i.getColor(po);t(".find-widget",n);const o=i.getColor(Gh);o&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${o}; }`);const r=i.getColor(xG);r&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${r}; border-right: 1px solid ${r}; border-bottom: 1px solid ${r}; }`);const s=i.getColor(Em);s&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Hu(i.type)?"dotted":"solid"} ${s}; box-sizing: border-box; }`);const a=i.getColor(Fnt);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=i.getColor(Bnt);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${Hu(i.type)?"dashed":"solid"} ${l}; }`);const c=i.getColor(Ln);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const d=i.getColor(Zh);d&&e.addRule(`.monaco-editor .find-widget { color: ${d}; }`);const u=i.getColor(ont);u&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${u}; }`);const h=i.getColor(Ent);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const p=i.getColor(Qh);p&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${p}; }`)}const f=i.getColor(_H);f&&e.addRule(` .monaco-editor .find-widget .button:not(.disabled):hover, .monaco-editor .find-widget .codicon-find-selection:hover { background-color: ${f} !important; } - `);const g=i.getColor(Hl);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var Jwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_u=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Cb=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Qz;const _Ct=524288;function Jz(i,e="single",t=!1){if(!i.hasModel())return null;const n=i.getSelection();if(e==="single"&&n.startLineNumber===n.endLineNumber||e==="multiple"){if(n.isEmpty()){const o=i.getConfiguredWordAtPosition(n.getStartPosition());if(o&&t===!1)return o.word}else if(i.getModel().getValueLengthInRange(n)<_Ct)return i.getModel().getValueInRange(n)}return null}let ha=Qz=class extends _e{get editor(){return this._editor}static get(e){return e.getContribution(Qz.ID)}constructor(e,t,n,o,r){super(),this._editor=e,this._findWidgetVisible=Sp.bindTo(t),this._contextKeyService=t,this._storageService=n,this._clipboardService=o,this._notificationService=r,this._updateHistoryDelayer=new Wd(500),this._state=this._register(new U1t),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(s=>this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=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),s&&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!!wF.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=Xl(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return Cb(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const n=Object.assign(Object.assign({},t),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const o=Jz(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);o&&(this._state.isRegex?n.searchString=Xl(o):n.searchString=o)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const o=Jz(this._editor,e.seedSearchStringFromSelection);o&&(n.searchString=o)}if(!n.searchString&&e.seedSearchStringFromGlobalClipboard){const o=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;o&&(n.searchString=o)}if(e.forceRevealReplace||n.isReplaceRevealed?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){const o=this._editor.getSelections();o.some(r=>!r.isEmpty())&&(n.searchScope=o)}n.loop=e.loop,this._state.change(n,!1),this._model||(this._model=new AE(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(C("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 Cb(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)}};ha.ID="editor.contrib.findController";ha=Qz=Jwe([_u(1,Ut),_u(2,Gd),_u(3,wp),_u(4,Ao)],ha);let eU=class extends ha{constructor(e,t,n,o,r,s,a,l){super(e,n,a,l,s),this._contextViewService=t,this._keybindingService=o,this._themeService=r,this._widget=null,this._findOptionsWidget=null}_start(e,t){const n=Object.create(null,{_start:{get:()=>super._start}});return Cb(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const o=this._editor.getSelection();let r=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":r=!0;break;case"never":r=!1;break;case"multiline":{r=!!o&&o.startLineNumber!==o.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||r,yield n._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 xF(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new SF(this._editor,this._state,this._keybindingService))}};eU=Jwe([_u(1,bp),_u(2,Ut),_u(3,xi),_u(4,vr),_u(5,Ao),_u(6,Gd),_u(7,wp)],eU);const bCt=w0e(new y0e({id:Ri.StartFindAction,label:C("startFindAction","Find"),alias:"Find",precondition:Me.or(Q.focus,Me.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:Z.MenubarEditMenu,group:"3_find",title:C({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));bCt.addImplementation(0,(i,e,t)=>{const n=ha.get(e);return n?n.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 CCt={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:C("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag. + `);const g=i.getColor(Hl);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var Jwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_u=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Cb=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Jz;const CCt=524288;function eU(i,e="single",t=!1){if(!i.hasModel())return null;const n=i.getSelection();if(e==="single"&&n.startLineNumber===n.endLineNumber||e==="multiple"){if(n.isEmpty()){const o=i.getConfiguredWordAtPosition(n.getStartPosition());if(o&&t===!1)return o.word}else if(i.getModel().getValueLengthInRange(n)this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=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),s&&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!!SF.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=Xl(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return Cb(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const n=Object.assign(Object.assign({},t),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const o=eU(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);o&&(this._state.isRegex?n.searchString=Xl(o):n.searchString=o)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const o=eU(this._editor,e.seedSearchStringFromSelection);o&&(n.searchString=o)}if(!n.searchString&&e.seedSearchStringFromGlobalClipboard){const o=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;o&&(n.searchString=o)}if(e.forceRevealReplace||n.isReplaceRevealed?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){const o=this._editor.getSelections();o.some(r=>!r.isEmpty())&&(n.searchScope=o)}n.loop=e.loop,this._state.change(n,!1),this._model||(this._model=new AE(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(C("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 Cb(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)}};ha.ID="editor.contrib.findController";ha=Jz=Jwe([_u(1,Ut),_u(2,Gd),_u(3,Sp),_u(4,Ao)],ha);let tU=class extends ha{constructor(e,t,n,o,r,s,a,l){super(e,n,a,l,s),this._contextViewService=t,this._keybindingService=o,this._themeService=r,this._widget=null,this._findOptionsWidget=null}_start(e,t){const n=Object.create(null,{_start:{get:()=>super._start}});return Cb(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const o=this._editor.getSelection();let r=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":r=!0;break;case"never":r=!1;break;case"multiline":{r=!!o&&o.startLineNumber!==o.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||r,yield n._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 LF(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new xF(this._editor,this._state,this._keybindingService))}};tU=Jwe([_u(1,Cp),_u(2,Ut),_u(3,xi),_u(4,vr),_u(5,Ao),_u(6,Gd),_u(7,Sp)],tU);const yCt=w0e(new y0e({id:Ri.StartFindAction,label:C("startFindAction","Find"),alias:"Find",precondition:Me.or(Q.focus,Me.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:Z.MenubarEditMenu,group:"3_find",title:C({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));yCt.addImplementation(0,(i,e,t)=>{const n=ha.get(e);return n?n.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 wCt={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:C("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag. The flag will not be saved for the future. 0: Do Nothing 1: True @@ -1069,43 +1069,43 @@ The flag will not be saved for the future. The flag will not be saved for the future. 0: Do Nothing 1: True -2: False`)},findInSelection:{type:"boolean"}}}}]};class yCt extends ft{constructor(){super({id:Ri.StartFindWithArgs,label:C("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:CCt})}run(e,t,n){return Cb(this,void 0,void 0,function*(){const o=ha.get(t);if(o){const r=n?{searchString:n.searchString,replaceString:n.replaceString,isReplaceRevealed:n.replaceString!==void 0,isRegex:n.isRegex,wholeWord:n.matchWholeWord,matchCase:n.isCaseSensitive,preserveCase:n.preserveCase}:{};yield o.start({forceRevealReplace:!1,seedSearchStringFromSelection:o.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(n==null?void 0:n.findInSelection)||!1,loop:t.getOption(41).loop},r),o.setGlobalBufferTerm(o.getState().searchString)}})}}class wCt extends ft{constructor(){super({id:Ri.StartFindWithSelection,label:C("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 Cb(this,void 0,void 0,function*(){const n=ha.get(t);n&&(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),n.setGlobalBufferTerm(n.getState().searchString))})}}class eSe extends ft{run(e,t){return Cb(this,void 0,void 0,function*(){const n=ha.get(t);n&&!this._run(n)&&(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.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(n))})}}class SCt extends eSe{constructor(){super({id:Ri.NextMatchFindAction,label:C("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:Q.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Me.and(Q.focus,wF),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class xCt extends eSe{constructor(){super({id:Ri.PreviousMatchFindAction,label:C("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:Q.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Me.and(Q.focus,wF),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class LCt extends ft{constructor(){super({id:Ri.GoToMatchFindAction,label:C("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Sp}),this._highlightDecorations=[]}run(e,t,n){const o=ha.get(t);if(!o)return;const r=o.getState().matchesCount;if(r<1){e.get(Ao).notify({severity:D5.Warning,message:C("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(dh).createInputBox();a.placeholder=C("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",r);const l=d=>{const u=parseInt(d);if(isNaN(u))return;const h=o.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,o.goToMatch(u);const h=o.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=C("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",o.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{c(d)}),a.onDidAccept(()=>{const d=l(a.value);typeof d=="number"?(o.goToMatch(d),a.hide()):a.validationMessage=C("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",o.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(n=>{this._highlightDecorations=n.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:ro(xbe),position:Yl.Full}}}])})}}class tSe extends ft{run(e,t){return Cb(this,void 0,void 0,function*(){const n=ha.get(t);if(!n)return;const o=Jz(t,"single",!1);o&&n.setSearchString(o),this._run(n)||(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))})}}class ECt extends tSe{constructor(){super({id:Ri.NextSelectionMatchFindAction,label:C("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class DCt extends tSe{constructor(){super({id:Ri.PreviousSelectionMatchFindAction,label:C("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const kCt=w0e(new y0e({id:Ri.StartFindReplaceAction,label:C("startReplace","Replace"),alias:"Replace",precondition:Me.or(Q.focus,Me.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:Z.MenubarEditMenu,group:"3_find",title:C({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));kCt.addImplementation(0,(i,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const n=ha.get(e);if(!n)return!1;const o=e.getSelection(),r=n.isFindInputFocused(),s=!o.isEmpty()&&o.startLineNumber===o.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!r,a=r||s?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"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})});Un(ha.ID,eU,0);ze(yCt);ze(wCt);ze(SCt);ze(xCt);ze(LCt);ze(ECt);ze(DCt);const uh=Ir.bindToContribution(ha.get);Ye(new uh({id:Ri.CloseFindWidgetCommand,precondition:Sp,handler:i=>i.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:9,secondary:[1033]}}));Ye(new uh({id:Ri.ToggleCaseSensitiveCommand,precondition:void 0,handler:i=>i.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:iR.primary,mac:iR.mac,win:iR.win,linux:iR.linux}}));Ye(new uh({id:Ri.ToggleWholeWordCommand,precondition:void 0,handler:i=>i.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:oR.primary,mac:oR.mac,win:oR.win,linux:oR.linux}}));Ye(new uh({id:Ri.ToggleRegexCommand,precondition:void 0,handler:i=>i.toggleRegex(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:rR.primary,mac:rR.mac,win:rR.win,linux:rR.linux}}));Ye(new uh({id:Ri.ToggleSearchScopeCommand,precondition:void 0,handler:i=>i.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:sR.primary,mac:sR.mac,win:sR.win,linux:sR.linux}}));Ye(new uh({id:Ri.TogglePreserveCaseCommand,precondition:void 0,handler:i=>i.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:aR.primary,mac:aR.mac,win:aR.win,linux:aR.linux}}));Ye(new uh({id:Ri.ReplaceOneAction,precondition:Sp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:3094}}));Ye(new uh({id:Ri.ReplaceOneAction,precondition:Sp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,xY),primary:3}}));Ye(new uh({id:Ri.ReplaceAllAction,precondition:Sp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:2563}}));Ye(new uh({id:Ri.ReplaceAllAction,precondition:Sp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,xY),primary:void 0,mac:{primary:2051}}}));Ye(new uh({id:Ri.SelectAllMatchesAction,precondition:Sp,handler:i=>i.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:515}}));const ICt={[0]:" ",[1]:"u",[2]:"r"},vce=65535,bu=16777215,_ce=4278190080;class h7{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,n=e%32;return(this._states[t]&1<vce)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new h7(e.length),this._userDefinedStates=new h7(e.length),this._recoveredStates=new h7(e.length),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(n,o)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=n&&this.getEndLineNumber(r)>=o};for(let n=0,o=this._startIndexes.length;nbu||s>bu)throw new Error("startLineNumber or endLineNumber must not exceed "+bu);for(;e.length>0&&!t(r,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=r+((a&255)<<24),this._endIndexes[n]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&bu}getEndLineNumber(e){return this._endIndexes[e]&bu}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 n=!1;if(this._types)for(let o=0;o>>24)+((this._endIndexes[e]&_ce)>>>16);return t===vce?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(n===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)?m=>mm=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=r(++a)):(p=d,d.isCollapsed&&d.source===0&&(p.source=2)),d=s(++l);else{let v=l,m=d;for(;;){if(!m||m.startLineNumber>c.endLineNumber){p=c;break}if(m.source===1&&m.endLineNumber>c.endLineNumber)break;m=s(++v)}c=r(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=n&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&u.push(h),h=p)}}return g}}class TCt{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 NCt{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new le,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Ml(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((n,o)=>n.regionIndex-o.regionIndex);const t={};this._decorationProvider.changeDecorations(n=>{let o=0,r=-1,s=-1;const a=l=>{for(;os&&(s=c),o++}};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),r=Math.max(r,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,n=o=>{for(const r of e)if(!(r.startLineNumber>o.endLineNumber||o.startLineNumber>r.endLineNumber))return!0;return!1};for(let o=0;on&&(n=a)}this._decorationProvider.changeDecorations(o=>this._editorDecorationIds=o.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(o,r)=>{for(const s of e)if(o=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>n)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,n;if(!Array.isArray(e))return;const o=[],r=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>r)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&o.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(n=a.source)!==null&&n!==void 0?n:0})}const s=Ml.sanitizeAndMerge(this._regions,o,r);this.updatePost(Ml.fromFoldRanges(s))}_getLinesChecksum(e,t){return H0e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const n=[];if(this._regions){let o=this._regions.findRange(e),r=1;for(;o>=0;){const s=this._regions.toRegion(o);(!t||t(s,r))&&n.push(s),r++,o=s.parentIndex}}return n}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 n=[],o=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=o,l=this._regions.length;a0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&n.push(c)}else break}}else for(let s=o,a=this._regions.length;s1){const a=i.getRegionsInside(r,(l,c)=>l.isCollapsed!==s&&c0)for(const r of n){const s=i.getRegionAtLine(r);if(s&&(s.isCollapsed!==e&&o.push(s),t>1)){const a=i.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&cs.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);o.push(...s)}i.toggleCollapseState(o)}function RCt(i,e,t){const n=[];for(const o of t){const r=i.getAllRegionsAtLine(o,s=>s.isCollapsed!==e);r.length>0&&n.push(r[0])}i.toggleCollapseState(n)}function MCt(i,e,t,n){const o=(s,a)=>a===e&&s.isCollapsed!==t&&!n.some(l=>s.containsLine(l)),r=i.getRegionsInside(null,o);i.toggleCollapseState(r)}function oSe(i,e,t){const n=[];for(const s of t){const a=i.getAllRegionsAtLine(s,void 0);a.length>0&&n.push(a[0])}const o=s=>n.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,r=i.getRegionsInside(null,o);i.toggleCollapseState(r)}function DY(i,e,t){const n=i.textModel,o=i.regions,r=[];for(let s=o.length-1;s>=0;s--)if(t!==o.isCollapsed(s)){const a=o.getStartLineNumber(s);e.test(n.getLineContent(a))&&r.push(o.toRegion(s))}i.toggleCollapseState(r)}function kY(i,e,t){const n=i.regions,o=[];for(let r=n.length-1;r>=0;r--)t!==n.isCollapsed(r)&&e===n.getType(r)&&o.push(n.toRegion(r));i.toggleCollapseState(o)}function ACt(i,e){let t=null;const n=e.getRegionAtLine(i);if(n!==null&&(t=n.startLineNumber,i===t)){const o=n.parentIndex;o!==-1?t=e.regions.getStartLineNumber(o):t=null}return t}function PCt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){if(i!==t.startLineNumber)return t.startLineNumber;{const n=t.parentIndex;let o=0;for(n!==-1&&(o=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=o)return null;if(t.parentIndex===n)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 OCt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){const n=t.parentIndex;let o=0;if(n!==-1)o=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;o=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=o)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>i)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||Tv(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let n=0,o=0,r=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;n0}isHidden(e){return bce(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const n=this._foldingModel.textModel;let o=null;const r=s=>((!o||!BCt(s,o))&&(o=bce(this._hiddenRanges,s)),o?o.startLineNumber-1:null);for(let s=0,a=e.length;s0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function BCt(i,e){return i>=e.startLineNumber&&i<=e.endLineNumber}function bce(i,e){const t=UD(i,n=>e=0&&i[t].endLineNumber>=e?i[t]:null}const WCt=5e3,VCt="indent";class IY{constructor(e,t,n){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=n,this.id=VCt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,n=t&&!!t.offSide,o=t&&t.markers;return Promise.resolve(zCt(this.editorModel,n,o,this.foldingRangesLimit))}}class HCt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>bu||t>bu)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),o=new Uint32Array(this._length);for(let r=this._length-1,s=0;r>=0;r--,s++)n[s]=this._startIndexes[r],o[s]=this._endIndexes[r];return new Ml(n,o)}else{this._foldingRangesLimit.update(this._length,t);let n=0,o=this._indentOccurrences.length;for(let l=0;lt){o=l;break}n+=c}}const r=e.getOptions().tabSize,s=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=w5(u,r);(h{}};function zCt(i,e,t,n=$Ct){const o=i.getOptions().tabSize,r=new HCt(n);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=i.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=i.getLineCount();c>0;c--){const d=i.getLineContent(c),u=w5(d,o);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=d.match(s)))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],r.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&&r.insertFirst(c,g,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return r.toIndentRanges(i)}const UCt=J("editor.foldBackground",{light:St(xm,.3),dark:St(xm,.3),hcDark:null,hcLight:null},C("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);J("editorGutter.foldingControlForeground",{dark:Sm,light:Sm,hcDark:Sm,hcLight:Sm},C("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const LF=Eo("folding-expanded",Xe.chevronDown,C("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),EF=Eo("folding-collapsed",Xe.chevronRight,C("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),rSe=Eo("folding-manual-collapsed",EF,C("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),sSe=Eo("folding-manual-expanded",LF,C("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),TY={color:ro(UCt),position:ll.Inline};class Bo{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,n){return t?Bo.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Bo.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Bo.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Bo.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?n?this.showFoldingHighlights?Bo.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Bo.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Bo.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Bo.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?n?Bo.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Bo.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:n?Bo.MANUALLY_EXPANDED_VISUAL_DECORATION:Bo.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Bo.COLLAPSED_VISUAL_DECORATION=Jt.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(EF)});Bo.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Jt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:TY,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(EF)});Bo.MANUALLY_COLLAPSED_VISUAL_DECORATION=Jt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(rSe)});Bo.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Jt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:TY,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(rSe)});Bo.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Bo.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:TY,isWholeLine:!0});Bo.EXPANDED_VISUAL_DECORATION=Jt.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Mt.asClassName(LF)});Bo.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Jt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(LF)});Bo.MANUALLY_EXPANDED_VISUAL_DECORATION=Jt.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Mt.asClassName(sSe)});Bo.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Jt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(sSe)});Bo.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Bo.HIDDEN_RANGE_DECORATION=Jt.register({description:"folding-hidden-range-decoration",stickiness:1});const jCt={},KCt="syntax";class NY{constructor(e,t,n,o,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=n,this.foldingRangesLimit=o,this.fallbackRangeProvider=r,this.id=KCt,this.disposables=new Be,r&&this.disposables.add(r);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(n))}compute(e){return qCt(this.providers,this.editorModel,e).then(t=>{var n,o;return t?XCt(t,this.foldingRangesLimit):(o=(n=this.fallbackRangeProvider)===null||n===void 0?void 0:n.compute(e))!==null&&o!==void 0?o:null})}dispose(){this.disposables.dispose()}}function qCt(i,e,t){let n=null;const o=i.map((r,s)=>Promise.resolve(r.provideFoldingRanges(e,jCt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(n)||(n=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&n.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},$o));return Promise.all(o).then(r=>n)}class GCt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,n,o){if(e>bu||t>bu)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=o,this._types[r]=n,this._length++,o<30&&(this._nestingLevelCounts[o]=(this._nestingLevelCounts[o]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let o=0;oe){n=a;break}t+=l}}const o=new Uint32Array(e),r=new Uint32Array(e),s=[];for(let a=0,l=0;a{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),n=new GCt(e);let o;const r=[];for(const s of t)if(!o)o=s,n.add(s.start,s.end,s.kind&&s.kind.value,r.length);else if(s.start>o.start)if(s.end<=o.end)r.push(o),o=s,n.add(s.start,s.end,s.kind&&s.kind.value,r.length);else{if(s.start>o.end){do o=r.pop();while(o&&s.start>o.end);o&&r.push(o),o=s}n.add(s.start,s.end,s.kind&&s.kind.value,r.length)}return n.toIndentRanges()}var YCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ZCt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},gC;const Is=new lt("foldingEnabled",!1);let xf=gC=class extends _e{static get(e){return e.getContribution(gC.ID)}static getFoldingRangeProviders(e,t){var n,o;const r=e.foldingRangeProvider.ordered(t);return(o=(n=gC._foldingRangeSelector)===null||n===void 0?void 0:n.call(gC,r,t))!==null&&o!==void 0?o:r}constructor(e,t,n,o,r,s){super(),this.contextKeyService=t,this.languageConfigurationService=n,this.languageFeaturesService=s,this.localToDispose=this._register(new Be),this.editor=e,this._foldingLimitReporter=new aSe(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=r.for(s.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 Bo(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Is.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(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n,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 NCt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new FCt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Wd(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new bi(()=>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,n;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,(n=this.rangeProvider)===null||n===void 0||n.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 IY(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const n=gC.getFoldingRangeProviders(this.languageFeaturesService,e);n.length>0&&(this.rangeProvider=new NY(e,n,()=>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 Ls,n=this.getRangeProvider(e.textModel),o=this.foldingRegionPromise=sr(r=>n.compute(r));return o.then(r=>{if(r&&o===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=r.setCollapsedAllOfType(ra.Imports.value,!0);d&&(s=Zu.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),l=a?a.map(d=>d.startLineNumber):[];e.update(r,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(en(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 n=this.editor.getSelections();if(n&&n.length>0){const o=[];for(const r of n){const s=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&o.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}o.length&&(t.toggleCollapseState(o),this.reveal(n[0].getPosition()))}}}).then(void 0,en)}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 n=!1;switch(e.target.type){case 4:{const o=e.target.detail,r=e.target.element.offsetLeft;if(o.offsetX-r<4)return;n=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const o=this.editor.getModel();if(o&&t.startColumn===o.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:n}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const n=this.mouseDownInfo.lineNumber,o=this.mouseDownInfo.iconClicked,r=e.target.range;if(!r||r.startLineNumber!==n)return;if(o){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(n))return}const s=t.getRegionAtLine(n);if(s&&s.startLineNumber===n){const a=s.isCollapsed;if(o||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(s)&&!s.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(s))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:n,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};xf.ID="editor.contrib.folding";xf=gC=YCt([iL(1,Ut),iL(2,Ti),iL(3,Ao),iL(4,qc),iL(5,pt)],xf);class aSe{constructor(e){this.editor=e,this._onDidChange=new le,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 $s extends ft{runEditorCommand(e,t,n){const o=e.get(Ti),r=xf.get(t);if(!r)return;const s=r.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(r,a,t,n,o);const l=t.getSelection();l&&r.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(n=>n.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(n=>n+1):this.getSelectedLines(t)}run(e,t){}}function lSe(i){if(!il(i)){if(!ia(i))return!1;const e=i;if(!il(e.levels)&&!Cv(e.levels)||!il(e.direction)&&!la(e.direction)||!il(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Cv)))return!1}return!0}class QCt extends $s{constructor(){super({id:"editor.unfold",label:C("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Is,kbOpts:{kbExpr:Q.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: +2: False`)},findInSelection:{type:"boolean"}}}}]};class SCt extends ft{constructor(){super({id:Ri.StartFindWithArgs,label:C("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:wCt})}run(e,t,n){return Cb(this,void 0,void 0,function*(){const o=ha.get(t);if(o){const r=n?{searchString:n.searchString,replaceString:n.replaceString,isReplaceRevealed:n.replaceString!==void 0,isRegex:n.isRegex,wholeWord:n.matchWholeWord,matchCase:n.isCaseSensitive,preserveCase:n.preserveCase}:{};yield o.start({forceRevealReplace:!1,seedSearchStringFromSelection:o.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(n==null?void 0:n.findInSelection)||!1,loop:t.getOption(41).loop},r),o.setGlobalBufferTerm(o.getState().searchString)}})}}class xCt extends ft{constructor(){super({id:Ri.StartFindWithSelection,label:C("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 Cb(this,void 0,void 0,function*(){const n=ha.get(t);n&&(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),n.setGlobalBufferTerm(n.getState().searchString))})}}class eSe extends ft{run(e,t){return Cb(this,void 0,void 0,function*(){const n=ha.get(t);n&&!this._run(n)&&(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.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(n))})}}class LCt extends eSe{constructor(){super({id:Ri.NextMatchFindAction,label:C("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:Q.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Me.and(Q.focus,SF),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class ECt extends eSe{constructor(){super({id:Ri.PreviousMatchFindAction,label:C("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:Q.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Me.and(Q.focus,SF),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class DCt extends ft{constructor(){super({id:Ri.GoToMatchFindAction,label:C("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:xp}),this._highlightDecorations=[]}run(e,t,n){const o=ha.get(t);if(!o)return;const r=o.getState().matchesCount;if(r<1){e.get(Ao).notify({severity:k5.Warning,message:C("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(dh).createInputBox();a.placeholder=C("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",r);const l=d=>{const u=parseInt(d);if(isNaN(u))return;const h=o.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,o.goToMatch(u);const h=o.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=C("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",o.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{c(d)}),a.onDidAccept(()=>{const d=l(a.value);typeof d=="number"?(o.goToMatch(d),a.hide()):a.validationMessage=C("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",o.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(n=>{this._highlightDecorations=n.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:ro(xbe),position:Yl.Full}}}])})}}class tSe extends ft{run(e,t){return Cb(this,void 0,void 0,function*(){const n=ha.get(t);if(!n)return;const o=eU(t,"single",!1);o&&n.setSearchString(o),this._run(n)||(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))})}}class kCt extends tSe{constructor(){super({id:Ri.NextSelectionMatchFindAction,label:C("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class ICt extends tSe{constructor(){super({id:Ri.PreviousSelectionMatchFindAction,label:C("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const TCt=w0e(new y0e({id:Ri.StartFindReplaceAction,label:C("startReplace","Replace"),alias:"Replace",precondition:Me.or(Q.focus,Me.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:Z.MenubarEditMenu,group:"3_find",title:C({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));TCt.addImplementation(0,(i,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const n=ha.get(e);if(!n)return!1;const o=e.getSelection(),r=n.isFindInputFocused(),s=!o.isEmpty()&&o.startLineNumber===o.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!r,a=r||s?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"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})});Un(ha.ID,tU,0);ze(SCt);ze(xCt);ze(LCt);ze(ECt);ze(DCt);ze(kCt);ze(ICt);const uh=Ir.bindToContribution(ha.get);Ye(new uh({id:Ri.CloseFindWidgetCommand,precondition:xp,handler:i=>i.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:9,secondary:[1033]}}));Ye(new uh({id:Ri.ToggleCaseSensitiveCommand,precondition:void 0,handler:i=>i.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:iR.primary,mac:iR.mac,win:iR.win,linux:iR.linux}}));Ye(new uh({id:Ri.ToggleWholeWordCommand,precondition:void 0,handler:i=>i.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:oR.primary,mac:oR.mac,win:oR.win,linux:oR.linux}}));Ye(new uh({id:Ri.ToggleRegexCommand,precondition:void 0,handler:i=>i.toggleRegex(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:rR.primary,mac:rR.mac,win:rR.win,linux:rR.linux}}));Ye(new uh({id:Ri.ToggleSearchScopeCommand,precondition:void 0,handler:i=>i.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:sR.primary,mac:sR.mac,win:sR.win,linux:sR.linux}}));Ye(new uh({id:Ri.TogglePreserveCaseCommand,precondition:void 0,handler:i=>i.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:aR.primary,mac:aR.mac,win:aR.win,linux:aR.linux}}));Ye(new uh({id:Ri.ReplaceOneAction,precondition:xp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:3094}}));Ye(new uh({id:Ri.ReplaceOneAction,precondition:xp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,LY),primary:3}}));Ye(new uh({id:Ri.ReplaceAllAction,precondition:xp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:2563}}));Ye(new uh({id:Ri.ReplaceAllAction,precondition:xp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,LY),primary:void 0,mac:{primary:2051}}}));Ye(new uh({id:Ri.SelectAllMatchesAction,precondition:xp,handler:i=>i.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:515}}));const NCt={[0]:" ",[1]:"u",[2]:"r"},_ce=65535,bu=16777215,bce=4278190080;class f7{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,n=e%32;return(this._states[t]&1<_ce)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new f7(e.length),this._userDefinedStates=new f7(e.length),this._recoveredStates=new f7(e.length),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(n,o)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=n&&this.getEndLineNumber(r)>=o};for(let n=0,o=this._startIndexes.length;nbu||s>bu)throw new Error("startLineNumber or endLineNumber must not exceed "+bu);for(;e.length>0&&!t(r,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=r+((a&255)<<24),this._endIndexes[n]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&bu}getEndLineNumber(e){return this._endIndexes[e]&bu}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 n=!1;if(this._types)for(let o=0;o>>24)+((this._endIndexes[e]&bce)>>>16);return t===_ce?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(n===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)?m=>mm=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=r(++a)):(p=d,d.isCollapsed&&d.source===0&&(p.source=2)),d=s(++l);else{let v=l,m=d;for(;;){if(!m||m.startLineNumber>c.endLineNumber){p=c;break}if(m.source===1&&m.endLineNumber>c.endLineNumber)break;m=s(++v)}c=r(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=n&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&u.push(h),h=p)}}return g}}class RCt{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 MCt{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new le,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Ml(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((n,o)=>n.regionIndex-o.regionIndex);const t={};this._decorationProvider.changeDecorations(n=>{let o=0,r=-1,s=-1;const a=l=>{for(;os&&(s=c),o++}};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),r=Math.max(r,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,n=o=>{for(const r of e)if(!(r.startLineNumber>o.endLineNumber||o.startLineNumber>r.endLineNumber))return!0;return!1};for(let o=0;on&&(n=a)}this._decorationProvider.changeDecorations(o=>this._editorDecorationIds=o.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(o,r)=>{for(const s of e)if(o=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>n)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,n;if(!Array.isArray(e))return;const o=[],r=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>r)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&o.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(n=a.source)!==null&&n!==void 0?n:0})}const s=Ml.sanitizeAndMerge(this._regions,o,r);this.updatePost(Ml.fromFoldRanges(s))}_getLinesChecksum(e,t){return H0e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const n=[];if(this._regions){let o=this._regions.findRange(e),r=1;for(;o>=0;){const s=this._regions.toRegion(o);(!t||t(s,r))&&n.push(s),r++,o=s.parentIndex}}return n}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 n=[],o=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=o,l=this._regions.length;a0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&n.push(c)}else break}}else for(let s=o,a=this._regions.length;s1){const a=i.getRegionsInside(r,(l,c)=>l.isCollapsed!==s&&c0)for(const r of n){const s=i.getRegionAtLine(r);if(s&&(s.isCollapsed!==e&&o.push(s),t>1)){const a=i.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&cs.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);o.push(...s)}i.toggleCollapseState(o)}function ACt(i,e,t){const n=[];for(const o of t){const r=i.getAllRegionsAtLine(o,s=>s.isCollapsed!==e);r.length>0&&n.push(r[0])}i.toggleCollapseState(n)}function PCt(i,e,t,n){const o=(s,a)=>a===e&&s.isCollapsed!==t&&!n.some(l=>s.containsLine(l)),r=i.getRegionsInside(null,o);i.toggleCollapseState(r)}function oSe(i,e,t){const n=[];for(const s of t){const a=i.getAllRegionsAtLine(s,void 0);a.length>0&&n.push(a[0])}const o=s=>n.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,r=i.getRegionsInside(null,o);i.toggleCollapseState(r)}function kY(i,e,t){const n=i.textModel,o=i.regions,r=[];for(let s=o.length-1;s>=0;s--)if(t!==o.isCollapsed(s)){const a=o.getStartLineNumber(s);e.test(n.getLineContent(a))&&r.push(o.toRegion(s))}i.toggleCollapseState(r)}function IY(i,e,t){const n=i.regions,o=[];for(let r=n.length-1;r>=0;r--)t!==n.isCollapsed(r)&&e===n.getType(r)&&o.push(n.toRegion(r));i.toggleCollapseState(o)}function OCt(i,e){let t=null;const n=e.getRegionAtLine(i);if(n!==null&&(t=n.startLineNumber,i===t)){const o=n.parentIndex;o!==-1?t=e.regions.getStartLineNumber(o):t=null}return t}function FCt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){if(i!==t.startLineNumber)return t.startLineNumber;{const n=t.parentIndex;let o=0;for(n!==-1&&(o=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=o)return null;if(t.parentIndex===n)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 BCt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){const n=t.parentIndex;let o=0;if(n!==-1)o=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;o=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=o)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>i)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||Tv(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let n=0,o=0,r=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;n0}isHidden(e){return Cce(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const n=this._foldingModel.textModel;let o=null;const r=s=>((!o||!VCt(s,o))&&(o=Cce(this._hiddenRanges,s)),o?o.startLineNumber-1:null);for(let s=0,a=e.length;s0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function VCt(i,e){return i>=e.startLineNumber&&i<=e.endLineNumber}function Cce(i,e){const t=UD(i,n=>e=0&&i[t].endLineNumber>=e?i[t]:null}const HCt=5e3,$Ct="indent";class TY{constructor(e,t,n){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=n,this.id=$Ct}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,n=t&&!!t.offSide,o=t&&t.markers;return Promise.resolve(jCt(this.editorModel,n,o,this.foldingRangesLimit))}}class zCt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>bu||t>bu)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),o=new Uint32Array(this._length);for(let r=this._length-1,s=0;r>=0;r--,s++)n[s]=this._startIndexes[r],o[s]=this._endIndexes[r];return new Ml(n,o)}else{this._foldingRangesLimit.update(this._length,t);let n=0,o=this._indentOccurrences.length;for(let l=0;lt){o=l;break}n+=c}}const r=e.getOptions().tabSize,s=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=S5(u,r);(h{}};function jCt(i,e,t,n=UCt){const o=i.getOptions().tabSize,r=new zCt(n);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=i.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=i.getLineCount();c>0;c--){const d=i.getLineContent(c),u=S5(d,o);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=d.match(s)))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],r.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&&r.insertFirst(c,g,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return r.toIndentRanges(i)}const KCt=J("editor.foldBackground",{light:St(Lm,.3),dark:St(Lm,.3),hcDark:null,hcLight:null},C("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);J("editorGutter.foldingControlForeground",{dark:xm,light:xm,hcDark:xm,hcLight:xm},C("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const EF=Eo("folding-expanded",Xe.chevronDown,C("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),DF=Eo("folding-collapsed",Xe.chevronRight,C("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),rSe=Eo("folding-manual-collapsed",DF,C("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),sSe=Eo("folding-manual-expanded",EF,C("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),NY={color:ro(KCt),position:ll.Inline};class Bo{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,n){return t?Bo.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Bo.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Bo.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Bo.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?n?this.showFoldingHighlights?Bo.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Bo.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Bo.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Bo.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?n?Bo.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Bo.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:n?Bo.MANUALLY_EXPANDED_VISUAL_DECORATION:Bo.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Bo.COLLAPSED_VISUAL_DECORATION=Jt.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(DF)});Bo.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Jt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:NY,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(DF)});Bo.MANUALLY_COLLAPSED_VISUAL_DECORATION=Jt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(rSe)});Bo.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Jt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:NY,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(rSe)});Bo.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Bo.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:NY,isWholeLine:!0});Bo.EXPANDED_VISUAL_DECORATION=Jt.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Mt.asClassName(EF)});Bo.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Jt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(EF)});Bo.MANUALLY_EXPANDED_VISUAL_DECORATION=Jt.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Mt.asClassName(sSe)});Bo.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Jt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(sSe)});Bo.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Bo.HIDDEN_RANGE_DECORATION=Jt.register({description:"folding-hidden-range-decoration",stickiness:1});const qCt={},GCt="syntax";class RY{constructor(e,t,n,o,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=n,this.foldingRangesLimit=o,this.fallbackRangeProvider=r,this.id=GCt,this.disposables=new Be,r&&this.disposables.add(r);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(n))}compute(e){return XCt(this.providers,this.editorModel,e).then(t=>{var n,o;return t?ZCt(t,this.foldingRangesLimit):(o=(n=this.fallbackRangeProvider)===null||n===void 0?void 0:n.compute(e))!==null&&o!==void 0?o:null})}dispose(){this.disposables.dispose()}}function XCt(i,e,t){let n=null;const o=i.map((r,s)=>Promise.resolve(r.provideFoldingRanges(e,qCt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(n)||(n=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&n.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},$o));return Promise.all(o).then(r=>n)}class YCt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,n,o){if(e>bu||t>bu)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=o,this._types[r]=n,this._length++,o<30&&(this._nestingLevelCounts[o]=(this._nestingLevelCounts[o]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let o=0;oe){n=a;break}t+=l}}const o=new Uint32Array(e),r=new Uint32Array(e),s=[];for(let a=0,l=0;a{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),n=new YCt(e);let o;const r=[];for(const s of t)if(!o)o=s,n.add(s.start,s.end,s.kind&&s.kind.value,r.length);else if(s.start>o.start)if(s.end<=o.end)r.push(o),o=s,n.add(s.start,s.end,s.kind&&s.kind.value,r.length);else{if(s.start>o.end){do o=r.pop();while(o&&s.start>o.end);o&&r.push(o),o=s}n.add(s.start,s.end,s.kind&&s.kind.value,r.length)}return n.toIndentRanges()}var QCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},JCt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},gC;const Is=new lt("foldingEnabled",!1);let xf=gC=class extends _e{static get(e){return e.getContribution(gC.ID)}static getFoldingRangeProviders(e,t){var n,o;const r=e.foldingRangeProvider.ordered(t);return(o=(n=gC._foldingRangeSelector)===null||n===void 0?void 0:n.call(gC,r,t))!==null&&o!==void 0?o:r}constructor(e,t,n,o,r,s){super(),this.contextKeyService=t,this.languageConfigurationService=n,this.languageFeaturesService=s,this.localToDispose=this._register(new Be),this.editor=e,this._foldingLimitReporter=new aSe(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=r.for(s.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 Bo(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Is.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(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n,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 MCt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new WCt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Wd(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new bi(()=>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,n;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,(n=this.rangeProvider)===null||n===void 0||n.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 TY(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const n=gC.getFoldingRangeProviders(this.languageFeaturesService,e);n.length>0&&(this.rangeProvider=new RY(e,n,()=>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 Ls,n=this.getRangeProvider(e.textModel),o=this.foldingRegionPromise=sr(r=>n.compute(r));return o.then(r=>{if(r&&o===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=r.setCollapsedAllOfType(ra.Imports.value,!0);d&&(s=Zu.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),l=a?a.map(d=>d.startLineNumber):[];e.update(r,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(en(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 n=this.editor.getSelections();if(n&&n.length>0){const o=[];for(const r of n){const s=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&o.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}o.length&&(t.toggleCollapseState(o),this.reveal(n[0].getPosition()))}}}).then(void 0,en)}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 n=!1;switch(e.target.type){case 4:{const o=e.target.detail,r=e.target.element.offsetLeft;if(o.offsetX-r<4)return;n=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const o=this.editor.getModel();if(o&&t.startColumn===o.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:n}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const n=this.mouseDownInfo.lineNumber,o=this.mouseDownInfo.iconClicked,r=e.target.range;if(!r||r.startLineNumber!==n)return;if(o){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(n))return}const s=t.getRegionAtLine(n);if(s&&s.startLineNumber===n){const a=s.isCollapsed;if(o||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(s)&&!s.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(s))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:n,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};xf.ID="editor.contrib.folding";xf=gC=QCt([iL(1,Ut),iL(2,Ti),iL(3,Ao),iL(4,qc),iL(5,pt)],xf);class aSe{constructor(e){this.editor=e,this._onDidChange=new le,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 $s extends ft{runEditorCommand(e,t,n){const o=e.get(Ti),r=xf.get(t);if(!r)return;const s=r.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(r,a,t,n,o);const l=t.getSelection();l&&r.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(n=>n.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(n=>n+1):this.getSelectedLines(t)}run(e,t){}}function lSe(i){if(!il(i)){if(!ia(i))return!1;const e=i;if(!il(e.levels)&&!Cv(e.levels)||!il(e.direction)&&!la(e.direction)||!il(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Cv)))return!1}return!0}class eyt extends $s{constructor(){super({id:"editor.unfold",label:C("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. - `,constraint:lSe,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,n,o){const r=o&&o.levels||1,s=this.getLineNumbers(o,n);o&&o.direction==="up"?iSe(t,!1,r,s):RS(t,!1,r,s)}}class JCt extends $s{constructor(){super({id:"editor.unfoldRecursively",label:C("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2142),weight:100}})}invoke(e,t,n,o){RS(t,!1,Number.MAX_VALUE,this.getSelectedLines(n))}}class eyt extends $s{constructor(){super({id:"editor.fold",label:C("foldAction.label","Fold"),alias:"Fold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: + `,constraint:lSe,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,n,o){const r=o&&o.levels||1,s=this.getLineNumbers(o,n);o&&o.direction==="up"?iSe(t,!1,r,s):RS(t,!1,r,s)}}class tyt extends $s{constructor(){super({id:"editor.unfoldRecursively",label:C("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2142),weight:100}})}invoke(e,t,n,o){RS(t,!1,Number.MAX_VALUE,this.getSelectedLines(n))}}class nyt extends $s{constructor(){super({id:"editor.fold",label:C("foldAction.label","Fold"),alias:"Fold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. - `,constraint:lSe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,o){const r=this.getLineNumbers(o,n),s=o&&o.levels,a=o&&o.direction;typeof s!="number"&&typeof a!="string"?RCt(t,!0,r):a==="up"?iSe(t,!0,s||1,r):RS(t,!0,s||1,r)}}class tyt extends $s{constructor(){super({id:"editor.toggleFold",label:C("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2090),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);nSe(t,1,o)}}class nyt extends $s{constructor(){super({id:"editor.foldRecursively",label:C("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2140),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);RS(t,!0,Number.MAX_VALUE,o)}}class iyt extends $s{constructor(){super({id:"editor.foldAllBlockComments",label:C("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2138),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())kY(t,ra.Comment.value,!0);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+Xl(a.blockCommentStartToken));DY(t,l,!0)}}}}class oyt extends $s{constructor(){super({id:"editor.foldAllMarkerRegions",label:C("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2077),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())kY(t,ra.Region.value,!0);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);DY(t,l,!0)}}}}class ryt extends $s{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:C("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2078),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())kY(t,ra.Region.value,!1);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);DY(t,l,!1)}}}}class syt extends $s{constructor(){super({id:"editor.foldAllExcept",label:C("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2136),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);oSe(t,!0,o)}}class ayt extends $s{constructor(){super({id:"editor.unfoldAllExcept",label:C("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2134),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);oSe(t,!1,o)}}class lyt extends $s{constructor(){super({id:"editor.foldAll",label:C("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2069),weight:100}})}invoke(e,t,n){RS(t,!0)}}class cyt extends $s{constructor(){super({id:"editor.unfoldAll",label:C("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2088),weight:100}})}invoke(e,t,n){RS(t,!1)}}class yb extends $s{getFoldingLevel(){return parseInt(this.id.substr(yb.ID_PREFIX.length))}invoke(e,t,n){MCt(t,this.getFoldingLevel(),!0,this.getSelectedLines(n))}}yb.ID_PREFIX="editor.foldLevel";yb.ID=i=>yb.ID_PREFIX+i;class dyt extends $s{constructor(){super({id:"editor.gotoParentFold",label:C("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=ACt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class uyt extends $s{constructor(){super({id:"editor.gotoPreviousFold",label:C("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=PCt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class hyt extends $s{constructor(){super({id:"editor.gotoNextFold",label:C("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=OCt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class fyt extends $s{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:C("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2135),weight:100}})}invoke(e,t,n){var o;const r=[],s=n.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(r.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),n.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(r.length>0){r.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=Ml.sanitizeAndMerge(t.regions,r,(o=n.getModel())===null||o===void 0?void 0:o.getLineCount());t.updatePost(Ml.fromFoldRanges(a))}}}}class gyt extends $s{constructor(){super({id:"editor.removeManualFoldingRanges",label:C("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2137),weight:100}})}invoke(e,t,n){const o=n.getSelections();if(o){const r=[];for(const s of o){const{startLineNumber:a,endLineNumber:l}=s;r.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(r),e.triggerFoldingModelChanged()}}}Un(xf.ID,xf,0);ze(QCt);ze(JCt);ze(eyt);ze(nyt);ze(lyt);ze(cyt);ze(iyt);ze(oyt);ze(ryt);ze(syt);ze(ayt);ze(tyt);ze(dyt);ze(uyt);ze(hyt);ze(fyt);ze(gyt);for(let i=1;i<=7;i++)eJe(new yb({id:yb.ID(i),label:C("foldLevelAction.label","Fold Level {0}",i),alias:`Fold Level ${i}`,precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2048|21+i),weight:100}}));Rn.registerCommand("_executeFoldingRangeProvider",function(i,...e){return ZCt(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof Rt))throw Mc();const n=i.get(pt),o=i.get(Yi).getModel(t);if(!o)throw Mc();const r=i.get(En);if(!r.getValue("editor.folding",{resource:t}))return[];const s=i.get(Ti),a=r.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return r.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new IY(o,s,l);let d=c;if(a!=="indentation"){const f=xf.getFoldingRangeProviders(n,o);f.length&&(d=new NY(o,f,()=>{},l,c))}const u=yield d.compute(_n.None),h=[];try{if(u)for(let f=0;f=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},LO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},RY=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let $k=class{constructor(e,t,n){this._editor=e,this._languageFeaturesService=t,this._workerService=n,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(o=>{o.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 n=new eP;for(const o of t.autoFormatTriggerCharacters)n.add(o.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(o=>{const r=o.charCodeAt(o.length-1);n.has(r)&&this._trigger(String.fromCharCode(r))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),n=this._editor.getPosition(),o=new Ro,r=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){o.cancel(),r.dispose();return}for(let a=0,l=s.changes.length;a{o.token.isCancellationRequested||ws(s)&&(Vw.execute(this._editor,s,!0),eY(s))}).finally(()=>{r.dispose()})}};$k.ID="editor.contrib.autoFormat";$k=cSe([LO(1,pt),LO(2,Xd)],$k);let zk=class{constructor(e,t,n){this.editor=e,this._languageFeaturesService=t,this._instantiationService=n,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(oye,this.editor,e,2,Xg.None,_n.None).catch(en)}};zk.ID="editor.contrib.formatOnPaste";zk=cSe([LO(1,pt),LO(2,$t)],zk);class _yt extends ft{constructor(){super({id:"editor.action.formatDocument",label:C("formatDocument.label","Format Document"),alias:"Format Document",precondition:Me.and(Q.notInCompositeEditor,Q.writable,Q.hasDocumentFormattingProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return RY(this,void 0,void 0,function*(){if(t.hasModel()){const n=e.get($t);yield e.get(t_).showWhile(n.invokeFunction(hvt,t,1,Xg.None,_n.None),250)}})}}class byt extends ft{constructor(){super({id:"editor.action.formatSelection",label:C("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:Me.and(Q.writable,Q.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2084),weight:100},contextMenuOpts:{when:Q.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return RY(this,void 0,void 0,function*(){if(!t.hasModel())return;const n=e.get($t),o=t.getModel(),r=t.getSelections().map(a=>a.isEmpty()?new V(a.startLineNumber,1,a.startLineNumber,o.getLineMaxColumn(a.startLineNumber)):a);yield e.get(t_).showWhile(n.invokeFunction(oye,t,r,1,Xg.None,_n.None),250)})}}Un($k.ID,$k,2);Un(zk.ID,zk,2);ze(_yt);ze(byt);Rn.registerCommand("editor.action.format",i=>RY(void 0,void 0,void 0,function*(){const e=i.get(Jn).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=i.get(_o);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var Cyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},f7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},yyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class QC{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let o=n;for(let r=0;t.children.get(o)!==void 0;r++)o=`${n}_${r}`;return o}static empty(e){return e.children.size===0}}class tU extends QC{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class dSe extends QC{constructor(e,t,n,o){super(),this.id=e,this.parent=t,this.label=n,this.order=o,this.children=new Map}}class _g extends QC{static create(e,t,n){const o=new Ro(n),r=new _g(t.uri),s=e.ordered(t),a=s.map((c,d)=>{var u;const h=QC.findId(`provider_${d}`,r),f=new dSe(h,r,(u=c.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,o.token)).then(g=>{for(const p of g||[])_g._makeOutlineElement(p,f);return f},g=>($o(g),f)).then(g=>{QC.empty(g)?g.remove():r._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Lo(c,s)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!n.isCancellationRequested?_g.create(e,t,n):r._compact()).finally(()=>{o.dispose(),l.dispose(),o.dispose()})}static _makeOutlineElement(e,t){const n=QC.findId(e,t),o=new tU(n,t,e);if(e.children)for(const r of e.children)_g._makeOutlineElement(r,o);t.children.set(o.id,o)}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,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=vn.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof tU?e.push(t.symbol):e.push(...vn.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>V.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return _g._flattenDocumentSymbols(t,e,""),t.sort((n,o)=>ae.compare(V.getStartPosition(n.range),V.getStartPosition(o.range))||ae.compare(V.getEndPosition(o.range),V.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const o of t)e.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&_g._flattenDocumentSymbols(e,o.children,o.name)}}const DF=yn("IOutlineModelService");let nU=class{constructor(e,t,n){this._languageFeaturesService=e,this._disposables=new Be,this._cache=new Qv(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(n.onModelRemoved(o=>{this._cache.delete(o.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return yyt(this,void 0,void 0,function*(){const n=this._languageFeaturesService.documentSymbolProvider,o=n.ordered(e);let r=this._cache.get(e.id);if(!r||r.versionId!==e.getVersionId()||!Lo(r.provider,o)){const a=new Ro;r={versionId:e.getVersionId(),provider:o,promiseCnt:0,source:a,promise:_g.create(n,e,a.token),model:void 0},this._cache.set(e.id,r);const l=Date.now();r.promise.then(c=>{r.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(r.model)return r.model;r.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--r.promiseCnt===0&&(r.source.cancel(),this._cache.delete(e.id))});try{return yield r.promise}finally{s.dispose()}})}};nU=Cyt([f7(0,pt),f7(1,qc),f7(2,Yi)],nU);Mn(DF,nU,1);var wyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};Rn.registerCommand("_executeDocumentSymbolProvider",function(i,...e){return wyt(this,void 0,void 0,function*(){const[t]=e;fi(Rt.isUri(t));const n=i.get(DF),r=yield i.get(za).createModelReference(t);try{return(yield n.getOrCreate(r.object.textEditorModel,_n.None)).getTopLevelSymbols()}finally{r.dispose()}})});class Dr extends _e{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Dr.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Dr.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Dr.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Dr.suppressSuggestions.bindTo(this.contextKeyService),this._register(Ii(n=>{const o=this.model.read(n),r=o==null?void 0:o.state.read(n),s=!!(r!=null&&r.inlineCompletion)&&(r==null?void 0:r.ghostText)!==void 0&&!(r!=null&&r.ghostText.isEmpty());this.inlineCompletionVisible.set(s),(r==null?void 0:r.ghostText)&&(r==null?void 0:r.inlineCompletion)&&this.suppressSuggestions.set(r.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(Ii(n=>{const o=this.model.read(n);let r=!1,s=!0;const a=o==null?void 0:o.ghostText.read(n);if(!!(o!=null&&o.selectedSuggestItem)&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],d=c[0],u=o.textModel.getLineIndentColumn(a.lineNumber);if(l<=u){let f=Ws(d);f===-1&&(f=d.length-1),r=f>0;const g=o.textModel.getOptions().tabSize;s=or.visibleColumnFromColumn(d,f+1,g){const r=V.lift(o.range);return{startOffset:t.getOffset(r.getStartPosition()),endOffset:t.getOffset(r.getEndPosition()),text:o.text}});n.sort((o,r)=>r.startOffset-o.startOffset);for(const o of n)i=i.substring(0,o.startOffset)+o.text+i.substring(o.endOffset);return i}class xyt{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tt)throw new Vo(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new V(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function kyt(i,e){const t=new Be,n=i.createDecorationsCollection();return t.add(UX({debugName:()=>`Apply decorations from ${e.debugName}`},o=>{const r=e.read(o);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function iU(i,e){return new ae(i.lineNumber+e.lineNumber-1,e.lineNumber===1?i.column+e.column-1:e.column)}function oU(i){let e=1,t=1;for(const n of i)n===` -`?(e++,t=1):t++;return new ae(e,t)}class EO{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,n)=>t.equals(e.parts[n]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],n=e.substr(0,t.column-1);return Syt(n,this.parts.map(r=>({range:{startLineNumber:1,endLineNumber:1,startColumn:r.column,endColumn:r.column},text:r.lines.join(` -`)}))).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 rU{constructor(e,t,n){this.column=e,this.lines=t,this.preview=n}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,n)=>t===e.lines[n])}}class sU{constructor(e,t,n,o=0){this.lineNumber=e,this.columnRange=t,this.newLines=n,this.additionalReservedLineCount=o,this.parts=[new rU(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join(` -`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,n)=>t===e.newLines[n])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function Cce(i,e){return i===e?!0:!i||!e?!1:i instanceof EO&&e instanceof EO||i instanceof sU&&e instanceof sU?i.equals(e):!1}var Iyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Tyt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const yce="ghost-text";let aU=class extends _e{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Ai(this,!1),this.currentTextModel=$r(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=In(this,o=>{if(this.isDisposed.read(o))return;const r=this.currentTextModel.read(o);if(r!==this.model.targetTextModel.read(o))return;const s=this.model.ghostText.read(o);if(!s)return;const a=s instanceof sU?s.columnRange:void 0,l=[],c=[];function d(p,v){if(c.length>0){const m=c[c.length-1];v&&m.decorations.push(new rl(m.content.length+1,m.content.length+1+p[0].length,v,0)),m.content+=p[0],p=p.slice(1)}for(const m of p)c.push({content:m,decorations:v?[new rl(1,m.length+1,v,0)]:[]})}const u=r.getLineContent(s.lineNumber);let h,f=0;for(const p of s.parts){let v=p.lines;h===void 0?(l.push({column:p.column,text:v[0],preview:p.preview}),v=v.slice(1)):d([u.substring(f,p.column-1)],void 0),v.length>0&&(d(v,yce),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 Dyt(h,u.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(o),targetTextModel:r}}),this.decorations=In(this,o=>{const r=this.uiState.read(o);if(!r)return[];const s=[];r.replacedRange&&s.push({range:r.replacedRange.toRange(r.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),r.hiddenRange&&s.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of r.inlineTexts)s.push({range:V.fromPositions(new ae(r.lineNumber,a.column)),options:{description:yce,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Nu.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new Nyt(this.editor,this.languageService.languageIdCodec,In(o=>{const r=this.uiState.read(o);return r?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(zt(()=>{this.isDisposed.set(!0,void 0)})),this._register(kyt(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};aU=Iyt([Tyt(2,Ki)],aU);class Nyt extends _e{get viewZoneId(){return this._viewZoneId}constructor(e,t,n){super(),this.editor=e,this.languageIdCodec=t,this.lines=n,this._viewZoneId=void 0,this.editorOptionsChanged=Fl("editorOptionChanged",st.filter(this.editor.onDidChangeConfiguration,o=>o.hasChanged(33)||o.hasChanged(116)||o.hasChanged(98)||o.hasChanged(93)||o.hasChanged(51)||o.hasChanged(50)||o.hasChanged(66))),this._register(Ii(o=>{const r=this.lines.read(o);this.editorOptionsChanged.read(o),r?this.updateLines(r.lineNumber,r.additionalLines,r.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,n){const o=this.editor.getModel();if(!o)return;const{tabSize:r}=o.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,n);if(a>0){const l=document.createElement("div");Ryt(l,r,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function Ryt(i,e,t,n,o){const r=n.get(33),s=n.get(116),a="none",l=n.get(93),c=n.get(51),d=n.get(50),u=n.get(66),h=new yS(1e4);h.appendString('

');for(let p=0,v=t.length;p');const y=$I(_),w=pw(_),L=pr.createEmpty(_,o);qI(new Jv(d.isMonospace&&!r,d.canUseHalfwidthRightwardsArrow,_,!1,y,w,0,L,m.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,s,a,l,c!==Pl.OFF,null),h),h.appendString("
")}h.appendString(""),ss(i,d);const f=h.build(),g=wce?wce.createHTML(f):f;i.innerHTML=g}const wce=vp("editorGhostText",{createHTML:i=>i});function Myt(i,e){const t=new zbe,n=new jbe(t,c=>e.getLanguageConfiguration(c)),o=new Ube(new Ayt([i]),n),r=LH(o,[],void 0,!0);let s="";const a=i.getLineContent();function l(c,d){if(c.kind===2)l(c.openingBracket,d),d=so(d,c.openingBracket.length),c.child&&(l(c.child,d),d=so(d,c.child.length)),c.closingBracket?(l(c.closingBracket,d),d=so(d,c.closingBracket.length)):s+=n.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(d,so(d,c.length));else if(c.kind===4)for(const u of c.children)l(u,d),d=so(d,u.length)}}return l(r,sa),s}class Ayt{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 fd{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,n=this.value.charCodeAt(e),o;if(o=fd._table[n],typeof o=="number")return this.pos+=1,{type:o,pos:e,len:1};if(fd.isDigitCharacter(n)){o=8;do t+=1,n=this.value.charCodeAt(e+t);while(fd.isDigitCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}if(fd.isVariableCharacter(n)){o=9;do n=this.value.charCodeAt(e+ ++t);while(fd.isVariableCharacter(n)||fd.isDigitCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}o=10;do t+=1,n=this.value.charCodeAt(e+t);while(!isNaN(n)&&typeof fd._table[n]=="undefined"&&!fd.isDigitCharacter(n)&&!fd.isVariableCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}}fd._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class MS{constructor(){this._children=[]}appendChild(e){return e instanceof ta&&this._children[this._children.length-1]instanceof ta?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,o=n.children.indexOf(e),r=n.children.slice(0);r.splice(o,1,...t),n._children=r,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,n)}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 xT)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class ta extends MS{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new ta(this.value)}}class uSe extends MS{}class yc extends uSe{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 AS?this._children[0]:void 0}clone(){const e=new yc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class AS extends MS{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof ta&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new AS;return this.options.forEach(e.appendChild,e),e}}class MY extends MS{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,o=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(r=>r instanceof Cu&&Boolean(r.elseValue))&&(o=this._replace([])),o}_replace(e){let t="";for(const n of this._children)if(n instanceof Cu){let o=e[n.index]||"";o=n.resolve(o),t+=o}else t+=n.toString();return t}toString(){return""}clone(){const e=new MY;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 Cu extends MS{constructor(e,t,n,o){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=o}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):"":Boolean(e)&&typeof this.ifValue=="string"?this.ifValue:!Boolean(e)&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(n=>n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((n,o)=>o===0?n.charAt(0).toLowerCase()+n.substr(1):n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}clone(){return new Cu(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Uk extends uSe{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 ta(t)],!0):!1}clone(){const e=new Uk(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Sce(i,e){const t=[...i];for(;t.length>0;){const n=t.shift();if(!e(n))break;t.unshift(...n.children)}}class xT extends MS{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(n){return n instanceof yc&&(e.push(n),t=!t||t.indexo===e?(n=!0,!1):(t+=o.len(),!0)),n?t:-1}fullLen(e){let t=0;return Sce([e],n=>(t+=n.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:n}=e;for(;n;)n instanceof yc&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Uk&&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 xT;return this._children=this.children.map(t=>t.clone()),e}walk(e){Sce(this.children,e)}}class Yw{constructor(){this._scanner=new fd,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,n){const o=new xT;return this.parseFragment(e,o),this.ensureFinalTabstop(o,n!=null?n:!1,t!=null?t:!1),o}parseFragment(e,t){const n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const o=new Map,r=[];t.walk(l=>(l instanceof yc&&(l.isFinalTabstop?o.set(0,void 0):!o.has(l.index)&&l.children.length>0?o.set(l.index,l.children):r.push(l)),!0));const s=(l,c)=>{const d=o.get(l.index);if(!d)return;const u=new yc(l.index);u.transform=l.transform;for(const h of d){const f=h.clone();u.appendChild(f),f instanceof yc&&o.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[u])},a=new Set;for(const l of r)s(l,a);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(r=>r.index===0)||e.appendChild(new yc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const n=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),n}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 o=this._scanner.next();if(o.type!==0&&o.type!==4&&o.type!==5)return!1}this._token=this._scanner.next()}const n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_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 ta(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new yc(Number(t)):new Uk(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const r=new yc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ta("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){const s=new AS;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(s),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(n)}_parseChoiceElement(e){const t=this._token,n=[];for(;!(this._token.type===2||this._token.type===7);){let o;if((o=this._accept(5,!0))?o=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||o:o=this._accept(void 0,!0),!o)return this._backTo(t),!1;n.push(o)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new ta(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const r=new Uk(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ta("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(n)}_parseTransform(e){const t=new MY;let n="",o="";for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(6,!0)||r,n+=r;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(5,!0)||this._accept(6,!0)||r,t.appendChild(new ta(r));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){o+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,o)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);const o=this._accept(8,!0);if(o)if(n){if(this._accept(4))return e.appendChild(new Cu(Number(o))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Cu(Number(o))),!0;else return this._backTo(t),!1;if(this._accept(6)){const r=this._accept(9,!0);return!r||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Cu(Number(o),r)),!0)}else if(this._accept(11)){const r=this._until(4);if(r)return e.appendChild(new Cu(Number(o),void 0,r,void 0)),!0}else if(this._accept(12)){const r=this._until(4);if(r)return e.appendChild(new Cu(Number(o),void 0,void 0,r)),!0}else if(this._accept(13)){const r=this._until(1);if(r){const s=this._until(4);if(s)return e.appendChild(new Cu(Number(o),void 0,r,s)),!0}}else{const r=this._until(4);if(r)return e.appendChild(new Cu(Number(o),void 0,void 0,r)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new ta(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var g7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Pyt(i,e,t,n,o=_n.None,r){return g7(this,void 0,void 0,function*(){const s=Byt(e,t),a=i.all(t),l=new fG;for(const m of a)m.groupId&&l.add(m.groupId,m);function c(m){if(!m.yieldsToGroupIds)return[];const _=[];for(const y of m.yieldsToGroupIds||[]){const w=l.get(y);for(const L of w)_.push(L)}return _}const d=new Map,u=new Set;function h(m,_){if(_=[..._,m],u.has(m))return _;u.add(m);try{const y=c(m);for(const w of y){const L=h(w,_);if(L)return L}}finally{u.delete(m)}}function f(m){const _=d.get(m);if(_)return _;const y=h(m,[]);y&&$o(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(L=>L.toString?L.toString():""+L).join(" -> ")}`));const w=new i5;return d.set(m,w.p),(()=>g7(this,void 0,void 0,function*(){if(!y){const L=c(m);for(const D of L){const E=yield f(D);if(E&&E.items.length>0)return}}try{return yield m.provideInlineCompletions(t,e,n,o)}catch(L){$o(L);return}}))().then(L=>w.complete(L),L=>w.error(L)),w.p}const g=yield Promise.all(a.map(m=>g7(this,void 0,void 0,function*(){return{provider:m,completions:yield f(m)}}))),p=new Map,v=[];for(const m of g){const _=m.completions;if(!_)continue;const y=new Fyt(_,m.provider);v.push(y);for(const w of _.items){const L=DO.from(w,y,s,t,r);p.set(L.hash(),L)}}return new Oyt(Array.from(p.values()),new Set(p.keys()),v)})}class Oyt{constructor(e,t,n){this.completions=e,this.hashs=t,this.providerResults=n}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class Fyt{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 DO{static from(e,t,n,o,r){let s,a,l=e.range?V.lift(e.range):n;if(typeof e.insertText=="string"){if(s=e.insertText,r&&e.completeBracketPairs){s=xce(s,l.getStartPosition(),o,r);const c=s.length-e.insertText.length;c!==0&&(l=new V(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(r&&e.completeBracketPairs){e.insertText.snippet=xce(e.insertText.snippet,l.getStartPosition(),o,r);const u=e.insertText.snippet.length-c;u!==0&&(l=new V(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+u))}const d=new Yw().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof ta?(s=d.children[0].value,a=void 0):(s=d.toString(),a={snippet:e.insertText.snippet,range:l})}else Q4(e.insertText);return new DO(s,e.command,l,s,a,e.additionalTextEdits||Eyt(),e,t)}constructor(e,t,n,o,r,s,a,l){this.filterText=e,this.command=t,this.range=n,this.insertText=o,this.snippetInfo=r,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` + `,constraint:lSe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,o){const r=this.getLineNumbers(o,n),s=o&&o.levels,a=o&&o.direction;typeof s!="number"&&typeof a!="string"?ACt(t,!0,r):a==="up"?iSe(t,!0,s||1,r):RS(t,!0,s||1,r)}}class iyt extends $s{constructor(){super({id:"editor.toggleFold",label:C("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2090),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);nSe(t,1,o)}}class oyt extends $s{constructor(){super({id:"editor.foldRecursively",label:C("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2140),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);RS(t,!0,Number.MAX_VALUE,o)}}class ryt extends $s{constructor(){super({id:"editor.foldAllBlockComments",label:C("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2138),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())IY(t,ra.Comment.value,!0);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+Xl(a.blockCommentStartToken));kY(t,l,!0)}}}}class syt extends $s{constructor(){super({id:"editor.foldAllMarkerRegions",label:C("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2077),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())IY(t,ra.Region.value,!0);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);kY(t,l,!0)}}}}class ayt extends $s{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:C("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2078),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())IY(t,ra.Region.value,!1);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);kY(t,l,!1)}}}}class lyt extends $s{constructor(){super({id:"editor.foldAllExcept",label:C("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2136),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);oSe(t,!0,o)}}class cyt extends $s{constructor(){super({id:"editor.unfoldAllExcept",label:C("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2134),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);oSe(t,!1,o)}}class dyt extends $s{constructor(){super({id:"editor.foldAll",label:C("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2069),weight:100}})}invoke(e,t,n){RS(t,!0)}}class uyt extends $s{constructor(){super({id:"editor.unfoldAll",label:C("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2088),weight:100}})}invoke(e,t,n){RS(t,!1)}}class yb extends $s{getFoldingLevel(){return parseInt(this.id.substr(yb.ID_PREFIX.length))}invoke(e,t,n){PCt(t,this.getFoldingLevel(),!0,this.getSelectedLines(n))}}yb.ID_PREFIX="editor.foldLevel";yb.ID=i=>yb.ID_PREFIX+i;class hyt extends $s{constructor(){super({id:"editor.gotoParentFold",label:C("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=OCt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class fyt extends $s{constructor(){super({id:"editor.gotoPreviousFold",label:C("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=FCt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class gyt extends $s{constructor(){super({id:"editor.gotoNextFold",label:C("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=BCt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class pyt extends $s{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:C("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2135),weight:100}})}invoke(e,t,n){var o;const r=[],s=n.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(r.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),n.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(r.length>0){r.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=Ml.sanitizeAndMerge(t.regions,r,(o=n.getModel())===null||o===void 0?void 0:o.getLineCount());t.updatePost(Ml.fromFoldRanges(a))}}}}class myt extends $s{constructor(){super({id:"editor.removeManualFoldingRanges",label:C("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2137),weight:100}})}invoke(e,t,n){const o=n.getSelections();if(o){const r=[];for(const s of o){const{startLineNumber:a,endLineNumber:l}=s;r.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(r),e.triggerFoldingModelChanged()}}}Un(xf.ID,xf,0);ze(eyt);ze(tyt);ze(nyt);ze(oyt);ze(dyt);ze(uyt);ze(ryt);ze(syt);ze(ayt);ze(lyt);ze(cyt);ze(iyt);ze(hyt);ze(fyt);ze(gyt);ze(pyt);ze(myt);for(let i=1;i<=7;i++)nJe(new yb({id:yb.ID(i),label:C("foldLevelAction.label","Fold Level {0}",i),alias:`Fold Level ${i}`,precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2048|21+i),weight:100}}));Rn.registerCommand("_executeFoldingRangeProvider",function(i,...e){return JCt(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof Rt))throw Mc();const n=i.get(pt),o=i.get(Yi).getModel(t);if(!o)throw Mc();const r=i.get(En);if(!r.getValue("editor.folding",{resource:t}))return[];const s=i.get(Ti),a=r.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return r.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new TY(o,s,l);let d=c;if(a!=="indentation"){const f=xf.getFoldingRangeProviders(n,o);f.length&&(d=new RY(o,f,()=>{},l,c))}const u=yield d.compute(_n.None),h=[];try{if(u)for(let f=0;f=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},LO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},MY=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let $k=class{constructor(e,t,n){this._editor=e,this._languageFeaturesService=t,this._workerService=n,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(o=>{o.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 n=new eP;for(const o of t.autoFormatTriggerCharacters)n.add(o.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(o=>{const r=o.charCodeAt(o.length-1);n.has(r)&&this._trigger(String.fromCharCode(r))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),n=this._editor.getPosition(),o=new Ro,r=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){o.cancel(),r.dispose();return}for(let a=0,l=s.changes.length;a{o.token.isCancellationRequested||ws(s)&&(Vw.execute(this._editor,s,!0),tY(s))}).finally(()=>{r.dispose()})}};$k.ID="editor.contrib.autoFormat";$k=cSe([LO(1,pt),LO(2,Xd)],$k);let zk=class{constructor(e,t,n){this.editor=e,this._languageFeaturesService=t,this._instantiationService=n,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(oye,this.editor,e,2,Xg.None,_n.None).catch(en)}};zk.ID="editor.contrib.formatOnPaste";zk=cSe([LO(1,pt),LO(2,$t)],zk);class Cyt extends ft{constructor(){super({id:"editor.action.formatDocument",label:C("formatDocument.label","Format Document"),alias:"Format Document",precondition:Me.and(Q.notInCompositeEditor,Q.writable,Q.hasDocumentFormattingProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return MY(this,void 0,void 0,function*(){if(t.hasModel()){const n=e.get($t);yield e.get(t_).showWhile(n.invokeFunction(gvt,t,1,Xg.None,_n.None),250)}})}}class yyt extends ft{constructor(){super({id:"editor.action.formatSelection",label:C("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:Me.and(Q.writable,Q.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2084),weight:100},contextMenuOpts:{when:Q.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return MY(this,void 0,void 0,function*(){if(!t.hasModel())return;const n=e.get($t),o=t.getModel(),r=t.getSelections().map(a=>a.isEmpty()?new V(a.startLineNumber,1,a.startLineNumber,o.getLineMaxColumn(a.startLineNumber)):a);yield e.get(t_).showWhile(n.invokeFunction(oye,t,r,1,Xg.None,_n.None),250)})}}Un($k.ID,$k,2);Un(zk.ID,zk,2);ze(Cyt);ze(yyt);Rn.registerCommand("editor.action.format",i=>MY(void 0,void 0,void 0,function*(){const e=i.get(Jn).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=i.get(_o);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var wyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},g7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Syt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class QC{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let o=n;for(let r=0;t.children.get(o)!==void 0;r++)o=`${n}_${r}`;return o}static empty(e){return e.children.size===0}}class nU extends QC{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class dSe extends QC{constructor(e,t,n,o){super(),this.id=e,this.parent=t,this.label=n,this.order=o,this.children=new Map}}class _g extends QC{static create(e,t,n){const o=new Ro(n),r=new _g(t.uri),s=e.ordered(t),a=s.map((c,d)=>{var u;const h=QC.findId(`provider_${d}`,r),f=new dSe(h,r,(u=c.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,o.token)).then(g=>{for(const p of g||[])_g._makeOutlineElement(p,f);return f},g=>($o(g),f)).then(g=>{QC.empty(g)?g.remove():r._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Lo(c,s)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!n.isCancellationRequested?_g.create(e,t,n):r._compact()).finally(()=>{o.dispose(),l.dispose(),o.dispose()})}static _makeOutlineElement(e,t){const n=QC.findId(e,t),o=new nU(n,t,e);if(e.children)for(const r of e.children)_g._makeOutlineElement(r,o);t.children.set(o.id,o)}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,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=vn.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof nU?e.push(t.symbol):e.push(...vn.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>V.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return _g._flattenDocumentSymbols(t,e,""),t.sort((n,o)=>ae.compare(V.getStartPosition(n.range),V.getStartPosition(o.range))||ae.compare(V.getEndPosition(o.range),V.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const o of t)e.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&_g._flattenDocumentSymbols(e,o.children,o.name)}}const kF=yn("IOutlineModelService");let iU=class{constructor(e,t,n){this._languageFeaturesService=e,this._disposables=new Be,this._cache=new Qv(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(n.onModelRemoved(o=>{this._cache.delete(o.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return Syt(this,void 0,void 0,function*(){const n=this._languageFeaturesService.documentSymbolProvider,o=n.ordered(e);let r=this._cache.get(e.id);if(!r||r.versionId!==e.getVersionId()||!Lo(r.provider,o)){const a=new Ro;r={versionId:e.getVersionId(),provider:o,promiseCnt:0,source:a,promise:_g.create(n,e,a.token),model:void 0},this._cache.set(e.id,r);const l=Date.now();r.promise.then(c=>{r.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(r.model)return r.model;r.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--r.promiseCnt===0&&(r.source.cancel(),this._cache.delete(e.id))});try{return yield r.promise}finally{s.dispose()}})}};iU=wyt([g7(0,pt),g7(1,qc),g7(2,Yi)],iU);Mn(kF,iU,1);var xyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};Rn.registerCommand("_executeDocumentSymbolProvider",function(i,...e){return xyt(this,void 0,void 0,function*(){const[t]=e;fi(Rt.isUri(t));const n=i.get(kF),r=yield i.get(za).createModelReference(t);try{return(yield n.getOrCreate(r.object.textEditorModel,_n.None)).getTopLevelSymbols()}finally{r.dispose()}})});class Dr extends _e{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Dr.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Dr.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Dr.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Dr.suppressSuggestions.bindTo(this.contextKeyService),this._register(Ii(n=>{const o=this.model.read(n),r=o==null?void 0:o.state.read(n),s=!!(r!=null&&r.inlineCompletion)&&(r==null?void 0:r.ghostText)!==void 0&&!(r!=null&&r.ghostText.isEmpty());this.inlineCompletionVisible.set(s),(r==null?void 0:r.ghostText)&&(r==null?void 0:r.inlineCompletion)&&this.suppressSuggestions.set(r.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(Ii(n=>{const o=this.model.read(n);let r=!1,s=!0;const a=o==null?void 0:o.ghostText.read(n);if(!!(o!=null&&o.selectedSuggestItem)&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],d=c[0],u=o.textModel.getLineIndentColumn(a.lineNumber);if(l<=u){let f=Ws(d);f===-1&&(f=d.length-1),r=f>0;const g=o.textModel.getOptions().tabSize;s=or.visibleColumnFromColumn(d,f+1,g){const r=V.lift(o.range);return{startOffset:t.getOffset(r.getStartPosition()),endOffset:t.getOffset(r.getEndPosition()),text:o.text}});n.sort((o,r)=>r.startOffset-o.startOffset);for(const o of n)i=i.substring(0,o.startOffset)+o.text+i.substring(o.endOffset);return i}class Eyt{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tt)throw new Vo(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new V(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function Tyt(i,e){const t=new Be,n=i.createDecorationsCollection();return t.add(jX({debugName:()=>`Apply decorations from ${e.debugName}`},o=>{const r=e.read(o);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function oU(i,e){return new ae(i.lineNumber+e.lineNumber-1,e.lineNumber===1?i.column+e.column-1:e.column)}function rU(i){let e=1,t=1;for(const n of i)n===` +`?(e++,t=1):t++;return new ae(e,t)}class EO{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,n)=>t.equals(e.parts[n]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],n=e.substr(0,t.column-1);return Lyt(n,this.parts.map(r=>({range:{startLineNumber:1,endLineNumber:1,startColumn:r.column,endColumn:r.column},text:r.lines.join(` +`)}))).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 sU{constructor(e,t,n){this.column=e,this.lines=t,this.preview=n}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,n)=>t===e.lines[n])}}class aU{constructor(e,t,n,o=0){this.lineNumber=e,this.columnRange=t,this.newLines=n,this.additionalReservedLineCount=o,this.parts=[new sU(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join(` +`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,n)=>t===e.newLines[n])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function yce(i,e){return i===e?!0:!i||!e?!1:i instanceof EO&&e instanceof EO||i instanceof aU&&e instanceof aU?i.equals(e):!1}var Nyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ryt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const wce="ghost-text";let lU=class extends _e{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Ai(this,!1),this.currentTextModel=$r(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=In(this,o=>{if(this.isDisposed.read(o))return;const r=this.currentTextModel.read(o);if(r!==this.model.targetTextModel.read(o))return;const s=this.model.ghostText.read(o);if(!s)return;const a=s instanceof aU?s.columnRange:void 0,l=[],c=[];function d(p,v){if(c.length>0){const m=c[c.length-1];v&&m.decorations.push(new rl(m.content.length+1,m.content.length+1+p[0].length,v,0)),m.content+=p[0],p=p.slice(1)}for(const m of p)c.push({content:m,decorations:v?[new rl(1,m.length+1,v,0)]:[]})}const u=r.getLineContent(s.lineNumber);let h,f=0;for(const p of s.parts){let v=p.lines;h===void 0?(l.push({column:p.column,text:v[0],preview:p.preview}),v=v.slice(1)):d([u.substring(f,p.column-1)],void 0),v.length>0&&(d(v,wce),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 Iyt(h,u.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(o),targetTextModel:r}}),this.decorations=In(this,o=>{const r=this.uiState.read(o);if(!r)return[];const s=[];r.replacedRange&&s.push({range:r.replacedRange.toRange(r.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),r.hiddenRange&&s.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of r.inlineTexts)s.push({range:V.fromPositions(new ae(r.lineNumber,a.column)),options:{description:wce,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Nu.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new Myt(this.editor,this.languageService.languageIdCodec,In(o=>{const r=this.uiState.read(o);return r?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(zt(()=>{this.isDisposed.set(!0,void 0)})),this._register(Tyt(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};lU=Nyt([Ryt(2,Ki)],lU);class Myt extends _e{get viewZoneId(){return this._viewZoneId}constructor(e,t,n){super(),this.editor=e,this.languageIdCodec=t,this.lines=n,this._viewZoneId=void 0,this.editorOptionsChanged=Fl("editorOptionChanged",st.filter(this.editor.onDidChangeConfiguration,o=>o.hasChanged(33)||o.hasChanged(116)||o.hasChanged(98)||o.hasChanged(93)||o.hasChanged(51)||o.hasChanged(50)||o.hasChanged(66))),this._register(Ii(o=>{const r=this.lines.read(o);this.editorOptionsChanged.read(o),r?this.updateLines(r.lineNumber,r.additionalLines,r.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,n){const o=this.editor.getModel();if(!o)return;const{tabSize:r}=o.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,n);if(a>0){const l=document.createElement("div");Ayt(l,r,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function Ayt(i,e,t,n,o){const r=n.get(33),s=n.get(116),a="none",l=n.get(93),c=n.get(51),d=n.get(50),u=n.get(66),h=new yS(1e4);h.appendString('
');for(let p=0,v=t.length;p');const y=$I(_),w=pw(_),L=pr.createEmpty(_,o);qI(new Jv(d.isMonospace&&!r,d.canUseHalfwidthRightwardsArrow,_,!1,y,w,0,L,m.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,s,a,l,c!==Pl.OFF,null),h),h.appendString("
")}h.appendString(""),ss(i,d);const f=h.build(),g=Sce?Sce.createHTML(f):f;i.innerHTML=g}const Sce=_p("editorGhostText",{createHTML:i=>i});function Pyt(i,e){const t=new zbe,n=new jbe(t,c=>e.getLanguageConfiguration(c)),o=new Ube(new Oyt([i]),n),r=EH(o,[],void 0,!0);let s="";const a=i.getLineContent();function l(c,d){if(c.kind===2)l(c.openingBracket,d),d=so(d,c.openingBracket.length),c.child&&(l(c.child,d),d=so(d,c.child.length)),c.closingBracket?(l(c.closingBracket,d),d=so(d,c.closingBracket.length)):s+=n.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(d,so(d,c.length));else if(c.kind===4)for(const u of c.children)l(u,d),d=so(d,u.length)}}return l(r,sa),s}class Oyt{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 fd{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,n=this.value.charCodeAt(e),o;if(o=fd._table[n],typeof o=="number")return this.pos+=1,{type:o,pos:e,len:1};if(fd.isDigitCharacter(n)){o=8;do t+=1,n=this.value.charCodeAt(e+t);while(fd.isDigitCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}if(fd.isVariableCharacter(n)){o=9;do n=this.value.charCodeAt(e+ ++t);while(fd.isVariableCharacter(n)||fd.isDigitCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}o=10;do t+=1,n=this.value.charCodeAt(e+t);while(!isNaN(n)&&typeof fd._table[n]=="undefined"&&!fd.isDigitCharacter(n)&&!fd.isVariableCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}}fd._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class MS{constructor(){this._children=[]}appendChild(e){return e instanceof ta&&this._children[this._children.length-1]instanceof ta?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,o=n.children.indexOf(e),r=n.children.slice(0);r.splice(o,1,...t),n._children=r,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,n)}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 xT)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class ta extends MS{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new ta(this.value)}}class uSe extends MS{}class yc extends uSe{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 AS?this._children[0]:void 0}clone(){const e=new yc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class AS extends MS{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof ta&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new AS;return this.options.forEach(e.appendChild,e),e}}class AY extends MS{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,o=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(r=>r instanceof Cu&&Boolean(r.elseValue))&&(o=this._replace([])),o}_replace(e){let t="";for(const n of this._children)if(n instanceof Cu){let o=e[n.index]||"";o=n.resolve(o),t+=o}else t+=n.toString();return t}toString(){return""}clone(){const e=new AY;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 Cu extends MS{constructor(e,t,n,o){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=o}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):"":Boolean(e)&&typeof this.ifValue=="string"?this.ifValue:!Boolean(e)&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(n=>n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((n,o)=>o===0?n.charAt(0).toLowerCase()+n.substr(1):n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}clone(){return new Cu(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Uk extends uSe{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 ta(t)],!0):!1}clone(){const e=new Uk(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function xce(i,e){const t=[...i];for(;t.length>0;){const n=t.shift();if(!e(n))break;t.unshift(...n.children)}}class xT extends MS{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(n){return n instanceof yc&&(e.push(n),t=!t||t.indexo===e?(n=!0,!1):(t+=o.len(),!0)),n?t:-1}fullLen(e){let t=0;return xce([e],n=>(t+=n.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:n}=e;for(;n;)n instanceof yc&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Uk&&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 xT;return this._children=this.children.map(t=>t.clone()),e}walk(e){xce(this.children,e)}}class Yw{constructor(){this._scanner=new fd,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,n){const o=new xT;return this.parseFragment(e,o),this.ensureFinalTabstop(o,n!=null?n:!1,t!=null?t:!1),o}parseFragment(e,t){const n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const o=new Map,r=[];t.walk(l=>(l instanceof yc&&(l.isFinalTabstop?o.set(0,void 0):!o.has(l.index)&&l.children.length>0?o.set(l.index,l.children):r.push(l)),!0));const s=(l,c)=>{const d=o.get(l.index);if(!d)return;const u=new yc(l.index);u.transform=l.transform;for(const h of d){const f=h.clone();u.appendChild(f),f instanceof yc&&o.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[u])},a=new Set;for(const l of r)s(l,a);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(r=>r.index===0)||e.appendChild(new yc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const n=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),n}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 o=this._scanner.next();if(o.type!==0&&o.type!==4&&o.type!==5)return!1}this._token=this._scanner.next()}const n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_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 ta(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new yc(Number(t)):new Uk(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const r=new yc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ta("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){const s=new AS;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(s),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(n)}_parseChoiceElement(e){const t=this._token,n=[];for(;!(this._token.type===2||this._token.type===7);){let o;if((o=this._accept(5,!0))?o=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||o:o=this._accept(void 0,!0),!o)return this._backTo(t),!1;n.push(o)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new ta(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const r=new Uk(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ta("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(n)}_parseTransform(e){const t=new AY;let n="",o="";for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(6,!0)||r,n+=r;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(5,!0)||this._accept(6,!0)||r,t.appendChild(new ta(r));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){o+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,o)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);const o=this._accept(8,!0);if(o)if(n){if(this._accept(4))return e.appendChild(new Cu(Number(o))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Cu(Number(o))),!0;else return this._backTo(t),!1;if(this._accept(6)){const r=this._accept(9,!0);return!r||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Cu(Number(o),r)),!0)}else if(this._accept(11)){const r=this._until(4);if(r)return e.appendChild(new Cu(Number(o),void 0,r,void 0)),!0}else if(this._accept(12)){const r=this._until(4);if(r)return e.appendChild(new Cu(Number(o),void 0,void 0,r)),!0}else if(this._accept(13)){const r=this._until(1);if(r){const s=this._until(4);if(s)return e.appendChild(new Cu(Number(o),void 0,r,s)),!0}}else{const r=this._until(4);if(r)return e.appendChild(new Cu(Number(o),void 0,void 0,r)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new ta(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var p7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Fyt(i,e,t,n,o=_n.None,r){return p7(this,void 0,void 0,function*(){const s=Vyt(e,t),a=i.all(t),l=new gG;for(const m of a)m.groupId&&l.add(m.groupId,m);function c(m){if(!m.yieldsToGroupIds)return[];const _=[];for(const y of m.yieldsToGroupIds||[]){const w=l.get(y);for(const L of w)_.push(L)}return _}const d=new Map,u=new Set;function h(m,_){if(_=[..._,m],u.has(m))return _;u.add(m);try{const y=c(m);for(const w of y){const L=h(w,_);if(L)return L}}finally{u.delete(m)}}function f(m){const _=d.get(m);if(_)return _;const y=h(m,[]);y&&$o(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(L=>L.toString?L.toString():""+L).join(" -> ")}`));const w=new o5;return d.set(m,w.p),(()=>p7(this,void 0,void 0,function*(){if(!y){const L=c(m);for(const D of L){const E=yield f(D);if(E&&E.items.length>0)return}}try{return yield m.provideInlineCompletions(t,e,n,o)}catch(L){$o(L);return}}))().then(L=>w.complete(L),L=>w.error(L)),w.p}const g=yield Promise.all(a.map(m=>p7(this,void 0,void 0,function*(){return{provider:m,completions:yield f(m)}}))),p=new Map,v=[];for(const m of g){const _=m.completions;if(!_)continue;const y=new Wyt(_,m.provider);v.push(y);for(const w of _.items){const L=DO.from(w,y,s,t,r);p.set(L.hash(),L)}}return new Byt(Array.from(p.values()),new Set(p.keys()),v)})}class Byt{constructor(e,t,n){this.completions=e,this.hashs=t,this.providerResults=n}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class Wyt{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 DO{static from(e,t,n,o,r){let s,a,l=e.range?V.lift(e.range):n;if(typeof e.insertText=="string"){if(s=e.insertText,r&&e.completeBracketPairs){s=Lce(s,l.getStartPosition(),o,r);const c=s.length-e.insertText.length;c!==0&&(l=new V(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(r&&e.completeBracketPairs){e.insertText.snippet=Lce(e.insertText.snippet,l.getStartPosition(),o,r);const u=e.insertText.snippet.length-c;u!==0&&(l=new V(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+u))}const d=new Yw().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof ta?(s=d.children[0].value,a=void 0):(s=d.toString(),a={snippet:e.insertText.snippet,range:l})}else J4(e.insertText);return new DO(s,e.command,l,s,a,e.additionalTextEdits||kyt(),e,t)}constructor(e,t,n,o,r,s,a,l){this.filterText=e,this.command=t,this.range=n,this.insertText=o,this.snippetInfo=r,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` `),o=e.replace(/\r\n|\r/g,` -`)}withRange(e){return new DO(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 Byt(i,e){const t=e.getWordAtPosition(i),n=e.getLineMaxColumn(i.lineNumber);return t?new V(i.lineNumber,t.startColumn,i.lineNumber,n):V.fromPositions(i,i.with(void 0,n))}function xce(i,e,t,n){const r=t.getLineContent(e.lineNumber).substring(0,e.column-1)+i,s=t.tokenization.tokenizeLineWithEdit(e,r.length-(e.column-1),i),a=s==null?void 0:s.sliceAndInflate(e.column-1,r.length,0);return a?Myt(a,n):i}class Zw{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const n=t?this.range.intersectRanges(t):this.range;if(!n)return this;const o=e.getValueInRange(n,1),r=Q0(o,this.text),s=iU(this.range.getStartPosition(),oU(o.substring(0,r))),a=this.text.substring(r),l=V.fromPositions(s,this.range.getEndPosition());return new Zw(l,a)}augments(e){return this.text.startsWith(e.text)&&Wyt(this.range,e.range)}computeGhostText(e,t,n,o=0){let r=this.removeCommonPrefix(e);if(r.range.endLineNumber!==r.range.startLineNumber)return;const s=e.getLineContent(r.range.startLineNumber),a=Si(s).length;if(r.range.startColumn-1<=a){const g=Si(r.text).length,p=s.substring(r.range.startColumn-1,a),[v,m]=[r.range.getStartPosition(),r.range.getEndPosition()],_=v.column+p.length<=m.column?v.delta(0,p.length):m,y=V.fromPositions(_,m),w=r.text.startsWith(p)?r.text.substring(p.length):r.text.substring(g);r=new Zw(y,w)}const c=e.getValueInRange(r.range),d=Vyt(c,r.text);if(!d)return;const u=r.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=r.text.length-o;for(const g of d){const p=r.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&n&&n.lineNumber===r.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const v=g.modifiedStart+g.modifiedLength,m=Math.max(g.modifiedStart,Math.min(v,f)),_=r.text.substring(g.modifiedStart,m),y=r.text.substring(m,Math.max(g.modifiedStart,v));if(_.length>0){const w=gf(_);h.push(new rU(p,w,!1))}if(y.length>0){const w=gf(y);h.push(new rU(p,w,!0))}}return new EO(u,h)}}function Wyt(i,e){return e.getStartPosition().equals(i.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(i.getEndPosition())}let bh;function Vyt(i,e){if((bh==null?void 0:bh.originalValue)===i&&(bh==null?void 0:bh.newValue)===e)return bh==null?void 0:bh.changes;{let t=Ece(i,e,!0);if(t){const n=Lce(t);if(n>0){const o=Ece(i,e,!1);o&&Lce(o)5e3||e.length>5e3)return;function n(c){let d=0;for(let u=0,h=c.length;ud&&(d=f)}return d}const o=Math.max(n(i),n(e));function r(c){if(c<0)throw new Error("unexpected");return o+c+1}function s(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 Hyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Dce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$yt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let lU=class extends _e{constructor(e,t,n,o,r){super(),this.textModel=e,this.versionId=t,this._debounceValue=n,this.languageFeaturesService=o,this.languageConfigurationService=r,this._updateOperation=this._register(new Kr),this.inlineCompletions=tO("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=tO("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,n){var o,r;const s=new Uyt(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((o=this._updateOperation.value)===null||o===void 0)&&o.request.satisfies(s))return this._updateOperation.value.promise;if(!((r=a.get())===null||r===void 0)&&r.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new Ro,d=(()=>$yt(this,void 0,void 0,function*(){if((l||t.triggerKind===Kg.Automatic)&&(yield zyt(this._debounceValue.get(this.textModel))),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=yield Pyt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const v=new qyt(g,s,this.textModel,this.versionId);if(n){const m=n.toInlineCompletion(void 0);n.canBeReused(this.textModel,e)&&!g.has(m)&&v.prepend(n.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),qi(m=>{a.set(v,m)}),!0}))(),u=new Kyt(s,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()}};lU=Hyt([Dce(3,pt),Dce(4,Ti)],lU);function zyt(i,e){return new Promise(t=>{let n;const o=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(o),n&&n.dispose(),t()}))})}class Uyt{constructor(e,t,n){this.position=e,this.context=t,this.versionId=n}satisfies(e){return this.position.equals(e.position)&&jyt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,n)=>t.equals(n))&&(e.context.triggerKind===Kg.Automatic||this.context.triggerKind===Kg.Explicit)&&this.versionId===e.versionId}}function jyt(i,e,t){return!i||!e?i===e:t(i,e)}class Kyt{constructor(e,t,n){this.request=e,this.cancellationTokenSource=t,this.promise=n}dispose(){this.cancellationTokenSource.cancel()}}class qyt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,n,o){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=n,this.versionId=o,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=In(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const r=n.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new kce(s,r[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,n){n&&e.source.addRef();const o=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new kce(e,o,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class kce{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,n,o){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=o!=null?o:e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new Zw(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,n){const o=this._toFilterTextReplacement(n).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(n).getStartPosition())||t.lineNumber!==o.range.startLineNumber)return!1;const r=e.getValueInRange(o.range,1).toLowerCase(),s=o.text.toLowerCase(),a=Math.max(0,t.column-o.range.startColumn);let l=s.substring(0,a),c=s.substring(a),d=r.substring(0,a),u=r.substring(a);const h=e.getLineIndentColumn(o.range.startLineNumber);return o.range.startColumn<=h&&(d=d.trimStart(),d.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(d)&&!!N1e(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 Zw(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return Ice(this._getUpdatedRange(e)).isBefore(Ice(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 Ice(i){return i.startLineNumber===i.endLineNumber?new ae(1,1+i.endColumn-i.startColumn):new ae(1+i.endLineNumber-i.startLineNumber,i.endColumn)}var PE=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const sn={Visible:LY,HasFocusedSuggestion:new lt("suggestWidgetHasFocusedSuggestion",!1,C("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new lt("suggestWidgetDetailsVisible",!1,C("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new lt("suggestWidgetMultipleSuggestions",!1,C("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new lt("suggestionMakesTextEdit",!0,C("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new lt("acceptSuggestionOnEnter",!0,C("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new lt("suggestionHasInsertAndReplaceRange",!1,C("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new lt("suggestionInsertMode",void 0,{type:"string",description:C("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new lt("suggestionCanResolve",!1,C("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},sv=new Z("suggestWidgetStatusBar");class Gyt{constructor(e,t,n,o){var r;this.position=e,this.completion=t,this.container=n,this.provider=o,this.isInvalid=!1,this.score=$u.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(r=t.label)===null||r===void 0?void 0:r.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,V.isIRange(t.range)?(this.editStart=new ae(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||V.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ae(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ae(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ae(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||V.spansMultipleLines(t.range.insert)||V.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 o.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 PE(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),n=new Ls(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(o=>{Object.assign(this.completion,o),this._resolveDuration=n.elapsed()},o=>{sh(o)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache})}}class jk{constructor(e=2,t=new Set,n=new Set,o=new Map,r=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=n,this.providerItemsToReuse=o,this.showDeprecated=r}}jk.default=new jk;let Xyt;function Yyt(){return Xyt}class Zyt{constructor(e,t,n,o){this.items=e,this.needsClipboard=t,this.durations=n,this.disposable=o}}function AY(i,e,t,n=jk.default,o={triggerKind:0},r=_n.None){return PE(this,void 0,void 0,function*(){const s=new Ls;t=t.clone();const a=e.getWordAtPosition(t),l=a?new V(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):V.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],u=new Be,h=[];let f=!1;const g=(v,m,_)=>{var y,w,L;let D=!1;if(!m)return D;for(const E of m.suggestions)if(!n.kindFilter.has(E.kind)){if(!n.showDeprecated&&((y=E==null?void 0:E.tags)===null||y===void 0?void 0:y.includes(1)))continue;E.range||(E.range=c),E.sortText||(E.sortText=typeof E.label=="string"?E.label:E.label.label),!f&&E.insertTextRules&&E.insertTextRules&4&&(f=Yw.guessNeedsClipboard(E.insertText)),d.push(new Gyt(t,E,m,v)),D=!0}return Hq(m)&&u.add(m),h.push({providerName:(w=v._debugDisplayName)!==null&&w!==void 0?w:"unknown_provider",elapsedProvider:(L=m.duration)!==null&&L!==void 0?L:-1,elapsedOverall:_.elapsed()}),D},p=(()=>PE(this,void 0,void 0,function*(){}))();for(const v of i.orderedGroups(e)){let m=!1;if(yield Promise.all(v.map(_=>PE(this,void 0,void 0,function*(){if(n.providerItemsToReuse.has(_)){const y=n.providerItemsToReuse.get(_);y.forEach(w=>d.push(w)),m=m||y.length>0;return}if(!(n.providerFilter.size>0&&!n.providerFilter.has(_)))try{const y=new Ls,w=yield _.provideCompletionItems(e,t,o,r);m=g(_,w,y)||m}catch(y){$o(y)}}))),m||r.isCancellationRequested)break}return yield p,r.isCancellationRequested?(u.dispose(),Promise.reject(new Yv)):new Zyt(d.sort(ewt(n.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},u)})}function PY(i,e){if(i.sortTextLow&&e.sortTextLow){if(i.sortTextLowe.sortTextLow)return 1}return i.textLabele.textLabel?1:i.completion.kind-e.completion.kind}function Qyt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return PY(i,e)}function Jyt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return PY(i,e)}const kF=new Map;kF.set(0,Qyt);kF.set(2,Jyt);kF.set(1,PY);function ewt(i){return kF.get(i)}Rn.registerCommand("_executeCompletionItemProvider",(i,...e)=>PE(void 0,void 0,void 0,function*(){const[t,n,o,r]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string"||!o),fi(typeof r=="number"||!r);const{completionProvider:s}=i.get(pt),a=yield i.get(za).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=a.object.textEditorModel.validatePosition(n),u=yield AY(s,a.object.textEditorModel,d,void 0,{triggerCharacter:o!=null?o:void 0,triggerKind:o?1:0});for(const h of u.items)c.length<(r!=null?r:0)&&c.push(h.resolve(_n.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 twt(i,e){var t;(t=i.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class JC{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 Tce(i,e=ls){return Vst(i,e)?i.charAt(0).toUpperCase()+i.slice(1):i}var nwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,CURRENT_TIMEZONE_OFFSET:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class Nce{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const n=t.resolve(e);if(n!==void 0)return n}}}class Rce{constructor(e,t,n,o){this._model=e,this._selection=t,this._selectionIdx=n,this._overtypingCapturer=o}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let n=this._model.getValueInRange(this._selection)||void 0,o=this._selection.startLineNumber!==this._selection.endLineNumber;if(!n&&this._overtypingCapturer){const r=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);r&&(n=r.value,o=r.multiline)}if(n&&o&&e.snippet){const r=this._model.getLineContent(this._selection.startLineNumber),s=Si(r,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof ta&&(a=Si(gf(c.value).pop())),!0));const l=Q0(a,s);n=n.replace(/(\r\n|\r|\n)(.*)/g,(c,d,u)=>`${d}${a.substr(l)}${u}`)}return n}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const n=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return n&&n.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 Mce{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return qm(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const n=qm(this._model.uri.fsPath),o=n.lastIndexOf(".");return o<=0?n:n.slice(0,o)}else{if(t==="TM_DIRECTORY")return P_e(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(x5(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 Ace{constructor(e,t,n,o){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=n,this._spread=o}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(!!t){if(this._spread){const n=t.split(/\r\n|\n|\r/).filter(o=>!$_e(o));if(n.length===this._selectionCount)return n[this._selectionIdx]}return t}}}let kO=class{constructor(e,t,n){this._model=e,this._selection=t,this._languageConfigurationService=n}resolve(e){const{name:t}=e,n=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),o=this._languageConfigurationService.getLanguageConfiguration(n).comments;if(!!o){if(t==="LINE_COMMENT")return o.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return o.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return o.blockCommentEndToken||void 0}}};kO=nwt([iwt(2,Ti)],kO);class Ru{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 Ru.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Ru.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Ru.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Ru.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const n=this._date.getTimezoneOffset(),o=n>0?"-":"+",r=Math.trunc(Math.abs(n/60)),s=r<10?"0"+r:r,a=Math.abs(n)-r*60,l=a<10?"0"+a:a;return o+s+":"+l}}}Ru.dayNames=[C("Sunday","Sunday"),C("Monday","Monday"),C("Tuesday","Tuesday"),C("Wednesday","Wednesday"),C("Thursday","Thursday"),C("Friday","Friday"),C("Saturday","Saturday")];Ru.dayNamesShort=[C("SundayShort","Sun"),C("MondayShort","Mon"),C("TuesdayShort","Tue"),C("WednesdayShort","Wed"),C("ThursdayShort","Thu"),C("FridayShort","Fri"),C("SaturdayShort","Sat")];Ru.monthNames=[C("January","January"),C("February","February"),C("March","March"),C("April","April"),C("May","May"),C("June","June"),C("July","July"),C("August","August"),C("September","September"),C("October","October"),C("November","November"),C("December","December")];Ru.monthNamesShort=[C("JanuaryShort","Jan"),C("FebruaryShort","Feb"),C("MarchShort","Mar"),C("AprilShort","Apr"),C("MayShort","May"),C("JuneShort","Jun"),C("JulyShort","Jul"),C("AugustShort","Aug"),C("SeptemberShort","Sep"),C("OctoberShort","Oct"),C("NovemberShort","Nov"),C("DecemberShort","Dec")];class Pce{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=edt(this._workspaceService.getWorkspace());if(!Zct(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(KH(e))return qm(e.uri.path);let t=qm(e.configPath.path);return t.endsWith(qH)&&(t=t.substr(0,t.length-qH.length-1)),t}_resoveWorkspacePath(e){if(KH(e))return Tce(e.uri.fsPath);const t=qm(e.configPath.path);let n=e.configPath.fsPath;return n.endsWith(t)&&(n=n.substr(0,n.length-t.length-1)),n?Tce(n):"/"}}class Oce{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 bF()}}var owt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},rwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lu;class bc{constructor(e,t,n){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=n,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=noe(t.placeholders,yc.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 n of this._snippet.placeholders){const o=this._snippet.offset(n),r=this._snippet.fullLen(n),s=V.fromPositions(e.getPositionAt(this._offset+o),e.getPositionAt(this._offset+o+r)),a=n.isFinalTabstop?bc._decor.inactiveFinal:bc._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(n,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const o=[];for(const r of this._placeholderGroups[this._placeholderGroupsIdx])if(r.transform){const s=this._placeholderDecorations.get(r),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=r.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",o)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const n=this._editor.getModel().changeDecorations(o=>{const r=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new gt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),o.changeDecorationOptions(l,a.isFinalTabstop?bc._decor.activeFinal:bc._decor.active),r.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const u=this._placeholderDecorations.get(d);o.changeDecorationOptions(u,d.isFinalTabstop?bc._decor.activeFinal:bc._decor.active),r.add(d)}}for(const[a,l]of this._placeholderDecorations)r.has(a)||o.changeDecorationOptions(l,a.isFinalTabstop?bc._decor.inactiveFinal:bc._decor.inactive);return s});return t?this.move(e):n!=null?n:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof yc){const n=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(n).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 n;for(const o of t){if(o.isFinalTabstop)break;n||(n=[],e.set(o.index,n));const r=this._placeholderDecorations.get(o),s=this._editor.getModel().getDecorationRange(r);if(!s){e.delete(o.index);break}n.push(s)}}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 n=this._editor.getModel().getDecorationRange(t);if(!!n)return{range:n,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof AS,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const r=e.shift();console.assert(r._offset!==-1),console.assert(!r._placeholderDecorations);const s=r._snippet.placeholderInfo.last.index;for(const l of r._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=o.index+(s+1)/this._nestingLevel:l.index=o.index+l.index/this._nestingLevel;this._snippet.replace(o,r._snippet.children);const a=this._placeholderDecorations.get(o);n.removeDecoration(a),this._placeholderDecorations.delete(o);for(const l of r._snippet.placeholders){const c=r._snippet.offset(l),d=r._snippet.fullLen(l),u=V.fromPositions(t.getPositionAt(r._offset+c),t.getPositionAt(r._offset+c+d)),h=n.addDecoration(u,bc._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=noe(this._snippet.placeholders,yc.compareByIndex)})}}bc._decor={active:Jt.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Jt.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Jt.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Jt.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const Fce={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let IO=lu=class{static adjustWhitespace(e,t,n,o,r){const s=e.getLineContent(t.lineNumber),a=Si(s,0,t.column-1);let l;return o.walk(c=>{if(!(c instanceof ta)||c.parent instanceof AS||r&&!r.has(c))return!0;const d=c.value.split(/\r\n|\r|\n/);if(n){const h=o.offset(c);if(h===0)d[0]=e.normalizeIndentation(d[0]);else{l=l!=null?l:o.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fw.get(rb)),g=e.invokeWithinContext(w=>new Mce(w.get(Rw),h)),p=()=>a,v=h.getValueInRange(lu.adjustSelection(h,e.getSelection(),n,0)),m=h.getValueInRange(lu.adjustSelection(h,e.getSelection(),0,o)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((w,L)=>({selection:w,idx:L})).sort((w,L)=>V.compareRangesUsingStarts(w.selection,L.selection));for(const{selection:w,idx:L}of y){let D=lu.adjustSelection(h,w,n,0),E=lu.adjustSelection(h,w,0,o);v!==h.getValueInRange(D)&&(D=w),m!==h.getValueInRange(E)&&(E=w);const I=w.setStartPosition(D.startLineNumber,D.startColumn).setEndPosition(E.endLineNumber,E.endColumn),k=new Yw().parse(t,!0,r),R=I.getStartPosition(),A=lu.adjustWhitespace(h,R,s||L>0&&_!==h.getLineFirstNonWhitespaceColumn(w.positionLineNumber),k);k.resolveVariables(new Nce([g,new Ace(p,L,y.length,e.getOption(78)==="spread"),new Rce(h,w,L,l),new kO(h,w,c),new Ru,new Pce(f),new Oce])),d[L]=Gi.replace(I,k.toString()),d[L].identifier={major:L,minor:0},d[L]._isTracked=!0,u[L]=new bc(e,k,A)}return{edits:d,snippets:u}}static createEditsAndSnippetsFromEdits(e,t,n,o,r,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new Yw,u=new xT,h=new Nce([e.invokeWithinContext(g=>new Mce(g.get(Rw),c)),new Ace(()=>r,0,e.getSelections().length,e.getOption(78)==="spread"),new Rce(c,e.getSelection(),0,s),new kO(c,e.getSelection(),a),new Ru,new Pce(e.invokeWithinContext(g=>g.get(rb))),new Oce]);t=t.sort((g,p)=>V.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,D=V.fromPositions(L.getEndPosition(),p.getStartPosition()),E=new ta(c.getValueInRange(D));u.appendChild(E),f+=E.value.length}const m=d.parseFragment(v,u);lu.adjustWhitespace(c,p.getStartPosition(),!0,u,new Set(m)),u.resolveVariables(h);const _=u.toString(),y=_.slice(f);f=_.length;const w=Gi.replace(p,y);w.identifier={major:g,minor:0},w._isTracked=!0,l.push(w)}return d.ensureFinalTabstop(u,n,!0),{edits:l,snippets:[new bc(e,u,"")]}}constructor(e,t,n=Fce,o){this._editor=e,this._template=t,this._options=n,this._languageConfigurationService=o,this._templateMerges=[],this._snippets=[]}dispose(){si(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?lu.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):lu.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,n=>{const o=n.filter(r=>!!r.identifier);for(let r=0;rgt.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=Fce){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:n,snippets:o}=lu.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",n,r=>{const s=r.filter(l=>!!l.identifier);for(let l=0;lgt.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 n of this._snippets){const o=n.move(e);t.push(...o)}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{r.push(...o.get(s))})}e.sort(V.compareRangesUsingStarts);for(const[n,o]of t){if(o.length!==e.length){t.delete(n);continue}o.sort(V.compareRangesUsingStarts);for(let r=0;r0}};IO=lu=owt([rwt(3,Ti)],IO);var swt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},dR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pC;const Bce={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let qr=pC=class{static get(e){return e.getContribution(pC.ID)}constructor(e,t,n,o,r){this._editor=e,this._logService=t,this._languageFeaturesService=n,this._languageConfigurationService=r,this._snippetListener=new Be,this._modelVersionId=-1,this._inSnippet=pC.InSnippetMode.bindTo(o),this._hasNextTabstop=pC.HasNextTabstop.bindTo(o),this._hasPrevTabstop=pC.HasPrevTabstop.bindTo(o)}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=="undefined"?Bce:Object.assign(Object.assign({},Bce),t))}catch(n){this.cancel(),this._logService.error(n),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 n;if(!!this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(fi(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new IO(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((n=this._session)===null||n===void 0)&&n.hasChoice){const o={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(d,u)=>{if(!this._session||d!==this._editor.getModel()||!ae.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=Boolean(h.choice.options.find(v=>v.value===f)),p=[];for(let v=0;v{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:r.getLanguageId(),pattern:r.uri.fsPath,scheme:r.uri.scheme,exclusive:!0},o),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:o,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(o=>o.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(()=>{twt(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 Boolean(this._inSnippet.get())}};qr.ID="snippetController2";qr.InSnippetMode=new lt("inSnippetMode",!1,C("inSnippetMode","Whether the editor in current in snippet mode"));qr.HasNextTabstop=new lt("hasNextTabstop",!1,C("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));qr.HasPrevTabstop=new lt("hasPrevTabstop",!1,C("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));qr=pC=swt([dR(1,nc),dR(2,pt),dR(3,Ut),dR(4,Ti)],qr);Un(qr.ID,qr,4);const IF=Ir.bindToContribution(qr.get);Ye(new IF({id:"jumpToNextSnippetPlaceholder",precondition:Me.and(qr.InSnippetMode,qr.HasNextTabstop),handler:i=>i.next(),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:2}}));Ye(new IF({id:"jumpToPrevSnippetPlaceholder",precondition:Me.and(qr.InSnippetMode,qr.HasPrevTabstop),handler:i=>i.prev(),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:1026}}));Ye(new IF({id:"leaveSnippet",precondition:qr.InSnippetMode,handler:i=>i.cancel(!0),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:9,secondary:[1033]}}));Ye(new IF({id:"acceptSnippet",precondition:qr.InSnippetMode,handler:i=>i.finish()}));var awt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},p7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},og=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Nl;(function(i){i[i.Undo=0]="Undo",i[i.Redo=1]="Redo",i[i.AcceptWord=2]="AcceptWord",i[i.Other=3]="Other"})(Nl||(Nl={}));let cU=class extends _e{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,n,o,r,s,a,l,c,d,u,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=n,this.textModelVersionId=o,this._debounceValue=r,this._suggestPreviewEnabled=s,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(lU,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Ai(this,!1),this._forceUpdate=VCe("forceUpdate"),this._selectedInlineCompletionId=Ai(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Nl.Redo,Nl.Undo,Nl.AcceptWord]),this._fetchInlineCompletions=Wgt({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Kg.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 m=this.selectedInlineCompletion.get(),_=p.preserveCurrentCompletion||(m==null?void 0:m.forwardStable)?m:void 0,y=this._source.suggestWidgetInlineCompletions.get(),w=this.selectedSuggestItem.read(g);if(y&&!w){const E=this._source.inlineCompletions.get();qi(I=>{E&&y.request.versionId>E.request.versionId&&this._source.inlineCompletions.set(y.clone(),I),this._source.clearSuggestWidgetInlineCompletions(I)})}const L=this.cursorPosition.read(g),D={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:w==null?void 0:w.toSelectedSuggestionInfo()};return this._source.fetch(L,D,_)}),this._filteredInlineCompletionItems=In(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const v=this.cursorPosition.read(g);return p.inlineCompletions.filter(_=>_.isVisible(this.textModel,v,g))}),this.selectedInlineCompletionIndex=In(this,g=>{const p=this._selectedInlineCompletionId.read(g),v=this._filteredInlineCompletionItems.read(g),m=this._selectedInlineCompletionId===void 0?-1:v.findIndex(_=>_.semanticId===p);return m===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):m}),this.selectedInlineCompletion=In(this,g=>{const p=this._filteredInlineCompletionItems.read(g),v=this.selectedInlineCompletionIndex.read(g);return p[v]}),this.lastTriggerKind=this._source.inlineCompletions.map(g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=In(this,g=>{if(this.lastTriggerKind.read(g)===Kg.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=Gae({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:Cce(g.ghostText,p.ghostText)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p;const v=this.textModel,m=this.selectedSuggestItem.read(g);if(m){const _=m.toSingleTextEdit().removeCommonPrefix(v),y=this._computeAugmentedCompletion(_,g);if(!this._suggestPreviewEnabled.read(g)&&!y)return;const L=(p=y==null?void 0:y.edit)!==null&&p!==void 0?p:_,D=y?y.edit.text.length-_.text.length:0,E=this._suggestPreviewMode.read(g),I=this.cursorPosition.read(g),k=L.computeGhostText(v,E,I,D);return{ghostText:k!=null?k:new EO(L.range.endLineNumber,[]),inlineCompletion:y==null?void 0:y.completion,suggestItem:m}}else{if(!this._isActive.read(g))return;const _=this.selectedInlineCompletion.read(g);if(!_)return;const y=_.toSingleTextEdit(g),w=this._inlineSuggestMode.read(g),L=this.cursorPosition.read(g),D=y.computeGhostText(v,w,L);return D?{ghostText:D,inlineCompletion:_,suggestItem:void 0}:void 0}}),this.ghostText=Gae({owner:this,equalityComparer:Cce},g=>{const p=this.state.read(g);if(!!p)return p.ghostText}),this._register(Rk(this._fetchInlineCompletions));let f;this._register(Ii(g=>{var p,v;const m=this.state.read(g),_=m==null?void 0:m.inlineCompletion;if((_==null?void 0:_.semanticId)!==(f==null?void 0:f.semanticId)&&(f=_,_)){const y=_.inlineCompletion,w=y.source;(v=(p=w.provider).handleItemDidShow)===null||v===void 0||v.call(p,w.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}trigger(e){return og(this,void 0,void 0,function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()})}triggerExplicitly(e){return og(this,void 0,void 0,function*(){Y$(e,t=>{this._isActive.set(!0,t),this._forceUpdate.trigger(t,Kg.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){Y$(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentedCompletion(e,t){const n=this.textModel,o=this._source.suggestWidgetInlineCompletions.read(t),r=o?o.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(kD);return Ret(r,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(n,V.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{edit:l,completion:a}:void 0})}_deltaSelectedInlineCompletionIndex(e){return og(this,void 0,void 0,function*(){yield this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const n=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[n].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)})}next(){return og(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(1)})}previous(){return og(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(-1)})}accept(e){var t;return og(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vo;const n=this.state.get();if(!n||n.ghostText.isEmpty()||!n.inlineCompletion)return;const o=n.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),o.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Gi.replaceMove(o.range,""),...o.additionalTextEdits]),e.setPosition(o.snippetInfo.range.getStartPosition()),(t=qr.get(e))===null||t===void 0||t.insert(o.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Gi.replaceMove(o.range,o.insertText),...o.additionalTextEdits]),o.command&&o.source.addRef(),qi(r=>{this._source.clear(r),this._isActive.set(!1,r)}),o.command&&(yield this._commandService.executeCommand(o.command.id,...o.command.arguments||[]).then(void 0,$o),o.source.removeRef())})}acceptNextWord(e){return og(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,n)=>{const o=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),r=this._languageConfigurationService.getLanguageConfiguration(o),s=new RegExp(r.wordDefinition.source,r.wordDefinition.flags.replace("g","")),a=n.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=n.length;const d=/\s+/g.exec(n);return d&&d.index!==void 0&&d.index+d[0].length{const o=n.match(/\n/);return o&&o.index!==void 0?o.index+1:n.length})})}_acceptNext(e,t){return og(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vo;const n=this.state.get();if(!n||n.ghostText.isEmpty()||!n.inlineCompletion)return;const o=n.ghostText,r=n.inlineCompletion.toInlineCompletion(void 0);if(r.snippetInfo||r.filterText!==r.insertText){yield this.accept(e);return}const s=o.parts[0],a=new ae(o.lineNumber,s.column),l=s.lines.join(` -`),c=t(a,l);if(c===l.length&&o.parts.length===1){this.accept(e);return}const d=l.substring(0,c);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Gi.replace(V.fromPositions(a),d)]);const u=oU(d);e.setPosition(iU(a,u))}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const u=V.fromPositions(r.range.getStartPosition(),iU(a,oU(d))),h=e.getModel().getValueInRange(u,1);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,h.length)}})}handleSuggestAccepted(e){var t,n;const o=e.toSingleTextEdit().removeCommonPrefix(this.textModel),r=this._computeAugmentedCompletion(o,void 0);if(!r)return;const s=r.completion.inlineCompletion;(n=(t=s.source.provider).handlePartialAccept)===null||n===void 0||n.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,o.text.length)}};cU=awt([p7(9,$t),p7(10,_o),p7(11,Ti)],cU);var lwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Wce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},BL;class OY{constructor(e){this.name=e}select(e,t,n){if(n.length===0)return 0;const o=n[0].score[0];for(let r=0;rl&&u.type===n[c].completion.kind&&u.insertText===n[c].completion.insertText&&(l=u.touch,a=c),n[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[n,o]of e)o.touch=t,o.type=typeof o.type=="number"?o.type:RD.fromString(o.type),this._cache.set(n,o);this._seq=this._cache.size}}class dwt extends OY{constructor(){super("recentlyUsedByPrefix"),this._trie=Ay.forStrings(),this._seq=0}memorize(e,t,n){const{word:o}=e.getWordUntilPosition(t),r=`${e.getLanguageId()}/${o}`;this._trie.set(r,{type:n.completion.kind,insertText:n.completion.insertText,touch:this._seq++})}select(e,t,n){const{word:o}=e.getWordUntilPosition(t);if(!o)return super.select(e,t,n);const r=`${e.getLanguageId()}/${o}`;let s=this._trie.get(r);if(s||(s=this._trie.findSubstr(r)),s)for(let a=0;ae.push([n,t])),e.sort((t,n)=>-(t[1].touch-n[1].touch)).forEach((t,n)=>t[1].touch=n),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,n]of e)n.type=typeof n.type=="number"?n.type:RD.fromString(n.type),this._trie.set(t,n)}}}let Kk=BL=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Be,this._persistSoon=new bi(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(n=>{n.reason===FP.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,n){this._withStrategy(e,t).memorize(e,t,n),this._persistSoon.schedule()}select(e,t,n){return this._withStrategy(e,t).select(e,t,n)}_withStrategy(e,t){var n;const o=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)===null||n===void 0?void 0:n.name)!==o){this._saveState();const r=BL._strategyCtors.get(o)||hSe;this._strategy=new r;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${BL._storagePrefix}/${o}`,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,n=JSON.stringify(this._strategy);this._storageService.store(`${BL._storagePrefix}/${this._strategy.name}`,n,t,1)}}};Kk._strategyCtors=new Map([["recentlyUsedByPrefix",dwt],["recentlyUsed",cwt],["first",hSe]]);Kk._storagePrefix="suggest/memories";Kk=BL=lwt([Wce(0,Gd),Wce(1,En)],Kk);const TF=yn("ISuggestMemories");Mn(TF,Kk,1);var uwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},hwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dU;let qk=dU=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=dU.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(n=>n.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 n=this._editor.getModel(),o=this._editor.getSelection(),r=n.getWordAtPosition(o.getStartPosition());if(!r){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(r.endColumn===o.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};qk.AtEnd=new lt("atEndOfWord",!1);qk=dU=uwt([hwt(1,Ut)],qk);var fwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},gwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},WL;let wb=WL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=WL.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},n){if(e.items.length===0){this.reset();return}if(WL._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=n,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,n){let o=n;for(let r=t.items.length;r>0&&(o=(o+t.items.length+(e?1:-1))%t.items.length,!(o===n||!t.items[o].completion.additionalTextEdits));r--);return o}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(!!this._model)try{this._ignore=!0,this._index=WL._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};wb.OtherSuggestions=new lt("hasOtherSuggestions",!1);wb=WL=fwt([gwt(1,Ut)],wb);class pwt{constructor(e,t,n,o){this._disposables=new Be,this._disposables.add(n.onDidSuggest(r=>{r.completionModel.items.length===0&&this.reset()})),this._disposables.add(n.onDidCancel(r=>{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(r=>{if(this._active&&!t.isFrozen()&&n.state!==0){const s=r.charCodeAt(r.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&o(this._active.item)}}))}_onItem(e){if(!e||!ws(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new eP;for(const n of e.item.completion.commitCharacters)n.length>0&&t.add(n.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var mwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Rl{provideSelectionRanges(e,t){return mwt(this,void 0,void 0,function*(){const n=[];for(const o of t){const r=[];n.push(r);const s=new Map;yield new Promise(a=>Rl._bracketsRightYield(a,0,e,o,s)),yield new Promise(a=>Rl._bracketsLeftYield(a,0,e,o,s,r))}return n})}static _bracketsRightYield(e,t,n,o,r){const s=new Map,a=Date.now();for(;;){if(t>=Rl._maxRounds){e();break}if(!o){e();break}const l=n.bracketPairs.findNextBracket(o);if(!l){e();break}if(Date.now()-a>Rl._maxDuration){setTimeout(()=>Rl._bracketsRightYield(e,t+1,n,o,r));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,u=s.has(d)?s.get(d):0;s.set(d,u+1)}else{const d=l.bracketInfo.getOpeningBrackets()[0].bracketText;let u=s.has(d)?s.get(d):0;if(u-=1,s.set(d,Math.max(0,u)),u<0){let h=r.get(d);h||(h=new oa,r.set(d,h)),h.push(l.range)}}o=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,n,o,r,s){const a=new Map,l=Date.now();for(;;){if(t>=Rl._maxRounds&&r.size===0){e();break}if(!o){e();break}const c=n.bracketPairs.findPrevBracket(o);if(!c){e();break}if(Date.now()-l>Rl._maxDuration){setTimeout(()=>Rl._bracketsLeftYield(e,t+1,n,o,r,s));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=r.get(u);if(f){const g=f.shift();f.size===0&&r.delete(u);const p=V.fromPositions(c.range.getEndPosition(),g.getStartPosition()),v=V.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:p}),s.push({range:v}),Rl._addBracketLeading(n,v,s)}}}else{const u=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(u)?a.get(u):0;a.set(u,h+1)}o=c.range.getStartPosition()}}static _addBracketLeading(e,t,n){if(t.startLineNumber===t.endLineNumber)return;const o=t.startLineNumber,r=e.getLineFirstNonWhitespaceColumn(o);r!==0&&r!==t.startColumn&&(n.push({range:V.fromPositions(new ae(o,r),t.getEndPosition())}),n.push({range:V.fromPositions(new ae(o,1),t.getEndPosition())}));const s=o-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(n.push({range:V.fromPositions(new ae(s,a),t.getEndPosition())}),n.push({range:V.fromPositions(new ae(s,1),t.getEndPosition())}))}}}Rl._maxDuration=30;Rl._maxRounds=2;var vwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class xu{static create(e,t){return vwt(this,void 0,void 0,function*(){if(!t.getOption(117).localityBonus||!t.hasModel())return xu.None;const n=t.getModel(),o=t.getPosition();if(!e.canComputeWordRanges(n.uri))return xu.None;const[r]=yield new Rl().provideSelectionRanges(n,[o]);if(r.length===0)return xu.None;const s=yield e.computeWordRanges(n.uri,r[0].range);if(!s)return xu.None;const a=n.getWordUntilPosition(o);return delete s[a.word],new class extends xu{distance(l,c){if(!o.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,u=s[d];if(c_e(u))return 2<<20;const h=ED(u,V.fromPositions(l),V.compareRangesUsingStarts),f=h>=0?u[h]:u[Math.max(0,~h-1)];let g=r.length;for(const p of r){if(!V.containsRange(p.range,f))break;g-=1}return g}}})}}xu.None=new class extends xu{distance(){return 0}};class Vce{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}class hm{constructor(e,t,n,o,r,s,a=M5.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=hm._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=o,this._options=r,this._refilterKind=1,this._lineContext=n,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=hm._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=hm._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&n[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:n}=this._lineContext;let o="",r="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?sb:kdt;for(let c=0;c=f)d.score=$u.Default;else if(typeof d.completion.filterText=="string"){const p=l(o,r,g,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;HV(d.completion.filterText,d.textLabel)===0?d.score=p:(d.score=xdt(o,r,g,d.textLabel,d.labelLow,0),d.score[0]=p[0])}else{const p=l(o,r,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?KW(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 hm._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 hm._compareCompletionItems(e,t)}}var _wt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zp=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},bwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},uU;class x_{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),n=e.getPosition();t.tokenization.tokenizeIfCheap(n.lineNumber);const o=t.getWordAtPosition(n);return!(!o||o.endColumn!==n.column&&o.startColumn+1!==n.column||!isNaN(Number(o.word)))}constructor(e,t,n){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=n}}function Cwt(i,e,t){if(!Boolean(e.getContextKeyValue(Dr.inlineSuggestionVisible.key)))return!0;const n=e.getContextKeyValue(Dr.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}function ywt(i,e,t){if(!Boolean(e.getContextKeyValue("inlineSuggestionVisible")))return!0;const n=e.getContextKeyValue(Dr.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}let hU=uU=class{constructor(e,t,n,o,r,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=n,this._telemetryService=o,this._logService=r,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new Be,this._triggerCharacterListener=new Be,this._triggerQuickSuggest=new zd,this._triggerState=void 0,this._completionDisposables=new Be,this._onDidCancel=new le,this._onDidTrigger=new le,this._onDidSuggest=new le,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new gt(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(){si(this._triggerCharacterListener),si([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 n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const o of n.triggerCharacters||[]){let r=e.get(o);r||(r=new Set,r.add(Yyt()),e.set(o,r)),r.add(n)}const t=n=>{var o;if(!ywt(this._editor,this._contextKeyService,this._configurationService)||x_.shouldAutoTrigger(this._editor))return;if(!n){const a=this._editor.getPosition();n=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let r="";J0(n.charCodeAt(n.length-1))?gr(n.charCodeAt(n.length-2))&&(r=n.substr(n.length-2)):r=n.charAt(n.length-1);const s=e.get(r);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:r,retrigger:Boolean(this._completionModel),clipboardText:(o=this._completionModel)===null||o===void 0?void 0:o.clipboardText,completionOptions:{providerFilter:s,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;JC.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&((e=qr.get(this._editor))===null||e===void 0?void 0:e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!x_.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),n=this._editor.getPosition(),o=this._editor.getOption(88);if(!JC.isAllOff(o)){if(!JC.isAllOn(o)){t.tokenization.tokenizeIfCheap(n.lineNumber);const r=t.tokenization.getLineTokens(n.lineNumber),s=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(JC.valueFor(o,s)!=="on")return}!Cwt(this._editor,this._contextKeyService,this._configurationService)||!this._languageFeaturesService.completionProvider.has(t)||this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){fi(this._editor.hasModel()),fi(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),n=new x_(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(n)}trigger(e){var t,n,o,r,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new x_(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:(n=e.triggerKind)!==null&&n!==void 0?n:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Ro;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}=uU._createSuggestFilter(this._editor),p=new jk(h,(r=(o=e.completionOptions)===null||o===void 0?void 0:o.kindFilter)!==null&&r!==void 0?r:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),v=xu.create(this._editorWorkerService,this._editor),m=AY(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,d,this._requestToken.token);Promise.all([m,v]).then(([_,y])=>bwt(this,void 0,void 0,function*(){var w;if((w=this._requestToken)===null||w===void 0||w.dispose(),!this._editor.hasModel())return;let L=e==null?void 0:e.clipboardText;if(!L&&_.needsClipboard&&(L=yield this._clipboardService.readText()),this._triggerState===void 0)return;const D=this._editor.getModel(),E=new x_(D,this._editor.getPosition(),e),I=Object.assign(Object.assign({},M5.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new hm(_.items,this._context.column,{leadingLineContent:E.leadingLineContent,characterCountDelta:E.column-this._context.column},y,this._editor.getOption(117),this._editor.getOption(111),I,L),this._completionDisposables.add(_.disposable),this._onNewContext(E),this._reportDurationsTelemetry(_.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const k of _.items)k.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${k.provider._debugDisplayName}`,k.completion)})).catch(en)}_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 o=e.getOption(117);return o.showMethods||t.add(0),o.showFunctions||t.add(1),o.showConstructors||t.add(2),o.showFields||t.add(3),o.showVariables||t.add(4),o.showClasses||t.add(5),o.showStructs||t.add(6),o.showInterfaces||t.add(7),o.showModules||t.add(8),o.showProperties||t.add(9),o.showEvents||t.add(10),o.showOperators||t.add(11),o.showUnits||t.add(12),o.showValues||t.add(13),o.showConstants||t.add(14),o.showEnums||t.add(15),o.showEnumMembers||t.add(16),o.showKeywords||t.add(17),o.showWords||t.add(18),o.showColors||t.add(19),o.showFiles||t.add(20),o.showReferences||t.add(21),o.showColors||t.add(22),o.showFolders||t.add(23),o.showTypeParameters||t.add(24),o.showSnippets||t.add(27),o.showUsers||t.add(25),o.showIssues||t.add(26),{itemKind:t,showDeprecated:o.showDeprecated}}_onNewContext(e){if(!!this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Si(e.leadingLineContent)!==Si(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(x_.shouldAutoTrigger(this._editor)&&this._context){const n=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:n}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,n=new Set;for(const[o,r]of this._completionModel.getItemsByProvider())r.length>0&&r[0].container.incomplete?n.add(o):t.set(o,r);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let n=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const o=x_.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(o&&this._context.leadingWord.endColumn0,n&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:n})}}}}};hU=uU=_wt([zp(1,Xd),zp(2,wp),zp(3,tc),zp(4,nc),zp(5,Ut),zp(6,En),zp(7,pt),zp(8,iX)],hU);class NF{constructor(e,t){this._disposables=new Be,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const n=e.getSelections(),o=n.length;let r=!1;for(let a=0;aNF._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(n=>{this._locked=!0})),this._disposables.add(t.onDidCancel(n=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},m7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class FY extends ab{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=C({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,FY.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"\u23CE")}}let fU=class{constructor(e,t,n,o,r){this._menuId=t,this._menuService=o,this._contextKeyService=r,this._menuDisposables=new Be,this.element=Ae(e,He(".suggest-status-bar"));const s=a=>a instanceof Fd?n.createInstance(FY,a,void 0):void 0;this._leftActions=new zc(this.element,{actionViewItemProvider:s}),this._rightActions=new zc(this.element,{actionViewItemProvider:s}),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 n=[],o=[];for(const[r,s]of e.getActions())r==="left"?n.push(...s):o.push(...s);this._leftActions.clear(),this._leftActions.push(n),this._rightActions.clear(),this._rightActions.push(o)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};fU=wwt([m7(2,$t),m7(3,If),m7(4,Ut)],fU);var Swt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},xwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function BY(i){return!!i&&Boolean(i.completion.documentation||i.completion.detail&&i.completion.detail!==i.completion.label)}let gU=class{constructor(e,t){this._editor=e,this._onDidClose=new le,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new le,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Be,this._renderDisposeable=new Be,this._borderWidth=1,this._size=new Kn(330,0),this.domNode=He(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(up,{editor:e}),this._body=He(".body"),this._scrollbar=new QI(this._body,{alwaysConsumeMouseWheel:!0}),Ae(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Ae(this._body,He(".header")),this._close=Ae(this._header,He("span"+Mt.asCSSSelector(Xe.close))),this._close.title=C("details.close","Close"),this._type=Ae(this._header,He("p.type")),this._docs=Ae(this._body,He("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),n=t.getMassagedFontFamily(),o=e.get(118)||t.fontSize,r=e.get(119)||t.lineHeight,s=t.fontWeight,a=`${o}px`,l=`${r}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${r/o}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=n,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,n=t*2;return{lineHeight:e,borderWidth:t,borderHeight:n,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=C("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 n,o;this._renderDisposeable.clear();let{detail:r,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} +`)}withRange(e){return new DO(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 Vyt(i,e){const t=e.getWordAtPosition(i),n=e.getLineMaxColumn(i.lineNumber);return t?new V(i.lineNumber,t.startColumn,i.lineNumber,n):V.fromPositions(i,i.with(void 0,n))}function Lce(i,e,t,n){const r=t.getLineContent(e.lineNumber).substring(0,e.column-1)+i,s=t.tokenization.tokenizeLineWithEdit(e,r.length-(e.column-1),i),a=s==null?void 0:s.sliceAndInflate(e.column-1,r.length,0);return a?Pyt(a,n):i}class Zw{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const n=t?this.range.intersectRanges(t):this.range;if(!n)return this;const o=e.getValueInRange(n,1),r=Q0(o,this.text),s=oU(this.range.getStartPosition(),rU(o.substring(0,r))),a=this.text.substring(r),l=V.fromPositions(s,this.range.getEndPosition());return new Zw(l,a)}augments(e){return this.text.startsWith(e.text)&&Hyt(this.range,e.range)}computeGhostText(e,t,n,o=0){let r=this.removeCommonPrefix(e);if(r.range.endLineNumber!==r.range.startLineNumber)return;const s=e.getLineContent(r.range.startLineNumber),a=Si(s).length;if(r.range.startColumn-1<=a){const g=Si(r.text).length,p=s.substring(r.range.startColumn-1,a),[v,m]=[r.range.getStartPosition(),r.range.getEndPosition()],_=v.column+p.length<=m.column?v.delta(0,p.length):m,y=V.fromPositions(_,m),w=r.text.startsWith(p)?r.text.substring(p.length):r.text.substring(g);r=new Zw(y,w)}const c=e.getValueInRange(r.range),d=$yt(c,r.text);if(!d)return;const u=r.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=r.text.length-o;for(const g of d){const p=r.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&n&&n.lineNumber===r.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const v=g.modifiedStart+g.modifiedLength,m=Math.max(g.modifiedStart,Math.min(v,f)),_=r.text.substring(g.modifiedStart,m),y=r.text.substring(m,Math.max(g.modifiedStart,v));if(_.length>0){const w=gf(_);h.push(new sU(p,w,!1))}if(y.length>0){const w=gf(y);h.push(new sU(p,w,!0))}}return new EO(u,h)}}function Hyt(i,e){return e.getStartPosition().equals(i.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(i.getEndPosition())}let bh;function $yt(i,e){if((bh==null?void 0:bh.originalValue)===i&&(bh==null?void 0:bh.newValue)===e)return bh==null?void 0:bh.changes;{let t=Dce(i,e,!0);if(t){const n=Ece(t);if(n>0){const o=Dce(i,e,!1);o&&Ece(o)5e3||e.length>5e3)return;function n(c){let d=0;for(let u=0,h=c.length;ud&&(d=f)}return d}const o=Math.max(n(i),n(e));function r(c){if(c<0)throw new Error("unexpected");return o+c+1}function s(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 zyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},kce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Uyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let cU=class extends _e{constructor(e,t,n,o,r){super(),this.textModel=e,this.versionId=t,this._debounceValue=n,this.languageFeaturesService=o,this.languageConfigurationService=r,this._updateOperation=this._register(new Kr),this.inlineCompletions=tO("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=tO("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,n){var o,r;const s=new Kyt(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((o=this._updateOperation.value)===null||o===void 0)&&o.request.satisfies(s))return this._updateOperation.value.promise;if(!((r=a.get())===null||r===void 0)&&r.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new Ro,d=(()=>Uyt(this,void 0,void 0,function*(){if((l||t.triggerKind===Kg.Automatic)&&(yield jyt(this._debounceValue.get(this.textModel))),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=yield Fyt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const v=new Xyt(g,s,this.textModel,this.versionId);if(n){const m=n.toInlineCompletion(void 0);n.canBeReused(this.textModel,e)&&!g.has(m)&&v.prepend(n.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),qi(m=>{a.set(v,m)}),!0}))(),u=new Gyt(s,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()}};cU=zyt([kce(3,pt),kce(4,Ti)],cU);function jyt(i,e){return new Promise(t=>{let n;const o=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(o),n&&n.dispose(),t()}))})}class Kyt{constructor(e,t,n){this.position=e,this.context=t,this.versionId=n}satisfies(e){return this.position.equals(e.position)&&qyt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,n)=>t.equals(n))&&(e.context.triggerKind===Kg.Automatic||this.context.triggerKind===Kg.Explicit)&&this.versionId===e.versionId}}function qyt(i,e,t){return!i||!e?i===e:t(i,e)}class Gyt{constructor(e,t,n){this.request=e,this.cancellationTokenSource=t,this.promise=n}dispose(){this.cancellationTokenSource.cancel()}}class Xyt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,n,o){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=n,this.versionId=o,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=In(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const r=n.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new Ice(s,r[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,n){n&&e.source.addRef();const o=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new Ice(e,o,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class Ice{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,n,o){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=o!=null?o:e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new Zw(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,n){const o=this._toFilterTextReplacement(n).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(n).getStartPosition())||t.lineNumber!==o.range.startLineNumber)return!1;const r=e.getValueInRange(o.range,1).toLowerCase(),s=o.text.toLowerCase(),a=Math.max(0,t.column-o.range.startColumn);let l=s.substring(0,a),c=s.substring(a),d=r.substring(0,a),u=r.substring(a);const h=e.getLineIndentColumn(o.range.startLineNumber);return o.range.startColumn<=h&&(d=d.trimStart(),d.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(d)&&!!N1e(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 Zw(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return Tce(this._getUpdatedRange(e)).isBefore(Tce(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 Tce(i){return i.startLineNumber===i.endLineNumber?new ae(1,1+i.endColumn-i.startColumn):new ae(1+i.endLineNumber-i.startLineNumber,i.endColumn)}var PE=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const sn={Visible:EY,HasFocusedSuggestion:new lt("suggestWidgetHasFocusedSuggestion",!1,C("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new lt("suggestWidgetDetailsVisible",!1,C("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new lt("suggestWidgetMultipleSuggestions",!1,C("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new lt("suggestionMakesTextEdit",!0,C("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new lt("acceptSuggestionOnEnter",!0,C("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new lt("suggestionHasInsertAndReplaceRange",!1,C("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new lt("suggestionInsertMode",void 0,{type:"string",description:C("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new lt("suggestionCanResolve",!1,C("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},av=new Z("suggestWidgetStatusBar");class Yyt{constructor(e,t,n,o){var r;this.position=e,this.completion=t,this.container=n,this.provider=o,this.isInvalid=!1,this.score=$u.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(r=t.label)===null||r===void 0?void 0:r.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,V.isIRange(t.range)?(this.editStart=new ae(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||V.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ae(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ae(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ae(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||V.spansMultipleLines(t.range.insert)||V.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 o.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 PE(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),n=new Ls(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(o=>{Object.assign(this.completion,o),this._resolveDuration=n.elapsed()},o=>{sh(o)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache})}}class jk{constructor(e=2,t=new Set,n=new Set,o=new Map,r=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=n,this.providerItemsToReuse=o,this.showDeprecated=r}}jk.default=new jk;let Zyt;function Qyt(){return Zyt}class Jyt{constructor(e,t,n,o){this.items=e,this.needsClipboard=t,this.durations=n,this.disposable=o}}function PY(i,e,t,n=jk.default,o={triggerKind:0},r=_n.None){return PE(this,void 0,void 0,function*(){const s=new Ls;t=t.clone();const a=e.getWordAtPosition(t),l=a?new V(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):V.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],u=new Be,h=[];let f=!1;const g=(v,m,_)=>{var y,w,L;let D=!1;if(!m)return D;for(const E of m.suggestions)if(!n.kindFilter.has(E.kind)){if(!n.showDeprecated&&((y=E==null?void 0:E.tags)===null||y===void 0?void 0:y.includes(1)))continue;E.range||(E.range=c),E.sortText||(E.sortText=typeof E.label=="string"?E.label:E.label.label),!f&&E.insertTextRules&&E.insertTextRules&4&&(f=Yw.guessNeedsClipboard(E.insertText)),d.push(new Yyt(t,E,m,v)),D=!0}return $q(m)&&u.add(m),h.push({providerName:(w=v._debugDisplayName)!==null&&w!==void 0?w:"unknown_provider",elapsedProvider:(L=m.duration)!==null&&L!==void 0?L:-1,elapsedOverall:_.elapsed()}),D},p=(()=>PE(this,void 0,void 0,function*(){}))();for(const v of i.orderedGroups(e)){let m=!1;if(yield Promise.all(v.map(_=>PE(this,void 0,void 0,function*(){if(n.providerItemsToReuse.has(_)){const y=n.providerItemsToReuse.get(_);y.forEach(w=>d.push(w)),m=m||y.length>0;return}if(!(n.providerFilter.size>0&&!n.providerFilter.has(_)))try{const y=new Ls,w=yield _.provideCompletionItems(e,t,o,r);m=g(_,w,y)||m}catch(y){$o(y)}}))),m||r.isCancellationRequested)break}return yield p,r.isCancellationRequested?(u.dispose(),Promise.reject(new Yv)):new Jyt(d.sort(nwt(n.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},u)})}function OY(i,e){if(i.sortTextLow&&e.sortTextLow){if(i.sortTextLowe.sortTextLow)return 1}return i.textLabele.textLabel?1:i.completion.kind-e.completion.kind}function ewt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return OY(i,e)}function twt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return OY(i,e)}const IF=new Map;IF.set(0,ewt);IF.set(2,twt);IF.set(1,OY);function nwt(i){return IF.get(i)}Rn.registerCommand("_executeCompletionItemProvider",(i,...e)=>PE(void 0,void 0,void 0,function*(){const[t,n,o,r]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string"||!o),fi(typeof r=="number"||!r);const{completionProvider:s}=i.get(pt),a=yield i.get(za).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=a.object.textEditorModel.validatePosition(n),u=yield PY(s,a.object.textEditorModel,d,void 0,{triggerCharacter:o!=null?o:void 0,triggerKind:o?1:0});for(const h of u.items)c.length<(r!=null?r:0)&&c.push(h.resolve(_n.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 iwt(i,e){var t;(t=i.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class JC{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 Nce(i,e=ls){return $st(i,e)?i.charAt(0).toUpperCase()+i.slice(1):i}var owt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},rwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,CURRENT_TIMEZONE_OFFSET:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class Rce{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const n=t.resolve(e);if(n!==void 0)return n}}}class Mce{constructor(e,t,n,o){this._model=e,this._selection=t,this._selectionIdx=n,this._overtypingCapturer=o}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let n=this._model.getValueInRange(this._selection)||void 0,o=this._selection.startLineNumber!==this._selection.endLineNumber;if(!n&&this._overtypingCapturer){const r=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);r&&(n=r.value,o=r.multiline)}if(n&&o&&e.snippet){const r=this._model.getLineContent(this._selection.startLineNumber),s=Si(r,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof ta&&(a=Si(gf(c.value).pop())),!0));const l=Q0(a,s);n=n.replace(/(\r\n|\r|\n)(.*)/g,(c,d,u)=>`${d}${a.substr(l)}${u}`)}return n}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const n=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return n&&n.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 Ace{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Gm(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const n=Gm(this._model.uri.fsPath),o=n.lastIndexOf(".");return o<=0?n:n.slice(0,o)}else{if(t==="TM_DIRECTORY")return P_e(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(L5(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 Pce{constructor(e,t,n,o){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=n,this._spread=o}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(!!t){if(this._spread){const n=t.split(/\r\n|\n|\r/).filter(o=>!$_e(o));if(n.length===this._selectionCount)return n[this._selectionIdx]}return t}}}let kO=class{constructor(e,t,n){this._model=e,this._selection=t,this._languageConfigurationService=n}resolve(e){const{name:t}=e,n=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),o=this._languageConfigurationService.getLanguageConfiguration(n).comments;if(!!o){if(t==="LINE_COMMENT")return o.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return o.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return o.blockCommentEndToken||void 0}}};kO=owt([rwt(2,Ti)],kO);class Ru{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 Ru.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Ru.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Ru.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Ru.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const n=this._date.getTimezoneOffset(),o=n>0?"-":"+",r=Math.trunc(Math.abs(n/60)),s=r<10?"0"+r:r,a=Math.abs(n)-r*60,l=a<10?"0"+a:a;return o+s+":"+l}}}Ru.dayNames=[C("Sunday","Sunday"),C("Monday","Monday"),C("Tuesday","Tuesday"),C("Wednesday","Wednesday"),C("Thursday","Thursday"),C("Friday","Friday"),C("Saturday","Saturday")];Ru.dayNamesShort=[C("SundayShort","Sun"),C("MondayShort","Mon"),C("TuesdayShort","Tue"),C("WednesdayShort","Wed"),C("ThursdayShort","Thu"),C("FridayShort","Fri"),C("SaturdayShort","Sat")];Ru.monthNames=[C("January","January"),C("February","February"),C("March","March"),C("April","April"),C("May","May"),C("June","June"),C("July","July"),C("August","August"),C("September","September"),C("October","October"),C("November","November"),C("December","December")];Ru.monthNamesShort=[C("JanuaryShort","Jan"),C("FebruaryShort","Feb"),C("MarchShort","Mar"),C("AprilShort","Apr"),C("MayShort","May"),C("JuneShort","Jun"),C("JulyShort","Jul"),C("AugustShort","Aug"),C("SeptemberShort","Sep"),C("OctoberShort","Oct"),C("NovemberShort","Nov"),C("DecemberShort","Dec")];class Oce{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=ndt(this._workspaceService.getWorkspace());if(!Jct(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(qH(e))return Gm(e.uri.path);let t=Gm(e.configPath.path);return t.endsWith(GH)&&(t=t.substr(0,t.length-GH.length-1)),t}_resoveWorkspacePath(e){if(qH(e))return Nce(e.uri.fsPath);const t=Gm(e.configPath.path);let n=e.configPath.fsPath;return n.endsWith(t)&&(n=n.substr(0,n.length-t.length-1)),n?Nce(n):"/"}}class Fce{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 CF()}}var swt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},awt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lu;class bc{constructor(e,t,n){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=n,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=ioe(t.placeholders,yc.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 n of this._snippet.placeholders){const o=this._snippet.offset(n),r=this._snippet.fullLen(n),s=V.fromPositions(e.getPositionAt(this._offset+o),e.getPositionAt(this._offset+o+r)),a=n.isFinalTabstop?bc._decor.inactiveFinal:bc._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(n,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const o=[];for(const r of this._placeholderGroups[this._placeholderGroupsIdx])if(r.transform){const s=this._placeholderDecorations.get(r),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=r.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",o)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const n=this._editor.getModel().changeDecorations(o=>{const r=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new gt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),o.changeDecorationOptions(l,a.isFinalTabstop?bc._decor.activeFinal:bc._decor.active),r.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const u=this._placeholderDecorations.get(d);o.changeDecorationOptions(u,d.isFinalTabstop?bc._decor.activeFinal:bc._decor.active),r.add(d)}}for(const[a,l]of this._placeholderDecorations)r.has(a)||o.changeDecorationOptions(l,a.isFinalTabstop?bc._decor.inactiveFinal:bc._decor.inactive);return s});return t?this.move(e):n!=null?n:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof yc){const n=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(n).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 n;for(const o of t){if(o.isFinalTabstop)break;n||(n=[],e.set(o.index,n));const r=this._placeholderDecorations.get(o),s=this._editor.getModel().getDecorationRange(r);if(!s){e.delete(o.index);break}n.push(s)}}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 n=this._editor.getModel().getDecorationRange(t);if(!!n)return{range:n,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof AS,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const r=e.shift();console.assert(r._offset!==-1),console.assert(!r._placeholderDecorations);const s=r._snippet.placeholderInfo.last.index;for(const l of r._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=o.index+(s+1)/this._nestingLevel:l.index=o.index+l.index/this._nestingLevel;this._snippet.replace(o,r._snippet.children);const a=this._placeholderDecorations.get(o);n.removeDecoration(a),this._placeholderDecorations.delete(o);for(const l of r._snippet.placeholders){const c=r._snippet.offset(l),d=r._snippet.fullLen(l),u=V.fromPositions(t.getPositionAt(r._offset+c),t.getPositionAt(r._offset+c+d)),h=n.addDecoration(u,bc._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=ioe(this._snippet.placeholders,yc.compareByIndex)})}}bc._decor={active:Jt.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Jt.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Jt.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Jt.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const Bce={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let IO=lu=class{static adjustWhitespace(e,t,n,o,r){const s=e.getLineContent(t.lineNumber),a=Si(s,0,t.column-1);let l;return o.walk(c=>{if(!(c instanceof ta)||c.parent instanceof AS||r&&!r.has(c))return!0;const d=c.value.split(/\r\n|\r|\n/);if(n){const h=o.offset(c);if(h===0)d[0]=e.normalizeIndentation(d[0]);else{l=l!=null?l:o.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fw.get(rb)),g=e.invokeWithinContext(w=>new Ace(w.get(Rw),h)),p=()=>a,v=h.getValueInRange(lu.adjustSelection(h,e.getSelection(),n,0)),m=h.getValueInRange(lu.adjustSelection(h,e.getSelection(),0,o)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((w,L)=>({selection:w,idx:L})).sort((w,L)=>V.compareRangesUsingStarts(w.selection,L.selection));for(const{selection:w,idx:L}of y){let D=lu.adjustSelection(h,w,n,0),E=lu.adjustSelection(h,w,0,o);v!==h.getValueInRange(D)&&(D=w),m!==h.getValueInRange(E)&&(E=w);const I=w.setStartPosition(D.startLineNumber,D.startColumn).setEndPosition(E.endLineNumber,E.endColumn),k=new Yw().parse(t,!0,r),R=I.getStartPosition(),A=lu.adjustWhitespace(h,R,s||L>0&&_!==h.getLineFirstNonWhitespaceColumn(w.positionLineNumber),k);k.resolveVariables(new Rce([g,new Pce(p,L,y.length,e.getOption(78)==="spread"),new Mce(h,w,L,l),new kO(h,w,c),new Ru,new Oce(f),new Fce])),d[L]=Gi.replace(I,k.toString()),d[L].identifier={major:L,minor:0},d[L]._isTracked=!0,u[L]=new bc(e,k,A)}return{edits:d,snippets:u}}static createEditsAndSnippetsFromEdits(e,t,n,o,r,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new Yw,u=new xT,h=new Rce([e.invokeWithinContext(g=>new Ace(g.get(Rw),c)),new Pce(()=>r,0,e.getSelections().length,e.getOption(78)==="spread"),new Mce(c,e.getSelection(),0,s),new kO(c,e.getSelection(),a),new Ru,new Oce(e.invokeWithinContext(g=>g.get(rb))),new Fce]);t=t.sort((g,p)=>V.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,D=V.fromPositions(L.getEndPosition(),p.getStartPosition()),E=new ta(c.getValueInRange(D));u.appendChild(E),f+=E.value.length}const m=d.parseFragment(v,u);lu.adjustWhitespace(c,p.getStartPosition(),!0,u,new Set(m)),u.resolveVariables(h);const _=u.toString(),y=_.slice(f);f=_.length;const w=Gi.replace(p,y);w.identifier={major:g,minor:0},w._isTracked=!0,l.push(w)}return d.ensureFinalTabstop(u,n,!0),{edits:l,snippets:[new bc(e,u,"")]}}constructor(e,t,n=Bce,o){this._editor=e,this._template=t,this._options=n,this._languageConfigurationService=o,this._templateMerges=[],this._snippets=[]}dispose(){si(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?lu.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):lu.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,n=>{const o=n.filter(r=>!!r.identifier);for(let r=0;rgt.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=Bce){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:n,snippets:o}=lu.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",n,r=>{const s=r.filter(l=>!!l.identifier);for(let l=0;lgt.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 n of this._snippets){const o=n.move(e);t.push(...o)}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{r.push(...o.get(s))})}e.sort(V.compareRangesUsingStarts);for(const[n,o]of t){if(o.length!==e.length){t.delete(n);continue}o.sort(V.compareRangesUsingStarts);for(let r=0;r0}};IO=lu=swt([awt(3,Ti)],IO);var lwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},dR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pC;const Wce={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let qr=pC=class{static get(e){return e.getContribution(pC.ID)}constructor(e,t,n,o,r){this._editor=e,this._logService=t,this._languageFeaturesService=n,this._languageConfigurationService=r,this._snippetListener=new Be,this._modelVersionId=-1,this._inSnippet=pC.InSnippetMode.bindTo(o),this._hasNextTabstop=pC.HasNextTabstop.bindTo(o),this._hasPrevTabstop=pC.HasPrevTabstop.bindTo(o)}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=="undefined"?Wce:Object.assign(Object.assign({},Wce),t))}catch(n){this.cancel(),this._logService.error(n),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 n;if(!!this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(fi(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new IO(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((n=this._session)===null||n===void 0)&&n.hasChoice){const o={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(d,u)=>{if(!this._session||d!==this._editor.getModel()||!ae.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=Boolean(h.choice.options.find(v=>v.value===f)),p=[];for(let v=0;v{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:r.getLanguageId(),pattern:r.uri.fsPath,scheme:r.uri.scheme,exclusive:!0},o),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:o,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(o=>o.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(()=>{iwt(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 Boolean(this._inSnippet.get())}};qr.ID="snippetController2";qr.InSnippetMode=new lt("inSnippetMode",!1,C("inSnippetMode","Whether the editor in current in snippet mode"));qr.HasNextTabstop=new lt("hasNextTabstop",!1,C("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));qr.HasPrevTabstop=new lt("hasPrevTabstop",!1,C("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));qr=pC=lwt([dR(1,nc),dR(2,pt),dR(3,Ut),dR(4,Ti)],qr);Un(qr.ID,qr,4);const TF=Ir.bindToContribution(qr.get);Ye(new TF({id:"jumpToNextSnippetPlaceholder",precondition:Me.and(qr.InSnippetMode,qr.HasNextTabstop),handler:i=>i.next(),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:2}}));Ye(new TF({id:"jumpToPrevSnippetPlaceholder",precondition:Me.and(qr.InSnippetMode,qr.HasPrevTabstop),handler:i=>i.prev(),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:1026}}));Ye(new TF({id:"leaveSnippet",precondition:qr.InSnippetMode,handler:i=>i.cancel(!0),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:9,secondary:[1033]}}));Ye(new TF({id:"acceptSnippet",precondition:qr.InSnippetMode,handler:i=>i.finish()}));var cwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},m7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},og=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Nl;(function(i){i[i.Undo=0]="Undo",i[i.Redo=1]="Redo",i[i.AcceptWord=2]="AcceptWord",i[i.Other=3]="Other"})(Nl||(Nl={}));let dU=class extends _e{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,n,o,r,s,a,l,c,d,u,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=n,this.textModelVersionId=o,this._debounceValue=r,this._suggestPreviewEnabled=s,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(cU,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Ai(this,!1),this._forceUpdate=VCe("forceUpdate"),this._selectedInlineCompletionId=Ai(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Nl.Redo,Nl.Undo,Nl.AcceptWord]),this._fetchInlineCompletions=Hgt({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Kg.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 m=this.selectedInlineCompletion.get(),_=p.preserveCurrentCompletion||(m==null?void 0:m.forwardStable)?m:void 0,y=this._source.suggestWidgetInlineCompletions.get(),w=this.selectedSuggestItem.read(g);if(y&&!w){const E=this._source.inlineCompletions.get();qi(I=>{E&&y.request.versionId>E.request.versionId&&this._source.inlineCompletions.set(y.clone(),I),this._source.clearSuggestWidgetInlineCompletions(I)})}const L=this.cursorPosition.read(g),D={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:w==null?void 0:w.toSelectedSuggestionInfo()};return this._source.fetch(L,D,_)}),this._filteredInlineCompletionItems=In(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const v=this.cursorPosition.read(g);return p.inlineCompletions.filter(_=>_.isVisible(this.textModel,v,g))}),this.selectedInlineCompletionIndex=In(this,g=>{const p=this._selectedInlineCompletionId.read(g),v=this._filteredInlineCompletionItems.read(g),m=this._selectedInlineCompletionId===void 0?-1:v.findIndex(_=>_.semanticId===p);return m===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):m}),this.selectedInlineCompletion=In(this,g=>{const p=this._filteredInlineCompletionItems.read(g),v=this.selectedInlineCompletionIndex.read(g);return p[v]}),this.lastTriggerKind=this._source.inlineCompletions.map(g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=In(this,g=>{if(this.lastTriggerKind.read(g)===Kg.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=Xae({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:yce(g.ghostText,p.ghostText)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p;const v=this.textModel,m=this.selectedSuggestItem.read(g);if(m){const _=m.toSingleTextEdit().removeCommonPrefix(v),y=this._computeAugmentedCompletion(_,g);if(!this._suggestPreviewEnabled.read(g)&&!y)return;const L=(p=y==null?void 0:y.edit)!==null&&p!==void 0?p:_,D=y?y.edit.text.length-_.text.length:0,E=this._suggestPreviewMode.read(g),I=this.cursorPosition.read(g),k=L.computeGhostText(v,E,I,D);return{ghostText:k!=null?k:new EO(L.range.endLineNumber,[]),inlineCompletion:y==null?void 0:y.completion,suggestItem:m}}else{if(!this._isActive.read(g))return;const _=this.selectedInlineCompletion.read(g);if(!_)return;const y=_.toSingleTextEdit(g),w=this._inlineSuggestMode.read(g),L=this.cursorPosition.read(g),D=y.computeGhostText(v,w,L);return D?{ghostText:D,inlineCompletion:_,suggestItem:void 0}:void 0}}),this.ghostText=Xae({owner:this,equalityComparer:yce},g=>{const p=this.state.read(g);if(!!p)return p.ghostText}),this._register(Rk(this._fetchInlineCompletions));let f;this._register(Ii(g=>{var p,v;const m=this.state.read(g),_=m==null?void 0:m.inlineCompletion;if((_==null?void 0:_.semanticId)!==(f==null?void 0:f.semanticId)&&(f=_,_)){const y=_.inlineCompletion,w=y.source;(v=(p=w.provider).handleItemDidShow)===null||v===void 0||v.call(p,w.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}trigger(e){return og(this,void 0,void 0,function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()})}triggerExplicitly(e){return og(this,void 0,void 0,function*(){Z$(e,t=>{this._isActive.set(!0,t),this._forceUpdate.trigger(t,Kg.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){Z$(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentedCompletion(e,t){const n=this.textModel,o=this._source.suggestWidgetInlineCompletions.read(t),r=o?o.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(kD);return Aet(r,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(n,V.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{edit:l,completion:a}:void 0})}_deltaSelectedInlineCompletionIndex(e){return og(this,void 0,void 0,function*(){yield this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const n=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[n].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)})}next(){return og(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(1)})}previous(){return og(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(-1)})}accept(e){var t;return og(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vo;const n=this.state.get();if(!n||n.ghostText.isEmpty()||!n.inlineCompletion)return;const o=n.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),o.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Gi.replaceMove(o.range,""),...o.additionalTextEdits]),e.setPosition(o.snippetInfo.range.getStartPosition()),(t=qr.get(e))===null||t===void 0||t.insert(o.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Gi.replaceMove(o.range,o.insertText),...o.additionalTextEdits]),o.command&&o.source.addRef(),qi(r=>{this._source.clear(r),this._isActive.set(!1,r)}),o.command&&(yield this._commandService.executeCommand(o.command.id,...o.command.arguments||[]).then(void 0,$o),o.source.removeRef())})}acceptNextWord(e){return og(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,n)=>{const o=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),r=this._languageConfigurationService.getLanguageConfiguration(o),s=new RegExp(r.wordDefinition.source,r.wordDefinition.flags.replace("g","")),a=n.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=n.length;const d=/\s+/g.exec(n);return d&&d.index!==void 0&&d.index+d[0].length{const o=n.match(/\n/);return o&&o.index!==void 0?o.index+1:n.length})})}_acceptNext(e,t){return og(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vo;const n=this.state.get();if(!n||n.ghostText.isEmpty()||!n.inlineCompletion)return;const o=n.ghostText,r=n.inlineCompletion.toInlineCompletion(void 0);if(r.snippetInfo||r.filterText!==r.insertText){yield this.accept(e);return}const s=o.parts[0],a=new ae(o.lineNumber,s.column),l=s.lines.join(` +`),c=t(a,l);if(c===l.length&&o.parts.length===1){this.accept(e);return}const d=l.substring(0,c);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Gi.replace(V.fromPositions(a),d)]);const u=rU(d);e.setPosition(oU(a,u))}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const u=V.fromPositions(r.range.getStartPosition(),oU(a,rU(d))),h=e.getModel().getValueInRange(u,1);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,h.length)}})}handleSuggestAccepted(e){var t,n;const o=e.toSingleTextEdit().removeCommonPrefix(this.textModel),r=this._computeAugmentedCompletion(o,void 0);if(!r)return;const s=r.completion.inlineCompletion;(n=(t=s.source.provider).handlePartialAccept)===null||n===void 0||n.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,o.text.length)}};dU=cwt([m7(9,$t),m7(10,_o),m7(11,Ti)],dU);var dwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},BL;class FY{constructor(e){this.name=e}select(e,t,n){if(n.length===0)return 0;const o=n[0].score[0];for(let r=0;rl&&u.type===n[c].completion.kind&&u.insertText===n[c].completion.insertText&&(l=u.touch,a=c),n[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[n,o]of e)o.touch=t,o.type=typeof o.type=="number"?o.type:RD.fromString(o.type),this._cache.set(n,o);this._seq=this._cache.size}}class hwt extends FY{constructor(){super("recentlyUsedByPrefix"),this._trie=Ay.forStrings(),this._seq=0}memorize(e,t,n){const{word:o}=e.getWordUntilPosition(t),r=`${e.getLanguageId()}/${o}`;this._trie.set(r,{type:n.completion.kind,insertText:n.completion.insertText,touch:this._seq++})}select(e,t,n){const{word:o}=e.getWordUntilPosition(t);if(!o)return super.select(e,t,n);const r=`${e.getLanguageId()}/${o}`;let s=this._trie.get(r);if(s||(s=this._trie.findSubstr(r)),s)for(let a=0;ae.push([n,t])),e.sort((t,n)=>-(t[1].touch-n[1].touch)).forEach((t,n)=>t[1].touch=n),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,n]of e)n.type=typeof n.type=="number"?n.type:RD.fromString(n.type),this._trie.set(t,n)}}}let Kk=BL=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Be,this._persistSoon=new bi(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(n=>{n.reason===FP.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,n){this._withStrategy(e,t).memorize(e,t,n),this._persistSoon.schedule()}select(e,t,n){return this._withStrategy(e,t).select(e,t,n)}_withStrategy(e,t){var n;const o=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)===null||n===void 0?void 0:n.name)!==o){this._saveState();const r=BL._strategyCtors.get(o)||hSe;this._strategy=new r;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${BL._storagePrefix}/${o}`,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,n=JSON.stringify(this._strategy);this._storageService.store(`${BL._storagePrefix}/${this._strategy.name}`,n,t,1)}}};Kk._strategyCtors=new Map([["recentlyUsedByPrefix",hwt],["recentlyUsed",uwt],["first",hSe]]);Kk._storagePrefix="suggest/memories";Kk=BL=dwt([Vce(0,Gd),Vce(1,En)],Kk);const NF=yn("ISuggestMemories");Mn(NF,Kk,1);var fwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},gwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},uU;let qk=uU=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=uU.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(n=>n.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 n=this._editor.getModel(),o=this._editor.getSelection(),r=n.getWordAtPosition(o.getStartPosition());if(!r){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(r.endColumn===o.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};qk.AtEnd=new lt("atEndOfWord",!1);qk=uU=fwt([gwt(1,Ut)],qk);var pwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},mwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},WL;let wb=WL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=WL.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},n){if(e.items.length===0){this.reset();return}if(WL._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=n,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,n){let o=n;for(let r=t.items.length;r>0&&(o=(o+t.items.length+(e?1:-1))%t.items.length,!(o===n||!t.items[o].completion.additionalTextEdits));r--);return o}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(!!this._model)try{this._ignore=!0,this._index=WL._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};wb.OtherSuggestions=new lt("hasOtherSuggestions",!1);wb=WL=pwt([mwt(1,Ut)],wb);class vwt{constructor(e,t,n,o){this._disposables=new Be,this._disposables.add(n.onDidSuggest(r=>{r.completionModel.items.length===0&&this.reset()})),this._disposables.add(n.onDidCancel(r=>{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(r=>{if(this._active&&!t.isFrozen()&&n.state!==0){const s=r.charCodeAt(r.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&o(this._active.item)}}))}_onItem(e){if(!e||!ws(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new eP;for(const n of e.item.completion.commitCharacters)n.length>0&&t.add(n.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var _wt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Rl{provideSelectionRanges(e,t){return _wt(this,void 0,void 0,function*(){const n=[];for(const o of t){const r=[];n.push(r);const s=new Map;yield new Promise(a=>Rl._bracketsRightYield(a,0,e,o,s)),yield new Promise(a=>Rl._bracketsLeftYield(a,0,e,o,s,r))}return n})}static _bracketsRightYield(e,t,n,o,r){const s=new Map,a=Date.now();for(;;){if(t>=Rl._maxRounds){e();break}if(!o){e();break}const l=n.bracketPairs.findNextBracket(o);if(!l){e();break}if(Date.now()-a>Rl._maxDuration){setTimeout(()=>Rl._bracketsRightYield(e,t+1,n,o,r));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,u=s.has(d)?s.get(d):0;s.set(d,u+1)}else{const d=l.bracketInfo.getOpeningBrackets()[0].bracketText;let u=s.has(d)?s.get(d):0;if(u-=1,s.set(d,Math.max(0,u)),u<0){let h=r.get(d);h||(h=new oa,r.set(d,h)),h.push(l.range)}}o=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,n,o,r,s){const a=new Map,l=Date.now();for(;;){if(t>=Rl._maxRounds&&r.size===0){e();break}if(!o){e();break}const c=n.bracketPairs.findPrevBracket(o);if(!c){e();break}if(Date.now()-l>Rl._maxDuration){setTimeout(()=>Rl._bracketsLeftYield(e,t+1,n,o,r,s));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=r.get(u);if(f){const g=f.shift();f.size===0&&r.delete(u);const p=V.fromPositions(c.range.getEndPosition(),g.getStartPosition()),v=V.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:p}),s.push({range:v}),Rl._addBracketLeading(n,v,s)}}}else{const u=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(u)?a.get(u):0;a.set(u,h+1)}o=c.range.getStartPosition()}}static _addBracketLeading(e,t,n){if(t.startLineNumber===t.endLineNumber)return;const o=t.startLineNumber,r=e.getLineFirstNonWhitespaceColumn(o);r!==0&&r!==t.startColumn&&(n.push({range:V.fromPositions(new ae(o,r),t.getEndPosition())}),n.push({range:V.fromPositions(new ae(o,1),t.getEndPosition())}));const s=o-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(n.push({range:V.fromPositions(new ae(s,a),t.getEndPosition())}),n.push({range:V.fromPositions(new ae(s,1),t.getEndPosition())}))}}}Rl._maxDuration=30;Rl._maxRounds=2;var bwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class xu{static create(e,t){return bwt(this,void 0,void 0,function*(){if(!t.getOption(117).localityBonus||!t.hasModel())return xu.None;const n=t.getModel(),o=t.getPosition();if(!e.canComputeWordRanges(n.uri))return xu.None;const[r]=yield new Rl().provideSelectionRanges(n,[o]);if(r.length===0)return xu.None;const s=yield e.computeWordRanges(n.uri,r[0].range);if(!s)return xu.None;const a=n.getWordUntilPosition(o);return delete s[a.word],new class extends xu{distance(l,c){if(!o.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,u=s[d];if(c_e(u))return 2<<20;const h=ED(u,V.fromPositions(l),V.compareRangesUsingStarts),f=h>=0?u[h]:u[Math.max(0,~h-1)];let g=r.length;for(const p of r){if(!V.containsRange(p.range,f))break;g-=1}return g}}})}}xu.None=new class extends xu{distance(){return 0}};class Hce{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}class fm{constructor(e,t,n,o,r,s,a=A5.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=fm._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=o,this._options=r,this._refilterKind=1,this._lineContext=n,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=fm._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=fm._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&n[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:n}=this._lineContext;let o="",r="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?sb:Tdt;for(let c=0;c=f)d.score=$u.Default;else if(typeof d.completion.filterText=="string"){const p=l(o,r,g,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;$V(d.completion.filterText,d.textLabel)===0?d.score=p:(d.score=Edt(o,r,g,d.textLabel,d.labelLow,0),d.score[0]=p[0])}else{const p=l(o,r,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?qW(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 fm._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 fm._compareCompletionItems(e,t)}}var Cwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Up=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ywt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},hU;class x_{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),n=e.getPosition();t.tokenization.tokenizeIfCheap(n.lineNumber);const o=t.getWordAtPosition(n);return!(!o||o.endColumn!==n.column&&o.startColumn+1!==n.column||!isNaN(Number(o.word)))}constructor(e,t,n){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=n}}function wwt(i,e,t){if(!Boolean(e.getContextKeyValue(Dr.inlineSuggestionVisible.key)))return!0;const n=e.getContextKeyValue(Dr.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}function Swt(i,e,t){if(!Boolean(e.getContextKeyValue("inlineSuggestionVisible")))return!0;const n=e.getContextKeyValue(Dr.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}let fU=hU=class{constructor(e,t,n,o,r,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=n,this._telemetryService=o,this._logService=r,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new Be,this._triggerCharacterListener=new Be,this._triggerQuickSuggest=new zd,this._triggerState=void 0,this._completionDisposables=new Be,this._onDidCancel=new le,this._onDidTrigger=new le,this._onDidSuggest=new le,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new gt(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(){si(this._triggerCharacterListener),si([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 n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const o of n.triggerCharacters||[]){let r=e.get(o);r||(r=new Set,r.add(Qyt()),e.set(o,r)),r.add(n)}const t=n=>{var o;if(!Swt(this._editor,this._contextKeyService,this._configurationService)||x_.shouldAutoTrigger(this._editor))return;if(!n){const a=this._editor.getPosition();n=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let r="";J0(n.charCodeAt(n.length-1))?gr(n.charCodeAt(n.length-2))&&(r=n.substr(n.length-2)):r=n.charAt(n.length-1);const s=e.get(r);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:r,retrigger:Boolean(this._completionModel),clipboardText:(o=this._completionModel)===null||o===void 0?void 0:o.clipboardText,completionOptions:{providerFilter:s,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;JC.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&((e=qr.get(this._editor))===null||e===void 0?void 0:e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!x_.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),n=this._editor.getPosition(),o=this._editor.getOption(88);if(!JC.isAllOff(o)){if(!JC.isAllOn(o)){t.tokenization.tokenizeIfCheap(n.lineNumber);const r=t.tokenization.getLineTokens(n.lineNumber),s=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(JC.valueFor(o,s)!=="on")return}!wwt(this._editor,this._contextKeyService,this._configurationService)||!this._languageFeaturesService.completionProvider.has(t)||this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){fi(this._editor.hasModel()),fi(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),n=new x_(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(n)}trigger(e){var t,n,o,r,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new x_(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:(n=e.triggerKind)!==null&&n!==void 0?n:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Ro;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}=hU._createSuggestFilter(this._editor),p=new jk(h,(r=(o=e.completionOptions)===null||o===void 0?void 0:o.kindFilter)!==null&&r!==void 0?r:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),v=xu.create(this._editorWorkerService,this._editor),m=PY(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,d,this._requestToken.token);Promise.all([m,v]).then(([_,y])=>ywt(this,void 0,void 0,function*(){var w;if((w=this._requestToken)===null||w===void 0||w.dispose(),!this._editor.hasModel())return;let L=e==null?void 0:e.clipboardText;if(!L&&_.needsClipboard&&(L=yield this._clipboardService.readText()),this._triggerState===void 0)return;const D=this._editor.getModel(),E=new x_(D,this._editor.getPosition(),e),I=Object.assign(Object.assign({},A5.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new fm(_.items,this._context.column,{leadingLineContent:E.leadingLineContent,characterCountDelta:E.column-this._context.column},y,this._editor.getOption(117),this._editor.getOption(111),I,L),this._completionDisposables.add(_.disposable),this._onNewContext(E),this._reportDurationsTelemetry(_.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const k of _.items)k.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${k.provider._debugDisplayName}`,k.completion)})).catch(en)}_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 o=e.getOption(117);return o.showMethods||t.add(0),o.showFunctions||t.add(1),o.showConstructors||t.add(2),o.showFields||t.add(3),o.showVariables||t.add(4),o.showClasses||t.add(5),o.showStructs||t.add(6),o.showInterfaces||t.add(7),o.showModules||t.add(8),o.showProperties||t.add(9),o.showEvents||t.add(10),o.showOperators||t.add(11),o.showUnits||t.add(12),o.showValues||t.add(13),o.showConstants||t.add(14),o.showEnums||t.add(15),o.showEnumMembers||t.add(16),o.showKeywords||t.add(17),o.showWords||t.add(18),o.showColors||t.add(19),o.showFiles||t.add(20),o.showReferences||t.add(21),o.showColors||t.add(22),o.showFolders||t.add(23),o.showTypeParameters||t.add(24),o.showSnippets||t.add(27),o.showUsers||t.add(25),o.showIssues||t.add(26),{itemKind:t,showDeprecated:o.showDeprecated}}_onNewContext(e){if(!!this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Si(e.leadingLineContent)!==Si(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(x_.shouldAutoTrigger(this._editor)&&this._context){const n=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:n}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,n=new Set;for(const[o,r]of this._completionModel.getItemsByProvider())r.length>0&&r[0].container.incomplete?n.add(o):t.set(o,r);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let n=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const o=x_.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(o&&this._context.leadingWord.endColumn0,n&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:n})}}}}};fU=hU=Cwt([Up(1,Xd),Up(2,Sp),Up(3,tc),Up(4,nc),Up(5,Ut),Up(6,En),Up(7,pt),Up(8,oX)],fU);class RF{constructor(e,t){this._disposables=new Be,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const n=e.getSelections(),o=n.length;let r=!1;for(let a=0;aRF._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(n=>{this._locked=!0})),this._disposables.add(t.onDidCancel(n=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},v7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class BY extends ab{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=C({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,BY.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"\u23CE")}}let gU=class{constructor(e,t,n,o,r){this._menuId=t,this._menuService=o,this._contextKeyService=r,this._menuDisposables=new Be,this.element=Ae(e,He(".suggest-status-bar"));const s=a=>a instanceof Fd?n.createInstance(BY,a,void 0):void 0;this._leftActions=new zc(this.element,{actionViewItemProvider:s}),this._rightActions=new zc(this.element,{actionViewItemProvider:s}),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 n=[],o=[];for(const[r,s]of e.getActions())r==="left"?n.push(...s):o.push(...s);this._leftActions.clear(),this._leftActions.push(n),this._rightActions.clear(),this._rightActions.push(o)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};gU=xwt([v7(2,$t),v7(3,If),v7(4,Ut)],gU);var Lwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ewt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function WY(i){return!!i&&Boolean(i.completion.documentation||i.completion.detail&&i.completion.detail!==i.completion.label)}let pU=class{constructor(e,t){this._editor=e,this._onDidClose=new le,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new le,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Be,this._renderDisposeable=new Be,this._borderWidth=1,this._size=new Kn(330,0),this.domNode=He(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(hp,{editor:e}),this._body=He(".body"),this._scrollbar=new QI(this._body,{alwaysConsumeMouseWheel:!0}),Ae(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Ae(this._body,He(".header")),this._close=Ae(this._header,He("span"+Mt.asCSSSelector(Xe.close))),this._close.title=C("details.close","Close"),this._type=Ae(this._header,He("p.type")),this._docs=Ae(this._body,He("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),n=t.getMassagedFontFamily(),o=e.get(118)||t.fontSize,r=e.get(119)||t.lineHeight,s=t.fontWeight,a=`${o}px`,l=`${r}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${r/o}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=n,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,n=t*2;return{lineHeight:e,borderWidth:t,borderHeight:n,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=C("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 n,o;this._renderDisposeable.clear();let{detail:r,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} `,a+=`prefix: ${(n=e.word)!==null&&n!==void 0?n:"(no prefix)"} `,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,a+=`distance: ${e.distance} (localityBonus-setting) `,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,a+=`commit_chars: ${(o=e.completion.commitCharacters)===null||o===void 0?void 0:o.join("")} -`,s=new os().appendCodeblock("empty",a),r=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!BY(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),r){const a=r.length>1e5?`${r.substr(0,1e5)}\u2026`:r;this._type.textContent=a,this._type.title=a,nl(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ur(this._type),this._type.title="",Js(this._type),this.domNode.classList.add("no-type");if(Ur(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Ur(this._docs);const a=this._markdownRenderer.render(s);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 n=new Kn(e,t);Kn.equals(n,this._size)||(this._size=n,WQe(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}};gU=Swt([xwt(1,$t)],gU);class Lwt{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new Be,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new pY,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let n,o,r=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{n=this._topLeft,o=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(n&&o){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=o.width-a.dimension.width,l=!0),a.north&&(r=o.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:n.top+r,left:n.left+s})}a.done&&(n=void 0,o=void 0,r=0,s=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 n;const o=e.getBoundingClientRect();this._anchorBox=o,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(n=this._userSize)!==null&&n!==void 0?n:this.widget.size,t)}_placeAtAnchor(e,t,n){var o;const r=bS(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new Kn(220,2*s.lineHeight),l=e.top,c=function(){const y=r.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),w=-s.borderWidth+e.left+e.width,L=new Kn(y,r.height-e.top-s.borderHeight-s.verticalPadding),D=L.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:w,fit:y-t.width,maxSizeTop:L,maxSizeBottom:D,minSize:a.with(Math.min(y,a.width))}}(),d=function(){const y=e.left-s.borderWidth-s.horizontalPadding,w=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),L=new Kn(y,r.height-e.top-s.borderHeight-s.verticalPadding),D=L.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:w,fit:y-t.width,maxSizeTop:L,maxSizeBottom:D,minSize:a.with(Math.min(y,a.width))}}(),u=function(){const y=e.left,w=-s.borderWidth+e.top+e.height,L=new Kn(e.width-s.borderHeight,r.height-e.top-e.height-s.verticalPadding);return{top:w,left:y,fit:L.height-t.height,maxSizeBottom:L,maxSizeTop:L,minSize:a.with(L.width)}}(),h=[c,d,u],f=(o=h.find(y=>y.fit>=0))!==null&&o!==void 0?o:h.sort((y,w)=>w.fit-y.fit)[0],g=e.top+e.height-s.borderHeight;let p,v=t.height;const m=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);v>m&&(v=m);let _;n?v<=f.maxSizeTop.height?(p=!0,_=f.maxSizeTop):(p=!1,_=f.maxSizeBottom):v<=f.maxSizeBottom.height?(p=!1,_=f.maxSizeBottom):(p=!0,_=f.maxSizeTop),this._applyTopLeft({left:f.left,top:p?f.top:g-v}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=_,this._resizable.layout(v,Math.min(_.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var $g;(function(i){i[i.FILE=0]="FILE",i[i.FOLDER=1]="FOLDER",i[i.ROOT_FOLDER=2]="ROOT_FOLDER"})($g||($g={}));const Ewt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function uR(i,e,t,n){const o=n===$g.ROOT_FOLDER?["rootfolder-icon"]:n===$g.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===hn.data)r=Nv.parseMetaData(t).get(Nv.META_DATA_LABEL);else{const s=t.path.match(Ewt);s?(r=hR(s[2].toLowerCase()),s[1]&&o.push(`${hR(s[1].toLowerCase())}-name-dir-icon`)):r=hR(t.authority.toLowerCase())}if(n===$g.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const a=r.split(".");for(let l=1;l=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},v7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Up;function fSe(i){return`suggest-aria-id:${i}`}const Iwt=Eo("suggest-more-info",Xe.chevronRight,C("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),Twt=new(Up=class{extract(e,t){if(e.textLabel.match(Up._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(Up._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const n=Up._regexRelaxed.exec(e.completion.documentation);if(n&&(n.index===0||n.index+n[0].length===e.completion.documentation.length))return t[0]=n[0],!0}return!1}},Up._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*\))/,Up._regexStrict=new RegExp(`^${Up._regexRelaxed.source}$`,"i"),Up);let pU=class{constructor(e,t,n,o){this._editor=e,this._modelService=t,this._languageService=n,this._themeService=o,this._onDidToggleDetails=new le,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Be,n=e;n.classList.add("show-file-icons");const o=Ae(e,He(".icon")),r=Ae(o,He("span.colorspan")),s=Ae(e,He(".contents")),a=Ae(s,He(".main")),l=Ae(a,He(".icon-label.codicon")),c=Ae(a,He("span.left")),d=Ae(a,He("span.right")),u=new ZP(c,{supportHighlights:!0,supportIcons:!0});t.add(u);const h=Ae(c,He("span.signature-label")),f=Ae(c,He("span.qualifier-label")),g=Ae(d,He("span.details-label")),p=Ae(d,He("span.readMore"+Mt.asCSSSelector(Iwt)));p.title=C("readMore","Read More");const v=()=>{const m=this._editor.getOptions(),_=m.get(50),y=_.getMassagedFontFamily(),w=_.fontFeatureSettings,L=m.get(118)||_.fontSize,D=m.get(119)||_.lineHeight,E=_.fontWeight,I=_.letterSpacing,k=`${L}px`,R=`${D}px`,A=`${I}px`;n.style.fontSize=k,n.style.fontWeight=E,n.style.letterSpacing=A,a.style.fontFamily=y,a.style.fontFeatureSettings=w,a.style.lineHeight=R,o.style.height=R,o.style.width=R,p.style.height=R,p.style.width=R};return v(),t.add(this._editor.onDidChangeConfiguration(m=>{(m.hasChanged(50)||m.hasChanged(118)||m.hasChanged(119))&&v()})),{root:n,left:c,right:d,icon:o,colorspan:r,iconLabel:u,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t}}renderElement(e,t,n){const{completion:o}=e;n.root.id=fSe(t),n.colorspan.style.backgroundColor="";const r={labelEscapeNewLines:!0,matches:rT(e.score)},s=[];if(o.kind===19&&Twt.extract(e,s))n.icon.className="icon customcolor",n.iconContainer.className="icon hide",n.colorspan.style.backgroundColor=s[0];else if(o.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){n.icon.className="icon hide",n.iconContainer.className="icon hide";const a=uR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:e.textLabel}),$g.FILE),l=uR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:o.detail}),$g.FILE);r.extraClasses=a.length>l.length?a:l}else o.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(n.icon.className="icon hide",n.iconContainer.className="icon hide",r.extraClasses=[uR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:e.textLabel}),$g.FOLDER),uR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:o.detail}),$g.FOLDER)].flat()):(n.icon.className="icon hide",n.iconContainer.className="",n.iconContainer.classList.add("suggest-icon",...Mt.asClassNameArray(RD.toIcon(o.kind))));o.tags&&o.tags.indexOf(1)>=0&&(r.extraClasses=(r.extraClasses||[]).concat(["deprecated"]),r.matches=[]),n.iconLabel.setLabel(e.textLabel,void 0,r),typeof o.label=="string"?(n.parametersLabel.textContent="",n.detailsLabel.textContent=_7(o.detail||""),n.root.classList.add("string-label")):(n.parametersLabel.textContent=_7(o.label.detail||""),n.detailsLabel.textContent=_7(o.label.description||""),n.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?nl(n.detailsLabel):Js(n.detailsLabel),BY(e)?(n.right.classList.add("can-expand-details"),nl(n.readMore),n.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},n.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(n.right.classList.remove("can-expand-details"),Js(n.readMore),n.readMore.onmousedown=null,n.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};pU=kwt([v7(1,Yi),v7(2,Ki),v7(3,vr)],pU);function _7(i){return i.replace(/\r\n|\r|\n/g,"")}var Nwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Rwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},mC;J("editorSuggestWidget.background",{dark:po,light:po,hcDark:po,hcLight:po},C("editorSuggestWidgetBackground","Background color of the suggest widget."));J("editorSuggestWidget.border",{dark:Qh,light:Qh,hcDark:Qh,hcLight:Qh},C("editorSuggestWidgetBorder","Border color of the suggest widget."));const gR=J("editorSuggestWidget.foreground",{dark:Sd,light:Sd,hcDark:Sd,hcLight:Sd},C("editorSuggestWidgetForeground","Foreground color of the suggest widget."));J("editorSuggestWidget.selectedForeground",{dark:g0,light:g0,hcDark:g0,hcLight:g0},C("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));J("editorSuggestWidget.selectedIconForeground",{dark:OC,light:OC,hcDark:OC,hcLight:OC},C("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const Mwt=J("editorSuggestWidget.selectedBackground",{dark:p0,light:p0,hcDark:p0,hcLight:p0},C("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));J("editorSuggestWidget.highlightForeground",{dark:xd,light:xd,hcDark:xd,hcLight:xd},C("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));J("editorSuggestWidget.focusHighlightForeground",{dark:u2,light:u2,hcDark:u2,hcLight:u2},C("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));J("editorSuggestWidgetStatus.foreground",{dark:St(gR,.5),light:St(gR,.5),hcDark:St(gR,.5),hcLight:St(gR,.5)},C("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class Awt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Fv}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const n=JSON.parse(t);if(Kn.is(n))return Kn.lift(n)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Gk=mC=class{constructor(e,t,n,o,r){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Kr,this._pendingShowDetails=new Kr,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new zd,this._disposables=new Be,this._onDidSelect=new Y0,this._onDidFocus=new Y0,this._onDidHide=new le,this._onDidShow=new le,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new le,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new pY,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Pwt(this,e),this._persistedSize=new Awt(t,e);class s{constructor(f,g,p=!1,v=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,v;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:m,defaultSize:_}=this.getLayoutInfo(),y=Math.round(m/2);let{width:w,height:L}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-L)<=y)&&(L=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:_.height),(!a.persistWidth||Math.abs(a.currentSize.width-w)<=y)&&(w=(v=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&v!==void 0?v:_.width),this._persistedSize.store(new Kn(w,L))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Ae(this.element.domNode,He(".message")),this._listElement=Ae(this.element.domNode,He(".tree"));const l=this._disposables.add(r.createInstance(gU,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Lwt(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);c();const d=r.createInstance(pU,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new qd("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>C("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:m,description:_}=h.completion.label;m&&_?f=C("label.full","{0} {1}, {2}",f,m,_):m?f=C("label.detail","{0} {1}",f,m):_&&(f=C("label.desc","{0}, {1}",f,_))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,v=Z0("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return C("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,v)}}}),this._list.style(ES({listInactiveFocusBackground:Mwt,listInactiveFocusOutline:Wi})),this._status=r.createInstance(fU,this.element.domNode,sv);const u=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);u(),this._disposables.add(o.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(o.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=sn.Visible.bindTo(n),this._ctxSuggestWidgetDetailsVisible=sn.DetailsVisible.bindTo(n),this._ctxSuggestWidgetMultipleSuggestions=sn.MultipleSuggestions.bindTo(n),this._ctxSuggestWidgetHasFocusedSuggestion=sn.HasFocusedSuggestion.bindTo(n),this._disposables.add(No(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=="undefined"||typeof e.index=="undefined"||(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 n=this._completionModel;n&&(this._onDidSelect.fire({item:e,index:t,model:n}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=Hu(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 n=e.elements[0],o=e.indexes[0];n!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(o),this._currentSuggestionDetails=sr(r=>Rwt(this,void 0,void 0,function*(){const s=Lv(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=r.onCancellationRequested(()=>s.dispose());try{return yield n.resolve(r)}finally{s.dispose(),a.dispose()}})),this._currentSuggestionDetails.then(()=>{o>=this._list.length||n!==this._list.element(o)||(this._ignoreFocusEvents=!0,this._list.splice(o,1,[n]),this._list.setFocus([o]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:fSe(o)}))}).catch(en)),this._onDidFocus.fire({item:n,index:o,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:Js(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=mC.LOADING_MESSAGE,Js(this._listElement,this._status.element),nl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,kv(mC.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=mC.NO_SUGGESTIONS_MESSAGE,Js(this._listElement,this._status.element),nl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,kv(mC.NO_SUGGESTIONS_MESSAGE);break;case 3:Js(this._messageElement),nl(this._listElement,this._status.element),this._show();break;case 4:Js(this._messageElement),nl(this._listElement,this._status.element),this._show();break;case 5:Js(this._messageElement),nl(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=Lv(()=>this._setState(1),t)))}showSuggestions(e,t,n,o,r){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),n&&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(o?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(n?4:3),this._list.reveal(t,0),this._list.setFocus(r?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=GA(()=>{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")):(BY(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=GA(()=>{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(),n=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const d=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,u=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,f=Yo(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,v=Math.min(r.height-p-s.verticalPadding,u),m=f.top+g.top-s.verticalPadding,_=Math.min(m,u);let y=Math.min(Math.max(_,v)+s.borderHeight,u);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),ay&&(a=y);const w=150;a>v||this._forceRenderingAbove&&m>w?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),y=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),y=v),this.element.preferredSize=new Kn(d,s.defaultSize.height),this.element.maxSize=new Kn(c,y),this.element.minSize=new Kn(220,h),this._cappedHeight=a===u?{wanted:(o=(n=this._cappedHeight)===null||n===void 0?void 0:n.wanted)!==null&&o!==void 0?o:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:n,height:o}=this.element.maxSize;e=Math.min(n,e),t=Math.min(o,t);const{statusBarHeight:r}=this.getLayoutInfo();this._list.layout(t-r,e),this._listElement.style.height=`${t-r}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=Za(this.editor.getOption(119)||e.lineHeight,8,1e3),n=!this.editor.getOption(117).showStatusBar||this._state===2||this._state===1?0:t,o=this._details.widget.borderWidth,r=2*o;return{itemHeight:t,statusBarHeight:n,borderWidth:o,borderHeight:r,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Kn(430,n+12*t+r)}}_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}};Gk.LOADING_MESSAGE=C("suggestWidget.loading","Loading...");Gk.NO_SUGGESTIONS_MESSAGE=C("suggestWidget.noSuggestions","No suggestions.");Gk=mC=Nwt([fR(1,Gd),fR(2,Ut),fR(3,vr),fR(4,$t)],Gk);class Pwt{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:n,horizontalPadding:o}=this._widget.getLayoutInfo();return new Kn(t+2*n+o,e+2*n)}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 Owt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mU;class Fwt{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const o=e.getOffsetAt(t),r=e.getPositionAt(o+1);this._marker=e.deltaDecorations([],[{range:V.fromPositions(t,r),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 Ed=mU=class{static get(e){return e.getContribution(mU.ID)}constructor(e,t,n,o,r,s,a){this._memoryService=t,this._commandService=n,this._contextKeyService=o,this._instantiationService=r,this._logService=s,this._telemetryService=a,this._lineSuffix=new Kr,this._toDispose=new Be,this._selectors=new Bwt(u=>u.priority),this._onWillInsertSuggestItem=new le,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=r.createInstance(hU,this.editor),this._selectors.register({priority:0,select:(u,h,f)=>this._memoryService.select(u,h,f)});const l=sn.InsertMode.bindTo(o);l.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(117).insertMode))),this.widget=this._toDispose.add(new oM(()=>{const u=this._instantiationService.createInstance(Gk,this.editor);this._toDispose.add(u),this._toDispose.add(u.onDidSelect(v=>this._insertSuggestion(v,0),this));const h=new pwt(this.editor,u,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(h);const f=sn.MakesTextEdit.bindTo(this._contextKeyService),g=sn.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=sn.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(zt(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(u.onDidFocus(({item:v})=>{const m=this.editor.getPosition(),_=v.editStart.column,y=m.column;let w=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&y-_===v.completion.insertText.length&&(w=this.editor.getModel().getValueInRange({startLineNumber:m.lineNumber,startColumn:_,endLineNumber:m.lineNumber,endColumn:y})!==v.completion.insertText),f.set(w),g.set(!ae.equals(v.editInsertEnd,v.editReplaceEnd)),p.set(Boolean(v.provider.resolveCompletionItem)||Boolean(v.completion.documentation)||v.completion.detail!==v.completion.label)})),this._toDispose.add(u.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new cp(!0,!1,!1,!1,33))||Nn&&v.toKeyCodeChord().equals(new cp(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),u})),this._overtypingCapturer=this._toDispose.add(new oM(()=>this._toDispose.add(new NF(this.editor,this.model)))),this._alternatives=this._toDispose.add(new oM(()=>this._toDispose.add(new wb(this.editor,this._contextKeyService)))),this._toDispose.add(r.createInstance(qk,e)),this._toDispose.add(this.model.onDidTrigger(u=>{this.widget.value.showTriggered(u.auto,u.shy?250:50),this._lineSuffix.value=new Fwt(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=sn.AcceptSuggestionsOnEnter.bindTo(o),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 n=qr.get(this.editor);if(!n)return;this._onWillInsertSuggestItem.fire({item:e.item});const o=this.editor.getModel(),r=o.getAlternativeVersionId(),{item:s}=e,a=[],l=new Ro;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,Boolean(t&8));this._memoryService.memorize(o,this.editor.getPosition(),s);const d=s.isResolved;let u=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const g=Zu.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(p=>Gi.replaceMove(V.lift(p.range),p.text))),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const g=new Ls;let p;const v=o.onDidChangeContent(w=>{if(w.isFlush){l.cancel(),v.dispose();return}for(const L of w.changes){const D=V.getEndPosition(L.range);(!p||ae.isBefore(D,p))&&(p=D)}}),m=t;t|=2;let _=!1;const y=this.editor.onWillType(()=>{y.dispose(),_=!0,m&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&s.completion.additionalTextEdits.some(L=>ae.isBefore(p,V.getStartPosition(L.range))))return!1;_&&this.editor.pushUndoStop();const w=Zu.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(L=>Gi.replaceMove(V.lift(L.range),L.text))),w.restoreRelativeVerticalPositionOfCursor(this.editor),(_||!(m&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(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=Yw.escape(f)),this.model.cancel(),n.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===LT.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Ls;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(p=>{s.completion.extensionId?$o(p):en(p)}).finally(()=>{u=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();o.canUndo();){r!==o.getAlternativeVersionId()&&o.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,o,d,u,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,n,o,r){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:H0e($c(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:$st(t.uri),resolveInfo:e.provider.resolveCompletionItem?n?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:o,additionalEditsAsync:r})}getOverwriteInfo(e,t){fi(this.editor.hasModel());let n=this.editor.getOption(117).insertMode==="replace";t&&(n=!n);const o=e.position.column-e.editStart.column,r=(n?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:o+s,overwriteAfter:r+a}}_alertCompletionItem(e){if(ws(e.completion.additionalTextEdits)){const t=C("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Cs(t)}}triggerSuggest(e,t,n){this.editor.hasModel()&&(this.model.trigger({auto:t!=null?t:!1,completionOptions:{providerFilter:e,kindFilter:n?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(),n=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},o=r=>{if(r.completion.insertTextRules&4||r.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=r.editStart.column,l=s.column;return l-a!==r.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==r.completion.insertText};st.once(this.model.onDidTrigger)(r=>{const s=[];st.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{si(s),n()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(si(s),a.items.length===0){n();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!o(c)){n();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const n=this.widget.value.getFocusedItem();let o=0;e&&(o|=4),t&&(o|=8),this._insertSuggestion(n,o)}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)}};Ed.ID="editor.contrib.suggestController";Ed=mU=Owt([nC(1,TF),nC(2,_o),nC(3,Ut),nC(4,$t),nC(5,nc),nC(6,tc)],Ed);class Bwt{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,n)=>this.prioritySelector(n)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class LT extends ft{constructor(){super({id:LT.id,label:C("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:Me.and(Q.writable,Q.hasCompletionItemProvider,sn.Visible.toNegated()),kbOpts:{kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,n){const o=Ed.get(t);if(!o)return;let r;n&&typeof n=="object"&&n.auto===!0&&(r=!0),o.triggerSuggest(void 0,r,void 0)}}LT.id="editor.action.triggerSuggest";Un(Ed.ID,Ed,2);ze(LT);const Ql=100+90,_a=Ir.bindToContribution(Ed.get);Ye(new _a({id:"acceptSelectedSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion),handler(i){i.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Me.and(sn.Visible,Q.textInputFocus),weight:Ql},{primary:3,kbExpr:Me.and(sn.Visible,Q.textInputFocus,sn.AcceptSuggestionsOnEnter,sn.MakesTextEdit),weight:Ql}],menuOpts:[{menuId:sv,title:C("accept.insert","Insert"),group:"left",order:1,when:sn.HasInsertAndReplaceRange.toNegated()},{menuId:sv,title:C("accept.insert","Insert"),group:"left",order:1,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("insert"))},{menuId:sv,title:C("accept.replace","Replace"),group:"left",order:1,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("replace"))}]}));Ye(new _a({id:"acceptAlternativeSelectedSuggestion",precondition:Me.and(sn.Visible,Q.textInputFocus,sn.HasFocusedSuggestion),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:1027,secondary:[1026]},handler(i){i.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:sv,group:"left",order:2,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("insert")),title:C("accept.replace","Replace")},{menuId:sv,group:"left",order:2,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("replace")),title:C("accept.insert","Insert")}]}));Rn.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Ye(new _a({id:"hideSuggestWidget",precondition:sn.Visible,handler:i=>i.cancelSuggestWidget(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:9,secondary:[1033]}}));Ye(new _a({id:"selectNextSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Ye(new _a({id:"selectNextPageSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextPageSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:12,secondary:[2060]}}));Ye(new _a({id:"selectLastSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectLastSuggestion()}));Ye(new _a({id:"selectPrevSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Ye(new _a({id:"selectPrevPageSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevPageSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:11,secondary:[2059]}}));Ye(new _a({id:"selectFirstSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectFirstSuggestion()}));Ye(new _a({id:"focusSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion.negate()),handler:i=>i.focusSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));Ye(new _a({id:"focusAndAcceptSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion.negate()),handler:i=>{i.focusSuggestion(),i.acceptSelectedSuggestion(!0,!1)}}));Ye(new _a({id:"toggleSuggestionDetails",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion),handler:i=>i.toggleSuggestionDetails(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:sv,group:"right",order:1,when:Me.and(sn.DetailsVisible,sn.CanResolve),title:C("detail.more","show less")},{menuId:sv,group:"right",order:1,when:Me.and(sn.DetailsVisible.toNegated(),sn.CanResolve),title:C("detail.less","show more")}]}));Ye(new _a({id:"toggleExplainMode",precondition:sn.Visible,handler:i=>i.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));Ye(new _a({id:"toggleSuggestionFocus",precondition:sn.Visible,handler:i=>i.toggleSuggestionFocus(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2570,mac:{primary:778}}}));Ye(new _a({id:"insertBestCompletion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),qk.AtEnd,sn.Visible.toNegated(),wb.OtherSuggestions.toNegated(),qr.InSnippetMode.toNegated()),handler:(i,e)=>{i.triggerSuggestAndAcceptBest(ia(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:Ql,primary:2}}));Ye(new _a({id:"insertNextSuggestion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),wb.OtherSuggestions,sn.Visible.toNegated(),qr.InSnippetMode.toNegated()),handler:i=>i.acceptNextSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2}}));Ye(new _a({id:"insertPrevSuggestion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),wb.OtherSuggestions,sn.Visible.toNegated(),qr.InSnippetMode.toNegated()),handler:i=>i.acceptPrevSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:1026}}));ze(class extends ft{constructor(){super({id:"editor.action.resetSuggestSize",label:C("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(i,e){var t;(t=Ed.get(e))===null||t===void 0||t.resetWidgetSize()}});class Wwt extends _e{get selectedItem(){return this._selectedItem}constructor(e,t,n,o){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=n,this.onWillAccept=o,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Ai(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const r=Ed.get(this.editor);if(r){this._register(r.registerSelector({priority:100,select:(l,c,d)=>{var u;qi(m=>this.checkModelVersion(m));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=ae.lift(c),p=d.map((m,_)=>{const w=OE.fromSuggestion(r,h,g,m,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),L=f.augments(w);return{index:_,valid:L,prefixLength:w.text.length,suggestItem:m}}).filter(m=>m&&m.valid&&m.prefixLength>0),v=U0e(p,Rc(m=>m.prefixLength,jg));return v?v.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(r.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(r.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(r.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(st.once(r.model.onDidTrigger)(l=>{a()})),this._register(r.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),d=this.editor.getModel();if(!c||!d)return;const u=OE.fromSuggestion(r,d,c,l.item,this.isShiftKeyPressed);this.onWillAccept(u)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!Vwt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,qi(n=>{this.checkModelVersion(n),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,n)}))}getSuggestItemInfo(){const e=Ed.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),n=this.editor.getPosition(),o=this.editor.getModel();if(!(!t||!n||!o))return OE.fromSuggestion(e,o,n,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Ed.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Ed.get(this.editor);e==null||e.forceRenderingAbove()}}class OE{static fromSuggestion(e,t,n,o,r){let{insertText:s}=o.completion,a=!1;if(o.completion.insertTextRules&4){const c=new Yw().parse(s);c.children.length<100&&IO.adjustWhitespace(t,n,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(o,r);return new OE(V.fromPositions(n.delta(0,-l.overwriteBefore),n.delta(0,Math.max(l.overwriteAfter,0))),s,o.completion.kind,a)}constructor(e,t,n,o){this.range=e,this.insertText=t,this.completionItemKind=n,this.isSnippetText=o}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new V_e(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new Zw(this.range,this.insertText)}}function Vwt(i,e){return i===e?!0:!i||!e?!1:i.equals(e)}var Hwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jp=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},vU;let Jl=vU=class extends _e{static get(e){return e.getContribution(vU.ID)}constructor(e,t,n,o,r,s,a,l,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=n,this.configurationService=o,this.commandService=r,this.debounceService=s,this.languageFeaturesService=a,this.audioCueService=l,this._keybindingService=c,this.model=tO("inlineCompletionModel",void 0),this.textModelVersionId=Ai(this,-1),this.cursorPosition=Ai(this,new ae(1,1)),this.suggestWidgetAdaptor=this._register(new Wwt(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,Nl.Other),h=>{qi(f=>{var g;this.updateObservables(f,Nl.Other),(g=this.model.get())===null||g===void 0||g.handleSuggestAccepted(h)})})),this._enabled=$r(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(aU,this.editor,{ghostText:this.model.map((h,f)=>h==null?void 0:h.ghostText.read(f)),minReservedLineCount:nO(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 Dr(this.contextKeyService,this.model)),this._register(st.runAndSubscribe(e.onDidChangeModel,()=>qi(h=>{this.model.set(void 0,h),this.updateObservables(h,Nl.Other);const f=e.getModel();if(f){const g=t.createInstance(cU,f,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,$r(e.onDidChangeConfiguration,()=>e.getOption(117).preview),$r(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),$r(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(g,h)}})));const d=h=>{var f;return h.isUndoing?Nl.Undo:h.isRedoing?Nl.Redo:!((f=this.model.get())===null||f===void 0)&&f.isAcceptingPartially?Nl.AcceptWord:Nl.Other};this._register(e.onDidChangeModelContent(h=>qi(f=>this.updateObservables(f,d(h))))),this._register(e.onDidChangeCursorPosition(h=>qi(f=>{var g;this.updateObservables(f,Nl.Other),(h.reason===3||h.source==="api")&&((g=this.model.get())===null||g===void 0||g.stop(f))}))),this._register(e.onDidType(()=>qi(h=>{var f;this.updateObservables(h,Nl.Other),this._enabled.get()&&((f=this.model.get())===null||f===void 0||f.trigger(h))}))),this._register(this.commandService.onDidExecuteCommand(h=>{new Set([ky.Tab.id,ky.DeleteLeft.id,ky.DeleteRight.id,Ewe,"acceptSelectedSuggestion"]).has(h.commandId)&&e.hasTextFocus()&&this._enabled.get()&&qi(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||Hv.dropDownVisible||qi(h=>{var f;(f=this.model.get())===null||f===void 0||f.stop(h)})})),this._register(Ii(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(zt(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let u;this._register(Ii(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(Wn.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(g.ghostText.renderForScreenReader(p))})}})),this._register(new Bz(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"),n=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let o;!t&&n&&this.editor.getOption(147)&&(o=C("showAccessibleViewHint","Inspect this in the accessible view ({0})",n.getAriaLabel())),Cs(o?e+", "+o:e)}updateObservables(e,t){var n,o;const r=this.editor.getModel();this.textModelVersionId.set((n=r==null?void 0:r.getVersionId())!==null&&n!==void 0?n:-1,e,t),this.cursorPosition.set((o=this.editor.getPosition())!==null&&o!==void 0?o:new ae(1,1),e)}shouldShowHoverAt(e){var t;const n=(t=this.model.get())===null||t===void 0?void 0:t.ghostText.get();return n?n.parts.some(o=>e.containsPosition(new ae(n.lineNumber,o.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};Jl.ID="editor.contrib.inlineCompletionsController";Jl=vU=Hwt([jp(1,$t),jp(2,Ut),jp(3,En),jp(4,_o),jp(5,qc),jp(6,pt),jp(7,hT),jp(8,xi)],Jl);var i_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class RF extends ft{constructor(){super({id:RF.ID,label:C("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.next()})}}RF.ID=kwe;class MF extends ft{constructor(){super({id:MF.ID,label:C("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.previous()})}}MF.ID=Dwe;class $wt extends ft{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:C("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:Q.writable})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.triggerExplicitly()})}}class zwt extends ft{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:C("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:Me.and(Q.writable,Dr.inlineSuggestionVisible)},menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);yield(n=o==null?void 0:o.model.get())===null||n===void 0?void 0:n.acceptNextWord(o.editor)})}}class Uwt extends ft{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:C("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);yield(n=o==null?void 0:o.model.get())===null||n===void 0?void 0:n.acceptNextLine(o.editor)})}}class jwt extends ft{constructor(){super({id:Ewe,label:C("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Dr.inlineSuggestionVisible,menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:Me.and(Dr.inlineSuggestionVisible,Q.tabMovesFocus.toNegated(),Dr.inlineSuggestionHasIndentationLessThanTabSize,sn.Visible.toNegated(),Q.hoverFocused.toNegated())}})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);o&&((n=o.model.get())===null||n===void 0||n.accept(o.editor),o.editor.focus())})}}class AF extends ft{constructor(){super({id:AF.ID,label:C("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Dr.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return i_(this,void 0,void 0,function*(){const n=Jl.get(t);qi(o=>{var r;(r=n==null?void 0:n.model.get())===null||r===void 0||r.stop(o)})})}}AF.ID="editor.action.inlineSuggest.hide";class PF extends ec{constructor(){super({id:PF.ID,title:C("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Z.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Me.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return i_(this,void 0,void 0,function*(){const n=e.get(En),r=n.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";n.updateValue("editor.inlineSuggest.showToolbar",r)})}}PF.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var Kwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class qwt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let _U=class{constructor(e,t,n,o,r,s){this._editor=e,this._languageService=t,this._openerService=n,this.accessibilityService=o,this._instantiationService=r,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Jl.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const o=n.detail;if(t.shouldShowHoverAtViewZone(o.viewZoneId))return new IM(1e3,this,V.fromPositions(this._editor.getModel().validatePosition(o.positionBefore||o.position)),e.event.posx,e.event.posy,!1)}return n.type===7&&t.shouldShowHoverAt(n.range)?new IM(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new IM(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar==="always")return[];const n=Jl.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new qwt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Be,o=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,o,n);const r=o.controller.model.get(),s=this._instantiationService.createInstance(Hv,this._editor,!1,nO(null),r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.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(s.getDomNode()),r.triggerExplicitly(),n.add(s),n}renderScreenReaderText(e,t,n){const o=He,r=o("div.hover-row.markdown-hover"),s=Ae(r,o("div.hover-contents",{["aria-live"]:"assertive"})),a=n.add(new up({editor:this._editor},this._languageService,this._openerService)),l=c=>{n.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=C("inlineSuggestionFollows","Suggestion:"),u=n.add(a.render(new os().appendText(d).appendCodeblock("text",c)));s.replaceChildren(u.element)};n.add(Ii(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 jr(s)})),e.fragment.appendChild(r)}};_U=Kwt([oL(1,Ki),oL(2,ml),oL(3,_p),oL(4,$t),oL(5,tc)],_U);Un(Jl.ID,Jl,3);ze($wt);ze(RF);ze(MF);ze(zwt);ze(Uwt);ze(jwt);ze(AF);$i(PF);n1.register(_U);function Ya(i,e){let t=0;for(let n=0;n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Xwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function gSe(i,e,t,n,o){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return[];const r=e.getLanguageConfiguration(i.getLanguageId()).indentationRules;if(!r)return[];for(n=Math.min(n,i.getLineCount());t<=n&&r.unIndentedLinePattern;){const v=i.getLineContent(t);if(!r.unIndentedLinePattern.test(v))break;t++}if(t>n-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=i.getOptions(),c=(v,m)=>(m=m||1,Ec.shiftIndent(v,v.length+m,s,a,l)),d=(v,m)=>(m=m||1,Ec.unshiftIndent(v,v.length+m,s,a,l)),u=[];let h;const f=i.getLineContent(t);let g=f;if(o!=null){h=o;const v=Si(f);g=h+f.substring(v.length),r.decreaseIndentPattern&&r.decreaseIndentPattern.test(g)&&(h=d(h),g=h+f.substring(v.length)),f!==g&&u.push(Gi.replaceMove(new gt(t,1,t,v.length+1),hP(h,a,l)))}else h=Si(f);let p=h;r.increaseIndentPattern&&r.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):r.indentNextLinePattern&&r.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let v=t;v<=n;v++){const m=i.getLineContent(v),_=Si(m),y=p+m.substring(_.length);r.decreaseIndentPattern&&r.decreaseIndentPattern.test(y)&&(p=d(p),h=d(h)),_!==p&&u.push(Gi.replaceMove(new gt(v,1,v,_.length+1),hP(p,a,l))),!(r.unIndentedLinePattern&&r.unIndentedLinePattern.test(m))&&(r.increaseIndentPattern&&r.increaseIndentPattern.test(y)?(h=c(h),p=h):r.indentNextLinePattern&&r.indentNextLinePattern.test(y)?p=c(p):p=h)}return u}class OF extends ft{constructor(){super({id:OF.ID,label:C("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:Q.writable})}run(e,t){const n=t.getModel();if(!n)return;const o=n.getOptions(),r=t.getSelection();if(!r)return;const s=new Jwt(r,o.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!0})}}OF.ID="editor.action.indentationToSpaces";class FF extends ft{constructor(){super({id:FF.ID,label:C("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:Q.writable})}run(e,t){const n=t.getModel();if(!n)return;const o=n.getOptions(),r=t.getSelection();if(!r)return;const s=new eSt(r,o.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!1})}}FF.ID="editor.action.indentationToTabs";class WY extends ft{constructor(e,t,n){super(n),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const n=e.get(dh),o=e.get(Yi),r=t.getModel();if(!r)return;const s=o.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget),a=r.getOptions(),l=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===s.tabSize&&d===a.tabSize?C("configuredTabSize","Configured Tab Size"):d===s.tabSize?C("defaultTabSize","Default Tab Size"):d===a.tabSize?C("currentTabSize","Current Tab Size"):void 0})),c=Math.min(r.getOptions().tabSize-1,7);setTimeout(()=>{n.pick(l,{placeHolder:C({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(d=>{if(d&&r&&!r.isDisposed()){const u=parseInt(d.label,10);this.displaySizeOnly?r.updateOptions({tabSize:u}):r.updateOptions({tabSize:u,indentSize:u,insertSpaces:this.insertSpaces})}})},50)}}class BF extends WY{constructor(){super(!1,!1,{id:BF.ID,label:C("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}BF.ID="editor.action.indentUsingTabs";class WF extends WY{constructor(){super(!0,!1,{id:WF.ID,label:C("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}WF.ID="editor.action.indentUsingSpaces";class VF extends WY{constructor(){super(!0,!0,{id:VF.ID,label:C("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}VF.ID="editor.action.changeTabDisplaySize";class HF extends ft{constructor(){super({id:HF.ID,label:C("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const n=e.get(Yi),o=t.getModel();if(!o)return;const r=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget);o.detectIndentation(r.insertSpaces,r.tabSize)}}HF.ID="editor.action.detectIndentation";class Ywt extends ft{constructor(){super({id:"editor.action.reindentlines",label:C("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:Q.writable})}run(e,t){const n=e.get(Ti),o=t.getModel();if(!o)return;const r=gSe(o,n,1,o.getLineCount());r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class Zwt extends ft{constructor(){super({id:"editor.action.reindentselectedlines",label:C("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:Q.writable})}run(e,t){const n=e.get(Ti),o=t.getModel();if(!o)return;const r=t.getSelections();if(r===null)return;const s=[];for(const a of r){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=gSe(o,n,l,c);s.push(...d)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class Qwt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const n of e)n.range&&typeof n.text=="string"&&this._edits.push(n)}getEditOperations(e,t){for(const o of this._edits)t.addEditOperation(V.lift(o.range),o.text);let n=!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?(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),n||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let Xk=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 n=this.editor.getModel();if(!n||!n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const o=this.editor.getOption(12),{tabSize:r,indentSize:s,insertSpaces:a}=n.getOptions(),l=[],c={shiftIndent:f=>Ec.shiftIndent(f,f.length+1,r,s,a),unshiftIndent:f=>Ec.unshiftIndent(f,f.length+1,r,s,a)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(n,d)){d++;continue}break}if(d>e.endLineNumber)return;let u=n.getLineContent(d);if(!/\S/.test(u.substring(0,e.startColumn-1))){const f=pE(o,n,n.getLanguageId(),d,c,this._languageConfigurationService);if(f!==null){const g=Si(u),p=Ya(f,r),v=Ya(g,r);if(p!==v){const m=FE(p,r,a);l.push({range:new V(d,1,d,g.length+1),text:m}),u=m+u.substr(g.length)}else{const m=Nbe(n,d,this._languageConfigurationService);if(m===0||m===8)return}}}const h=d;for(;dn.tokenization.getLineTokens(p),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(p,v)=>n.getLanguageIdAtPosition(p,v)},getLineContent:p=>p===h?u:n.getLineContent(p)},n.getLanguageId(),d+1,c,this._languageConfigurationService);if(g!==null){const p=Ya(g,r),v=Ya(Si(n.getLineContent(d+1)),r);if(p!==v){const m=p-v;for(let _=d+1;_<=e.endLineNumber;_++){const y=n.getLineContent(_),w=Si(y),D=Ya(w,r)+m,E=FE(D,r,a);E!==w&&l.push({range:new V(_,1,_,w.length+1),text:E})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new Qwt(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const n=e.getLineFirstNonWhitespaceColumn(t);if(n===0)return!0;const o=e.tokenization.getLineTokens(t);if(o.getCount()>0){const r=o.findTokenIndexAtOffset(n);if(r>=0&&o.getStandardTokenType(r)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};Xk.ID="editor.contrib.autoIndentOnPaste";Xk=Gwt([Xwt(1,Ti)],Xk);function pSe(i,e,t,n){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let o="";for(let s=0;sthis._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var t,n;return TO(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=o==null?void 0:o.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(n=o==null?void 0:o.label)!==null&&n!==void 0?n:this.hint.label,this._isResolved=!0}catch(o){$o(o),this._isResolved=!1}})}}class Yk{static create(e,t,n,o){return TO(this,void 0,void 0,function*(){const r=[],s=e.ordered(t).reverse().map(a=>n.map(l=>TO(this,void 0,void 0,function*(){try{const c=yield a.provideInlayHints(t,l,o);c!=null&&c.hints.length&&r.push([c,a])}catch(c){$o(c)}})));if(yield Promise.all(s.flat()),o.isCancellationRequested||t.isDisposed())throw new Yv;return new Yk(n,r,t)})}constructor(e,t,n){this._disposables=new Be,this.ranges=e,this.provider=new Set;const o=[];for(const[r,s]of t){this._disposables.add(r),this.provider.add(s);for(const a of r.hints){const l=n.validatePosition(a.position);let c="before";const d=Yk._getRangeAtPosition(n,l);let u;d.getStartPosition().isBefore(l)?(u=V.fromPositions(d.getStartPosition(),l),c="after"):(u=V.fromPositions(l,d.getEndPosition()),c="before"),o.push(new VY(a,new mSe(u,c),s))}}this.items=o.sort((r,s)=>ae.compare(r.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const n=t.lineNumber,o=e.getWordAtPosition(t);if(o)return new V(n,o.startColumn,n,o.endColumn);e.tokenization.tokenizeIfCheap(n);const r=e.tokenization.getLineTokens(n),s=t.column-1,a=r.findTokenIndexAtOffset(s);let l=r.getStartOffset(a),c=r.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=r.getStartOffset(a-1),c=r.getEndOffset(a-1)):c===s&&aNC(g)?g.command.id:bF()));for(const g of Bs.all())h.has(g.desc.id)&&u.push(new ca(g.desc.id,Fd.label(g.desc,{renderShortTitle:!0}),void 0,!0,()=>BE(this,void 0,void 0,function*(){const p=yield r.createModelReference(d.uri);try{const v=new Uw(p.object.textEditorModel,V.getStartPosition(d.range)),m=n.item.anchor.range;yield l.invokeFunction(g.runEditorCommand.bind(g),e,v,m)}finally{p.dispose()}})));if(n.part.command){const{command:g}=n.part;u.push(new kr),u.push(new ca(g.id,g.title,void 0,!0,()=>BE(this,void 0,void 0,function*(){var p;try{yield a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(v){c.notify({severity:D5.Error,source:n.item.provider.displayName,message:v})}})))}const f=e.getOption(126);s.showContextMenu({domForShadowRoot:f&&(o=e.getDomNode())!==null&&o!==void 0?o:void 0,getAnchor:()=>{const g=Yo(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>u,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function vSe(i,e,t,n){return BE(this,void 0,void 0,function*(){const r=yield i.get(za).createModelReference(n.uri);yield t.invokeWithinContext(s=>BE(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=s.get(Ut),c=Ha.inPeekEditor.getValue(l),d=!a&&t.getOption(87)&&!c;return new ST({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new Uw(r.object.textEditorModel,V.getStartPosition(n.range)),V.lift(n.range))})),r.dispose()})}var iSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},vC=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},MM;class NO{constructor(){this._entries=new Qv(50)}get(e){const t=NO._key(e);return this._entries.get(t)}set(e,t){const n=NO._key(e);this._entries.set(n,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const _Se=yn("IInlayHintsCache");Mn(_Se,NO,1);class bU{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 oSt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let Sb=MM=class{static get(e){var t;return(t=e.getContribution(MM.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,n,o,r,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=o,this._commandService=r,this._notificationService=s,this._instaService=a,this._disposables=new Be,this._sessionDisposables=new Be,this._decorationsMetadata=new Map,this._ruleFactory=new XI(this._editor),this._activeRenderMode=0,this._debounceInfo=n.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 n=this._inlayHintsCache.get(t);n&&this._updateHintsDecorators([t.getFullModelRange()],n),this._sessionDisposables.add(zt(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let o;const r=new Set,s=new bi(()=>vC(this,void 0,void 0,function*(){const a=Date.now();o==null||o.dispose(!0),o=new Ro;const l=t.onWillDispose(()=>o==null?void 0:o.cancel());try{const c=o.token,d=yield Yk.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){d.dispose();return}for(const u of d.provider)typeof u.onDidChangeInlayHints=="function"&&!r.has(u)&&(r.add(u),this._sessionDisposables.add(u.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(c){en(c)}finally{o.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(s),this._sessionDisposables.add(zt(()=>o==null?void 0:o.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{const l=Math.max(s.delay,1250);s.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(Mg.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),s.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Be,t=e.add(new dF(this._editor)),n=new Be;return e.add(n),e.add(t.onMouseMoveOrRelevantKeyDown(o=>{const[r]=o,s=this._getInlayHintLabelPart(r),a=this._editor.getModel();if(!s||!a){n.clear();return}const l=new Ro;n.add(zt(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new oSt(s,r.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,d=new V(c,1,c,a.getLineMaxColumn(c)),u=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],u),n.add(zt(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],u)}))})),e.add(t.onCancel(()=>n.clear())),e.add(t.onExecute(o=>vC(this,void 0,void 0,function*(){const r=this._getInlayHintLabelPart(o);if(r){const s=r.part;s.location?this._instaService.invokeFunction(vSe,o,this._editor,s.location):tV.is(s.command)&&(yield this._invokeCommand(s.command,r.item))}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const n of this._decorationsMetadata.values())e.containsRange(n.item.anchor.range)&&t.add(n.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(t=>vC(this,void 0,void 0,function*(){if(t.event.detail!==2)return;const n=this._getInlayHintLabelPart(t);if(!!n&&(t.event.preventDefault(),yield n.item.resolve(_n.None),ws(n.item.hint.textEdits))){const o=n.item.hint.textEdits.map(r=>Gi.replace(V.lift(r.range),r.text));this._editor.executeEdits("inlayHint.default",o),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>vC(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(nSt,this._editor,e.event.target,t))}))}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(n instanceof Mv&&(n==null?void 0:n.attachedData)instanceof bU)return n.attachedData}_invokeCommand(e,t){var n;return vC(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(n=e.arguments)!==null&&n!==void 0?n:[])}catch(o){this._notificationService.notify({severity:D5.Error,source:t.provider.displayName,message:o})}})}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[n,o]of this._decorationsMetadata){if(t.has(o.item))continue;const r=e.getDecorationRange(n);if(r){const s=new mSe(r,o.item.anchor.direction),a=o.item.with({anchor:s});t.set(o.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),n=this._editor.getVisibleRangesPlusViewportAboveBelow(),o=[];for(const r of n.sort(V.compareRangesUsingStarts)){const s=t.validateRange(new V(r.startLineNumber-30,r.startColumn,r.endLineNumber+30,r.endColumn));o.length===0||!V.areIntersectingOrTouching(o[o.length-1],s)?o.push(s):o[o.length-1]=V.plusRange(o[o.length-1],s)}return o}_updateHintsDecorators(e,t){var n,o;const r=[],s=(p,v,m,_,y)=>{const w={content:m,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:_,attachedData:y};r.push({item:p,classNameRef:v,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,v)=>{const m=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(p,m,"\u200A",v?Nu.Right:Nu.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 v=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let m=0;mMM._MAX_DECORATORS)break}const f=[];for(const p of e)for(const{id:v}of(o=this._editor.getDecorationsInRange(p))!==null&&o!==void 0?o:[]){const m=this._decorationsMetadata.get(v);m&&(f.push(v),m.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const g=Zu.capture(this._editor);this._editor.changeDecorations(p=>{const v=p.deltaDecorations(f,r.map(m=>m.decoration));for(let m=0;mn)&&(r=n);const s=e.fontFamily||o;return{fontSize:r,fontFamily:s,padding:t,isUniform:!t&&s===o&&r===n}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};Sb.ID="editor.contrib.InlayHints";Sb._MAX_DECORATORS=1500;Sb=MM=iSt([iC(1,pt),iC(2,qc),iC(3,_Se),iC(4,_o),iC(5,Ao),iC(6,$t)],Sb);function rSt(i){const e="\xA0";return i.replace(/[ \t]/g,e)}Rn.registerCommand("_executeInlayHintProvider",(i,...e)=>vC(void 0,void 0,void 0,function*(){const[t,n]=e;fi(Rt.isUri(t)),fi(V.isIRange(n));const{inlayHintsProvider:o}=i.get(pt),r=yield i.get(za).createModelReference(t);try{const s=yield Yk.create(o,r.object.textEditorModel,[V.lift(n)],_n.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{r.dispose()}}));var sSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},rL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Hce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},aSt=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};class $ce extends IM{constructor(e,t,n,o){super(10,t,e.item.anchor.range,n,o,!0),this.part=e}}let CU=class extends vO{constructor(e,t,n,o,r,s){super(e,t,n,o,s),this._resolverService=r,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!Sb.get(this._editor)||e.target.type!==6)return null;const o=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return o instanceof Mv&&o.attachedData instanceof bU?new $ce(o.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,n){return e instanceof $ce?new Wo(o=>Hce(this,void 0,void 0,function*(){var r,s,a,l;const{part:c}=e;if(yield c.item.resolve(n),n.isCancellationRequested)return;let d;typeof c.item.hint.tooltip=="string"?d=new os().appendText(c.item.hint.tooltip):c.item.hint.tooltip&&(d=c.item.hint.tooltip),d&&o.emitOne(new Du(this,e.range,[d],!1,0)),ws(c.item.hint.textEdits)&&o.emitOne(new Du(this,e.range,[new os().appendText(C("hint.dbl","Double-click to insert"))],!1,10001));let u;if(typeof c.part.tooltip=="string"?u=new os().appendText(c.part.tooltip):c.part.tooltip&&(u=c.part.tooltip),u&&o.emitOne(new Du(this,e.range,[u],!1,1)),c.part.location||c.part.command){let v;const _=this._editor.getOption(77)==="altKey"?Nn?C("links.navigate.kb.meta.mac","cmd + click"):C("links.navigate.kb.meta","ctrl + click"):Nn?C("links.navigate.kb.alt.mac","option + click"):C("links.navigate.kb.alt","alt + click");c.part.location&&c.part.command?v=new os().appendText(C("hint.defAndCommand","Go to Definition ({0}), right click for more",_)):c.part.location?v=new os().appendText(C("hint.def","Go to Definition ({0})",_)):c.part.command&&(v=new os(`[${C("hint.cmd","Execute Command")}](${tSt(c.part.command)} "${c.part.command.title}") (${_})`,{isTrusted:!0})),v&&o.emitOne(new Du(this,e.range,[v],!1,1e4))}const h=yield this._resolveInlayHintLabelPartHover(c,n);try{for(var f=!0,g=aSt(h),p;p=yield g.next(),r=p.done,!r;f=!0){l=p.value,f=!1;const v=l;o.emitOne(v)}}catch(v){s={error:v}}finally{try{!f&&!r&&(a=g.return)&&(yield a.call(g))}finally{if(s)throw s.error}}})):Wo.EMPTY}_resolveInlayHintLabelPartHover(e,t){return Hce(this,void 0,void 0,function*(){if(!e.part.location)return Wo.EMPTY;const{uri:n,range:o}=e.part.location,r=yield this._resolverService.createModelReference(n);try{const s=r.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?vY(this._languageFeaturesService.hoverProvider,s,new ae(o.startLineNumber,o.startColumn),t).filter(a=>!Pw(a.hover.contents)).map(a=>new Du(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Wo.EMPTY}finally{r.dispose()}})}};CU=sSt([rL(1,Ki),rL(2,ml),rL(3,En),rL(4,za),rL(5,pt)],CU);Un(Sb.ID,Sb,1);n1.register(CU);class lSt{constructor(e,t,n){this._editRange=e,this._originalSelection=t,this._text=n}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const o=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new gt(o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn),o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn)):new gt(o.endLineNumber,o.endColumn-this._text.length,o.endLineNumber,o.endColumn)}}var cSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},dSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},AM;let zv=AM=class{static get(e){return e.getContribution(AM.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var n;(n=this.currentRequest)===null||n===void 0||n.cancel();const o=this.editor.getSelection(),r=this.editor.getModel();if(!r||!o)return;let s=o;if(s.startLineNumber!==s.endLineNumber)return;const a=new Ak(this.editor,5),l=r.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=sr(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var d;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const u=V.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new gt(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new lSt(u,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:AM.DECORATION}]),(d=this.decorationRemover)===null||d===void 0||d.cancel(),this.decorationRemover=xv(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(en)}).catch(en)):Promise.resolve(void 0)}};zv.ID="editor.contrib.inPlaceReplaceController";zv.DECORATION=Jt.register({description:"in-place-replace",className:"valueSetReplacement"});zv=AM=cSt([dSt(1,Xd)],zv);class uSt extends ft{constructor(){super({id:"editor.action.inPlaceReplace.up",label:C("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3159,weight:100}})}run(e,t){const n=zv.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)}}class hSt extends ft{constructor(){super({id:"editor.action.inPlaceReplace.down",label:C("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3161,weight:100}})}run(e,t){const n=zv.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)}}Un(zv.ID,zv,4);ze(uSt);ze(hSt);class fSt extends ft{constructor(){super({id:"expandLineSelection",label:C("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:Q.textInputFocus,primary:2090}})}run(e,t,n){if(n=n||{},!t.hasModel())return;const o=t._getViewModel();o.model.pushStackElement(),o.setCursorStates(n.source,3,Mr.expandLineSelection(o,o.getCursorStates())),o.revealPrimaryCursor(n.source,!0)}}ze(fSt);class gSt{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const n=pSt(e,this._cursors);for(let o=0,r=n.length;os.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let n=0,o=0;const r=e.length;for(let s=1,a=i.getLineCount();s<=a;s++){const l=i.getLineContent(s),c=l.length+1;let d=0;if(o1e5?`${r.substr(0,1e5)}\u2026`:r;this._type.textContent=a,this._type.title=a,nl(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ur(this._type),this._type.title="",Js(this._type),this.domNode.classList.add("no-type");if(Ur(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Ur(this._docs);const a=this._markdownRenderer.render(s);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 n=new Kn(e,t);Kn.equals(n,this._size)||(this._size=n,HQe(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}};pU=Lwt([Ewt(1,$t)],pU);class Dwt{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new Be,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new mY,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let n,o,r=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{n=this._topLeft,o=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(n&&o){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=o.width-a.dimension.width,l=!0),a.north&&(r=o.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:n.top+r,left:n.left+s})}a.done&&(n=void 0,o=void 0,r=0,s=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 n;const o=e.getBoundingClientRect();this._anchorBox=o,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(n=this._userSize)!==null&&n!==void 0?n:this.widget.size,t)}_placeAtAnchor(e,t,n){var o;const r=bS(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new Kn(220,2*s.lineHeight),l=e.top,c=function(){const y=r.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),w=-s.borderWidth+e.left+e.width,L=new Kn(y,r.height-e.top-s.borderHeight-s.verticalPadding),D=L.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:w,fit:y-t.width,maxSizeTop:L,maxSizeBottom:D,minSize:a.with(Math.min(y,a.width))}}(),d=function(){const y=e.left-s.borderWidth-s.horizontalPadding,w=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),L=new Kn(y,r.height-e.top-s.borderHeight-s.verticalPadding),D=L.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:w,fit:y-t.width,maxSizeTop:L,maxSizeBottom:D,minSize:a.with(Math.min(y,a.width))}}(),u=function(){const y=e.left,w=-s.borderWidth+e.top+e.height,L=new Kn(e.width-s.borderHeight,r.height-e.top-e.height-s.verticalPadding);return{top:w,left:y,fit:L.height-t.height,maxSizeBottom:L,maxSizeTop:L,minSize:a.with(L.width)}}(),h=[c,d,u],f=(o=h.find(y=>y.fit>=0))!==null&&o!==void 0?o:h.sort((y,w)=>w.fit-y.fit)[0],g=e.top+e.height-s.borderHeight;let p,v=t.height;const m=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);v>m&&(v=m);let _;n?v<=f.maxSizeTop.height?(p=!0,_=f.maxSizeTop):(p=!1,_=f.maxSizeBottom):v<=f.maxSizeBottom.height?(p=!1,_=f.maxSizeBottom):(p=!0,_=f.maxSizeTop),this._applyTopLeft({left:f.left,top:p?f.top:g-v}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=_,this._resizable.layout(v,Math.min(_.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var $g;(function(i){i[i.FILE=0]="FILE",i[i.FOLDER=1]="FOLDER",i[i.ROOT_FOLDER=2]="ROOT_FOLDER"})($g||($g={}));const kwt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function uR(i,e,t,n){const o=n===$g.ROOT_FOLDER?["rootfolder-icon"]:n===$g.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===hn.data)r=Nv.parseMetaData(t).get(Nv.META_DATA_LABEL);else{const s=t.path.match(kwt);s?(r=hR(s[2].toLowerCase()),s[1]&&o.push(`${hR(s[1].toLowerCase())}-name-dir-icon`)):r=hR(t.authority.toLowerCase())}if(n===$g.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const a=r.split(".");for(let l=1;l=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jp;function fSe(i){return`suggest-aria-id:${i}`}const Nwt=Eo("suggest-more-info",Xe.chevronRight,C("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),Rwt=new(jp=class{extract(e,t){if(e.textLabel.match(jp._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(jp._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const n=jp._regexRelaxed.exec(e.completion.documentation);if(n&&(n.index===0||n.index+n[0].length===e.completion.documentation.length))return t[0]=n[0],!0}return!1}},jp._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*\))/,jp._regexStrict=new RegExp(`^${jp._regexRelaxed.source}$`,"i"),jp);let mU=class{constructor(e,t,n,o){this._editor=e,this._modelService=t,this._languageService=n,this._themeService=o,this._onDidToggleDetails=new le,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Be,n=e;n.classList.add("show-file-icons");const o=Ae(e,He(".icon")),r=Ae(o,He("span.colorspan")),s=Ae(e,He(".contents")),a=Ae(s,He(".main")),l=Ae(a,He(".icon-label.codicon")),c=Ae(a,He("span.left")),d=Ae(a,He("span.right")),u=new ZP(c,{supportHighlights:!0,supportIcons:!0});t.add(u);const h=Ae(c,He("span.signature-label")),f=Ae(c,He("span.qualifier-label")),g=Ae(d,He("span.details-label")),p=Ae(d,He("span.readMore"+Mt.asCSSSelector(Nwt)));p.title=C("readMore","Read More");const v=()=>{const m=this._editor.getOptions(),_=m.get(50),y=_.getMassagedFontFamily(),w=_.fontFeatureSettings,L=m.get(118)||_.fontSize,D=m.get(119)||_.lineHeight,E=_.fontWeight,I=_.letterSpacing,k=`${L}px`,R=`${D}px`,A=`${I}px`;n.style.fontSize=k,n.style.fontWeight=E,n.style.letterSpacing=A,a.style.fontFamily=y,a.style.fontFeatureSettings=w,a.style.lineHeight=R,o.style.height=R,o.style.width=R,p.style.height=R,p.style.width=R};return v(),t.add(this._editor.onDidChangeConfiguration(m=>{(m.hasChanged(50)||m.hasChanged(118)||m.hasChanged(119))&&v()})),{root:n,left:c,right:d,icon:o,colorspan:r,iconLabel:u,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t}}renderElement(e,t,n){const{completion:o}=e;n.root.id=fSe(t),n.colorspan.style.backgroundColor="";const r={labelEscapeNewLines:!0,matches:rT(e.score)},s=[];if(o.kind===19&&Rwt.extract(e,s))n.icon.className="icon customcolor",n.iconContainer.className="icon hide",n.colorspan.style.backgroundColor=s[0];else if(o.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){n.icon.className="icon hide",n.iconContainer.className="icon hide";const a=uR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:e.textLabel}),$g.FILE),l=uR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:o.detail}),$g.FILE);r.extraClasses=a.length>l.length?a:l}else o.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(n.icon.className="icon hide",n.iconContainer.className="icon hide",r.extraClasses=[uR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:e.textLabel}),$g.FOLDER),uR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:o.detail}),$g.FOLDER)].flat()):(n.icon.className="icon hide",n.iconContainer.className="",n.iconContainer.classList.add("suggest-icon",...Mt.asClassNameArray(RD.toIcon(o.kind))));o.tags&&o.tags.indexOf(1)>=0&&(r.extraClasses=(r.extraClasses||[]).concat(["deprecated"]),r.matches=[]),n.iconLabel.setLabel(e.textLabel,void 0,r),typeof o.label=="string"?(n.parametersLabel.textContent="",n.detailsLabel.textContent=b7(o.detail||""),n.root.classList.add("string-label")):(n.parametersLabel.textContent=b7(o.label.detail||""),n.detailsLabel.textContent=b7(o.label.description||""),n.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?nl(n.detailsLabel):Js(n.detailsLabel),WY(e)?(n.right.classList.add("can-expand-details"),nl(n.readMore),n.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},n.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(n.right.classList.remove("can-expand-details"),Js(n.readMore),n.readMore.onmousedown=null,n.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};mU=Twt([_7(1,Yi),_7(2,Ki),_7(3,vr)],mU);function b7(i){return i.replace(/\r\n|\r|\n/g,"")}var Mwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Awt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},mC;J("editorSuggestWidget.background",{dark:po,light:po,hcDark:po,hcLight:po},C("editorSuggestWidgetBackground","Background color of the suggest widget."));J("editorSuggestWidget.border",{dark:Qh,light:Qh,hcDark:Qh,hcLight:Qh},C("editorSuggestWidgetBorder","Border color of the suggest widget."));const gR=J("editorSuggestWidget.foreground",{dark:Sd,light:Sd,hcDark:Sd,hcLight:Sd},C("editorSuggestWidgetForeground","Foreground color of the suggest widget."));J("editorSuggestWidget.selectedForeground",{dark:g0,light:g0,hcDark:g0,hcLight:g0},C("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));J("editorSuggestWidget.selectedIconForeground",{dark:OC,light:OC,hcDark:OC,hcLight:OC},C("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const Pwt=J("editorSuggestWidget.selectedBackground",{dark:p0,light:p0,hcDark:p0,hcLight:p0},C("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));J("editorSuggestWidget.highlightForeground",{dark:xd,light:xd,hcDark:xd,hcLight:xd},C("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));J("editorSuggestWidget.focusHighlightForeground",{dark:u2,light:u2,hcDark:u2,hcLight:u2},C("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));J("editorSuggestWidgetStatus.foreground",{dark:St(gR,.5),light:St(gR,.5),hcDark:St(gR,.5),hcLight:St(gR,.5)},C("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class Owt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Fv}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const n=JSON.parse(t);if(Kn.is(n))return Kn.lift(n)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Gk=mC=class{constructor(e,t,n,o,r){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Kr,this._pendingShowDetails=new Kr,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new zd,this._disposables=new Be,this._onDidSelect=new Y0,this._onDidFocus=new Y0,this._onDidHide=new le,this._onDidShow=new le,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new le,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new mY,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Fwt(this,e),this._persistedSize=new Owt(t,e);class s{constructor(f,g,p=!1,v=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,v;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:m,defaultSize:_}=this.getLayoutInfo(),y=Math.round(m/2);let{width:w,height:L}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-L)<=y)&&(L=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:_.height),(!a.persistWidth||Math.abs(a.currentSize.width-w)<=y)&&(w=(v=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&v!==void 0?v:_.width),this._persistedSize.store(new Kn(w,L))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Ae(this.element.domNode,He(".message")),this._listElement=Ae(this.element.domNode,He(".tree"));const l=this._disposables.add(r.createInstance(pU,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Dwt(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);c();const d=r.createInstance(mU,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new qd("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>C("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:m,description:_}=h.completion.label;m&&_?f=C("label.full","{0} {1}, {2}",f,m,_):m?f=C("label.detail","{0} {1}",f,m):_&&(f=C("label.desc","{0}, {1}",f,_))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,v=Z0("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return C("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,v)}}}),this._list.style(ES({listInactiveFocusBackground:Pwt,listInactiveFocusOutline:Wi})),this._status=r.createInstance(gU,this.element.domNode,av);const u=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);u(),this._disposables.add(o.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(o.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=sn.Visible.bindTo(n),this._ctxSuggestWidgetDetailsVisible=sn.DetailsVisible.bindTo(n),this._ctxSuggestWidgetMultipleSuggestions=sn.MultipleSuggestions.bindTo(n),this._ctxSuggestWidgetHasFocusedSuggestion=sn.HasFocusedSuggestion.bindTo(n),this._disposables.add(No(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=="undefined"||typeof e.index=="undefined"||(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 n=this._completionModel;n&&(this._onDidSelect.fire({item:e,index:t,model:n}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=Hu(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 n=e.elements[0],o=e.indexes[0];n!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(o),this._currentSuggestionDetails=sr(r=>Awt(this,void 0,void 0,function*(){const s=Lv(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=r.onCancellationRequested(()=>s.dispose());try{return yield n.resolve(r)}finally{s.dispose(),a.dispose()}})),this._currentSuggestionDetails.then(()=>{o>=this._list.length||n!==this._list.element(o)||(this._ignoreFocusEvents=!0,this._list.splice(o,1,[n]),this._list.setFocus([o]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:fSe(o)}))}).catch(en)),this._onDidFocus.fire({item:n,index:o,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:Js(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=mC.LOADING_MESSAGE,Js(this._listElement,this._status.element),nl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,kv(mC.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=mC.NO_SUGGESTIONS_MESSAGE,Js(this._listElement,this._status.element),nl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,kv(mC.NO_SUGGESTIONS_MESSAGE);break;case 3:Js(this._messageElement),nl(this._listElement,this._status.element),this._show();break;case 4:Js(this._messageElement),nl(this._listElement,this._status.element),this._show();break;case 5:Js(this._messageElement),nl(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=Lv(()=>this._setState(1),t)))}showSuggestions(e,t,n,o,r){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),n&&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(o?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(n?4:3),this._list.reveal(t,0),this._list.setFocus(r?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=GA(()=>{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")):(WY(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=GA(()=>{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(),n=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const d=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,u=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,f=Yo(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,v=Math.min(r.height-p-s.verticalPadding,u),m=f.top+g.top-s.verticalPadding,_=Math.min(m,u);let y=Math.min(Math.max(_,v)+s.borderHeight,u);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),ay&&(a=y);const w=150;a>v||this._forceRenderingAbove&&m>w?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),y=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),y=v),this.element.preferredSize=new Kn(d,s.defaultSize.height),this.element.maxSize=new Kn(c,y),this.element.minSize=new Kn(220,h),this._cappedHeight=a===u?{wanted:(o=(n=this._cappedHeight)===null||n===void 0?void 0:n.wanted)!==null&&o!==void 0?o:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:n,height:o}=this.element.maxSize;e=Math.min(n,e),t=Math.min(o,t);const{statusBarHeight:r}=this.getLayoutInfo();this._list.layout(t-r,e),this._listElement.style.height=`${t-r}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=Za(this.editor.getOption(119)||e.lineHeight,8,1e3),n=!this.editor.getOption(117).showStatusBar||this._state===2||this._state===1?0:t,o=this._details.widget.borderWidth,r=2*o;return{itemHeight:t,statusBarHeight:n,borderWidth:o,borderHeight:r,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Kn(430,n+12*t+r)}}_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}};Gk.LOADING_MESSAGE=C("suggestWidget.loading","Loading...");Gk.NO_SUGGESTIONS_MESSAGE=C("suggestWidget.noSuggestions","No suggestions.");Gk=mC=Mwt([fR(1,Gd),fR(2,Ut),fR(3,vr),fR(4,$t)],Gk);class Fwt{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:n,horizontalPadding:o}=this._widget.getLayoutInfo();return new Kn(t+2*n+o,e+2*n)}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 Bwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},vU;class Wwt{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const o=e.getOffsetAt(t),r=e.getPositionAt(o+1);this._marker=e.deltaDecorations([],[{range:V.fromPositions(t,r),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 Ed=vU=class{static get(e){return e.getContribution(vU.ID)}constructor(e,t,n,o,r,s,a){this._memoryService=t,this._commandService=n,this._contextKeyService=o,this._instantiationService=r,this._logService=s,this._telemetryService=a,this._lineSuffix=new Kr,this._toDispose=new Be,this._selectors=new Vwt(u=>u.priority),this._onWillInsertSuggestItem=new le,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=r.createInstance(fU,this.editor),this._selectors.register({priority:0,select:(u,h,f)=>this._memoryService.select(u,h,f)});const l=sn.InsertMode.bindTo(o);l.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(117).insertMode))),this.widget=this._toDispose.add(new oM(()=>{const u=this._instantiationService.createInstance(Gk,this.editor);this._toDispose.add(u),this._toDispose.add(u.onDidSelect(v=>this._insertSuggestion(v,0),this));const h=new vwt(this.editor,u,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(h);const f=sn.MakesTextEdit.bindTo(this._contextKeyService),g=sn.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=sn.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(zt(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(u.onDidFocus(({item:v})=>{const m=this.editor.getPosition(),_=v.editStart.column,y=m.column;let w=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&y-_===v.completion.insertText.length&&(w=this.editor.getModel().getValueInRange({startLineNumber:m.lineNumber,startColumn:_,endLineNumber:m.lineNumber,endColumn:y})!==v.completion.insertText),f.set(w),g.set(!ae.equals(v.editInsertEnd,v.editReplaceEnd)),p.set(Boolean(v.provider.resolveCompletionItem)||Boolean(v.completion.documentation)||v.completion.detail!==v.completion.label)})),this._toDispose.add(u.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new dp(!0,!1,!1,!1,33))||Nn&&v.toKeyCodeChord().equals(new dp(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),u})),this._overtypingCapturer=this._toDispose.add(new oM(()=>this._toDispose.add(new RF(this.editor,this.model)))),this._alternatives=this._toDispose.add(new oM(()=>this._toDispose.add(new wb(this.editor,this._contextKeyService)))),this._toDispose.add(r.createInstance(qk,e)),this._toDispose.add(this.model.onDidTrigger(u=>{this.widget.value.showTriggered(u.auto,u.shy?250:50),this._lineSuffix.value=new Wwt(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=sn.AcceptSuggestionsOnEnter.bindTo(o),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 n=qr.get(this.editor);if(!n)return;this._onWillInsertSuggestItem.fire({item:e.item});const o=this.editor.getModel(),r=o.getAlternativeVersionId(),{item:s}=e,a=[],l=new Ro;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,Boolean(t&8));this._memoryService.memorize(o,this.editor.getPosition(),s);const d=s.isResolved;let u=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const g=Zu.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(p=>Gi.replaceMove(V.lift(p.range),p.text))),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const g=new Ls;let p;const v=o.onDidChangeContent(w=>{if(w.isFlush){l.cancel(),v.dispose();return}for(const L of w.changes){const D=V.getEndPosition(L.range);(!p||ae.isBefore(D,p))&&(p=D)}}),m=t;t|=2;let _=!1;const y=this.editor.onWillType(()=>{y.dispose(),_=!0,m&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&s.completion.additionalTextEdits.some(L=>ae.isBefore(p,V.getStartPosition(L.range))))return!1;_&&this.editor.pushUndoStop();const w=Zu.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(L=>Gi.replaceMove(V.lift(L.range),L.text))),w.restoreRelativeVerticalPositionOfCursor(this.editor),(_||!(m&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(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=Yw.escape(f)),this.model.cancel(),n.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===LT.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Ls;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(p=>{s.completion.extensionId?$o(p):en(p)}).finally(()=>{u=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();o.canUndo();){r!==o.getAlternativeVersionId()&&o.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,o,d,u,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,n,o,r){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:H0e($c(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Ust(t.uri),resolveInfo:e.provider.resolveCompletionItem?n?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:o,additionalEditsAsync:r})}getOverwriteInfo(e,t){fi(this.editor.hasModel());let n=this.editor.getOption(117).insertMode==="replace";t&&(n=!n);const o=e.position.column-e.editStart.column,r=(n?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:o+s,overwriteAfter:r+a}}_alertCompletionItem(e){if(ws(e.completion.additionalTextEdits)){const t=C("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Cs(t)}}triggerSuggest(e,t,n){this.editor.hasModel()&&(this.model.trigger({auto:t!=null?t:!1,completionOptions:{providerFilter:e,kindFilter:n?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(),n=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},o=r=>{if(r.completion.insertTextRules&4||r.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=r.editStart.column,l=s.column;return l-a!==r.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==r.completion.insertText};st.once(this.model.onDidTrigger)(r=>{const s=[];st.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{si(s),n()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(si(s),a.items.length===0){n();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!o(c)){n();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const n=this.widget.value.getFocusedItem();let o=0;e&&(o|=4),t&&(o|=8),this._insertSuggestion(n,o)}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)}};Ed.ID="editor.contrib.suggestController";Ed=vU=Bwt([nC(1,NF),nC(2,_o),nC(3,Ut),nC(4,$t),nC(5,nc),nC(6,tc)],Ed);class Vwt{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,n)=>this.prioritySelector(n)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class LT extends ft{constructor(){super({id:LT.id,label:C("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:Me.and(Q.writable,Q.hasCompletionItemProvider,sn.Visible.toNegated()),kbOpts:{kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,n){const o=Ed.get(t);if(!o)return;let r;n&&typeof n=="object"&&n.auto===!0&&(r=!0),o.triggerSuggest(void 0,r,void 0)}}LT.id="editor.action.triggerSuggest";Un(Ed.ID,Ed,2);ze(LT);const Ql=100+90,_a=Ir.bindToContribution(Ed.get);Ye(new _a({id:"acceptSelectedSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion),handler(i){i.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Me.and(sn.Visible,Q.textInputFocus),weight:Ql},{primary:3,kbExpr:Me.and(sn.Visible,Q.textInputFocus,sn.AcceptSuggestionsOnEnter,sn.MakesTextEdit),weight:Ql}],menuOpts:[{menuId:av,title:C("accept.insert","Insert"),group:"left",order:1,when:sn.HasInsertAndReplaceRange.toNegated()},{menuId:av,title:C("accept.insert","Insert"),group:"left",order:1,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("insert"))},{menuId:av,title:C("accept.replace","Replace"),group:"left",order:1,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("replace"))}]}));Ye(new _a({id:"acceptAlternativeSelectedSuggestion",precondition:Me.and(sn.Visible,Q.textInputFocus,sn.HasFocusedSuggestion),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:1027,secondary:[1026]},handler(i){i.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:av,group:"left",order:2,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("insert")),title:C("accept.replace","Replace")},{menuId:av,group:"left",order:2,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("replace")),title:C("accept.insert","Insert")}]}));Rn.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Ye(new _a({id:"hideSuggestWidget",precondition:sn.Visible,handler:i=>i.cancelSuggestWidget(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:9,secondary:[1033]}}));Ye(new _a({id:"selectNextSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Ye(new _a({id:"selectNextPageSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextPageSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:12,secondary:[2060]}}));Ye(new _a({id:"selectLastSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectLastSuggestion()}));Ye(new _a({id:"selectPrevSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Ye(new _a({id:"selectPrevPageSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevPageSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:11,secondary:[2059]}}));Ye(new _a({id:"selectFirstSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectFirstSuggestion()}));Ye(new _a({id:"focusSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion.negate()),handler:i=>i.focusSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));Ye(new _a({id:"focusAndAcceptSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion.negate()),handler:i=>{i.focusSuggestion(),i.acceptSelectedSuggestion(!0,!1)}}));Ye(new _a({id:"toggleSuggestionDetails",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion),handler:i=>i.toggleSuggestionDetails(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:av,group:"right",order:1,when:Me.and(sn.DetailsVisible,sn.CanResolve),title:C("detail.more","show less")},{menuId:av,group:"right",order:1,when:Me.and(sn.DetailsVisible.toNegated(),sn.CanResolve),title:C("detail.less","show more")}]}));Ye(new _a({id:"toggleExplainMode",precondition:sn.Visible,handler:i=>i.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));Ye(new _a({id:"toggleSuggestionFocus",precondition:sn.Visible,handler:i=>i.toggleSuggestionFocus(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2570,mac:{primary:778}}}));Ye(new _a({id:"insertBestCompletion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),qk.AtEnd,sn.Visible.toNegated(),wb.OtherSuggestions.toNegated(),qr.InSnippetMode.toNegated()),handler:(i,e)=>{i.triggerSuggestAndAcceptBest(ia(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:Ql,primary:2}}));Ye(new _a({id:"insertNextSuggestion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),wb.OtherSuggestions,sn.Visible.toNegated(),qr.InSnippetMode.toNegated()),handler:i=>i.acceptNextSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2}}));Ye(new _a({id:"insertPrevSuggestion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),wb.OtherSuggestions,sn.Visible.toNegated(),qr.InSnippetMode.toNegated()),handler:i=>i.acceptPrevSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:1026}}));ze(class extends ft{constructor(){super({id:"editor.action.resetSuggestSize",label:C("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(i,e){var t;(t=Ed.get(e))===null||t===void 0||t.resetWidgetSize()}});class Hwt extends _e{get selectedItem(){return this._selectedItem}constructor(e,t,n,o){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=n,this.onWillAccept=o,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Ai(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const r=Ed.get(this.editor);if(r){this._register(r.registerSelector({priority:100,select:(l,c,d)=>{var u;qi(m=>this.checkModelVersion(m));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=ae.lift(c),p=d.map((m,_)=>{const w=OE.fromSuggestion(r,h,g,m,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),L=f.augments(w);return{index:_,valid:L,prefixLength:w.text.length,suggestItem:m}}).filter(m=>m&&m.valid&&m.prefixLength>0),v=U0e(p,Rc(m=>m.prefixLength,jg));return v?v.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(r.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(r.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(r.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(st.once(r.model.onDidTrigger)(l=>{a()})),this._register(r.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),d=this.editor.getModel();if(!c||!d)return;const u=OE.fromSuggestion(r,d,c,l.item,this.isShiftKeyPressed);this.onWillAccept(u)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!$wt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,qi(n=>{this.checkModelVersion(n),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,n)}))}getSuggestItemInfo(){const e=Ed.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),n=this.editor.getPosition(),o=this.editor.getModel();if(!(!t||!n||!o))return OE.fromSuggestion(e,o,n,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Ed.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Ed.get(this.editor);e==null||e.forceRenderingAbove()}}class OE{static fromSuggestion(e,t,n,o,r){let{insertText:s}=o.completion,a=!1;if(o.completion.insertTextRules&4){const c=new Yw().parse(s);c.children.length<100&&IO.adjustWhitespace(t,n,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(o,r);return new OE(V.fromPositions(n.delta(0,-l.overwriteBefore),n.delta(0,Math.max(l.overwriteAfter,0))),s,o.completion.kind,a)}constructor(e,t,n,o){this.range=e,this.insertText=t,this.completionItemKind=n,this.isSnippetText=o}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new V_e(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new Zw(this.range,this.insertText)}}function $wt(i,e){return i===e?!0:!i||!e?!1:i.equals(e)}var zwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Kp=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},_U;let Jl=_U=class extends _e{static get(e){return e.getContribution(_U.ID)}constructor(e,t,n,o,r,s,a,l,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=n,this.configurationService=o,this.commandService=r,this.debounceService=s,this.languageFeaturesService=a,this.audioCueService=l,this._keybindingService=c,this.model=tO("inlineCompletionModel",void 0),this.textModelVersionId=Ai(this,-1),this.cursorPosition=Ai(this,new ae(1,1)),this.suggestWidgetAdaptor=this._register(new Hwt(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,Nl.Other),h=>{qi(f=>{var g;this.updateObservables(f,Nl.Other),(g=this.model.get())===null||g===void 0||g.handleSuggestAccepted(h)})})),this._enabled=$r(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(lU,this.editor,{ghostText:this.model.map((h,f)=>h==null?void 0:h.ghostText.read(f)),minReservedLineCount:nO(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 Dr(this.contextKeyService,this.model)),this._register(st.runAndSubscribe(e.onDidChangeModel,()=>qi(h=>{this.model.set(void 0,h),this.updateObservables(h,Nl.Other);const f=e.getModel();if(f){const g=t.createInstance(dU,f,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,$r(e.onDidChangeConfiguration,()=>e.getOption(117).preview),$r(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),$r(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(g,h)}})));const d=h=>{var f;return h.isUndoing?Nl.Undo:h.isRedoing?Nl.Redo:!((f=this.model.get())===null||f===void 0)&&f.isAcceptingPartially?Nl.AcceptWord:Nl.Other};this._register(e.onDidChangeModelContent(h=>qi(f=>this.updateObservables(f,d(h))))),this._register(e.onDidChangeCursorPosition(h=>qi(f=>{var g;this.updateObservables(f,Nl.Other),(h.reason===3||h.source==="api")&&((g=this.model.get())===null||g===void 0||g.stop(f))}))),this._register(e.onDidType(()=>qi(h=>{var f;this.updateObservables(h,Nl.Other),this._enabled.get()&&((f=this.model.get())===null||f===void 0||f.trigger(h))}))),this._register(this.commandService.onDidExecuteCommand(h=>{new Set([ky.Tab.id,ky.DeleteLeft.id,ky.DeleteRight.id,Ewe,"acceptSelectedSuggestion"]).has(h.commandId)&&e.hasTextFocus()&&this._enabled.get()&&qi(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||Hv.dropDownVisible||qi(h=>{var f;(f=this.model.get())===null||f===void 0||f.stop(h)})})),this._register(Ii(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(zt(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let u;this._register(Ii(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(Wn.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(g.ghostText.renderForScreenReader(p))})}})),this._register(new Wz(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"),n=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let o;!t&&n&&this.editor.getOption(147)&&(o=C("showAccessibleViewHint","Inspect this in the accessible view ({0})",n.getAriaLabel())),Cs(o?e+", "+o:e)}updateObservables(e,t){var n,o;const r=this.editor.getModel();this.textModelVersionId.set((n=r==null?void 0:r.getVersionId())!==null&&n!==void 0?n:-1,e,t),this.cursorPosition.set((o=this.editor.getPosition())!==null&&o!==void 0?o:new ae(1,1),e)}shouldShowHoverAt(e){var t;const n=(t=this.model.get())===null||t===void 0?void 0:t.ghostText.get();return n?n.parts.some(o=>e.containsPosition(new ae(n.lineNumber,o.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};Jl.ID="editor.contrib.inlineCompletionsController";Jl=_U=zwt([Kp(1,$t),Kp(2,Ut),Kp(3,En),Kp(4,_o),Kp(5,qc),Kp(6,pt),Kp(7,hT),Kp(8,xi)],Jl);var i_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class MF extends ft{constructor(){super({id:MF.ID,label:C("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.next()})}}MF.ID=kwe;class AF extends ft{constructor(){super({id:AF.ID,label:C("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.previous()})}}AF.ID=Dwe;class Uwt extends ft{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:C("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:Q.writable})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.triggerExplicitly()})}}class jwt extends ft{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:C("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:Me.and(Q.writable,Dr.inlineSuggestionVisible)},menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);yield(n=o==null?void 0:o.model.get())===null||n===void 0?void 0:n.acceptNextWord(o.editor)})}}class Kwt extends ft{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:C("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);yield(n=o==null?void 0:o.model.get())===null||n===void 0?void 0:n.acceptNextLine(o.editor)})}}class qwt extends ft{constructor(){super({id:Ewe,label:C("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Dr.inlineSuggestionVisible,menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:Me.and(Dr.inlineSuggestionVisible,Q.tabMovesFocus.toNegated(),Dr.inlineSuggestionHasIndentationLessThanTabSize,sn.Visible.toNegated(),Q.hoverFocused.toNegated())}})}run(e,t){var n;return i_(this,void 0,void 0,function*(){const o=Jl.get(t);o&&((n=o.model.get())===null||n===void 0||n.accept(o.editor),o.editor.focus())})}}class PF extends ft{constructor(){super({id:PF.ID,label:C("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Dr.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return i_(this,void 0,void 0,function*(){const n=Jl.get(t);qi(o=>{var r;(r=n==null?void 0:n.model.get())===null||r===void 0||r.stop(o)})})}}PF.ID="editor.action.inlineSuggest.hide";class OF extends ec{constructor(){super({id:OF.ID,title:C("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Z.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Me.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return i_(this,void 0,void 0,function*(){const n=e.get(En),r=n.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";n.updateValue("editor.inlineSuggest.showToolbar",r)})}}OF.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var Gwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Xwt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let bU=class{constructor(e,t,n,o,r,s){this._editor=e,this._languageService=t,this._openerService=n,this.accessibilityService=o,this._instantiationService=r,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Jl.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const o=n.detail;if(t.shouldShowHoverAtViewZone(o.viewZoneId))return new IM(1e3,this,V.fromPositions(this._editor.getModel().validatePosition(o.positionBefore||o.position)),e.event.posx,e.event.posy,!1)}return n.type===7&&t.shouldShowHoverAt(n.range)?new IM(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new IM(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar==="always")return[];const n=Jl.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new Xwt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Be,o=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,o,n);const r=o.controller.model.get(),s=this._instantiationService.createInstance(Hv,this._editor,!1,nO(null),r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.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(s.getDomNode()),r.triggerExplicitly(),n.add(s),n}renderScreenReaderText(e,t,n){const o=He,r=o("div.hover-row.markdown-hover"),s=Ae(r,o("div.hover-contents",{["aria-live"]:"assertive"})),a=n.add(new hp({editor:this._editor},this._languageService,this._openerService)),l=c=>{n.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=C("inlineSuggestionFollows","Suggestion:"),u=n.add(a.render(new os().appendText(d).appendCodeblock("text",c)));s.replaceChildren(u.element)};n.add(Ii(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 jr(s)})),e.fragment.appendChild(r)}};bU=Gwt([oL(1,Ki),oL(2,ml),oL(3,bp),oL(4,$t),oL(5,tc)],bU);Un(Jl.ID,Jl,3);ze(Uwt);ze(MF);ze(AF);ze(jwt);ze(Kwt);ze(qwt);ze(PF);$i(OF);n1.register(bU);function Ya(i,e){let t=0;for(let n=0;n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Zwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function gSe(i,e,t,n,o){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return[];const r=e.getLanguageConfiguration(i.getLanguageId()).indentationRules;if(!r)return[];for(n=Math.min(n,i.getLineCount());t<=n&&r.unIndentedLinePattern;){const v=i.getLineContent(t);if(!r.unIndentedLinePattern.test(v))break;t++}if(t>n-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=i.getOptions(),c=(v,m)=>(m=m||1,Ec.shiftIndent(v,v.length+m,s,a,l)),d=(v,m)=>(m=m||1,Ec.unshiftIndent(v,v.length+m,s,a,l)),u=[];let h;const f=i.getLineContent(t);let g=f;if(o!=null){h=o;const v=Si(f);g=h+f.substring(v.length),r.decreaseIndentPattern&&r.decreaseIndentPattern.test(g)&&(h=d(h),g=h+f.substring(v.length)),f!==g&&u.push(Gi.replaceMove(new gt(t,1,t,v.length+1),hP(h,a,l)))}else h=Si(f);let p=h;r.increaseIndentPattern&&r.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):r.indentNextLinePattern&&r.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let v=t;v<=n;v++){const m=i.getLineContent(v),_=Si(m),y=p+m.substring(_.length);r.decreaseIndentPattern&&r.decreaseIndentPattern.test(y)&&(p=d(p),h=d(h)),_!==p&&u.push(Gi.replaceMove(new gt(v,1,v,_.length+1),hP(p,a,l))),!(r.unIndentedLinePattern&&r.unIndentedLinePattern.test(m))&&(r.increaseIndentPattern&&r.increaseIndentPattern.test(y)?(h=c(h),p=h):r.indentNextLinePattern&&r.indentNextLinePattern.test(y)?p=c(p):p=h)}return u}class FF extends ft{constructor(){super({id:FF.ID,label:C("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:Q.writable})}run(e,t){const n=t.getModel();if(!n)return;const o=n.getOptions(),r=t.getSelection();if(!r)return;const s=new tSt(r,o.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!0})}}FF.ID="editor.action.indentationToSpaces";class BF extends ft{constructor(){super({id:BF.ID,label:C("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:Q.writable})}run(e,t){const n=t.getModel();if(!n)return;const o=n.getOptions(),r=t.getSelection();if(!r)return;const s=new nSt(r,o.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!1})}}BF.ID="editor.action.indentationToTabs";class VY extends ft{constructor(e,t,n){super(n),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const n=e.get(dh),o=e.get(Yi),r=t.getModel();if(!r)return;const s=o.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget),a=r.getOptions(),l=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===s.tabSize&&d===a.tabSize?C("configuredTabSize","Configured Tab Size"):d===s.tabSize?C("defaultTabSize","Default Tab Size"):d===a.tabSize?C("currentTabSize","Current Tab Size"):void 0})),c=Math.min(r.getOptions().tabSize-1,7);setTimeout(()=>{n.pick(l,{placeHolder:C({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(d=>{if(d&&r&&!r.isDisposed()){const u=parseInt(d.label,10);this.displaySizeOnly?r.updateOptions({tabSize:u}):r.updateOptions({tabSize:u,indentSize:u,insertSpaces:this.insertSpaces})}})},50)}}class WF extends VY{constructor(){super(!1,!1,{id:WF.ID,label:C("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}WF.ID="editor.action.indentUsingTabs";class VF extends VY{constructor(){super(!0,!1,{id:VF.ID,label:C("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}VF.ID="editor.action.indentUsingSpaces";class HF extends VY{constructor(){super(!0,!0,{id:HF.ID,label:C("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}HF.ID="editor.action.changeTabDisplaySize";class $F extends ft{constructor(){super({id:$F.ID,label:C("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const n=e.get(Yi),o=t.getModel();if(!o)return;const r=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget);o.detectIndentation(r.insertSpaces,r.tabSize)}}$F.ID="editor.action.detectIndentation";class Qwt extends ft{constructor(){super({id:"editor.action.reindentlines",label:C("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:Q.writable})}run(e,t){const n=e.get(Ti),o=t.getModel();if(!o)return;const r=gSe(o,n,1,o.getLineCount());r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class Jwt extends ft{constructor(){super({id:"editor.action.reindentselectedlines",label:C("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:Q.writable})}run(e,t){const n=e.get(Ti),o=t.getModel();if(!o)return;const r=t.getSelections();if(r===null)return;const s=[];for(const a of r){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=gSe(o,n,l,c);s.push(...d)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class eSt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const n of e)n.range&&typeof n.text=="string"&&this._edits.push(n)}getEditOperations(e,t){for(const o of this._edits)t.addEditOperation(V.lift(o.range),o.text);let n=!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?(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),n||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let Xk=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 n=this.editor.getModel();if(!n||!n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const o=this.editor.getOption(12),{tabSize:r,indentSize:s,insertSpaces:a}=n.getOptions(),l=[],c={shiftIndent:f=>Ec.shiftIndent(f,f.length+1,r,s,a),unshiftIndent:f=>Ec.unshiftIndent(f,f.length+1,r,s,a)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(n,d)){d++;continue}break}if(d>e.endLineNumber)return;let u=n.getLineContent(d);if(!/\S/.test(u.substring(0,e.startColumn-1))){const f=pE(o,n,n.getLanguageId(),d,c,this._languageConfigurationService);if(f!==null){const g=Si(u),p=Ya(f,r),v=Ya(g,r);if(p!==v){const m=FE(p,r,a);l.push({range:new V(d,1,d,g.length+1),text:m}),u=m+u.substr(g.length)}else{const m=Nbe(n,d,this._languageConfigurationService);if(m===0||m===8)return}}}const h=d;for(;dn.tokenization.getLineTokens(p),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(p,v)=>n.getLanguageIdAtPosition(p,v)},getLineContent:p=>p===h?u:n.getLineContent(p)},n.getLanguageId(),d+1,c,this._languageConfigurationService);if(g!==null){const p=Ya(g,r),v=Ya(Si(n.getLineContent(d+1)),r);if(p!==v){const m=p-v;for(let _=d+1;_<=e.endLineNumber;_++){const y=n.getLineContent(_),w=Si(y),D=Ya(w,r)+m,E=FE(D,r,a);E!==w&&l.push({range:new V(_,1,_,w.length+1),text:E})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new eSt(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const n=e.getLineFirstNonWhitespaceColumn(t);if(n===0)return!0;const o=e.tokenization.getLineTokens(t);if(o.getCount()>0){const r=o.findTokenIndexAtOffset(n);if(r>=0&&o.getStandardTokenType(r)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};Xk.ID="editor.contrib.autoIndentOnPaste";Xk=Ywt([Zwt(1,Ti)],Xk);function pSe(i,e,t,n){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let o="";for(let s=0;sthis._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var t,n;return TO(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=o==null?void 0:o.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(n=o==null?void 0:o.label)!==null&&n!==void 0?n:this.hint.label,this._isResolved=!0}catch(o){$o(o),this._isResolved=!1}})}}class Yk{static create(e,t,n,o){return TO(this,void 0,void 0,function*(){const r=[],s=e.ordered(t).reverse().map(a=>n.map(l=>TO(this,void 0,void 0,function*(){try{const c=yield a.provideInlayHints(t,l,o);c!=null&&c.hints.length&&r.push([c,a])}catch(c){$o(c)}})));if(yield Promise.all(s.flat()),o.isCancellationRequested||t.isDisposed())throw new Yv;return new Yk(n,r,t)})}constructor(e,t,n){this._disposables=new Be,this.ranges=e,this.provider=new Set;const o=[];for(const[r,s]of t){this._disposables.add(r),this.provider.add(s);for(const a of r.hints){const l=n.validatePosition(a.position);let c="before";const d=Yk._getRangeAtPosition(n,l);let u;d.getStartPosition().isBefore(l)?(u=V.fromPositions(d.getStartPosition(),l),c="after"):(u=V.fromPositions(l,d.getEndPosition()),c="before"),o.push(new HY(a,new mSe(u,c),s))}}this.items=o.sort((r,s)=>ae.compare(r.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const n=t.lineNumber,o=e.getWordAtPosition(t);if(o)return new V(n,o.startColumn,n,o.endColumn);e.tokenization.tokenizeIfCheap(n);const r=e.tokenization.getLineTokens(n),s=t.column-1,a=r.findTokenIndexAtOffset(s);let l=r.getStartOffset(a),c=r.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=r.getStartOffset(a-1),c=r.getEndOffset(a-1)):c===s&&aNC(g)?g.command.id:CF()));for(const g of Bs.all())h.has(g.desc.id)&&u.push(new ca(g.desc.id,Fd.label(g.desc,{renderShortTitle:!0}),void 0,!0,()=>BE(this,void 0,void 0,function*(){const p=yield r.createModelReference(d.uri);try{const v=new Uw(p.object.textEditorModel,V.getStartPosition(d.range)),m=n.item.anchor.range;yield l.invokeFunction(g.runEditorCommand.bind(g),e,v,m)}finally{p.dispose()}})));if(n.part.command){const{command:g}=n.part;u.push(new kr),u.push(new ca(g.id,g.title,void 0,!0,()=>BE(this,void 0,void 0,function*(){var p;try{yield a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(v){c.notify({severity:k5.Error,source:n.item.provider.displayName,message:v})}})))}const f=e.getOption(126);s.showContextMenu({domForShadowRoot:f&&(o=e.getDomNode())!==null&&o!==void 0?o:void 0,getAnchor:()=>{const g=Yo(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>u,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function vSe(i,e,t,n){return BE(this,void 0,void 0,function*(){const r=yield i.get(za).createModelReference(n.uri);yield t.invokeWithinContext(s=>BE(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=s.get(Ut),c=Ha.inPeekEditor.getValue(l),d=!a&&t.getOption(87)&&!c;return new ST({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new Uw(r.object.textEditorModel,V.getStartPosition(n.range)),V.lift(n.range))})),r.dispose()})}var rSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},vC=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},MM;class NO{constructor(){this._entries=new Qv(50)}get(e){const t=NO._key(e);return this._entries.get(t)}set(e,t){const n=NO._key(e);this._entries.set(n,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const _Se=yn("IInlayHintsCache");Mn(_Se,NO,1);class CU{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 sSt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let Sb=MM=class{static get(e){var t;return(t=e.getContribution(MM.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,n,o,r,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=o,this._commandService=r,this._notificationService=s,this._instaService=a,this._disposables=new Be,this._sessionDisposables=new Be,this._decorationsMetadata=new Map,this._ruleFactory=new XI(this._editor),this._activeRenderMode=0,this._debounceInfo=n.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 n=this._inlayHintsCache.get(t);n&&this._updateHintsDecorators([t.getFullModelRange()],n),this._sessionDisposables.add(zt(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let o;const r=new Set,s=new bi(()=>vC(this,void 0,void 0,function*(){const a=Date.now();o==null||o.dispose(!0),o=new Ro;const l=t.onWillDispose(()=>o==null?void 0:o.cancel());try{const c=o.token,d=yield Yk.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){d.dispose();return}for(const u of d.provider)typeof u.onDidChangeInlayHints=="function"&&!r.has(u)&&(r.add(u),this._sessionDisposables.add(u.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(c){en(c)}finally{o.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(s),this._sessionDisposables.add(zt(()=>o==null?void 0:o.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{const l=Math.max(s.delay,1250);s.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(Mg.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),s.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Be,t=e.add(new uF(this._editor)),n=new Be;return e.add(n),e.add(t.onMouseMoveOrRelevantKeyDown(o=>{const[r]=o,s=this._getInlayHintLabelPart(r),a=this._editor.getModel();if(!s||!a){n.clear();return}const l=new Ro;n.add(zt(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new sSt(s,r.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,d=new V(c,1,c,a.getLineMaxColumn(c)),u=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],u),n.add(zt(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],u)}))})),e.add(t.onCancel(()=>n.clear())),e.add(t.onExecute(o=>vC(this,void 0,void 0,function*(){const r=this._getInlayHintLabelPart(o);if(r){const s=r.part;s.location?this._instaService.invokeFunction(vSe,o,this._editor,s.location):nV.is(s.command)&&(yield this._invokeCommand(s.command,r.item))}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const n of this._decorationsMetadata.values())e.containsRange(n.item.anchor.range)&&t.add(n.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(t=>vC(this,void 0,void 0,function*(){if(t.event.detail!==2)return;const n=this._getInlayHintLabelPart(t);if(!!n&&(t.event.preventDefault(),yield n.item.resolve(_n.None),ws(n.item.hint.textEdits))){const o=n.item.hint.textEdits.map(r=>Gi.replace(V.lift(r.range),r.text));this._editor.executeEdits("inlayHint.default",o),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>vC(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(oSt,this._editor,e.event.target,t))}))}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(n instanceof Mv&&(n==null?void 0:n.attachedData)instanceof CU)return n.attachedData}_invokeCommand(e,t){var n;return vC(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(n=e.arguments)!==null&&n!==void 0?n:[])}catch(o){this._notificationService.notify({severity:k5.Error,source:t.provider.displayName,message:o})}})}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[n,o]of this._decorationsMetadata){if(t.has(o.item))continue;const r=e.getDecorationRange(n);if(r){const s=new mSe(r,o.item.anchor.direction),a=o.item.with({anchor:s});t.set(o.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),n=this._editor.getVisibleRangesPlusViewportAboveBelow(),o=[];for(const r of n.sort(V.compareRangesUsingStarts)){const s=t.validateRange(new V(r.startLineNumber-30,r.startColumn,r.endLineNumber+30,r.endColumn));o.length===0||!V.areIntersectingOrTouching(o[o.length-1],s)?o.push(s):o[o.length-1]=V.plusRange(o[o.length-1],s)}return o}_updateHintsDecorators(e,t){var n,o;const r=[],s=(p,v,m,_,y)=>{const w={content:m,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:_,attachedData:y};r.push({item:p,classNameRef:v,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,v)=>{const m=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(p,m,"\u200A",v?Nu.Right:Nu.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 v=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let m=0;mMM._MAX_DECORATORS)break}const f=[];for(const p of e)for(const{id:v}of(o=this._editor.getDecorationsInRange(p))!==null&&o!==void 0?o:[]){const m=this._decorationsMetadata.get(v);m&&(f.push(v),m.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const g=Zu.capture(this._editor);this._editor.changeDecorations(p=>{const v=p.deltaDecorations(f,r.map(m=>m.decoration));for(let m=0;mn)&&(r=n);const s=e.fontFamily||o;return{fontSize:r,fontFamily:s,padding:t,isUniform:!t&&s===o&&r===n}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};Sb.ID="editor.contrib.InlayHints";Sb._MAX_DECORATORS=1500;Sb=MM=rSt([iC(1,pt),iC(2,qc),iC(3,_Se),iC(4,_o),iC(5,Ao),iC(6,$t)],Sb);function aSt(i){const e="\xA0";return i.replace(/[ \t]/g,e)}Rn.registerCommand("_executeInlayHintProvider",(i,...e)=>vC(void 0,void 0,void 0,function*(){const[t,n]=e;fi(Rt.isUri(t)),fi(V.isIRange(n));const{inlayHintsProvider:o}=i.get(pt),r=yield i.get(za).createModelReference(t);try{const s=yield Yk.create(o,r.object.textEditorModel,[V.lift(n)],_n.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{r.dispose()}}));var lSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},rL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$ce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},cSt=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};class zce extends IM{constructor(e,t,n,o){super(10,t,e.item.anchor.range,n,o,!0),this.part=e}}let yU=class extends vO{constructor(e,t,n,o,r,s){super(e,t,n,o,s),this._resolverService=r,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!Sb.get(this._editor)||e.target.type!==6)return null;const o=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return o instanceof Mv&&o.attachedData instanceof CU?new zce(o.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,n){return e instanceof zce?new Wo(o=>$ce(this,void 0,void 0,function*(){var r,s,a,l;const{part:c}=e;if(yield c.item.resolve(n),n.isCancellationRequested)return;let d;typeof c.item.hint.tooltip=="string"?d=new os().appendText(c.item.hint.tooltip):c.item.hint.tooltip&&(d=c.item.hint.tooltip),d&&o.emitOne(new Du(this,e.range,[d],!1,0)),ws(c.item.hint.textEdits)&&o.emitOne(new Du(this,e.range,[new os().appendText(C("hint.dbl","Double-click to insert"))],!1,10001));let u;if(typeof c.part.tooltip=="string"?u=new os().appendText(c.part.tooltip):c.part.tooltip&&(u=c.part.tooltip),u&&o.emitOne(new Du(this,e.range,[u],!1,1)),c.part.location||c.part.command){let v;const _=this._editor.getOption(77)==="altKey"?Nn?C("links.navigate.kb.meta.mac","cmd + click"):C("links.navigate.kb.meta","ctrl + click"):Nn?C("links.navigate.kb.alt.mac","option + click"):C("links.navigate.kb.alt","alt + click");c.part.location&&c.part.command?v=new os().appendText(C("hint.defAndCommand","Go to Definition ({0}), right click for more",_)):c.part.location?v=new os().appendText(C("hint.def","Go to Definition ({0})",_)):c.part.command&&(v=new os(`[${C("hint.cmd","Execute Command")}](${iSt(c.part.command)} "${c.part.command.title}") (${_})`,{isTrusted:!0})),v&&o.emitOne(new Du(this,e.range,[v],!1,1e4))}const h=yield this._resolveInlayHintLabelPartHover(c,n);try{for(var f=!0,g=cSt(h),p;p=yield g.next(),r=p.done,!r;f=!0){l=p.value,f=!1;const v=l;o.emitOne(v)}}catch(v){s={error:v}}finally{try{!f&&!r&&(a=g.return)&&(yield a.call(g))}finally{if(s)throw s.error}}})):Wo.EMPTY}_resolveInlayHintLabelPartHover(e,t){return $ce(this,void 0,void 0,function*(){if(!e.part.location)return Wo.EMPTY;const{uri:n,range:o}=e.part.location,r=yield this._resolverService.createModelReference(n);try{const s=r.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?_Y(this._languageFeaturesService.hoverProvider,s,new ae(o.startLineNumber,o.startColumn),t).filter(a=>!Pw(a.hover.contents)).map(a=>new Du(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Wo.EMPTY}finally{r.dispose()}})}};yU=lSt([rL(1,Ki),rL(2,ml),rL(3,En),rL(4,za),rL(5,pt)],yU);Un(Sb.ID,Sb,1);n1.register(yU);class dSt{constructor(e,t,n){this._editRange=e,this._originalSelection=t,this._text=n}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const o=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new gt(o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn),o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn)):new gt(o.endLineNumber,o.endColumn-this._text.length,o.endLineNumber,o.endColumn)}}var uSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},hSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},AM;let zv=AM=class{static get(e){return e.getContribution(AM.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var n;(n=this.currentRequest)===null||n===void 0||n.cancel();const o=this.editor.getSelection(),r=this.editor.getModel();if(!r||!o)return;let s=o;if(s.startLineNumber!==s.endLineNumber)return;const a=new Ak(this.editor,5),l=r.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=sr(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var d;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const u=V.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new gt(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new dSt(u,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:AM.DECORATION}]),(d=this.decorationRemover)===null||d===void 0||d.cancel(),this.decorationRemover=xv(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(en)}).catch(en)):Promise.resolve(void 0)}};zv.ID="editor.contrib.inPlaceReplaceController";zv.DECORATION=Jt.register({description:"in-place-replace",className:"valueSetReplacement"});zv=AM=uSt([hSt(1,Xd)],zv);class fSt extends ft{constructor(){super({id:"editor.action.inPlaceReplace.up",label:C("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3159,weight:100}})}run(e,t){const n=zv.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)}}class gSt extends ft{constructor(){super({id:"editor.action.inPlaceReplace.down",label:C("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3161,weight:100}})}run(e,t){const n=zv.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)}}Un(zv.ID,zv,4);ze(fSt);ze(gSt);class pSt extends ft{constructor(){super({id:"expandLineSelection",label:C("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:Q.textInputFocus,primary:2090}})}run(e,t,n){if(n=n||{},!t.hasModel())return;const o=t._getViewModel();o.model.pushStackElement(),o.setCursorStates(n.source,3,Mr.expandLineSelection(o,o.getCursorStates())),o.revealPrimaryCursor(n.source,!0)}}ze(pSt);class mSt{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const n=vSt(e,this._cursors);for(let o=0,r=n.length;os.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let n=0,o=0;const r=e.length;for(let s=1,a=i.getLineCount();s<=a;s++){const l=i.getLineContent(s),c=l.length+1;let d=0;if(o=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},vSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let yU=class{constructor(e,t,n,o){this._languageConfigurationService=o,this._selection=e,this._isMovingDown=t,this._autoIndent=n,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const n=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===n){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 o=this._selection;o.startLineNumbere.tokenization.getLineTokens(d),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(d,u)=>e.getLanguageIdAtPosition(d,u)},getLineContent:null};if(o.startLineNumber===o.endLineNumber&&e.getLineMaxColumn(o.startLineNumber)===1){const d=o.startLineNumber,u=this._isMovingDown?d+1:d-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new V(1,1,1,1),null):(t.addEditOperation(new V(d,1,d,1),e.getLineContent(u)),t.addEditOperation(new V(u,1,u,e.getLineMaxColumn(u)),null)),o=new gt(u,1,u,1)}else{let d,u;if(this._isMovingDown){d=o.endLineNumber+1,u=e.getLineContent(d),t.addEditOperation(new V(d-1,e.getLineMaxColumn(d-1),d,e.getLineMaxColumn(d)),null);let h=u;if(this.shouldAutoIndent(e,o)){const f=this.matchEnterRule(e,l,r,d,o.startLineNumber-1);if(f!==null){const p=Si(e.getLineContent(d)),v=f+Ya(p,r);h=FE(v,r,a)+this.trimStart(u)}else{c.getLineContent=v=>v===o.startLineNumber?e.getLineContent(d):e.getLineContent(v);const p=pE(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),o.startLineNumber,l,this._languageConfigurationService);if(p!==null){const v=Si(e.getLineContent(d)),m=Ya(p,r),_=Ya(v,r);m!==_&&(h=FE(m,r,a)+this.trimStart(u))}}t.addEditOperation(new V(o.startLineNumber,1,o.startLineNumber,1),h+` +`+r),this._selectionId=t.trackSelection(n),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let o=n.startLineNumber,r=n.startColumn,s=n.endLineNumber,a=n.endColumn;this._startLineNumberDelta!==0&&(o=o+this._startLineNumberDelta,r=1),this._endLineNumberDelta!==0&&(s=s+this._endLineNumberDelta,a=1),n=gt.createWithDirection(o,r,s,a,this._selectionDirection)}return n}}var _St=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},bSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let wU=class{constructor(e,t,n,o){this._languageConfigurationService=o,this._selection=e,this._isMovingDown=t,this._autoIndent=n,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const n=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===n){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 o=this._selection;o.startLineNumbere.tokenization.getLineTokens(d),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(d,u)=>e.getLanguageIdAtPosition(d,u)},getLineContent:null};if(o.startLineNumber===o.endLineNumber&&e.getLineMaxColumn(o.startLineNumber)===1){const d=o.startLineNumber,u=this._isMovingDown?d+1:d-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new V(1,1,1,1),null):(t.addEditOperation(new V(d,1,d,1),e.getLineContent(u)),t.addEditOperation(new V(u,1,u,e.getLineMaxColumn(u)),null)),o=new gt(u,1,u,1)}else{let d,u;if(this._isMovingDown){d=o.endLineNumber+1,u=e.getLineContent(d),t.addEditOperation(new V(d-1,e.getLineMaxColumn(d-1),d,e.getLineMaxColumn(d)),null);let h=u;if(this.shouldAutoIndent(e,o)){const f=this.matchEnterRule(e,l,r,d,o.startLineNumber-1);if(f!==null){const p=Si(e.getLineContent(d)),v=f+Ya(p,r);h=FE(v,r,a)+this.trimStart(u)}else{c.getLineContent=v=>v===o.startLineNumber?e.getLineContent(d):e.getLineContent(v);const p=pE(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),o.startLineNumber,l,this._languageConfigurationService);if(p!==null){const v=Si(e.getLineContent(d)),m=Ya(p,r),_=Ya(v,r);m!==_&&(h=FE(m,r,a)+this.trimStart(u))}}t.addEditOperation(new V(o.startLineNumber,1,o.startLineNumber,1),h+` `);const g=this.matchEnterRuleMovingDown(e,l,r,o.startLineNumber,d,h);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,o,r,a,g);else{c.getLineContent=v=>v===o.startLineNumber?h:v>=o.startLineNumber+1&&v<=o.endLineNumber+1?e.getLineContent(v-1):e.getLineContent(v);const p=pE(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),o.startLineNumber+1,l,this._languageConfigurationService);if(p!==null){const v=Si(e.getLineContent(o.startLineNumber)),m=Ya(p,r),_=Ya(v,r);if(m!==_){const y=m-_;this.getIndentEditsOfMovingBlock(e,t,o,r,a,y)}}}}else t.addEditOperation(new V(o.startLineNumber,1,o.startLineNumber,1),h+` `)}else if(d=o.startLineNumber-1,u=e.getLineContent(d),t.addEditOperation(new V(d,1,d+1,1),null),t.addEditOperation(new V(o.endLineNumber,e.getLineMaxColumn(o.endLineNumber),o.endLineNumber,e.getLineMaxColumn(o.endLineNumber)),` -`+u),this.shouldAutoIndent(e,o)){c.getLineContent=f=>f===d?e.getLineContent(o.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,r,o.startLineNumber,o.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,o,r,a,h);else{const f=pE(this._autoIndent,c,e.getLanguageIdAtPosition(o.startLineNumber,1),d,l,this._languageConfigurationService);if(f!==null){const g=Si(e.getLineContent(o.startLineNumber)),p=Ya(f,r),v=Ya(g,r);if(p!==v){const m=p-v;this.getIndentEditsOfMovingBlock(e,t,o,r,a,m)}}}}}this._selectionId=t.trackSelection(o)}buildIndentConverter(e,t,n){return{shiftIndent:o=>Ec.shiftIndent(o,o.length+1,e,t,n),unshiftIndent:o=>Ec.unshiftIndent(o,o.length+1,e,t,n)}}parseEnterResult(e,t,n,o,r){if(r){let s=r.indentation;r.indentAction===Ho.None||r.indentAction===Ho.Indent?s=r.indentation+r.appendText:r.indentAction===Ho.IndentOutdent?s=r.indentation:r.indentAction===Ho.Outdent&&(s=t.unshiftIndent(r.indentation)+r.appendText);const a=e.getLineContent(o);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=Si(e.getLineContent(o));let c=Si(s);const d=Nbe(e,o,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const u=Ya(c,n),h=Ya(l,n);return u-h}}return null}matchEnterRuleMovingDown(e,t,n,o,r,s){if(Wu(s)>=0){const a=e.getLineMaxColumn(r),l=Dy(this._autoIndent,e,new V(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,l)}else{let a=o-1;for(;a>=1;){const d=e.getLineContent(a);if(Wu(d)>=0)break;a--}if(a<1||o>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Dy(this._autoIndent,e,new V(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,c)}}matchEnterRule(e,t,n,o,r,s){let a=r;for(;a>=1;){let d;if(a===r&&s!==void 0?d=s:d=e.getLineContent(a),Wu(d)>=0)break;a--}if(a<1||o>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Dy(this._autoIndent,e,new V(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const n=e.getLanguageIdAtPosition(t.startLineNumber,1),o=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(n!==o||this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,n,o,r,s){for(let a=n.startLineNumber;a<=n.endLineNumber;a++){const l=e.getLineContent(a),c=Si(l),u=Ya(c,o)+s,h=FE(u,o,r);h!==c&&(t.addEditOperation(new V(a,1,a,c.length+1),h),a===n.endLineNumber&&n.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber=o)return null;const r=[];for(let a=n;a<=o;a++)r.push(i.getLineContent(a));let s=r.slice(0);return s.sort(av.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:n,endLineNumber:o,before:r,after:s}}function _St(i,e,t){const n=CSe(i,e,t);return n?Gi.replace(new V(n.startLineNumber,1,n.endLineNumber,i.getLineMaxColumn(n.endLineNumber)),n.after.join(` -`)):null}class ySe extends ft{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const n=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));n.sort((s,a)=>V.compareRangesUsingStarts(s.selection,a.selection));let o=n[0];for(let s=1;snew ae(a.positionLineNumber,a.positionColumn)));const r=t.getSelection();if(r===null)return;const s=new gSt(r,o);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}$F.ID="editor.action.trimTrailingWhitespace";class DSt extends ft{constructor(){super({id:"editor.action.deleteLines",label:C("lines.delete","Delete Line"),alias:"Delete Line",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const n=this._getLinesToRemove(t),o=t.getModel();if(o.getLineCount()===1&&o.getLineMaxColumn(1)===1)return;let r=0;const s=[],a=[];for(let l=0,c=n.length;l1&&(u-=1,f=o.getLineMaxColumn(u)),s.push(Gi.replace(new gt(u,f,h,g),"")),a.push(new gt(u-r,d.positionColumn,u-r,d.positionColumn)),r+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(r=>{let s=r.endLineNumber;return r.startLineNumberr.startLineNumber===s.startLineNumber?r.endLineNumber-s.endLineNumber:r.startLineNumber-s.startLineNumber);const n=[];let o=t[0];for(let r=1;r=t[r].startLineNumber?o.endLineNumber=t[r].endLineNumber:(n.push(o),o=t[r]);return n.push(o),n}}class kSt extends ft{constructor(){super({id:"editor.action.indentLines",label:C("lines.indent","Indent Line"),alias:"Indent Line",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2142,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.indent(n.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class ISt extends ft{constructor(){super({id:"editor.action.outdentLines",label:C("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2140,weight:100}})}run(e,t){ky.Outdent.runEditorCommand(e,t,null)}}class TSt extends ft{constructor(){super({id:"editor.action.insertLineBefore",label:C("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3075,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.lineInsertBefore(n.cursorConfig,t.getModel(),t.getSelections())))}}class NSt extends ft{constructor(){super({id:"editor.action.insertLineAfter",label:C("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2051,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.lineInsertAfter(n.cursorConfig,t.getModel(),t.getSelections())))}}class xSe extends ft{run(e,t){if(!t.hasModel())return;const n=t.getSelection(),o=this._getRangesToDelete(t),r=[];for(let l=0,c=o.length-1;lGi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class RSt extends xSe{constructor(){super({id:"deleteAllLeft",label:C("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let n=null;const o=[];let r=0;return t.forEach(s=>{let a;if(s.endColumn===1&&r>0){const l=s.startLineNumber-r;a=new gt(l,s.startColumn,l,s.startColumn)}else a=new gt(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);r+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?n=a:o.push(a)}),n&&o.unshift(n),o}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let n=t;const o=e.getModel();return o===null?[]:(n.sort(V.compareRangesUsingStarts),n=n.map(r=>{if(r.isEmpty())if(r.startColumn===1){const s=Math.max(1,r.startLineNumber-1),a=r.startLineNumber===1?1:o.getLineLength(s)+1;return new V(s,a,r.startLineNumber,1)}else return new V(r.startLineNumber,1,r.startLineNumber,r.startColumn);else return new V(r.startLineNumber,1,r.endLineNumber,r.endColumn)}),n)}}class MSt extends xSe{constructor(){super({id:"deleteAllRight",label:C("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let n=null;const o=[];for(let r=0,s=t.length,a=0;r{if(r.isEmpty()){const s=t.getLineMaxColumn(r.startLineNumber);return r.startColumn===s?new V(r.startLineNumber,r.startColumn,r.startLineNumber+1,1):new V(r.startLineNumber,r.startColumn,r.startLineNumber,s)}return r});return o.sort(V.compareRangesUsingStarts),o}}class ASt extends ft{constructor(){super({id:"editor.action.joinLines",label:C("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const n=t.getSelections();if(n===null)return;let o=t.getSelection();if(o===null)return;n.sort(V.compareRangesUsingStarts);const r=[],s=n.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(o.equalsSelection(h)&&(o=f),f):f.startLineNumber>h.endLineNumber+1?(r.push(h),f):new gt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(r.push(h),f):new gt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));r.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=o,u=0;for(let h=0,f=r.length;h=1){let R=!0;L===""&&(R=!1),R&&(L.charAt(L.length-1)===" "||L.charAt(L.length-1)===" ")&&(R=!1,L=L.replace(/[\s\uFEFF\xA0]+$/g," "));const A=I.substr(k-1);L+=(R?" ":"")+A,R?m=A.length+1:m=A.length}else m=0}const D=new V(p,v,_,y);if(!D.isEmpty()){let E;g.isEmpty()?(l.push(Gi.replace(D,L)),E=new gt(D.startLineNumber-u,L.length-m+1,p-u,L.length-m+1)):g.startLineNumber===g.endLineNumber?(l.push(Gi.replace(D,L)),E=new gt(g.startLineNumber-u,g.startColumn,g.endLineNumber-u,g.endColumn)):(l.push(Gi.replace(D,L)),E=new gt(g.startLineNumber-u,g.startColumn,g.startLineNumber-u,L.length-w)),V.intersectRanges(D,o)!==null?d=E:c.push(E)}u+=D.endLineNumber-D.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class PSt extends ft{constructor(){super({id:"editor.action.transpose",label:C("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:Q.writable})}run(e,t){const n=t.getSelections();if(n===null)return;const o=t.getModel();if(o===null)return;const r=[];for(let s=0,a=n.length;s=d){if(c.lineNumber===o.getLineCount())continue;const u=new V(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=o.getValueInRange(u).split("").reverse().join("");r.push(new Qr(new gt(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const u=new V(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=o.getValueInRange(u).split("").reverse().join("");r.push(new PG(u,h,new gt(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class PS extends ft{run(e,t){const n=t.getSelections();if(n===null)return;const o=t.getModel();if(o===null)return;const r=t.getOption(129),s=[];for(const a of n)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new V(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),u=o.getValueInRange(d);s.push(Gi.replace(d,this._modifyText(u,r)))}else{const l=o.getValueInRange(a);s.push(Gi.replace(a,this._modifyText(l,r)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class OSt extends PS{constructor(){super({id:"editor.action.transformToUppercase",label:C("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:Q.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class FSt extends PS{constructor(){super({id:"editor.action.transformToLowercase",label:C("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:Q.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class i1{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 Zk extends PS{constructor(){super({id:"editor.action.transformToTitlecase",label:C("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:Q.writable})}_modifyText(e,t){const n=Zk.titleBoundary.get();return n?e.toLocaleLowerCase().replace(n,o=>o.toLocaleUpperCase()):e}}Zk.titleBoundary=new i1("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class lv extends PS{constructor(){super({id:"editor.action.transformToSnakecase",label:C("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:Q.writable})}_modifyText(e,t){const n=lv.caseBoundary.get(),o=lv.singleLetters.get();return!n||!o?e:e.replace(n,"$1_$2").replace(o,"$1_$2$3").toLocaleLowerCase()}}lv.caseBoundary=new i1("(\\p{Ll})(\\p{Lu})","gmu");lv.singleLetters=new i1("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class Qk extends PS{constructor(){super({id:"editor.action.transformToCamelcase",label:C("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:Q.writable})}_modifyText(e,t){const n=Qk.wordBoundary.get();if(!n)return e;const o=e.split(n);return o.shift()+o.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}Qk.wordBoundary=new i1("[_\\s-]","gm");class ep extends PS{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:C("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:Q.writable})}_modifyText(e,t){const n=ep.caseBoundary.get(),o=ep.singleLetters.get(),r=ep.underscoreBoundary.get();return!n||!o||!r?e:e.replace(r,"$1-$3").replace(n,"$1-$2").replace(o,"$1-$2").toLocaleLowerCase()}}ep.caseBoundary=new i1("(\\p{Ll})(\\p{Lu})","gmu");ep.singleLetters=new i1("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");ep.underscoreBoundary=new i1("(\\S)(_)(\\S)","gm");ze(bSt);ze(CSt);ze(ySt);ze(wSt);ze(SSt);ze(xSt);ze(LSt);ze(ESt);ze($F);ze(DSt);ze(kSt);ze(ISt);ze(TSt);ze(NSt);ze(RSt);ze(MSt);ze(ASt);ze(PSt);ze(OSt);ze(FSt);lv.caseBoundary.isSupported()&&lv.singleLetters.isSupported()&&ze(lv);Qk.wordBoundary.isSupported()&&ze(Qk);Zk.titleBoundary.isSupported()&&ze(Zk);ep.isSupported()&&ze(ep);var BSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},pR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},wU=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},PM;const LSe=new lt("LinkedEditingInputVisible",!1),WSt="linked-editing-decoration";let Uv=PM=class extends _e{static get(e){return e.getContribution(PM.ID)}constructor(e,t,n,o,r){super(),this.languageConfigurationService=o,this._syncRangesToken=0,this._localToDispose=this._register(new Be),this._editor=e,this._providers=n.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=LSe.bindTo(t),this._debounceInformation=r.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(s=>{(s.hasChanged(69)||s.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(),n=t!==null&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(n===this._enabled&&!e||(this._enabled=n,this.clearRanges(),this._localToDispose.clear(),!n||t===null))return;this._localToDispose.add(st.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const o=new Wd(this._debounceInformation.get(t)),r=()=>{var l;this._rangeUpdateTriggerPromise=o.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new Wd(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{r()})),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}}r()})),this._localToDispose.add({dispose:()=>{o.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),n=this._currentDecorations.getRange(0);if(!n||n.startLineNumber!==n.endLineNumber)return this.clearRanges();const o=t.getValueInRange(n);if(this._currentWordPattern){const s=o.match(this._currentWordPattern);if((s?s[0].length:0)!==o.length)return this.clearRanges()}const r=[];for(let s=1,a=this._currentDecorations.length;s1){this.clearRanges();return}const n=this._editor.getModel(),o=n.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===o){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=o;const r=sr(s=>wU(this,void 0,void 0,function*(){try{const a=new Ls(!1),l=yield ESe(this._providers,n,t,s);if(this._debounceInformation.update(n,a.elapsed()),r!==this._currentRequest||(this._currentRequest=null,o!==n.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:PM.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(a){sh(a)||en(a),(this._currentRequest===r||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=r,r})}};Uv.ID="editor.contrib.linkedEditing";Uv.DECORATION=Jt.register({description:"linked-editing",stickiness:0,className:WSt});Uv=PM=BSt([pR(1,Ut),pR(2,pt),pR(3,Ti),pR(4,qc)],Uv);class VSt extends ft{constructor(){super({id:"editor.action.linkedEditing",label:C("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:Me.and(Q.writable,Q.hasRenameProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const n=e.get(Jn),[o,r]=Array.isArray(t)&&t||[void 0,void 0];return Rt.isUri(o)&&ae.isIPosition(r)?n.openCodeEditor({resource:o},n.getActiveCodeEditor()).then(s=>{!s||(s.setPosition(r),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=Uv.get(t);return n?Promise.resolve(n.updateRanges(!0)):Promise.resolve()}}const HSt=Ir.bindToContribution(Uv.get);Ye(new HSt({id:"cancelLinkedEditingInput",precondition:LSe,handler:i=>i.clearRanges(),kbOpts:{kbExpr:Q.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function ESe(i,e,t,n){const o=i.ordered(e);return D0e(o.map(r=>()=>wU(this,void 0,void 0,function*(){try{return yield r.provideLinkedEditingRanges(e,t,n)}catch(s){$o(s);return}})),r=>!!r&&ws(r==null?void 0:r.ranges))}J("editor.linkedEditingBackground",{dark:ve.fromHex("#f00").transparent(.3),light:ve.fromHex("#f00").transparent(.3),hcDark:ve.fromHex("#f00").transparent(.3),hcLight:ve.white},C("editorLinkedEditingBackground","Background color when the editor auto renames on type."));Nf("_executeLinkedEditingProvider",(i,e,t)=>{const{linkedEditingRangeProvider:n}=i.get(pt);return ESe(n,e,t,_n.None)});Un(Uv.ID,Uv,1);ze(VSt);var DSe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class $St{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 DSe(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 RO{constructor(e){this._disposables=new Be;let t=[];for(const[n,o]of e){const r=n.links.map(s=>new $St(s,o));t=RO._union(t,r),Hq(n)&&this._disposables.add(n)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const n=[];let o,r,s,a;for(o=0,s=0,r=e.length,a=t.length;oPromise.resolve(r.provideLinks(e,t)).then(a=>{a&&(n[s]=[a,r])},$o));return Promise.all(o).then(()=>{const r=new RO(hf(n));return t.isCancellationRequested?(r.dispose(),new RO([])):r})}Rn.registerCommand("_executeLinkProvider",(i,...e)=>DSe(void 0,void 0,void 0,function*(){let[t,n]=e;fi(t instanceof Rt),typeof n!="number"&&(n=0);const{linkProvider:o}=i.get(pt),r=i.get(Yi).getModel(t);if(!r)return[];const s=yield kSe(o,r,_n.None);if(!s)return[];for(let l=0;l=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},mR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},USt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},SU;let Qw=SU=class extends _e{static get(e){return e.getContribution(SU.ID)}constructor(e,t,n,o,r){super(),this.editor=e,this.openerService=t,this.notificationService=n,this.languageFeaturesService=o,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=r.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new bi(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new dF(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.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 USt(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=sr(t=>kSe(this.providers,e,t));try{const t=new Ls(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){en(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(77)==="altKey",n=[],o=Object.keys(this.currentOccurrences);for(const s of o){const a=this.currentOccurrences[s];n.push(a.decorationId)}const r=[];if(e)for(const s of e)r.push(Hy.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(n,r);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{o.activate(r,n),this.activeLinkDecorationId=o.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(n=>{t.deactivate(n,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,n=!1){if(!this.openerService)return;const{link:o}=e;o.resolve(_n.None).then(r=>{if(typeof r=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===hn.file&&r.startsWith(`${hn.file}:`)){const a=Rt.parse(r);if(a.scheme===hn.file){const l=yh(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(r=zst(s,c))}}}return this.openerService.open(r,{openToSide:t,fromUserGesture:n,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},r=>{const s=r instanceof Error?r.message:r;s==="invalid"?this.notificationService.warn(C("invalid.url","Failed to open this link because it is not well-formed: {0}",o.url.toString())):s==="missing"?this.notificationService.warn(C("missing.url","Failed to open this link because its target is missing.")):en(r)})}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 n of t){const o=this.currentOccurrences[n.id];if(o)return o}return null}isEnabled(e,t){return Boolean(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()}};Qw.ID="editor.linkDetector";Qw=SU=zSt([mR(1,ml),mR(2,Ao),mR(3,pt),mR(4,qc)],Qw);const zce={general:Jt.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Jt.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Hy{static decoration(e,t){return{range:e.range,options:Hy._getOptions(e,t,!1)}}static _getOptions(e,t,n){const o=Object.assign({},n?zce.active:zce.general);return o.hoverMessage=jSt(e,t),o}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,Hy._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Hy._getOptions(this.link,t,!1))}}function jSt(i,e){const t=i.url&&/^command:/i.test(i.url.toString()),n=i.tooltip?i.tooltip:t?C("links.navigate.executeCmd","Execute command"):C("links.navigate.follow","Follow link"),o=e?Nn?C("links.navigate.kb.meta.mac","cmd + click"):C("links.navigate.kb.meta","ctrl + click"):Nn?C("links.navigate.kb.alt.mac","option + click"):C("links.navigate.kb.alt","alt + click");if(i.url){let r="";if(/^command:/i.test(i.url.toString())){const a=i.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];r=C("tooltip.explanation","Execute command {0}",l)}}return new os("",!0).appendLink(i.url.toString(!0).replace(/ /g,"%20"),n,r).appendMarkdown(` (${o})`)}else return new os().appendText(`${n} (${o})`)}class KSt extends ft{constructor(){super({id:"editor.action.openLink",label:C("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const n=Qw.get(t);if(!n||!t.hasModel())return;const o=t.getSelections();for(const r of o){const s=n.getLinkOccurrence(r.getEndPosition());s&&n.openLinkOccurrence(s,!1)}}}Un(Qw.ID,Qw,1);ze(KSt);class xU extends _e{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const n=this._editor.getOption(116);n>=0&&t.target.type===6&&t.target.position.column>=n&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}xU.ID="editor.contrib.longLinesHelper";Un(xU.ID,xU,2);const vR=J("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},C("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);J("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},C("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);J("editor.wordHighlightTextBackground",{light:vR,dark:vR,hcDark:vR,hcLight:vR},C("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 _R=J("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));J("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));J("editor.wordHighlightTextBorder",{light:_R,dark:_R,hcDark:_R,hcLight:_R},C("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const qSt=J("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},C("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),GSt=J("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},C("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),XSt=J("editorOverviewRuler.wordHighlightTextForeground",{dark:DL,light:DL,hcDark:DL,hcLight:DL},C("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),YSt=Jt.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:ro(GSt),position:Yl.Center},minimap:{color:ro(p5),position:ll.Inline}}),ZSt=Jt.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:ro(XSt),position:Yl.Center},minimap:{color:ro(p5),position:ll.Inline}}),QSt=Jt.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:ro(DL),position:Yl.Center},minimap:{color:ro(p5),position:ll.Inline}}),JSt=Jt.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),ext=Jt.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:ro(qSt),position:Yl.Center},minimap:{color:ro(p5),position:ll.Inline}});function txt(i){return i===MD.Write?YSt:i===MD.Text?ZSt:ext}function nxt(i){return i?JSt:QSt}jd((i,e)=>{const t=i.getColor(EG);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var ixt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},LU;function o_(i,e){const t=e.filter(n=>!i.find(o=>o.equals(n)));if(t.length>=1){const n=t.map(r=>`line ${r.viewState.position.lineNumber} column ${r.viewState.position.column}`).join(", "),o=t.length===1?C("cursorAdded","Cursor added: {0}",n):C("cursorsAdded","Cursors added: {0}",n);kv(o)}}class rxt extends ft{constructor(){super({id:"editor.action.insertCursorAbove",label:C("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,n){if(!t.hasModel())return;let o=!0;n&&n.logicalLine===!1&&(o=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const s=r.getCursorStates();r.setCursorStates(n.source,3,Mr.addCursorUp(r,s,o)),r.revealTopMostCursor(n.source),o_(s,r.getCursorStates())}}class sxt extends ft{constructor(){super({id:"editor.action.insertCursorBelow",label:C("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,n){if(!t.hasModel())return;let o=!0;n&&n.logicalLine===!1&&(o=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const s=r.getCursorStates();r.setCursorStates(n.source,3,Mr.addCursorDown(r,s,o)),r.revealBottomMostCursor(n.source),o_(s,r.getCursorStates())}}class axt extends ft{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:C("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,n){if(!e.isEmpty()){for(let o=e.startLineNumber;o1&&n.push(new gt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const n=t.getModel(),o=t.getSelections(),r=t._getViewModel(),s=r.getCursorStates(),a=[];o.forEach(l=>this.getCursorsForSelection(l,n,a)),a.length>0&&t.setSelections(a),o_(s,r.getCursorStates())}}class lxt extends ft{constructor(){super({id:"editor.action.addCursorsToBottom",label:C("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),o=t.getModel().getLineCount(),r=[];for(let l=n[0].startLineNumber;l<=o;l++)r.push(new gt(l,n[0].startColumn,l,n[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();r.length>0&&t.setSelections(r),o_(a,s.getCursorStates())}}class cxt extends ft{constructor(){super({id:"editor.action.addCursorsToTop",label:C("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),o=[];for(let a=n[0].startLineNumber;a>=1;a--)o.push(new gt(a,n[0].startColumn,a,n[0].endColumn));const r=t._getViewModel(),s=r.getCursorStates();o.length>0&&t.setSelections(o),o_(s,r.getCursorStates())}}class bR{constructor(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}class Jk{static create(e,t){if(!e.hasModel())return null;const n=t.getState();if(!e.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new Jk(e,t,!1,n.searchString,n.wholeWord,n.matchCase,null);let o=!1,r,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(o=!0,r=!0,s=!0):(r=n.wholeWord,s=n.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 gt(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` -`);return new Jk(e,t,o,c,r,s,d)}constructor(e,t,n,o,r,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=o,this.wholeWord=r,this.matchCase=s,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 bR(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 bR(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return n?new gt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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 bR(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 bR(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return n?new gt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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 xb extends _e{static get(e){return e.getContribution(xb.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=Jk.create(this._editor,e);if(!t)return;this._session=t;const n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(o=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(o=>{(o.matchCase||o.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 n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new gt(t.startLineNumber,n.startColumn,t.startLineNumber,n.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 o=e.getState().matchCase;if(!ISe(this._editor.getModel(),t,o)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&n.isRegex){const o=this._editor.getModel();n.searchScope?t=o.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=o.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){const o=this._editor.getSelection();for(let r=0,s=t.length;rnew gt(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn)))}}}xb.ID="editor.contrib.multiCursorController";class OS extends ft{run(e,t){const n=xb.get(t);if(!n)return;const o=t._getViewModel();if(o){const r=o.getCursorStates(),s=ha.get(t);if(s)this._run(n,s);else{const a=e.get($t).createInstance(ha,t);this._run(n,a),a.dispose()}o_(r,o.getCursorStates())}}}class dxt extends OS{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:C("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2082,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class uxt extends OS{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:C("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class hxt extends OS{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:C("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:Zo(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class fxt extends OS{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:C("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 gxt extends OS{constructor(){super({id:"editor.action.selectHighlights",label:C("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:3114,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class pxt extends OS{constructor(){super({id:"editor.action.changeAll",label:C("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:Me.and(Q.writable,Q.editorTextFocus),kbOpts:{kbExpr:Q.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class mxt{constructor(e,t,n,o,r){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=o,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,r&&this._model===r._model&&this._searchText===r._searchText&&this._matchCase===r._matchCase&&this._wordSeparators===r._wordSeparators&&this._modelVersionId===r._modelVersionId&&(this._cachedFindMatches=r._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(V.compareRangesUsingStarts)),this._cachedFindMatches}}let eI=LU=class extends _e{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new bi(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(o=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(o=>{!this._isEnabled||(o.selection.isEmpty()?o.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(o=>{this._setState(null)})),this._register(e.onDidChangeModelContent(o=>{this._isEnabled&&this.updateSoon.schedule()}));const n=ha.get(e);n&&this._register(n.getState().onFindReplaceStateChange(o=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(LU._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,n){if(!t||!n.hasModel())return null;const o=n.getSelection();if(o.startLineNumber!==o.endLineNumber)return null;const r=xb.get(n);if(!r)return null;const s=ha.get(n);if(!s)return null;let a=r.getSession(s);if(!a){const d=n.getSelections();if(d.length>1){const h=s.getState().matchCase;if(!ISe(n.getModel(),d,h))return null}a=Jk.create(n,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.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 mxt(n.getModel(),a.searchText,a.matchCase,a.wholeWord?n.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 n=this.state.findMatches(),o=this.editor.getSelections();o.sort(V.compareRangesUsingStarts);const r=[];for(let l=0,c=0,d=n.length,u=o.length;l=u)r.push(h),l++;else{const f=V.compareRangesUsingStarts(h,o[c]);f<0?((o[c].isEmpty()||!V.areIntersecting(h,o[c]))&&r.push(h),l++):(f>0||l++,c++)}}const s=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=r.map(l=>({range:l,options:nxt(s)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};eI.ID="editor.contrib.selectionHighlighter";eI=LU=ixt([oxt(1,pt)],eI);function ISe(i,e,t){const n=Uce(i,e[0],!t);for(let o=1,r=e.length;oTSe(void 0,void 0,void 0,function*(){const[t,n,o]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string"||!o);const r=i.get(pt),s=yield i.get(za).createModelReference(t);try{const a=yield NSe(r.signatureHelpProvider,s.object.textEditorModel,ae.lift(n),{triggerKind:lf.Invoke,isRetrigger:!1,triggerCharacter:o},_n.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}}));var bxt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},rm;(function(i){i.Default={type:0};class e{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=2}}i.Pending=e;class t{constructor(o){this.hints=o,this.type=1}}i.Active=t})(rm||(rm={}));class zF extends _e{constructor(e,t,n=zF.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new le),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=rm.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Kr),this.triggerChars=new eP,this.retriggerChars=new eP,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Wd(n),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(o=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(o=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(o=>this.onCursorChange(o))),this._register(this.editor.onDidChangeModelContent(o=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(o=>this.onDidType(o))),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=rm.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const o=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(o),t).catch(en)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,o=this.editor.getOption(85).cycle;if((e<2||n)&&!o){this.cancel();return}this.updateActiveSignature(n&&o?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,o=this.editor.getOption(85).cycle;if((e<2||n)&&!o){this.cancel();return}this.updateActiveSignature(n&&o?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new rm.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return bxt(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const o=this._pendingTriggers.reduce(Cxt);this._pendingTriggers=[];const r={triggerKind:o.triggerKind,triggerCharacter:o.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new rm.Pending(sr(l=>NSe(this.providers,s,a,r,l)),n);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 rm.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=rm.Default),en(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 n of t.signatureHelpTriggerCharacters||[])if(n.length){const o=n.charCodeAt(0);this.triggerChars.add(o),this.retriggerChars.add(o)}for(const n of t.signatureHelpRetriggerCharacters||[])n.length&&this.retriggerChars.add(n.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:lf.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:lf.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:lf.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}zF.DEFAULT_DELAY=120;function Cxt(i,e){switch(e.triggerKind){case lf.Invoke:return e;case lf.ContentChange:return i;case lf.TriggerCharacter:default:return e}}var yxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},b7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},EU;const El=He,wxt=Eo("parameter-hints-next",Xe.chevronDown,C("parameterHintsNextIcon","Icon for show next parameter hint.")),Sxt=Eo("parameter-hints-previous",Xe.chevronUp,C("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let MO=EU=class extends _e{constructor(e,t,n,o,r){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 up({editor:e},r,o)),this.keyVisible=Lb.Visible.bindTo(n),this.keyMultipleSignatures=Lb.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){const e=El(".editor-widget.parameter-hints-widget"),t=Ae(e,El(".phwrapper"));t.tabIndex=-1;const n=Ae(t,El(".controls")),o=Ae(n,El(".button"+Mt.asCSSSelector(Sxt))),r=Ae(n,El(".overloads")),s=Ae(n,El(".button"+Mt.asCSSSelector(wxt)));this._register(ke(o,"click",h=>{un.stop(h),this.previous()})),this._register(ke(s,"click",h=>{un.stop(h),this.next()}));const a=El(".body"),l=new QI(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Ae(a,El(".signature")),d=Ae(a,El(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:r,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=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};u(),this._register(st.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 n=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const o=e.signatures[e.activeSignature];if(!o)return;const r=Ae(this.domNodes.signature,El(".code")),s=this.editor.getOption(50);r.style.fontSize=`${s.fontSize}px`,r.style.fontFamily=s.fontFamily;const a=o.parameters.length>0,l=(t=o.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(r,o,l);else{const u=Ae(r,El("span"));u.textContent=o.label}const c=o.parameters[l];if(c!=null&&c.documentation){const u=El("span.documentation");if(typeof c.documentation=="string")u.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);u.appendChild(h.element)}Ae(this.domNodes.docs,El("p",{},u))}if(o.documentation!==void 0)if(typeof o.documentation=="string")Ae(this.domNodes.docs,El("p",{},o.documentation));else{const u=this.renderMarkdownDocs(o.documentation);Ae(this.domNodes.docs,u.element)}const d=this.hasDocs(o,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=o.parameters[l];Array.isArray(h.label)?u=o.label.substring(h.label[0],h.label[1]):u=h.label,h.documentation&&(u+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),o.documentation&&(u+=typeof o.documentation=="string"?`, ${o.documentation}`:`, ${o.documentation.value}`),this.announcedLabel!==u&&(Cs(C("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 n;(n=this.domNodes)===null||n===void 0||n.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&c0(t.documentation).length>0||t&&typeof t.documentation=="object"&&c0(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&c0(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&c0(e.documentation.value).length>0)}renderParameters(e,t,n){const[o,r]=this.getParameterLabelOffsets(t,n),s=document.createElement("span");s.textContent=t.label.substring(0,o);const a=document.createElement("span");a.textContent=t.label.substring(o,r),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(r),Ae(e,s,a,l)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const o=new RegExp(`(\\W|^)${Xl(n.label)}(?=\\W|$)`,"g");o.test(e.label);const r=o.lastIndex-n.label.length;return r>=0?[r,o.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 EU.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const n=this.domNodes.element.getElementsByClassName("phwrapper");n.length&&(n[0].style.maxHeight=t)}};MO.ID="editor.widget.parameterHintsWidget";MO=EU=yxt([b7(2,Ut),b7(3,ml),b7(4,Ki)],MO);J("editorHoverWidget.highlightForeground",{dark:xd,light:xd,hcDark:xd,hcLight:xd},C("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var xxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},DU;let Eb=DU=class extends _e{static get(e){return e.getContribution(DU.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new zF(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(o=>{var r;o?(this.widget.value.show(),this.widget.value.render(o)):(r=this.widget.rawValue)===null||r===void 0||r.hide()})),this.widget=new ah(()=>this._register(t.createInstance(MO,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)}};Eb.ID="editor.controller.parameterHints";Eb=DU=xxt([jce(1,$t),jce(2,pt)],Eb);class Lxt extends ft{constructor(){super({id:"editor.action.triggerParameterHints",label:C("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:Q.hasSignatureHelpProvider,kbOpts:{kbExpr:Q.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=Eb.get(t);n==null||n.trigger({triggerKind:lf.Invoke})}}Un(Eb.ID,Eb,2);ze(Lxt);const HY=100+75,$Y=Ir.bindToContribution(Eb.get);Ye(new $Y({id:"closeParameterHints",precondition:Lb.Visible,handler:i=>i.cancel(),kbOpts:{weight:HY,kbExpr:Q.focus,primary:9,secondary:[1033]}}));Ye(new $Y({id:"showPrevParameterHint",precondition:Me.and(Lb.Visible,Lb.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:HY,kbExpr:Q.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Ye(new $Y({id:"showNextParameterHint",precondition:Me.and(Lb.Visible,Lb.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:HY,kbExpr:Q.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var Ext=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},C7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const UF=new lt("renameInputVisible",!1,C("renameInputVisible","Whether the rename input widget is visible"));let kU=class{constructor(e,t,n,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=o,this._disposables=new Be,this.allowEditorOverflow=!0,this._visibleContextKey=UF.bindTo(r),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._disposables.add(n.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",C("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,n,o,r;if(!this._input||!this._domNode)return;const s=e.getColor(Gh),a=e.getColor(SG);this._domNode.style.backgroundColor=String((t=e.getColor(po))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((n=e.getColor(rbe))!==null&&n!==void 0?n:""),this._input.style.backgroundColor=String((o=e.getColor(obe))!==null&&o!==void 0?o:"");const l=e.getColor(sbe);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(r=l==null?void 0:l.toString())!==null&&r!==void 0?r:"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=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[n,o]=this._acceptKeybindings;return this._label.innerText=C({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(n))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(o))===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,n,o,r,s){this._domNode.classList.toggle("preview",r),this._position=new ae(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",n.toString()),this._input.setAttribute("selectionEnd",o.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:r&&c})},a.add(s.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)}};kU=Ext([C7(2,vr),C7(3,xi),C7(4,Ut)],kU);var Dxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},L_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},B0=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},IU;class zY{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return B0(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` +`+u),this.shouldAutoIndent(e,o)){c.getLineContent=f=>f===d?e.getLineContent(o.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,r,o.startLineNumber,o.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,o,r,a,h);else{const f=pE(this._autoIndent,c,e.getLanguageIdAtPosition(o.startLineNumber,1),d,l,this._languageConfigurationService);if(f!==null){const g=Si(e.getLineContent(o.startLineNumber)),p=Ya(f,r),v=Ya(g,r);if(p!==v){const m=p-v;this.getIndentEditsOfMovingBlock(e,t,o,r,a,m)}}}}}this._selectionId=t.trackSelection(o)}buildIndentConverter(e,t,n){return{shiftIndent:o=>Ec.shiftIndent(o,o.length+1,e,t,n),unshiftIndent:o=>Ec.unshiftIndent(o,o.length+1,e,t,n)}}parseEnterResult(e,t,n,o,r){if(r){let s=r.indentation;r.indentAction===Ho.None||r.indentAction===Ho.Indent?s=r.indentation+r.appendText:r.indentAction===Ho.IndentOutdent?s=r.indentation:r.indentAction===Ho.Outdent&&(s=t.unshiftIndent(r.indentation)+r.appendText);const a=e.getLineContent(o);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=Si(e.getLineContent(o));let c=Si(s);const d=Nbe(e,o,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const u=Ya(c,n),h=Ya(l,n);return u-h}}return null}matchEnterRuleMovingDown(e,t,n,o,r,s){if(Wu(s)>=0){const a=e.getLineMaxColumn(r),l=Dy(this._autoIndent,e,new V(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,l)}else{let a=o-1;for(;a>=1;){const d=e.getLineContent(a);if(Wu(d)>=0)break;a--}if(a<1||o>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Dy(this._autoIndent,e,new V(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,c)}}matchEnterRule(e,t,n,o,r,s){let a=r;for(;a>=1;){let d;if(a===r&&s!==void 0?d=s:d=e.getLineContent(a),Wu(d)>=0)break;a--}if(a<1||o>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Dy(this._autoIndent,e,new V(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const n=e.getLanguageIdAtPosition(t.startLineNumber,1),o=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(n!==o||this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,n,o,r,s){for(let a=n.startLineNumber;a<=n.endLineNumber;a++){const l=e.getLineContent(a),c=Si(l),u=Ya(c,o)+s,h=FE(u,o,r);h!==c&&(t.addEditOperation(new V(a,1,a,c.length+1),h),a===n.endLineNumber&&n.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber=o)return null;const r=[];for(let a=n;a<=o;a++)r.push(i.getLineContent(a));let s=r.slice(0);return s.sort(lv.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:n,endLineNumber:o,before:r,after:s}}function CSt(i,e,t){const n=CSe(i,e,t);return n?Gi.replace(new V(n.startLineNumber,1,n.endLineNumber,i.getLineMaxColumn(n.endLineNumber)),n.after.join(` +`)):null}class ySe extends ft{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const n=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));n.sort((s,a)=>V.compareRangesUsingStarts(s.selection,a.selection));let o=n[0];for(let s=1;snew ae(a.positionLineNumber,a.positionColumn)));const r=t.getSelection();if(r===null)return;const s=new mSt(r,o);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}zF.ID="editor.action.trimTrailingWhitespace";class ISt extends ft{constructor(){super({id:"editor.action.deleteLines",label:C("lines.delete","Delete Line"),alias:"Delete Line",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const n=this._getLinesToRemove(t),o=t.getModel();if(o.getLineCount()===1&&o.getLineMaxColumn(1)===1)return;let r=0;const s=[],a=[];for(let l=0,c=n.length;l1&&(u-=1,f=o.getLineMaxColumn(u)),s.push(Gi.replace(new gt(u,f,h,g),"")),a.push(new gt(u-r,d.positionColumn,u-r,d.positionColumn)),r+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(r=>{let s=r.endLineNumber;return r.startLineNumberr.startLineNumber===s.startLineNumber?r.endLineNumber-s.endLineNumber:r.startLineNumber-s.startLineNumber);const n=[];let o=t[0];for(let r=1;r=t[r].startLineNumber?o.endLineNumber=t[r].endLineNumber:(n.push(o),o=t[r]);return n.push(o),n}}class TSt extends ft{constructor(){super({id:"editor.action.indentLines",label:C("lines.indent","Indent Line"),alias:"Indent Line",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2142,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.indent(n.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class NSt extends ft{constructor(){super({id:"editor.action.outdentLines",label:C("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2140,weight:100}})}run(e,t){ky.Outdent.runEditorCommand(e,t,null)}}class RSt extends ft{constructor(){super({id:"editor.action.insertLineBefore",label:C("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3075,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.lineInsertBefore(n.cursorConfig,t.getModel(),t.getSelections())))}}class MSt extends ft{constructor(){super({id:"editor.action.insertLineAfter",label:C("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2051,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.lineInsertAfter(n.cursorConfig,t.getModel(),t.getSelections())))}}class xSe extends ft{run(e,t){if(!t.hasModel())return;const n=t.getSelection(),o=this._getRangesToDelete(t),r=[];for(let l=0,c=o.length-1;lGi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class ASt extends xSe{constructor(){super({id:"deleteAllLeft",label:C("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let n=null;const o=[];let r=0;return t.forEach(s=>{let a;if(s.endColumn===1&&r>0){const l=s.startLineNumber-r;a=new gt(l,s.startColumn,l,s.startColumn)}else a=new gt(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);r+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?n=a:o.push(a)}),n&&o.unshift(n),o}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let n=t;const o=e.getModel();return o===null?[]:(n.sort(V.compareRangesUsingStarts),n=n.map(r=>{if(r.isEmpty())if(r.startColumn===1){const s=Math.max(1,r.startLineNumber-1),a=r.startLineNumber===1?1:o.getLineLength(s)+1;return new V(s,a,r.startLineNumber,1)}else return new V(r.startLineNumber,1,r.startLineNumber,r.startColumn);else return new V(r.startLineNumber,1,r.endLineNumber,r.endColumn)}),n)}}class PSt extends xSe{constructor(){super({id:"deleteAllRight",label:C("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let n=null;const o=[];for(let r=0,s=t.length,a=0;r{if(r.isEmpty()){const s=t.getLineMaxColumn(r.startLineNumber);return r.startColumn===s?new V(r.startLineNumber,r.startColumn,r.startLineNumber+1,1):new V(r.startLineNumber,r.startColumn,r.startLineNumber,s)}return r});return o.sort(V.compareRangesUsingStarts),o}}class OSt extends ft{constructor(){super({id:"editor.action.joinLines",label:C("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const n=t.getSelections();if(n===null)return;let o=t.getSelection();if(o===null)return;n.sort(V.compareRangesUsingStarts);const r=[],s=n.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(o.equalsSelection(h)&&(o=f),f):f.startLineNumber>h.endLineNumber+1?(r.push(h),f):new gt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(r.push(h),f):new gt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));r.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=o,u=0;for(let h=0,f=r.length;h=1){let R=!0;L===""&&(R=!1),R&&(L.charAt(L.length-1)===" "||L.charAt(L.length-1)===" ")&&(R=!1,L=L.replace(/[\s\uFEFF\xA0]+$/g," "));const A=I.substr(k-1);L+=(R?" ":"")+A,R?m=A.length+1:m=A.length}else m=0}const D=new V(p,v,_,y);if(!D.isEmpty()){let E;g.isEmpty()?(l.push(Gi.replace(D,L)),E=new gt(D.startLineNumber-u,L.length-m+1,p-u,L.length-m+1)):g.startLineNumber===g.endLineNumber?(l.push(Gi.replace(D,L)),E=new gt(g.startLineNumber-u,g.startColumn,g.endLineNumber-u,g.endColumn)):(l.push(Gi.replace(D,L)),E=new gt(g.startLineNumber-u,g.startColumn,g.startLineNumber-u,L.length-w)),V.intersectRanges(D,o)!==null?d=E:c.push(E)}u+=D.endLineNumber-D.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class FSt extends ft{constructor(){super({id:"editor.action.transpose",label:C("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:Q.writable})}run(e,t){const n=t.getSelections();if(n===null)return;const o=t.getModel();if(o===null)return;const r=[];for(let s=0,a=n.length;s=d){if(c.lineNumber===o.getLineCount())continue;const u=new V(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=o.getValueInRange(u).split("").reverse().join("");r.push(new Qr(new gt(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const u=new V(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=o.getValueInRange(u).split("").reverse().join("");r.push(new OG(u,h,new gt(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class PS extends ft{run(e,t){const n=t.getSelections();if(n===null)return;const o=t.getModel();if(o===null)return;const r=t.getOption(129),s=[];for(const a of n)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new V(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),u=o.getValueInRange(d);s.push(Gi.replace(d,this._modifyText(u,r)))}else{const l=o.getValueInRange(a);s.push(Gi.replace(a,this._modifyText(l,r)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class BSt extends PS{constructor(){super({id:"editor.action.transformToUppercase",label:C("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:Q.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class WSt extends PS{constructor(){super({id:"editor.action.transformToLowercase",label:C("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:Q.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class i1{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 Zk extends PS{constructor(){super({id:"editor.action.transformToTitlecase",label:C("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:Q.writable})}_modifyText(e,t){const n=Zk.titleBoundary.get();return n?e.toLocaleLowerCase().replace(n,o=>o.toLocaleUpperCase()):e}}Zk.titleBoundary=new i1("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class cv extends PS{constructor(){super({id:"editor.action.transformToSnakecase",label:C("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:Q.writable})}_modifyText(e,t){const n=cv.caseBoundary.get(),o=cv.singleLetters.get();return!n||!o?e:e.replace(n,"$1_$2").replace(o,"$1_$2$3").toLocaleLowerCase()}}cv.caseBoundary=new i1("(\\p{Ll})(\\p{Lu})","gmu");cv.singleLetters=new i1("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class Qk extends PS{constructor(){super({id:"editor.action.transformToCamelcase",label:C("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:Q.writable})}_modifyText(e,t){const n=Qk.wordBoundary.get();if(!n)return e;const o=e.split(n);return o.shift()+o.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}Qk.wordBoundary=new i1("[_\\s-]","gm");class ep extends PS{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:C("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:Q.writable})}_modifyText(e,t){const n=ep.caseBoundary.get(),o=ep.singleLetters.get(),r=ep.underscoreBoundary.get();return!n||!o||!r?e:e.replace(r,"$1-$3").replace(n,"$1-$2").replace(o,"$1-$2").toLocaleLowerCase()}}ep.caseBoundary=new i1("(\\p{Ll})(\\p{Lu})","gmu");ep.singleLetters=new i1("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");ep.underscoreBoundary=new i1("(\\S)(_)(\\S)","gm");ze(ySt);ze(wSt);ze(SSt);ze(xSt);ze(LSt);ze(ESt);ze(DSt);ze(kSt);ze(zF);ze(ISt);ze(TSt);ze(NSt);ze(RSt);ze(MSt);ze(ASt);ze(PSt);ze(OSt);ze(FSt);ze(BSt);ze(WSt);cv.caseBoundary.isSupported()&&cv.singleLetters.isSupported()&&ze(cv);Qk.wordBoundary.isSupported()&&ze(Qk);Zk.titleBoundary.isSupported()&&ze(Zk);ep.isSupported()&&ze(ep);var VSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},pR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},SU=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},PM;const LSe=new lt("LinkedEditingInputVisible",!1),HSt="linked-editing-decoration";let Uv=PM=class extends _e{static get(e){return e.getContribution(PM.ID)}constructor(e,t,n,o,r){super(),this.languageConfigurationService=o,this._syncRangesToken=0,this._localToDispose=this._register(new Be),this._editor=e,this._providers=n.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=LSe.bindTo(t),this._debounceInformation=r.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(s=>{(s.hasChanged(69)||s.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(),n=t!==null&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(n===this._enabled&&!e||(this._enabled=n,this.clearRanges(),this._localToDispose.clear(),!n||t===null))return;this._localToDispose.add(st.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const o=new Wd(this._debounceInformation.get(t)),r=()=>{var l;this._rangeUpdateTriggerPromise=o.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new Wd(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{r()})),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}}r()})),this._localToDispose.add({dispose:()=>{o.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),n=this._currentDecorations.getRange(0);if(!n||n.startLineNumber!==n.endLineNumber)return this.clearRanges();const o=t.getValueInRange(n);if(this._currentWordPattern){const s=o.match(this._currentWordPattern);if((s?s[0].length:0)!==o.length)return this.clearRanges()}const r=[];for(let s=1,a=this._currentDecorations.length;s1){this.clearRanges();return}const n=this._editor.getModel(),o=n.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===o){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=o;const r=sr(s=>SU(this,void 0,void 0,function*(){try{const a=new Ls(!1),l=yield ESe(this._providers,n,t,s);if(this._debounceInformation.update(n,a.elapsed()),r!==this._currentRequest||(this._currentRequest=null,o!==n.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:PM.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(a){sh(a)||en(a),(this._currentRequest===r||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=r,r})}};Uv.ID="editor.contrib.linkedEditing";Uv.DECORATION=Jt.register({description:"linked-editing",stickiness:0,className:HSt});Uv=PM=VSt([pR(1,Ut),pR(2,pt),pR(3,Ti),pR(4,qc)],Uv);class $St extends ft{constructor(){super({id:"editor.action.linkedEditing",label:C("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:Me.and(Q.writable,Q.hasRenameProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const n=e.get(Jn),[o,r]=Array.isArray(t)&&t||[void 0,void 0];return Rt.isUri(o)&&ae.isIPosition(r)?n.openCodeEditor({resource:o},n.getActiveCodeEditor()).then(s=>{!s||(s.setPosition(r),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=Uv.get(t);return n?Promise.resolve(n.updateRanges(!0)):Promise.resolve()}}const zSt=Ir.bindToContribution(Uv.get);Ye(new zSt({id:"cancelLinkedEditingInput",precondition:LSe,handler:i=>i.clearRanges(),kbOpts:{kbExpr:Q.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function ESe(i,e,t,n){const o=i.ordered(e);return D0e(o.map(r=>()=>SU(this,void 0,void 0,function*(){try{return yield r.provideLinkedEditingRanges(e,t,n)}catch(s){$o(s);return}})),r=>!!r&&ws(r==null?void 0:r.ranges))}J("editor.linkedEditingBackground",{dark:ve.fromHex("#f00").transparent(.3),light:ve.fromHex("#f00").transparent(.3),hcDark:ve.fromHex("#f00").transparent(.3),hcLight:ve.white},C("editorLinkedEditingBackground","Background color when the editor auto renames on type."));Nf("_executeLinkedEditingProvider",(i,e,t)=>{const{linkedEditingRangeProvider:n}=i.get(pt);return ESe(n,e,t,_n.None)});Un(Uv.ID,Uv,1);ze($St);var DSe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class USt{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 DSe(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 RO{constructor(e){this._disposables=new Be;let t=[];for(const[n,o]of e){const r=n.links.map(s=>new USt(s,o));t=RO._union(t,r),$q(n)&&this._disposables.add(n)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const n=[];let o,r,s,a;for(o=0,s=0,r=e.length,a=t.length;oPromise.resolve(r.provideLinks(e,t)).then(a=>{a&&(n[s]=[a,r])},$o));return Promise.all(o).then(()=>{const r=new RO(hf(n));return t.isCancellationRequested?(r.dispose(),new RO([])):r})}Rn.registerCommand("_executeLinkProvider",(i,...e)=>DSe(void 0,void 0,void 0,function*(){let[t,n]=e;fi(t instanceof Rt),typeof n!="number"&&(n=0);const{linkProvider:o}=i.get(pt),r=i.get(Yi).getModel(t);if(!r)return[];const s=yield kSe(o,r,_n.None);if(!s)return[];for(let l=0;l=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},mR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},KSt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},xU;let Qw=xU=class extends _e{static get(e){return e.getContribution(xU.ID)}constructor(e,t,n,o,r){super(),this.editor=e,this.openerService=t,this.notificationService=n,this.languageFeaturesService=o,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=r.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new bi(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new uF(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.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 KSt(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=sr(t=>kSe(this.providers,e,t));try{const t=new Ls(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){en(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(77)==="altKey",n=[],o=Object.keys(this.currentOccurrences);for(const s of o){const a=this.currentOccurrences[s];n.push(a.decorationId)}const r=[];if(e)for(const s of e)r.push(Hy.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(n,r);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{o.activate(r,n),this.activeLinkDecorationId=o.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(n=>{t.deactivate(n,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,n=!1){if(!this.openerService)return;const{link:o}=e;o.resolve(_n.None).then(r=>{if(typeof r=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===hn.file&&r.startsWith(`${hn.file}:`)){const a=Rt.parse(r);if(a.scheme===hn.file){const l=yh(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(r=jst(s,c))}}}return this.openerService.open(r,{openToSide:t,fromUserGesture:n,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},r=>{const s=r instanceof Error?r.message:r;s==="invalid"?this.notificationService.warn(C("invalid.url","Failed to open this link because it is not well-formed: {0}",o.url.toString())):s==="missing"?this.notificationService.warn(C("missing.url","Failed to open this link because its target is missing.")):en(r)})}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 n of t){const o=this.currentOccurrences[n.id];if(o)return o}return null}isEnabled(e,t){return Boolean(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()}};Qw.ID="editor.linkDetector";Qw=xU=jSt([mR(1,ml),mR(2,Ao),mR(3,pt),mR(4,qc)],Qw);const Uce={general:Jt.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Jt.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Hy{static decoration(e,t){return{range:e.range,options:Hy._getOptions(e,t,!1)}}static _getOptions(e,t,n){const o=Object.assign({},n?Uce.active:Uce.general);return o.hoverMessage=qSt(e,t),o}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,Hy._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Hy._getOptions(this.link,t,!1))}}function qSt(i,e){const t=i.url&&/^command:/i.test(i.url.toString()),n=i.tooltip?i.tooltip:t?C("links.navigate.executeCmd","Execute command"):C("links.navigate.follow","Follow link"),o=e?Nn?C("links.navigate.kb.meta.mac","cmd + click"):C("links.navigate.kb.meta","ctrl + click"):Nn?C("links.navigate.kb.alt.mac","option + click"):C("links.navigate.kb.alt","alt + click");if(i.url){let r="";if(/^command:/i.test(i.url.toString())){const a=i.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];r=C("tooltip.explanation","Execute command {0}",l)}}return new os("",!0).appendLink(i.url.toString(!0).replace(/ /g,"%20"),n,r).appendMarkdown(` (${o})`)}else return new os().appendText(`${n} (${o})`)}class GSt extends ft{constructor(){super({id:"editor.action.openLink",label:C("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const n=Qw.get(t);if(!n||!t.hasModel())return;const o=t.getSelections();for(const r of o){const s=n.getLinkOccurrence(r.getEndPosition());s&&n.openLinkOccurrence(s,!1)}}}Un(Qw.ID,Qw,1);ze(GSt);class LU extends _e{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const n=this._editor.getOption(116);n>=0&&t.target.type===6&&t.target.position.column>=n&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}LU.ID="editor.contrib.longLinesHelper";Un(LU.ID,LU,2);const vR=J("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},C("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);J("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},C("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);J("editor.wordHighlightTextBackground",{light:vR,dark:vR,hcDark:vR,hcLight:vR},C("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 _R=J("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));J("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));J("editor.wordHighlightTextBorder",{light:_R,dark:_R,hcDark:_R,hcLight:_R},C("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const XSt=J("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},C("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),YSt=J("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},C("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),ZSt=J("editorOverviewRuler.wordHighlightTextForeground",{dark:DL,light:DL,hcDark:DL,hcLight:DL},C("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),QSt=Jt.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:ro(YSt),position:Yl.Center},minimap:{color:ro(m5),position:ll.Inline}}),JSt=Jt.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:ro(ZSt),position:Yl.Center},minimap:{color:ro(m5),position:ll.Inline}}),ext=Jt.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:ro(DL),position:Yl.Center},minimap:{color:ro(m5),position:ll.Inline}}),txt=Jt.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),nxt=Jt.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:ro(XSt),position:Yl.Center},minimap:{color:ro(m5),position:ll.Inline}});function ixt(i){return i===MD.Write?QSt:i===MD.Text?JSt:nxt}function oxt(i){return i?txt:ext}jd((i,e)=>{const t=i.getColor(DG);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var rxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},sxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},EU;function o_(i,e){const t=e.filter(n=>!i.find(o=>o.equals(n)));if(t.length>=1){const n=t.map(r=>`line ${r.viewState.position.lineNumber} column ${r.viewState.position.column}`).join(", "),o=t.length===1?C("cursorAdded","Cursor added: {0}",n):C("cursorsAdded","Cursors added: {0}",n);kv(o)}}class axt extends ft{constructor(){super({id:"editor.action.insertCursorAbove",label:C("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,n){if(!t.hasModel())return;let o=!0;n&&n.logicalLine===!1&&(o=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const s=r.getCursorStates();r.setCursorStates(n.source,3,Mr.addCursorUp(r,s,o)),r.revealTopMostCursor(n.source),o_(s,r.getCursorStates())}}class lxt extends ft{constructor(){super({id:"editor.action.insertCursorBelow",label:C("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,n){if(!t.hasModel())return;let o=!0;n&&n.logicalLine===!1&&(o=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const s=r.getCursorStates();r.setCursorStates(n.source,3,Mr.addCursorDown(r,s,o)),r.revealBottomMostCursor(n.source),o_(s,r.getCursorStates())}}class cxt extends ft{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:C("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,n){if(!e.isEmpty()){for(let o=e.startLineNumber;o1&&n.push(new gt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const n=t.getModel(),o=t.getSelections(),r=t._getViewModel(),s=r.getCursorStates(),a=[];o.forEach(l=>this.getCursorsForSelection(l,n,a)),a.length>0&&t.setSelections(a),o_(s,r.getCursorStates())}}class dxt extends ft{constructor(){super({id:"editor.action.addCursorsToBottom",label:C("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),o=t.getModel().getLineCount(),r=[];for(let l=n[0].startLineNumber;l<=o;l++)r.push(new gt(l,n[0].startColumn,l,n[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();r.length>0&&t.setSelections(r),o_(a,s.getCursorStates())}}class uxt extends ft{constructor(){super({id:"editor.action.addCursorsToTop",label:C("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),o=[];for(let a=n[0].startLineNumber;a>=1;a--)o.push(new gt(a,n[0].startColumn,a,n[0].endColumn));const r=t._getViewModel(),s=r.getCursorStates();o.length>0&&t.setSelections(o),o_(s,r.getCursorStates())}}class bR{constructor(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}class Jk{static create(e,t){if(!e.hasModel())return null;const n=t.getState();if(!e.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new Jk(e,t,!1,n.searchString,n.wholeWord,n.matchCase,null);let o=!1,r,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(o=!0,r=!0,s=!0):(r=n.wholeWord,s=n.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 gt(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` +`);return new Jk(e,t,o,c,r,s,d)}constructor(e,t,n,o,r,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=o,this.wholeWord=r,this.matchCase=s,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 bR(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 bR(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return n?new gt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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 bR(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 bR(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return n?new gt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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 xb extends _e{static get(e){return e.getContribution(xb.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=Jk.create(this._editor,e);if(!t)return;this._session=t;const n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(o=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(o=>{(o.matchCase||o.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 n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new gt(t.startLineNumber,n.startColumn,t.startLineNumber,n.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 o=e.getState().matchCase;if(!ISe(this._editor.getModel(),t,o)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&n.isRegex){const o=this._editor.getModel();n.searchScope?t=o.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=o.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){const o=this._editor.getSelection();for(let r=0,s=t.length;rnew gt(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn)))}}}xb.ID="editor.contrib.multiCursorController";class OS extends ft{run(e,t){const n=xb.get(t);if(!n)return;const o=t._getViewModel();if(o){const r=o.getCursorStates(),s=ha.get(t);if(s)this._run(n,s);else{const a=e.get($t).createInstance(ha,t);this._run(n,a),a.dispose()}o_(r,o.getCursorStates())}}}class hxt extends OS{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:C("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2082,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class fxt extends OS{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:C("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class gxt extends OS{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:C("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:Zo(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class pxt extends OS{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:C("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 mxt extends OS{constructor(){super({id:"editor.action.selectHighlights",label:C("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:3114,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class vxt extends OS{constructor(){super({id:"editor.action.changeAll",label:C("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:Me.and(Q.writable,Q.editorTextFocus),kbOpts:{kbExpr:Q.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class _xt{constructor(e,t,n,o,r){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=o,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,r&&this._model===r._model&&this._searchText===r._searchText&&this._matchCase===r._matchCase&&this._wordSeparators===r._wordSeparators&&this._modelVersionId===r._modelVersionId&&(this._cachedFindMatches=r._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(V.compareRangesUsingStarts)),this._cachedFindMatches}}let eI=EU=class extends _e{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new bi(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(o=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(o=>{!this._isEnabled||(o.selection.isEmpty()?o.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(o=>{this._setState(null)})),this._register(e.onDidChangeModelContent(o=>{this._isEnabled&&this.updateSoon.schedule()}));const n=ha.get(e);n&&this._register(n.getState().onFindReplaceStateChange(o=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(EU._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,n){if(!t||!n.hasModel())return null;const o=n.getSelection();if(o.startLineNumber!==o.endLineNumber)return null;const r=xb.get(n);if(!r)return null;const s=ha.get(n);if(!s)return null;let a=r.getSession(s);if(!a){const d=n.getSelections();if(d.length>1){const h=s.getState().matchCase;if(!ISe(n.getModel(),d,h))return null}a=Jk.create(n,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.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 _xt(n.getModel(),a.searchText,a.matchCase,a.wholeWord?n.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 n=this.state.findMatches(),o=this.editor.getSelections();o.sort(V.compareRangesUsingStarts);const r=[];for(let l=0,c=0,d=n.length,u=o.length;l=u)r.push(h),l++;else{const f=V.compareRangesUsingStarts(h,o[c]);f<0?((o[c].isEmpty()||!V.areIntersecting(h,o[c]))&&r.push(h),l++):(f>0||l++,c++)}}const s=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=r.map(l=>({range:l,options:oxt(s)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};eI.ID="editor.contrib.selectionHighlighter";eI=EU=rxt([sxt(1,pt)],eI);function ISe(i,e,t){const n=jce(i,e[0],!t);for(let o=1,r=e.length;oTSe(void 0,void 0,void 0,function*(){const[t,n,o]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string"||!o);const r=i.get(pt),s=yield i.get(za).createModelReference(t);try{const a=yield NSe(r.signatureHelpProvider,s.object.textEditorModel,ae.lift(n),{triggerKind:lf.Invoke,isRetrigger:!1,triggerCharacter:o},_n.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}}));var yxt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},sm;(function(i){i.Default={type:0};class e{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=2}}i.Pending=e;class t{constructor(o){this.hints=o,this.type=1}}i.Active=t})(sm||(sm={}));class UF extends _e{constructor(e,t,n=UF.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new le),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=sm.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Kr),this.triggerChars=new eP,this.retriggerChars=new eP,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Wd(n),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(o=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(o=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(o=>this.onCursorChange(o))),this._register(this.editor.onDidChangeModelContent(o=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(o=>this.onDidType(o))),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=sm.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const o=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(o),t).catch(en)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,o=this.editor.getOption(85).cycle;if((e<2||n)&&!o){this.cancel();return}this.updateActiveSignature(n&&o?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,o=this.editor.getOption(85).cycle;if((e<2||n)&&!o){this.cancel();return}this.updateActiveSignature(n&&o?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new sm.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return yxt(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const o=this._pendingTriggers.reduce(wxt);this._pendingTriggers=[];const r={triggerKind:o.triggerKind,triggerCharacter:o.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new sm.Pending(sr(l=>NSe(this.providers,s,a,r,l)),n);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 sm.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=sm.Default),en(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 n of t.signatureHelpTriggerCharacters||[])if(n.length){const o=n.charCodeAt(0);this.triggerChars.add(o),this.retriggerChars.add(o)}for(const n of t.signatureHelpRetriggerCharacters||[])n.length&&this.retriggerChars.add(n.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:lf.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:lf.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:lf.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}UF.DEFAULT_DELAY=120;function wxt(i,e){switch(e.triggerKind){case lf.Invoke:return e;case lf.ContentChange:return i;case lf.TriggerCharacter:default:return e}}var Sxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},C7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},DU;const El=He,xxt=Eo("parameter-hints-next",Xe.chevronDown,C("parameterHintsNextIcon","Icon for show next parameter hint.")),Lxt=Eo("parameter-hints-previous",Xe.chevronUp,C("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let MO=DU=class extends _e{constructor(e,t,n,o,r){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 hp({editor:e},r,o)),this.keyVisible=Lb.Visible.bindTo(n),this.keyMultipleSignatures=Lb.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){const e=El(".editor-widget.parameter-hints-widget"),t=Ae(e,El(".phwrapper"));t.tabIndex=-1;const n=Ae(t,El(".controls")),o=Ae(n,El(".button"+Mt.asCSSSelector(Lxt))),r=Ae(n,El(".overloads")),s=Ae(n,El(".button"+Mt.asCSSSelector(xxt)));this._register(ke(o,"click",h=>{un.stop(h),this.previous()})),this._register(ke(s,"click",h=>{un.stop(h),this.next()}));const a=El(".body"),l=new QI(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Ae(a,El(".signature")),d=Ae(a,El(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:r,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=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};u(),this._register(st.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 n=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const o=e.signatures[e.activeSignature];if(!o)return;const r=Ae(this.domNodes.signature,El(".code")),s=this.editor.getOption(50);r.style.fontSize=`${s.fontSize}px`,r.style.fontFamily=s.fontFamily;const a=o.parameters.length>0,l=(t=o.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(r,o,l);else{const u=Ae(r,El("span"));u.textContent=o.label}const c=o.parameters[l];if(c!=null&&c.documentation){const u=El("span.documentation");if(typeof c.documentation=="string")u.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);u.appendChild(h.element)}Ae(this.domNodes.docs,El("p",{},u))}if(o.documentation!==void 0)if(typeof o.documentation=="string")Ae(this.domNodes.docs,El("p",{},o.documentation));else{const u=this.renderMarkdownDocs(o.documentation);Ae(this.domNodes.docs,u.element)}const d=this.hasDocs(o,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=o.parameters[l];Array.isArray(h.label)?u=o.label.substring(h.label[0],h.label[1]):u=h.label,h.documentation&&(u+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),o.documentation&&(u+=typeof o.documentation=="string"?`, ${o.documentation}`:`, ${o.documentation.value}`),this.announcedLabel!==u&&(Cs(C("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 n;(n=this.domNodes)===null||n===void 0||n.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&c0(t.documentation).length>0||t&&typeof t.documentation=="object"&&c0(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&c0(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&c0(e.documentation.value).length>0)}renderParameters(e,t,n){const[o,r]=this.getParameterLabelOffsets(t,n),s=document.createElement("span");s.textContent=t.label.substring(0,o);const a=document.createElement("span");a.textContent=t.label.substring(o,r),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(r),Ae(e,s,a,l)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const o=new RegExp(`(\\W|^)${Xl(n.label)}(?=\\W|$)`,"g");o.test(e.label);const r=o.lastIndex-n.label.length;return r>=0?[r,o.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 DU.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const n=this.domNodes.element.getElementsByClassName("phwrapper");n.length&&(n[0].style.maxHeight=t)}};MO.ID="editor.widget.parameterHintsWidget";MO=DU=Sxt([C7(2,Ut),C7(3,ml),C7(4,Ki)],MO);J("editorHoverWidget.highlightForeground",{dark:xd,light:xd,hcDark:xd,hcLight:xd},C("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var Ext=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Kce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},kU;let Eb=kU=class extends _e{static get(e){return e.getContribution(kU.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new UF(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(o=>{var r;o?(this.widget.value.show(),this.widget.value.render(o)):(r=this.widget.rawValue)===null||r===void 0||r.hide()})),this.widget=new ah(()=>this._register(t.createInstance(MO,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)}};Eb.ID="editor.controller.parameterHints";Eb=kU=Ext([Kce(1,$t),Kce(2,pt)],Eb);class Dxt extends ft{constructor(){super({id:"editor.action.triggerParameterHints",label:C("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:Q.hasSignatureHelpProvider,kbOpts:{kbExpr:Q.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=Eb.get(t);n==null||n.trigger({triggerKind:lf.Invoke})}}Un(Eb.ID,Eb,2);ze(Dxt);const $Y=100+75,zY=Ir.bindToContribution(Eb.get);Ye(new zY({id:"closeParameterHints",precondition:Lb.Visible,handler:i=>i.cancel(),kbOpts:{weight:$Y,kbExpr:Q.focus,primary:9,secondary:[1033]}}));Ye(new zY({id:"showPrevParameterHint",precondition:Me.and(Lb.Visible,Lb.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:$Y,kbExpr:Q.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Ye(new zY({id:"showNextParameterHint",precondition:Me.and(Lb.Visible,Lb.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:$Y,kbExpr:Q.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var kxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},y7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const jF=new lt("renameInputVisible",!1,C("renameInputVisible","Whether the rename input widget is visible"));let IU=class{constructor(e,t,n,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=o,this._disposables=new Be,this.allowEditorOverflow=!0,this._visibleContextKey=jF.bindTo(r),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._disposables.add(n.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",C("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,n,o,r;if(!this._input||!this._domNode)return;const s=e.getColor(Gh),a=e.getColor(xG);this._domNode.style.backgroundColor=String((t=e.getColor(po))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((n=e.getColor(rbe))!==null&&n!==void 0?n:""),this._input.style.backgroundColor=String((o=e.getColor(obe))!==null&&o!==void 0?o:"");const l=e.getColor(sbe);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(r=l==null?void 0:l.toString())!==null&&r!==void 0?r:"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=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[n,o]=this._acceptKeybindings;return this._label.innerText=C({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(n))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(o))===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,n,o,r,s){this._domNode.classList.toggle("preview",r),this._position=new ae(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",n.toString()),this._input.setAttribute("selectionEnd",o.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:r&&c})},a.add(s.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)}};IU=kxt([y7(2,vr),y7(3,xi),y7(4,Ut)],IU);var Ixt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},L_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},B0=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},TU;class UY{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return B0(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` `):void 0}:{range:V.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` `):void 0}})}provideRenameEdits(e,t){return B0(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,n,o){return B0(this,void 0,void 0,function*(){const r=this._providers[t];if(!r)return{edits:[],rejectReason:n.join(` -`)};const s=yield r.provideRenameEdits(this.model,this.position,e,o);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,n.concat(s.rejectReason),o)}else return this._provideRenameEdits(e,t+1,n.concat(C("no result","No result.")),o);return s})}}function kxt(i,e,t,n){return B0(this,void 0,void 0,function*(){const o=new zY(e,t,i),r=yield o.resolveRenameLocation(_n.None);return r!=null&&r.rejectReason?{edits:[],rejectReason:r.rejectReason}:o.provideRenameEdits(n,_n.None)})}let Db=IU=class{static get(e){return e.getContribution(IU.ID)}constructor(e,t,n,o,r,s,a,l){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=o,this._progressService=r,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new Be,this._cts=new Ro,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(kU,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return B0(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new Ro,!this.editor.hasModel())return;const n=this.editor.getPosition(),o=new zY(this.editor.getModel(),n,this._languageFeaturesService.renameProvider);if(!o.hasProvider())return;const r=new Av(this.editor,5,void 0,this._cts.token);let s;try{const g=o.resolveRenameLocation(r.token);this._progressService.showWhile(g,250),s=yield g}catch(g){(e=cl.get(this.editor))===null||e===void 0||e.showMessage(g||C("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),n);return}finally{r.dispose()}if(!s)return;if(s.rejectReason){(t=cl.get(this.editor))===null||t===void 0||t.showMessage(s.rejectReason,n);return}if(r.token.isCancellationRequested)return;const a=new Av(this.editor,5,s.range,this._cts.token),l=this.editor.getSelection();let c=0,d=s.text.length;!V.isEmpty(l)&&!V.spansMultipleLines(l)&&V.containsRange(s.range,l)&&(c=Math.max(0,l.startColumn-s.range.startColumn),d=Math.min(s.range.endColumn,l.endColumn)-s.range.startColumn);const u=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=yield this._renameInputField.getInput(s.range,s.text,c,d,u,a.token);if(typeof h=="boolean"){h&&this.editor.focus(),a.dispose();return}this.editor.focus();const f=n5(o.provideRenameEdits(h.newName,a.token),a.token).then(g=>B0(this,void 0,void 0,function*(){if(!(!g||!this.editor.hasModel())){if(g.rejectReason){this._notificationService.info(g.rejectReason);return}this.editor.setSelection(V.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(g,{editor:this.editor,showPreview:h.wantsPreview,label:C("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,h.newName),code:"undoredo.rename",quotableLabel:C("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,h.newName),respectAutoSaveConfig:!0}).then(p=>{p.ariaSummary&&Cs(C("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,h.newName,p.ariaSummary))}).catch(p=>{this._notificationService.error(C("rename.failedApply","Rename failed to apply edits")),this._logService.error(p)})}}),g=>{this._notificationService.error(C("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)}};Db.ID="editor.contrib.renameController";Db=IU=Dxt([L_(1,$t),L_(2,Ao),L_(3,oT),L_(4,t_),L_(5,nc),L_(6,pG),L_(7,pt)],Db);class Ixt extends ft{constructor(){super({id:"editor.action.rename",label:C("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:Me.and(Q.writable,Q.hasRenameProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(Jn),[o,r]=Array.isArray(t)&&t||[void 0,void 0];return Rt.isUri(o)&&ae.isIPosition(r)?n.openCodeEditor({resource:o},n.getActiveCodeEditor()).then(s=>{!s||(s.setPosition(r),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=Db.get(t);return n?n.run():Promise.resolve()}}Un(Db.ID,Db,4);ze(Ixt);const UY=Ir.bindToContribution(Db.get);Ye(new UY({id:"acceptRenameInput",precondition:UF,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:3}}));Ye(new UY({id:"acceptRenameInputWithPreview",precondition:Me.and(UF,Me.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:1024+3}}));Ye(new UY({id:"cancelRenameInput",precondition:UF,handler:i=>i.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:Q.focus,primary:9,secondary:[1033]}}));Nf("_executeDocumentRenameProvider",function(i,e,t,...n){const[o]=n;fi(typeof o=="string");const{renameProvider:r}=i.get(pt);return kxt(r,e,t,o)});Nf("_executePrepareRename",function(i,e,t){return B0(this,void 0,void 0,function*(){const{renameProvider:n}=i.get(pt),r=yield new zY(e,t,n).resolveRenameLocation(_n.None);if(r!=null&&r.rejectReason)throw new Error(r.rejectReason);return r})});no.as(ch.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:C("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function Txt(i){for(let e=0,t=i.length;e0?t[0]:[]}function PSe(i,e,t,n,o){return jv(this,void 0,void 0,function*(){const r=Axt(i,e),s=yield Promise.all(r.map(a=>jv(this,void 0,void 0,function*(){let l,c=null;try{l=yield a.provideDocumentSemanticTokens(e,a===t?n:null,o)}catch(d){c=d,l=null}return(!l||!jF(l)&&!MSe(l))&&(l=null),new Mxt(a,l,c)})));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null})}function Pxt(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class Oxt{constructor(e,t){this.provider=e,this.tokens=t}}function Fxt(i,e){return i.has(e)}function OSe(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}function jY(i,e,t,n){return jv(this,void 0,void 0,function*(){const o=OSe(i,e),r=yield Promise.all(o.map(s=>jv(this,void 0,void 0,function*(){let a;try{a=yield s.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){$o(l),a=null}return(!a||!jF(a))&&(a=null),new Oxt(s,a)})));for(const s of r)if(s.tokens)return s;return r.length>0?r[0]:null})}Rn.registerCommand("_provideDocumentSemanticTokensLegend",(i,...e)=>jv(void 0,void 0,void 0,function*(){const[t]=e;fi(t instanceof Rt);const n=i.get(Yi).getModel(t);if(!n)return;const{documentSemanticTokensProvider:o}=i.get(pt),r=Pxt(o,n);return r?r[0].getLegend():i.get(_o).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));Rn.registerCommand("_provideDocumentSemanticTokens",(i,...e)=>jv(void 0,void 0,void 0,function*(){const[t]=e;fi(t instanceof Rt);const n=i.get(Yi).getModel(t);if(!n)return;const{documentSemanticTokensProvider:o}=i.get(pt);if(!ASe(o,n))return i.get(_o).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const r=yield PSe(o,n,null,null,_n.None);if(!r)return;const{provider:s,tokens:a}=r;if(!a||!jF(a))return;const l=RSe({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l}));Rn.registerCommand("_provideDocumentRangeSemanticTokensLegend",(i,...e)=>jv(void 0,void 0,void 0,function*(){const[t,n]=e;fi(t instanceof Rt);const o=i.get(Yi).getModel(t);if(!o)return;const{documentRangeSemanticTokensProvider:r}=i.get(pt),s=OSe(r,o);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!n||!V.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=yield jY(r,o,V.lift(n),_n.None);if(!!a)return a.provider.getLegend()}));Rn.registerCommand("_provideDocumentRangeSemanticTokens",(i,...e)=>jv(void 0,void 0,void 0,function*(){const[t,n]=e;fi(t instanceof Rt),fi(V.isIRange(n));const o=i.get(Yi).getModel(t);if(!o)return;const{documentRangeSemanticTokensProvider:r}=i.get(pt),s=yield jY(r,o,V.lift(n),_n.None);if(!(!s||!s.tokens))return RSe({id:0,type:"full",data:s.tokens.data})}));const KY="editor.semanticHighlighting";function TU(i,e,t){var n;const o=(n=t.getValue(KY,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))===null||n===void 0?void 0:n.enabled;return typeof o=="boolean"?o:e.getColorTheme().semanticHighlighting}var FSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Nh=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Qp;let NU=class extends _e{constructor(e,t,n,o,r,s){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new tI(d,e,n,r,s)},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()];TU(d,n,o)?u||a(d):u&&l(d,u)}};this._register(t.onModelAdded(d=>{TU(d,n,o)&&a(d)})),this._register(t.onModelRemoved(d=>{const u=this._watchers[d.uri.toString()];u&&l(d,u)})),this._register(o.onDidChangeConfiguration(d=>{d.affectsConfiguration(KY)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};NU=FSe([Nh(0,k5),Nh(1,Yi),Nh(2,vr),Nh(3,En),Nh(4,qc),Nh(5,pt)],NU);let tI=Qp=class extends _e{constructor(e,t,n,o,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:Qp.REQUEST_MIN_DELAY,max:Qp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new bi(()=>this._fetchDocumentSemanticTokensNow(),Qp.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 s=()=>{si(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)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.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),si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!ASe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Ro,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,o=PSe(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],s=this._model.onDidChangeContent(l=>{r.push(l)}),a=new Ls(!1);o.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:c,tokens:d}=l,u=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,u,r)}},l=>{l&&(sh(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||en(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,o,r){r=Math.min(r,n.length-o,e.length-t);for(let s=0;s{(o.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||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(MSe(t)){if(!r){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:r.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=r.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){n.warnInvalidEditStart(r.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=d-(f.start+f.deleteCount);g>0&&(Qp._copy(l,d-g,c,u-g,g),u-=g),f.data&&(Qp._copy(f.data,0,c,u-f.data.length,f.data.length),u-=f.data.length),d=f.start}d>0&&Qp._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(jF(t)){this._currentDocumentResponse=new Bxt(e,t.resultId,t.data);const a=_1e(t,n,this._model.getLanguageId());if(o.length>0)for(const l of o)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);s()}};tI.REQUEST_MIN_DELAY=300;tI.REQUEST_MAX_DELAY=2e3;tI=Qp=FSe([Nh(1,k5),Nh(2,vr),Nh(3,qc),Nh(4,pt)],tI);class Bxt{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}X5(NU);var Wxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},sL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let nI=class extends _e{constructor(e,t,n,o,r,s){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=o,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new bi(()=>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(KY)&&(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,n=this._outstandingRequests.length;tthis._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),o=sr(s=>Promise.resolve(jY(this._provider,e,t,s))),r=new Ls(!1);return o.then(s=>{if(this._debounceInformation.update(e,r.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,_1e(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(o),()=>this._removeOutstandingRequest(o)),o}};nI.ID="editor.contrib.viewportSemanticTokens";nI=Wxt([sL(1,k5),sL(2,vr),sL(3,En),sL(4,qc),sL(5,pt)],nI);Un(nI.ID,nI,1);class Vxt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const o of t){const r=[];n.push(r),this.selectSubwords&&this._addInWordRanges(r,e,o),this._addWordRanges(r,e,o),this._addWhitespaceLine(r,e,o),r.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const o=t.getWordAtPosition(n);if(!o)return;const{word:r,startColumn:s}=o,a=n.column-s;let l=a,c=a,d=0;for(;l>=0;l--){const u=r.charCodeAt(l);if(l!==a&&(u===95||u===45))break;if(ym(u)&&kh(d))break;d=u}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new V(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var Hxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},$xt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},KF=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},RU;class qY{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 n=new qY(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let Jw=RU=class{static get(e){return e.getContribution(RU.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 KF(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||(yield WSe(this._languageFeaturesService.selectionRangeProvider,n,t.map(r=>r.getPosition()),this._editor.getOption(112),_n.None).then(r=>{var s;if(!(!ws(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!Lo(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),r[a].unshift(t[a]);this._state=r.map(a=>new qY(0,a)),(s=this._selectionListener)===null||s===void 0||s.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(r=>r.mov(e));const o=this._state.map(r=>gt.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(o)}finally{this._ignoreSelection=!1}})}};Jw.ID="editor.contrib.smartSelectController";Jw=RU=Hxt([$xt(1,pt)],Jw);class BSe extends ft{constructor(e,t){super(t),this._forward=e}run(e,t){return KF(this,void 0,void 0,function*(){const n=Jw.get(t);n&&(yield n.run(this._forward))})}}class zxt extends BSe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:C("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Rn.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Uxt extends BSe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:C("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}Un(Jw.ID,Jw,4);ze(zxt);ze(Uxt);function WSe(i,e,t,n,o){return KF(this,void 0,void 0,function*(){const r=i.all(e).concat(new Vxt(n.selectSubwords));r.length===1&&r.unshift(new Rl);const s=[],a=[];for(const l of r)s.push(Promise.resolve(l.provideSelectionRanges(e,t,o)).then(c=>{if(ws(c)&&c.length===t.length)for(let d=0;d{if(l.length===0)return[];l.sort((h,f)=>ae.isBefore(h.getStartPosition(),f.getStartPosition())?1:ae.isBefore(f.getStartPosition(),h.getStartPosition())||ae.isBefore(h.getEndPosition(),f.getEndPosition())?-1:ae.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let d;for(const h of l)(!d||V.containsRange(h,d)&&!V.equalsRange(h,d))&&(c.push(h),d=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const u=[c[0]];for(let h=1;hi}),y7="data-sticky-line-index",Gce="data-sticky-is-line",qxt="data-sticky-is-line-number",Xce="data-sticky-is-folding-icon";class Gxt extends _e{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 Fv),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(114)&&t(),n.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{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,n=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&n===1/0)return;this._previousState=e;const o=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const s=[...e.startLineNumbers];e.showEndForLine!==null&&(s[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=s}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(o,t,n)}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Ur(this._lineNumbersDomNode),Ur(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const n=t.foldingIcon;!n||n.setVisible(e?!0:n.isCollapsed)}}_renderRootNode(e,t,n=1/0){return Kxt(this,void 0,void 0,function*(){const o=this._editor.getLayoutInfo();for(const[s,a]of this._lineNumbers.entries()){const l=e[s],c=a>=n||(l==null?void 0:l.lineNumber)!==a?this._renderChildNode(s,a,t,o):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 r=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(r===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${r}px`,this._linesDomNodeScrollable.style.height=`${r}px`,this._rootDomNode.style.height=`${r}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)})}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(ke(this._lineNumbersDomNode,et.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ke(this._lineNumbersDomNode,et.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,o){const r=this._editor._getViewModel();if(!r)return;const s=r.coordinatesConverter.convertModelPositionToViewPosition(new ae(t,1)).lineNumber,a=r.getViewLineRenderingData(s),l=this._editor.getOption(67);let c;try{c=rl.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const d=new Jv(!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 yS(2e3),h=qI(d,u);let f;qce?f=qce.createHTML(u.build()):f=u.build();const g=document.createElement("span");g.setAttribute(y7,String(e)),g.setAttribute(Gce,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(y7,String(e)),p.setAttribute(qxt,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const v=o.contentLeft;p.style.width=`${v}px`;const m=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?m.innerText=t.toString():l.renderType===2&&(m.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),m.className="sticky-line-number-inner",m.style.lineHeight=`${this._lineHeight}px`,m.style.width=`${o.lineNumbersWidth}px`,m.style.paddingLeft=`${o.lineNumbersLeft}px`,p.appendChild(m);const _=this._renderFoldingIconForLine(n,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(m),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const y=new Xxt(e,t,g,p,_,h.characterMapping);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;const n=e.index,o=e.lineDomNode,r=e.lineNumberDomNode,s=n===this._lineNumbers.length-1,a="0",l="1";o.style.zIndex=s?a:l,r.style.zIndex=s?a:l;const c=`${n*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,d=`${n*this._lineHeight}px`;return o.style.top=s?c:d,r.style.top=s?c:d,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(109);if(!e||n==="never")return;const o=e.regions,r=o.findRange(t),s=o.getStartLineNumber(r);if(!(t===s))return;const l=o.isCollapsed(r),c=new Yxt(l,s,o.getEndLineNumber(r),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(Xce,""),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 n=TG(t.characterMapping,e,0);return new ae(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t,n;return(n=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&n!==void 0?n: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,y7);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Gce)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Xce)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class Xxt{constructor(e,t,n,o,r,s){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=o,this.foldingIcon=r,this.characterMapping=s}}class Yxt{constructor(e,t,n,o){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=o,this.domNode=document.createElement("div"),this.domNode.style.width=`${o}px`,this.domNode.style.height=`${o}px`,this.domNode.className=Mt.asClassName(e?EF:LF)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class WE{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class AO{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class VSe{constructor(e,t,n,o){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=o}}var qF=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iI=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Yce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},VE;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(VE||(VE={}));var Am;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(Am||(Am={}));let MU=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=n,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Wd(300)),this._updateOperation=this._register(new Be);const r=new AU(n),s=new OU(this._editor,n),a=new PU(this._editor,t);switch(o){case VE.OUTLINE_MODEL:this._modelProviders.push(r),this._modelProviders.push(s),this._modelProviders.push(a);break;case VE.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case VE.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,n){return Yce(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(()=>Yce(this,void 0,void 0,function*(){for(const o of this._modelProviders){const{statusPromise:r,modelPromise:s}=o.computeStickyModel(e,t,n);this._modelPromise=s;const a=yield r;if(this._modelPromise!==s)return null;switch(a){case Am.CANCELED:return this._updateOperation.clear(),null;case Am.VALID:return o.stickyModel}}return null})).catch(o=>(en(o),null))})}};MU=qF([iI(1,Ti),iI(2,pt)],MU);class HSe{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Am.INVALID}computeStickyModel(e,t,n){if(n.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const o=sr(r=>this.createModelFromProvider(e,t,r));return{statusPromise:o.then(r=>this.isModelValid(r)?n.isCancellationRequested?Am.CANCELED:(this._stickyModel=this.createStickyModel(e,t,n,r),Am.VALID):this._invalid()).then(void 0,r=>(en(r),Am.CANCELED)),modelPromise:o}}isModelValid(e){return!0}isProviderValid(e){return!0}}let AU=class extends HSe{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,n){return _g.create(this._languageFeaturesService.documentSymbolProvider,e,n)}createStickyModel(e,t,n,o){var r;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(o,(r=this._stickyModel)===null||r===void 0?void 0:r.outlineProviderId);return new VSe(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(vn.first(e.children.values())instanceof dSe){const a=vn.find(e.children.values(),l=>l.id===t);if(a)n=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,n=d.children}}else n=e.children;const o=[],r=Array.from(n.values()).sort((a,l)=>{const c=new WE(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new WE(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,d)});for(const a of r)o.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new AO(void 0,o,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const s of r.children.values())n.push(this._stickyModelFromOutlineElement(s,r.symbol.selectionRange.startLineNumber));n.sort((r,s)=>this._comparator(r.range,s.range));const o=new WE(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new AO(o,n,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 n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof tU?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};AU=qF([iI(0,pt)],AU);class $Se extends HSe{constructor(e){super(),this._foldingLimitReporter=new aSe(e)}createStickyModel(e,t,n,o){const r=this._fromFoldingRegions(o);return new VSe(e.uri,t,r,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],o=new AO(void 0,[],void 0);for(let r=0;r0}createModelFromProvider(e,t,n){const o=xf.getFoldingRangeProviders(this._languageFeaturesService,e);return new NY(e,o,()=>this.createModelFromProvider(e,t,n),this._foldingLimitReporter,void 0).compute(n)}};OU=qF([iI(1,pt)],OU);var Zxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Zce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Qce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Qxt{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let FU=class extends _e{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new le),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 bi(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(o=>{o.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 MU(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 Qce(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Ro,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return Qce(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(),n=t.getVersionId(),o=yield this._stickyModelProvider.update(t,n,e);e.isCancellationRequested||(this._model=o)})}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,o,r){if(t.children.length===0)return;let s=r;const a=[];for(let d=0;dd-u)),c=this.updateIndex(ED(a,e.startLineNumber+o,(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!==s&&(s=h,n.push(new Qxt(h,f-1,o+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,n,o+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,n,o,r)}}getCandidateStickyLinesIntersecting(e){var t,n;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let o=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,o,0,-1);const r=(n=this._editor._getViewModel())===null||n===void 0?void 0:n.getHiddenAreas();if(r)for(const s of r)o=o.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return o}};FU=Zxt([Zce(1,pt),Zce(2,Ti)],FU);var Jxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},w7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},BU;let Lf=BU=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=o,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 Gxt(this._editor),this._stickyLineCandidateProvider=new FU(this._editor,n,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new Kce([],[],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(ke(l,et.CONTEXT_MENU,d=>w7(this,void 0,void 0,function*(){this._onContextMenu(d)}))),this._stickyScrollFocusedContextKey=Q.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=Q.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(pf(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(ke(l,et.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(BU.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(V.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Be),t=this._register(new dF(this._editor,{extractLineNumberFromMouseEvent:r=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return s?s.lineNumber:0}})),n=r=>{if(!this._editor.hasModel()||r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return null;const s=r.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new V(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},o=this._stickyScrollWidget.getDomNode();this._register(No(o,et.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(c===null)return;const d=new ae(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(c===null)return;l=new ae(c,1)}this._revealPosition(l)})),this._register(No(o,et.MOUSE_MOVE,r=>{if(r.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(ke(o,et.MOUSE_LEAVE,r=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,s])=>{const a=n(r);if(!a||!r.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 Ro;e.add(zt(()=>d.dispose(!0)));let u;mF(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ae(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(zt(()=>{u.style.textDecoration="none"}))):u||(u=f,u.style.textDecoration="underline",e.add(zt(()=>{u.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(r=>w7(this,void 0,void 0,function*(){if(r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);!s||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(vSe,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const t=new kc(e);this._contextMenuService.showContextMenu({menuId:Z.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;nSe(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const o=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(o),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(n=>{n.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),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 n of t)for(const o of e.ranges)if(n>=o.fromLineNumber&&n<=o.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,n;return w7(this,void 0,void 0,function*(){const o=this._editor.getModel();if(!o||o.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const r=this._stickyLineCandidateProvider.getVersionId();if(r===void 0||r===o.getVersionId())if(this._foldingModel=(n=yield(t=xf.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel())!==null&&n!==void 0?n: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 s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(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),n=this._editor.getScrollTop();let o=0;const r=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new WE(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,v=this._editor.getBottomForLineNumber(u)-n,m=this._editor.getTopForLineNumber(h)-n,_=this._editor.getBottomForLineNumber(h)-n;if(g>m&&g<=_){r.push(u),s.push(h+1),o=_-p;break}else p>v&&p<=_&&(r.push(u),s.push(h+1));if(r.length===t)break}}}return this._endLineNumbers=s,new Kce(r,s,o,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Lf.ID="store.contrib.stickyScrollController";Lf=BU=Jxt([oC(1,Kd),oC(2,pt),oC(3,$t),oC(4,Ti),oC(5,qc),oC(6,Ut)],Lf);var eLt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class tLt extends ec{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:C("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:C({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:jxt.View,toggled:{condition:Me.equals("config.editor.stickyScroll.enabled",!0),title:C("stickyScroll","Sticky Scroll"),mnemonicTitle:C({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:Z.CommandPalette},{id:Z.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Z.StickyScrollContext}]})}run(e){return eLt(this,void 0,void 0,function*(){const t=e.get(En),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)})}}const GF=100;class nLt extends lh{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:C("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:C({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:Me.and(Me.has("config.editor.stickyScroll.enabled"),Q.stickyScrollVisible),menu:[{id:Z.CommandPalette}]})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.focus()}}class iLt extends lh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:C("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:GF,primary:18}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.focusNext()}}class oLt extends lh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:C("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:GF,primary:16}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.focusPrevious()}}class rLt extends lh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:C("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:GF,primary:3}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.goToFocused()}}class sLt extends lh{constructor(){super({id:"editor.action.selectEditor",title:{value:C("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:GF,primary:9}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.selectEditor()}}Un(Lf.ID,Lf,1);$i(tLt);$i(nLt);$i(oLt);$i(iLt);$i(rLt);$i(sLt);var GY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},W0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},aLt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},B_;class lLt{constructor(e,t,n,o,r,s){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=o,this.command=r,this.completion=s}}let WU=class extends DYe{constructor(e,t,n,o,r,s){super(r.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=o,this._suggestMemoryService=s}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn=0&&l.resolve(_n.None)}return t}};WU=GY([W0(5,TF)],WU);let VU=class{constructor(e,t,n,o){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=n,this._suggestMemoryService=o}provideInlineCompletions(e,t,n,o){var r;return aLt(this,void 0,void 0,function*(){if(n.selectedSuggestionInfo)return;const s=this._getEditorOption(88,e);if(JC.isAllOff(s))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(JC.valueFor(s,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 V(t.lineNumber,1,t.lineNumber,t.column));if(!d&&((r=this._lastResult)===null||r===void 0?void 0:r.canBeReused(e,t.lineNumber,c))){const f=new Vce(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),u=this._lastResult}else{const f=yield AY(this._languageFeatureService.completionProvider,e,t,new jk(void 0,void 0,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},o);let g;f.needsClipboard&&(g=yield this._clipboardService.readText());const p=new hm(f.items,t.column,new Vce(h,0),xu.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},g);u=new WU(e,t.lineNumber,c,p,f,this._suggestMemoryService)}return this._lastResult=u,u})}handleItemDidShow(e,t){t.completion.resolve(_n.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var n;const o=e.getValueInRange(V.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((n=s.triggerCharacters)===null||n===void 0)&&n.includes(o)&&r.add(s);if(r.size!==0)return{providers:r,ch:o}}};VU=GY([W0(1,pt),W0(2,wp),W0(3,TF)],VU);let PO=B_=class{constructor(e,t,n,o){if(++B_._counter===1){const r=o.createInstance(VU,(s,a)=>{var l;return((l=n.listCodeEditors().find(d=>d.getModel()===a))!==null&&l!==void 0?l:e).getOption(s)});B_._disposable=t.inlineCompletionsProvider.register("*",r)}}dispose(){var e;--B_._counter===0&&((e=B_._disposable)===null||e===void 0||e.dispose(),B_._disposable=void 0)}};PO._counter=0;PO=B_=GY([W0(1,pt),W0(2,Jn),W0(3,$t)],PO);Un("suggest.inlineCompletionsProvider",PO,0);class cLt extends ft{constructor(){super({id:"editor.action.forceRetokenize",label:C("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const o=new Ls;n.tokenization.forceTokenization(n.getLineCount()),o.stop(),console.log(`tokenization took ${o.elapsed()}`)}}ze(cLt);class XF extends ec{constructor(){super({id:XF.ID,title:{value:C({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=!Sw.getTabFocusMode();Sw.setTabFocusMode(t),Cs(t?C("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):C("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}XF.ID="editor.action.toggleTabFocusMode";$i(XF);var dLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},uLt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let HU=class extends _e{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,n={},o){var r;super(),this._link=t,this._enabled=!0,this.el=Ae(e,He("a.monaco-link",{tabIndex:(r=t.tabIndex)!==null&&r!==void 0?r:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new xn(this.el,"click")),a=this._register(new xn(this.el,"keypress")),l=st.chain(a.event,u=>u.map(h=>new Pi(h)).filter(h=>h.keyCode===3)),c=this._register(new xn(this.el,Di.Tap)).event;this._register(Ei.addTarget(this.el));const d=st.any(s.event,l,c);this._register(d(u=>{!this.enabled||(un.stop(u,!0),n!=null&&n.opener?n.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};HU=dLt([uLt(3,ml)],HU);var zSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},USe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const hLt=26;let $U=class extends _e{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(zU))}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,hLt)}};$U=zSe([USe(1,$t)],$U);let zU=class extends _e{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(up,{}),this.element=He("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=He("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ur(this.element)}show(e){Ur(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=Ae(this.element,He("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(He(`div${Mt.asCSSSelector(e.icon)}`));const o=Ae(this.element,He("div.message-container"));if(o.setAttribute("aria-hidden","true"),o.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ae(this.element,He("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(HU,this.messageActionsContainer,Object.assign(Object.assign({},s),{tabIndex:-1}),{}));const r=Ae(this.element,He("div.action-container"));this.actionBar=this._register(new zc(r)),this.actionBar.push(this._register(new ca("banner.close","Close Banner",Mt.asClassName(ICe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};zU=zSe([USe(0,$t)],zU);var XY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},$y=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ms=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const fLt=Eo("extensions-warning-message",Xe.warning,C("warningIcon","Icon shown with a warning message in the extensions editor."));let eS=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const s=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new BS};else if(r.ambiguousCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new r_};else if(r.invisibleCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new FS};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:fLt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(o.createInstance($U,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(n.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.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=gLt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!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(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?IXe:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new UU(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new pLt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};eS.ID="editor.contrib.unicodeHighlighter";eS=XY([$y(1,Xd),$y(2,D1e),$y(3,$t)],eS);function gLt(i,e){return{nonBasicASCII:e.nonBasicASCII===kl?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===kl?!i:e.includeComments,includeStrings:e.includeStrings===kl?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let UU=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=o,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new bi(()=>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 n=[];if(!t.hasMore)for(const o of t.ranges)n.push({range:o,options:OO.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!ZG(t,e))return null;const n=t.getValueInRange(e.range);return{reason:jSe(n,this._options),inComment:QG(t,e),inString:JG(t,e)}}};UU=XY([$y(3,Xd)],UU);class pLt extends _e{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new bi(()=>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=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const o of e){const r=uG.computeUnicodeHighlights(this._model,this._options,o);for(const s of r.ranges)n.ranges.push(s);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||r.hasMore}if(!n.hasMore)for(const o of n.ranges)t.push({range:o,options:OO.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return ZG(t,e)?{reason:jSe(n,this._options),inComment:QG(t,e),inString:JG(t,e)}:null}}let jU=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),o=this._editor.getContribution(eS.ID);if(!o)return[];const r=[],s=new Set;let a=300;for(const l of t){const c=o.getDecorationInfo(l);if(!c)continue;const u=n.getValueInRange(l.range).codePointAt(0),h=S7(u);let f;switch(c.reason.kind){case 0:{$I(c.reason.confusableWith)?f=C("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,S7(c.reason.confusableWith.codePointAt(0))):f=C("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,S7(c.reason.confusableWith.codePointAt(0)));break}case 1:f=C("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=C("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:u,reason:c.reason,inComment:c.inComment,inString:c.inString},p=C("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${ET.ID}?${encodeURIComponent(JSON.stringify(g))}`,m=new os("",!0).appendMarkdown(f).appendText(" ").appendLink(v,p);r.push(new Du(this,l.range,[m],!1,a++))}return r}renderHoverParts(e,t){return ywe(e,t,this._editor,this._languageService,this._openerService)}};jU=XY([$y(1,Ki),$y(2,ml)],jU);function KU(i){return`U+${i.toString(16).padStart(4,"0")}`}function S7(i){let e=`\`${KU(i)}\``;return cf.isInvisibleCharacter(i)||(e+=` "${`${mLt(i)}`}"`),e}function mLt(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function jSe(i,e){return uG.computeUnicodeHighlightReason(i,e)}class OO{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let o=this.map.get(n);return o||(o=Jt.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,o)),o}}OO.instance=new OO;class vLt extends ft{constructor(){super({id:r_.ID,label:C("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.includeComments,!1,2)})}}class _Lt extends ft{constructor(){super({id:r_.ID,label:C("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.includeStrings,!1,2)})}}class r_ extends ft{constructor(){super({id:r_.ID,label:C("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.ambiguousCharacters,!1,2)})}}r_.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class FS extends ft{constructor(){super({id:FS.ID,label:C("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.invisibleCharacters,!1,2)})}}FS.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class BS extends ft{constructor(){super({id:BS.ID,label:C("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.nonBasicASCII,!1,2)})}}BS.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class ET extends ft{constructor(){super({id:ET.ID,label:C("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,n){return ms(this,void 0,void 0,function*(){const{codePoint:o,reason:r,inString:s,inComment:a}=n,l=String.fromCodePoint(o),c=e.get(dh),d=e.get(En);function u(g){return cf.isInvisibleCharacter(g)?C("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",KU(g)):C("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${KU(g)} "${l}"`)}const h=[];if(r.kind===0)for(const g of r.notAmbiguousInLocales)h.push({label:C("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:()=>ms(this,void 0,void 0,function*(){CLt(d,[g])})});if(h.push({label:u(o),run:()=>bLt(d,[o])}),a){const g=new vLt;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(s){const g=new _Lt;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}if(r.kind===0){const g=new r_;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(r.kind===1){const g=new FS;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(r.kind===2){const g=new BS;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}else yLt(r);const f=yield c.pick(h,{title:C("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});f&&(yield f.run())})}}ET.ID="editor.action.unicodeHighlight.showExcludeOptions";function bLt(i,e){return ms(this,void 0,void 0,function*(){const t=i.getValue(Ta.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const o of e)n[String.fromCodePoint(o)]=!0;yield i.updateValue(Ta.allowedCharacters,n,2)})}function CLt(i,e){var t;return ms(this,void 0,void 0,function*(){const n=(t=i.inspect(Ta.allowedLocales).user)===null||t===void 0?void 0:t.value;let o;typeof n=="object"&&n?o=Object.assign({},n):o={};for(const r of e)o[r]=!0;yield i.updateValue(Ta.allowedLocales,o,2)})}function yLt(i){throw new Error(`Unexpected value: ${i}`)}ze(r_);ze(FS);ze(BS);ze(ET);Un(eS.ID,eS,1);n1.register(jU);var wLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Jce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},SLt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const KSe="ignoreUnusualLineTerminators";function xLt(i,e,t){i.setModelProperty(e.uri,KSe,t)}function LLt(i,e){return i.getModelProperty(e.uri,KSe)}let oI=class extends _e{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(o=>{o.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return SLt(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||LLt(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=yield this._dialogService.confirm({title:C("unusualLineTerminators.title","Unusual Line Terminators"),message:C("unusualLineTerminators.message","Detected unusual line terminators"),detail:C("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`.",$c(e.uri)),primaryButton:C({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:C("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){xLt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};oI.ID="editor.contrib.unusualLineTerminatorsDetector";oI=wLt([Jce(1,iT),Jce(2,Jn)],oI);Un(oI.ID,oI,1);var ELt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ede=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qU;const YF=new lt("hasWordHighlights",!1);function qSe(i,e,t,n){const o=i.ordered(e);return D0e(o.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,n)).then(void 0,$o)),ws)}class GSe{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=sr(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new V(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const o=t.startLineNumber,r=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=Boolean(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,d=n.length;!l&&c=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class DLt extends GSe{constructor(e,t,n,o){super(e,t,n),this._providers=o}_compute(e,t,n,o){return qSe(this._providers,e,t.getPosition(),o).then(r=>r||[])}}class kLt extends GSe{constructor(e,t,n){super(e,t,n),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,n,o){return xv(250,o).then(()=>{if(!t.isEmpty())return[];const r=e.getWordAtPosition(t.getPosition());return!r||r.word.length>1e3?[]:e.findMatches(r.word,!0,!1,!0,n,!1).map(a=>({range:a.range,kind:MD.Text}))})}isValid(e,t,n){const o=t.isEmpty();return this._selectionIsEmpty!==o?!1:super.isValid(e,t,n)}}function ILt(i,e,t,n){return i.has(e)?new DLt(e,t,n,i):new kLt(e,t,n)}Nf("_executeDocumentHighlights",(i,e,t)=>{const n=i.get(pt);return qSe(n.documentHighlightProvider,e,t,_n.None)});class TLt{constructor(e,t,n,o){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=n,this._hasWordHighlights=YF.bindTo(o),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||!this.occurrencesHighlight||this._onPositionChanged(r)})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const s=this.editor.getOption(80);this.occurrencesHighlight!==s&&(this.occurrencesHighlight=s,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(V.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,o=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const r=this._getWord();if(r){const s=this.editor.getModel().getLineContent(o.startLineNumber);Cs(`${s}, ${n+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,o=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const r=this._getWord();if(r){const s=this.editor.getModel().getLineContent(o.startLineNumber);Cs(`${s}, ${n+1} of ${e.length} for '${r.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,n=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:n})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const t=e.startColumn,n=e.endColumn,o=this._getWord();if(!o||o.startColumn>t||o.endColumn{s===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},en)}}_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:txt(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 kb=qU=class extends _e{static get(e){return e.getContribution(qU.ID)}constructor(e,t,n){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new TLt(e,n.documentHighlightProvider,()=>vn.map(this.linkedContributions,r=>r.wordHighlighter),t))};this._register(e.onDidChangeModel(r=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),o()})),o()}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()}};kb.ID="editor.contrib.wordHighlighter";kb=qU=ELt([ede(1,Ut),ede(2,pt)],kb);class XSe extends ft{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=kb.get(t);!n||(this._isNext?n.moveNext():n.moveBack())}}class NLt extends XSe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:C("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:YF,kbOpts:{kbExpr:Q.editorTextFocus,primary:65,weight:100}})}}class RLt extends XSe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:C("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:YF,kbOpts:{kbExpr:Q.editorTextFocus,primary:1089,weight:100}})}}class MLt extends ft{constructor(){super({id:"editor.action.wordHighlight.trigger",label:C("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:YF.toNegated(),kbOpts:{kbExpr:Q.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const o=kb.get(t);!o||o.restoreViewState(!0)}}Un(kb.ID,kb,0);ze(NLt);ze(RLt);ze(MLt);class ZF extends Ir{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const o=Vc(t.getOption(129)),r=t.getModel(),a=t.getSelections().map(l=>{const c=new ae(l.positionLineNumber,l.positionColumn),d=this._move(o,r,c,this._wordNavigationType);return this._moveTo(l,d,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>kn.fromModelSelection(l))),a.length===1){const l=new ae(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,n){return n?new gt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new gt(t.lineNumber,t.column,t.lineNumber,t.column)}}class s_ extends ZF{_move(e,t,n,o){return Qn.moveWordLeft(e,t,n,o)}}class a_ extends ZF{_move(e,t,n,o){return Qn.moveWordRight(e,t,n,o)}}class ALt extends s_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class PLt extends s_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class OLt extends s_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(GI,W5))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class FLt extends s_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class BLt extends s_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class WLt extends s_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(GI,W5))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class VLt extends s_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class HLt extends s_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class $Lt extends a_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class zLt extends a_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(GI,W5))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class ULt extends a_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class jLt extends a_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class KLt extends a_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(GI,W5))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class qLt extends a_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class GLt extends a_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class XLt extends a_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class QF extends Ir{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const o=e.get(Ti);if(!t.hasModel())return;const r=Vc(t.getOption(129)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),d=o.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:r,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Qr(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class YY extends QF{_delete(e,t){const n=Qn.deleteWordLeft(e,t);return n||new V(1,1,1,1)}}class ZY extends QF{_delete(e,t){const n=Qn.deleteWordRight(e,t);if(n)return n;const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return new V(o,r,o,r)}}class YLt extends YY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:Q.writable})}}class ZLt extends YY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:Q.writable})}}class QLt extends YY{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class JLt extends ZY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:Q.writable})}}class eEt extends ZY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:Q.writable})}}class tEt extends ZY{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class nEt extends ft{constructor(){super({id:"deleteInsideWord",precondition:Q.writable,label:C("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const o=Vc(t.getOption(129)),r=t.getModel(),a=t.getSelections().map(l=>{const c=Qn.deleteInsideWord(o,r,l);return new Qr(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ye(new ALt);Ye(new PLt);Ye(new OLt);Ye(new FLt);Ye(new BLt);Ye(new WLt);Ye(new $Lt);Ye(new zLt);Ye(new ULt);Ye(new jLt);Ye(new KLt);Ye(new qLt);Ye(new VLt);Ye(new HLt);Ye(new GLt);Ye(new XLt);Ye(new YLt);Ye(new ZLt);Ye(new QLt);Ye(new JLt);Ye(new eEt);Ye(new tEt);ze(nEt);class iEt extends QF{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=b5.deleteWordPartLeft(e);return n||new V(1,1,1,1)}}class oEt extends QF{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=b5.deleteWordPartRight(e);if(n)return n;const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return new V(o,r,o,r)}}class YSe extends ZF{_move(e,t,n,o){return b5.moveWordPartLeft(e,t,n)}}class rEt extends YSe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Rn.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class sEt extends YSe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Rn.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class ZSe extends ZF{_move(e,t,n,o){return b5.moveWordPartRight(e,t,n)}}class aEt extends ZSe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class lEt extends ZSe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Ye(new iEt);Ye(new oEt);Ye(new rEt);Ye(new sEt);Ye(new aEt);Ye(new lEt);class GU extends _e{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=cl.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new os(C("editor.simple.readonly","Cannot edit in read-only input")):t=new os(C("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}GU.ID="editor.contrib.readOnlyMessageController";Un(GU.ID,GU,2);class XU extends _e{constructor(e){super(),this.editor=e,this.widget=null,Ku&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new JF(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}XU.ID="editor.contrib.iPadShowKeyboard";class JF extends _e{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ke(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ke(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return JF.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}JF.ID="editor.contrib.ShowKeyboardWidget";Un(XU.ID,XU,3);var cEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tde=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},YU;let tS=YU=class extends _e{static get(e){return e.getContribution(YU.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(o=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(o=>this.stop())),this._register(oo.onDidChange(o=>this.stop())),this._register(this._editor.onKeyUp(o=>o.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||!this._editor.hasModel()||(this._widget=new e3(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};tS.ID="editor.contrib.inspectTokens";tS=YU=cEt([tde(1,ic),tde(2,Ki)],tS);class dEt extends ft{constructor(){super({id:"editor.action.inspectTokens",label:GH.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=tS.get(t);n==null||n.launch()}}function uEt(i){let e="";for(let t=0,n=i.length;tww,tokenize:(o,r,s)=>vG(e,s),tokenizeEncoded:(o,r,s)=>h5(n,s)}}class e3 extends _e{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=hEt(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return e3._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let o=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){o=l;break}const r=this._model.getLineContent(e.lineNumber);let s="";if(n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nde=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},VL;let FO=VL=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=no.as(Xb.Quickaccess)}provide(e){const t=new Be;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const o=this.registry.getQuickAccessProvider(n.substr(VL.PREFIX.length));o&&o.prefix&&o.prefix!==VL.PREFIX&&this.quickInputService.quickAccess.show(o.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==VL.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,o=n||"\u2026";return{prefix:n,label:o,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:C("helpPickAriaLabel","{0}, {1}",o,t.description),description:t.description}})}};FO.PREFIX="?";FO=VL=fEt([nde(0,dh),nde(1,xi)],FO);no.as(Xb.Quickaccess).registerQuickAccessProvider({ctor:FO,prefix:"",helpEntries:[{description:XH.helpQuickAccessActionLabel}]});class QSe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var n;const o=new Be;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=o.add(new Kr);return r.value=this.doProvide(e,t),o.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),o}doProvide(e,t){var n;const o=new Be,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const s={editor:r},a=nye(r);if(a){let l=(n=r.saveViewState())!==null&&n!==void 0?n:void 0;o.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=r.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&r===this.activeTextEditorControl&&r.restoreViewState(l)},o.add(yv(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}o.add(zt(()=>this.clearDecorations(r))),o.add(this.provideWithTextEditor(s,e,t))}else o.add(this.provideWithoutTextEditor(e,t));return o}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&kv(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return tye(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const o=[];this.rangeHighlightDecorationId&&(o.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),o.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const r=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:ro(xbe),position:Yl.Full}}}],[s,a]=n.deltaDecorations(o,r);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class t3 extends QSe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=C("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,_e.None}provideWithTextEditor(e,t,n){const o=e.editor,r=new Be;r.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(o,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(o,t.value.trim().substr(t3.PREFIX.length)),c=this.getPickLabel(o,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(o,l.lineNumber)){this.clearDecorations(o);return}const d=this.toRange(l.lineNumber,l.column);o.revealRangeInCenter(d,0),this.addDecorations(o,d)};s(),r.add(t.onDidChangeValue(()=>s()));const a=nye(o);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),r.add(zt(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),o=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:o+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?C("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):C("gotoLineLabel","Go to line {0}.",t);const o=e.getPosition()||{lineNumber:1,column:1},r=this.lineCount(e);return r>1?C("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",o.lineNumber,o.column,r):C("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",o.lineNumber,o.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,n){if(!n||typeof n!="number")return!1;const o=this.getModel(e);if(!o)return!1;const r={lineNumber:t,column:n};return o.validatePosition(r).equals(r)}lineCount(e){var t,n;return(n=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&n!==void 0?n:0}}t3.PREFIX=":";var gEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},pEt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let rI=class extends t3{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=st.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};rI=gEt([pEt(0,Jn)],rI);class DT extends ft{constructor(){super({id:DT.ID,label:NP.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(dh).quickAccess.show(rI.PREFIX)}}DT.ID="editor.action.gotoLine";ze(DT);no.as(Xb.Quickaccess).registerQuickAccessProvider({ctor:rI,prefix:rI.PREFIX,helpEntries:[{description:NP.gotoLineActionLabel,commandId:DT.ID}]});const JSe=[void 0,[]];function x7(i,e,t=0,n=0){const o=e;return o.values&&o.values.length>1?mEt(i,o.values,t,n):exe(i,e,t,n)}function mEt(i,e,t,n){let o=0;const r=[];for(const s of e){const[a,l]=exe(i,s,t,n);if(typeof a!="number")return JSe;o+=a,r.push(...l)}return[o,vEt(r)]}function exe(i,e,t,n){const o=sb(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return o?[o[0],rT(o)]:JSe}Object.freeze({score:0});function vEt(i){const e=i.sort((o,r)=>o.start-r.start),t=[];let n;for(const o of e)!n||!_Et(n,o)?(n=o,t.push(o)):(n.start=Math.min(n.start,o.start),n.end=Math.max(n.end,o.end));return t}function _Et(i,e){return!(i.end=0,s=ide(i);let a;const l=i.split(txe);if(l.length>1)for(const c of l){const d=ide(c),{pathNormalized:u,normalized:h,normalizedLowercase:f}=ode(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:u,normalized:h,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:o,values:a,containsPathSeparator:r,expectContiguousMatch:s}}function ode(i){let e;ls?e=i.replace(/\//g,Bu):e=i.replace(/\\/g,Bu);const t=fZe(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function rde(i){return Array.isArray(i)?ZU(i.map(e=>e.original).join(txe)):ZU(i.original)}var bEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},sde=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},aL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},zy;let uf=zy=class extends QSe{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,C("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),_e.None}provideWithTextEditor(e,t,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,n):this.doProvideWithoutEditorSymbols(e,r,t,n):_e.None}doProvideWithoutEditorSymbols(e,t,n,o){const r=new Be;return this.provideLabelPick(n,C("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),aL(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,r))||o.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,n,o))}),r}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return aL(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const n=new i5,o=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(o.dispose(),n.complete(!0))}));return t.add(zt(()=>n.complete(!1))),n.p})}doProvideWithEditorSymbols(e,t,n,o){var r;const s=e.editor,a=new Be;a.add(n.onDidAccept(u=>{const[h]=n.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,preserveFocus:u.inBackground}),u.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,o);let c;const d=u=>aL(this,void 0,void 0,function*(){c==null||c.dispose(!0),n.busy=!1,c=new Ro(o),n.busy=!0;try{const h=ZU(n.value.substr(zy.PREFIX.length).trim()),f=yield this.doGetSymbolPicks(l,h,void 0,c.token);if(o.isCancellationRequested)return;if(f.length>0){if(n.items=f,u&&h.original.length===0){const g=nP(f,p=>Boolean(p.type!=="separator"&&p.range&&V.containsPosition(p.range.decoration,u)));g&&(n.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(n,C("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,C("noSymbolResults","No editor symbols"))}finally{o.isCancellationRequested||(n.busy=!1)}});return a.add(n.onDidChangeValue(()=>d(void 0))),d((r=s.getSelection())===null||r===void 0?void 0:r.getPosition()),a.add(n.onDidChangeActive(()=>{const[u]=n.activeItems;u&&u.range&&(s.revealRangeInCenter(u.range.selection,0),this.addDecorations(s,u.range.decoration))})),a}doGetSymbolPicks(e,t,n,o){var r,s;return aL(this,void 0,void 0,function*(){const a=yield e;if(o.isCancellationRequested)return[];const l=t.original.indexOf(zy.SCOPE_PREFIX)===0,c=l?1:0;let d,u;t.values&&t.values.length>1?(d=rde(t.values[0]),u=rde(t.values.slice(1))):d=t;let h;const f=(s=(r=this.options)===null||r===void 0?void 0:r.openSideBySideDirection)===null||s===void 0?void 0:s.call(r);f&&(h=[{iconClass:f==="right"?Mt.asClassName(Xe.splitHorizontal):Mt.asClassName(Xe.splitVertical),tooltip:f==="right"?C("openToSide","Open to the Side"):C("openToBottom","Open to the Bottom")}]);const g=[];for(let m=0;mc){let P=!1;if(d!==t&&([E,I]=x7(w,Object.assign(Object.assign({},t),{values:void 0}),c,L),typeof E=="number"&&(P=!0)),typeof E!="number"&&([E,I]=x7(w,d,c,L),typeof E!="number"))continue;if(!P&&u){if(D&&u.original.length>0&&([k,R]=x7(D,u)),typeof k!="number")continue;typeof E=="number"&&(E+=k)}}const A=_.tags&&_.tags.indexOf(1)>=0;g.push({index:m,kind:_.kind,score:E,label:w,ariaLabel:aZe(_.name,_.kind),description:D,highlights:A?void 0:{label:I,description:R},range:{selection:V.collapseToStart(_.selectionRange),decoration:_.range},strikethrough:A,buttons:h})}const p=g.sort((m,_)=>l?this.compareByKindAndScore(m,_):this.compareByScore(m,_));let v=[];if(l){let w=function(){_&&typeof m=="number"&&y>0&&(_.label=Z0(E7[m]||L7,y))},m,_,y=0;for(const L of p)m!==L.kind?(w(),m=L.kind,y=1,_={type:"separator"},v.push(_)):y++,v.push(L);w()}else p.length>0&&(v=[{label:C("symbols","symbols ({0})",g.length),type:"separator"},...p]);return v})}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 n=E7[e.kind]||L7,o=E7[t.kind]||L7,r=n.localeCompare(o);return r===0?this.compareByScore(e,t):r}getDocumentSymbols(e,t){return aL(this,void 0,void 0,function*(){const n=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()})}};uf.PREFIX="@";uf.SCOPE_PREFIX=":";uf.PREFIX_BY_CATEGORY=`${zy.PREFIX}${zy.SCOPE_PREFIX}`;uf=zy=bEt([sde(0,pt),sde(1,DF)],uf);const L7=C("property","properties ({0})"),E7={[5]:C("method","methods ({0})"),[11]:C("function","functions ({0})"),[8]:C("_constructor","constructors ({0})"),[12]:C("variable","variables ({0})"),[4]:C("class","classes ({0})"),[22]:C("struct","structs ({0})"),[23]:C("event","events ({0})"),[24]:C("operator","operators ({0})"),[10]:C("interface","interfaces ({0})"),[2]:C("namespace","namespaces ({0})"),[3]:C("package","packages ({0})"),[25]:C("typeParameter","type parameters ({0})"),[1]:C("modules","modules ({0})"),[6]:C("property","properties ({0})"),[9]:C("enum","enumerations ({0})"),[21]:C("enumMember","enumeration members ({0})"),[14]:C("string","strings ({0})"),[0]:C("file","files ({0})"),[17]:C("array","arrays ({0})"),[15]:C("number","numbers ({0})"),[16]:C("boolean","booleans ({0})"),[18]:C("object","objects ({0})"),[19]:C("key","keys ({0})"),[7]:C("field","fields ({0})"),[13]:C("constant","constants ({0})")};var CEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},D7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let QU=class extends uf{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=st.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};QU=CEt([D7(0,Jn),D7(1,pt),D7(2,DF)],QU);class kT extends ft{constructor(){super({id:kT.ID,label:gk.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:Q.hasDocumentSymbolProvider,kbOpts:{kbExpr:Q.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(dh).quickAccess.show(uf.PREFIX,{itemActivation:vu.NONE})}}kT.ID="editor.action.quickOutline";ze(kT);no.as(Xb.Quickaccess).registerQuickAccessProvider({ctor:QU,prefix:uf.PREFIX,helpEntries:[{description:gk.quickOutlineActionLabel,prefix:uf.PREFIX,commandId:kT.ID},{description:gk.quickOutlineByCategoryActionLabel,prefix:uf.PREFIX_BY_CATEGORY}]});function k7(i,e){return e&&(i.stack||i.stacktrace)?C("stackTrace.format","{0}: {1}",lde(i),ade(i.stack)||ade(i.stacktrace)):lde(i)}function ade(i){return Array.isArray(i)?i.join(` -`):i}function lde(i){return i.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof i.code=="string"&&typeof i.errno=="number"&&typeof i.syscall=="string"?C("nodeExceptionMessage","A system error occurred ({0})",i.message):i.message||C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function nxe(i=null,e=!1){if(!i)return C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(i)){const t=hf(i),n=nxe(t[0],e);return t.length>1?C("error.moreErrors","{0} ({1} errors in total)",n,t.length):n}if(la(i))return i;if(i.detail){const t=i.detail;if(t.error)return k7(t.error,e);if(t.exception)return k7(t.exception,e)}return i.stack?k7(i,e):i.message?i.message:C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function yEt(i){var e;const t=new Map;for(const n of i)t.set(n,((e=t.get(n))!==null&&e!==void 0?e:0)+1);return t}class HE{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),o=new Map,r=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,o);c>0&&r.push({key:s,score:c})}}return r}static termFrequencies(e){return yEt(HE.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);const o=n.split(new RegExp("(?<=[a-z])(?=[A-Z])","g"));if(o.length>1)for(const r of o)r.length>2&&/\p{Letter}{3,}/gu.test(r)&&(yield t(r))}}updateDocuments(e){var t;for(const{key:n}of e)this.deleteDocument(n);for(const n of e){const o=[];for(const r of n.textChunks){const s=HE.termFrequencies(r);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);o.push({text:r,tf:s})}this.chunkCount+=o.length,this.documents.set(n.key,{chunks:o})}return this}deleteDocument(e){const t=this.documents.get(e);if(!!t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const o of n.tf.keys()){const r=this.chunkOccurrences.get(o);if(typeof r=="number"){const s=r-1;s<=0?this.chunkOccurrences.delete(o):this.chunkOccurrences.set(o,s)}}}}computeSimilarityScore(e,t,n){let o=0;for(const[r,s]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let l=n.get(r);typeof l!="number"&&(l=this.computeIdf(r),n.set(r,l)),o+=a*l*s}return o}computeEmbedding(e){const t=HE.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const n=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return n>0?Math.log((this.chunkCount+1)/n):0}computeTfidf(e){const t=Object.create(null);for(const[n,o]of e){const r=this.computeIdf(n);r>0&&(t[n]=o*r)}return t}}function wEt(i){var e,t;const n=i.slice(0);n.sort((r,s)=>s.score-r.score);const o=(t=(e=n[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(o>0)for(const r of n)r.score/=o;return n}var lL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},ey;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(ey||(ey={}));function I7(i){const e=i;return Array.isArray(e.items)}function cde(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class SEt extends _e{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var o;const r=new Be;e.canAcceptInBackground=!!(!((o=this.options)===null||o===void 0)&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=r.add(new Kr),l=()=>lL(this,void 0,void 0,function*(){const c=a.value=new Be;s==null||s.dispose(!0),e.busy=!1,s=new Ro(t);const d=s.token,u=e.value.substr(this.prefix.length).trim(),h=this._getPicks(u,c,d,n),f=(p,v)=>{var m;let _,y;if(I7(p)?(_=p.items,y=p.active):_=p,_.length===0){if(v)return!1;(u.length>0||e.hideInput)&&((m=this.options)===null||m===void 0?void 0:m.noResultsPick)&&(ID(this.options.noResultsPick)?_=[this.options.noResultsPick(u)]:_=[this.options.noResultsPick])}return e.items=_,y&&(e.activeItems=[y]),!0},g=p=>lL(this,void 0,void 0,function*(){let v=!1,m=!1;yield Promise.all([(()=>lL(this,void 0,void 0,function*(){typeof p.mergeDelay=="number"&&(yield xv(p.mergeDelay),d.isCancellationRequested)||m||(v=f(p.picks,!0))}))(),(()=>lL(this,void 0,void 0,function*(){e.busy=!0;try{const _=yield p.additionalPicks;if(d.isCancellationRequested)return;let y,w;I7(p.picks)?(y=p.picks.items,w=p.picks.active):y=p.picks;let L,D;if(I7(_)?(L=_.items,D=_.active):L=_,L.length>0||!v){let E;if(!w&&!D){const I=e.activeItems[0];I&&y.indexOf(I)!==-1&&(E=I)}f({items:[...y,...L],active:w||D||E})}}finally{d.isCancellationRequested||(e.busy=!1),m=!0}}))()])});if(h!==null)if(cde(h))yield g(h);else if(!(h instanceof Promise))f(h);else{e.busy=!0;try{const p=yield h;if(d.isCancellationRequested)return;cde(p)?yield g(p):f(p)}finally{d.isCancellationRequested||(e.busy=!1)}}});return r.add(e.onDidChangeValue(()=>l())),l(),r.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))})),r.add(e.onDidTriggerItemButton(({button:c,item:d})=>lL(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 ey.NO_ACTION:break;case ey.CLOSE_PICKER:e.hide();break;case ey.REFRESH_PICKER:l();break;case ey.REMOVE_ITEM:{const v=e.items.indexOf(d);if(v!==-1){const m=e.items.slice(),_=m.splice(v,1),y=e.activeItems.filter(L=>L!==_[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,y&&(e.activeItems=y),e.keepScrollPosition=w}break}}}}}))),r}}var ixe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Y_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},T7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},W_,hr;let Ib=W_=class extends SEt{constructor(e,t,n,o,r,s){super(W_.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=o,this.telemetryService=r,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(Tb)),this.options=e}_getPicks(e,t,n,o){var r,s,a,l;return T7(this,void 0,void 0,function*(){const c=yield this.getCommandPicks(n);if(n.isCancellationRequested)return[];const d=yv(()=>{const m=new HE;m.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[y.label+(y.commandAlias?` ${y.commandAlias}`:"")]})));const _=m.calculateScores(e,n);return wEt(_).filter(y=>y.score>W_.TFIDF_THRESHOLD).slice(0,W_.TFIDF_MAX_RESULTS)}),u=[];for(const m of c){const _=(r=W_.WORD_FILTER(e,m.label))!==null&&r!==void 0?r:void 0,y=m.commandAlias&&(s=W_.WORD_FILTER(e,m.commandAlias))!==null&&s!==void 0?s:void 0;if(_||y)m.highlights={label:_,detail:this.options.showAlias?y:void 0},u.push(m);else if(e===m.commandId)u.push(m);else if(e.length>=3){const w=d();if(n.isCancellationRequested)return[];const L=w.find(D=>D.key===m.commandId);L&&(m.tfIdfScore=L.score,u.push(m))}}const h=new Map;for(const m of u){const _=h.get(m.label);_?(m.description=m.commandId,_.description=_.commandId):h.set(m.label,m)}u.sort((m,_)=>{if(m.tfIdfScore&&_.tfIdfScore)return m.tfIdfScore===_.tfIdfScore?m.label.localeCompare(_.label):_.tfIdfScore-m.tfIdfScore;if(m.tfIdfScore)return 1;if(_.tfIdfScore)return-1;const y=this.commandsHistory.peek(m.commandId),w=this.commandsHistory.peek(_.commandId);if(y&&w)return y>w?-1:1;if(y)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(m.commandId),D=this.options.suggestedCommandIds.has(_.commandId);if(L&&D)return 0;if(L)return-1;if(D)return 1}return m.label.localeCompare(_.label)});const f=[];let g=!1,p=!0,v=!!this.options.suggestedCommandIds;for(let m=0;mT7(this,void 0,void 0,function*(){var m;const _=yield this.getAdditionalCommandPicks(c,u,e,n);if(n.isCancellationRequested)return[];const y=_.map(w=>this.toCommandPick(w,o));return p&&((m=y[0])===null||m===void 0?void 0:m.type)!=="separator"&&y.unshift({type:"separator",label:C("suggested","similar commands")}),y}))()}:f})}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),o=n?C("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:o,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:()=>T7(this,void 0,void 0,function*(){var r,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(r=t==null?void 0:t.from)!==null&&r!==void 0?r:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(a){sh(a)||this.dialogService.error(C("canNotRun","Command '{0}' resulted in an error",e.label),nxe(a))}})})}};Ib.PREFIX=">";Ib.TFIDF_THRESHOLD=.5;Ib.TFIDF_MAX_RESULTS=5;Ib.WORD_FILTER=cX(_k,Cdt,T1e);Ib=W_=ixe([Y_(1,$t),Y_(2,xi),Y_(3,_o),Y_(4,tc),Y_(5,iT)],Ib);let Tb=hr=class extends _e{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=hr.getConfiguredCommandHistoryLength(this.configurationService),hr.cache&&hr.cache.limit!==this.configuredCommandsHistoryLength&&(hr.cache.limit=this.configuredCommandsHistoryLength,hr.saveState(this.storageService)))}load(){const e=this.storageService.get(hr.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const n=hr.cache=new Qv(this.configuredCommandsHistoryLength,1);if(t){let o;t.usesLRU?o=t.entries:o=t.entries.sort((r,s)=>r.value-s.value),o.forEach(r=>n.set(r.key,r.value))}hr.counter=this.storageService.getNumber(hr.PREF_KEY_COUNTER,0,hr.counter)}push(e){!hr.cache||(hr.cache.set(e,hr.counter++),hr.saveState(this.storageService))}peek(e){var t;return(t=hr.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!hr.cache)return;const t={usesLRU:!0,entries:[]};hr.cache.forEach((n,o)=>t.entries.push({key:o,value:n})),e.store(hr.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(hr.PREF_KEY_COUNTER,hr.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,n;const r=(n=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||n===void 0?void 0:n.history;return typeof r=="number"?r:hr.DEFAULT_COMMANDS_HISTORY_LENGTH}};Tb.DEFAULT_COMMANDS_HISTORY_LENGTH=50;Tb.PREF_KEY_CACHE="commandPalette.mru.cache";Tb.PREF_KEY_COUNTER="commandPalette.mru.counter";Tb.counter=1;Tb=hr=ixe([Y_(0,Gd),Y_(1,En)],Tb);class xEt extends Ib{constructor(e,t,n,o,r,s){super(e,t,n,o,r,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions())t.push({commandId:n.id,commandAlias:n.alias,label:pX(n.label)||n.id});return t}}var LEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},rC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dde=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let sI=class extends xEt{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,n,o,r,s){super({showAlias:!1},e,n,o,r,s),this.codeEditorService=t}getCommandPicks(){return dde(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return dde(this,void 0,void 0,function*(){return[]})}};sI=LEt([rC(0,$t),rC(1,Jn),rC(2,xi),rC(3,_o),rC(4,tc),rC(5,iT)],sI);class IT extends ft{constructor(){super({id:IT.ID,label:RP.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(dh).quickAccess.show(sI.PREFIX)}}IT.ID="editor.action.quickCommand";ze(IT);no.as(Xb.Quickaccess).registerQuickAccessProvider({ctor:sI,prefix:sI.PREFIX,helpEntries:[{description:RP.quickCommandHelp,commandId:IT.ID}]});var EEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},sC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let JU=class extends Wv{constructor(e,t,n,o,r,s,a){super(!0,e,t,n,o,r,s,a)}};JU=EEt([sC(1,Ut),sC(2,Jn),sC(3,Ao),sC(4,$t),sC(5,Gd),sC(6,En)],JU);Un(Wv.ID,JU,4);class DEt extends ft{constructor(){super({id:"editor.action.toggleHighContrast",label:YH.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(ic),o=n.getColorTheme();Hu(o.type)?(n.setTheme(this._originalThemeName||(Ew(o.type)?By:Ig)),this._originalThemeName=null):(n.setTheme(Ew(o.type)?A0:P0),this._originalThemeName=o.themeName)}}ze(DEt);function kEt(){return new Worker("/eos/assets/editor.worker.efc65e0b.js",{type:"module"})}function IEt(){return new Worker("/eos/assets/json.worker.b6a074fe.js",{type:"module"})}function TEt(){return new Worker("/eos/assets/css.worker.903adc4e.js",{type:"module"})}function NEt(){return new Worker("/eos/assets/html.worker.dd9c9e9a.js",{type:"module"})}function REt(){return new Worker("/eos/assets/ts.worker.d675a6ca.js",{type:"module"})}self.MonacoEnvironment={getWorker(i,e){return e==="json"?new IEt:e==="css"||e==="scss"||e==="less"?new TEt:e==="html"||e==="handlebars"||e==="razor"?new NEt:e==="typescript"||e==="javascript"?new REt:new kEt}};aye.typescript.typescriptDefaults.setEagerModelSync(!0);function MEt(i,e){const{code:t,className:n,readonly:o,language:r}=i,[s,a]=x.exports.useState(null),l=x.exports.useRef(null);return x.exports.useEffect(()=>(l&&a(c=>c||sye.create(l.current,{value:t,language:r,readOnly:o})),()=>s==null?void 0:s.dispose()),[l.current]),iFe(()=>{async function c(){var d;s&&(s.setValue(t),o&&s.updateOptions({readOnly:!1}),await((d=s.getAction("editor.action.formatDocument"))==null?void 0:d.run()),o&&s.updateOptions({readOnly:!0}))}c()},[t]),x.exports.useImperativeHandle(e,()=>({editor:s}),[s]),he("div",{className:Ue(Ivt.editor,n),ref:l})}const oxe=x.exports.forwardRef(MEt);function AEt(i){const{node:e}=i,[t,n]=x.exports.useState(!1),o=n3(),[r,s]=x.exports.useState(""),a=x.exports.useRef(null),l=fr(e);return fn("div",{className:toe.container,children:[he("span",{style:{color:"white",cursor:"pointer",display:"block",textAlign:"center"},onClick:()=>{var c;s(((c=e.data)==null?void 0:c.customCode)||(l==null?void 0:l.getInitCustomCode())||""),n(!0)},children:"\u70B9\u51FB\u7F16\u8F91"}),he(Lq,{title:"Basic Modal",open:t,onOk:()=>{n(!1),o.updateNode(e.id,c=>{var d,u;return(l==null?void 0:l.updateData(c,{customCode:((u=(d=a.current)==null?void 0:d.editor)==null?void 0:u.getValue())||""}))||c})},onCancel:()=>{n(!1)},destroyOnClose:!0,children:he(oxe,{ref:a,code:r,language:"javascript",className:toe.editor})})]})}class rxe extends mp{constructor(){super({operatorName:"Transform",operatorType:"TransformOperator",nodeType:oh.Node});bt(this,"nodeColor","#F3F8FF")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",hint:"output",label:"output"}),new ri({type:"target",hint:"input",label:"input"})]}})}generateBlockDeclarations(t){var l,c,d,u,h,f,g,p;const{node:n,nodeGraph:o}=t,r=((d=(c=(l=n.data.endPointOptions)==null?void 0:l.endPointList)==null?void 0:c.find(v=>v.hint==="output"))==null?void 0:d.id)||"",s=((f=(h=(u=n.data.endPointOptions)==null?void 0:u.endPointList)==null?void 0:h.find(v=>v.hint==="input"))==null?void 0:f.id)||"",a=((p=(g=o.findSourceNodes(n.id))==null?void 0:g.find(v=>v.handleId===s))==null?void 0:p.relatedHandleId)||"";return[`${r?`const ${Cd(r)} = `:""}${pS}.transform( +`)};const s=yield r.provideRenameEdits(this.model,this.position,e,o);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,n.concat(s.rejectReason),o)}else return this._provideRenameEdits(e,t+1,n.concat(C("no result","No result.")),o);return s})}}function Txt(i,e,t,n){return B0(this,void 0,void 0,function*(){const o=new UY(e,t,i),r=yield o.resolveRenameLocation(_n.None);return r!=null&&r.rejectReason?{edits:[],rejectReason:r.rejectReason}:o.provideRenameEdits(n,_n.None)})}let Db=TU=class{static get(e){return e.getContribution(TU.ID)}constructor(e,t,n,o,r,s,a,l){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=o,this._progressService=r,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new Be,this._cts=new Ro,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(IU,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return B0(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new Ro,!this.editor.hasModel())return;const n=this.editor.getPosition(),o=new UY(this.editor.getModel(),n,this._languageFeaturesService.renameProvider);if(!o.hasProvider())return;const r=new Av(this.editor,5,void 0,this._cts.token);let s;try{const g=o.resolveRenameLocation(r.token);this._progressService.showWhile(g,250),s=yield g}catch(g){(e=cl.get(this.editor))===null||e===void 0||e.showMessage(g||C("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),n);return}finally{r.dispose()}if(!s)return;if(s.rejectReason){(t=cl.get(this.editor))===null||t===void 0||t.showMessage(s.rejectReason,n);return}if(r.token.isCancellationRequested)return;const a=new Av(this.editor,5,s.range,this._cts.token),l=this.editor.getSelection();let c=0,d=s.text.length;!V.isEmpty(l)&&!V.spansMultipleLines(l)&&V.containsRange(s.range,l)&&(c=Math.max(0,l.startColumn-s.range.startColumn),d=Math.min(s.range.endColumn,l.endColumn)-s.range.startColumn);const u=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=yield this._renameInputField.getInput(s.range,s.text,c,d,u,a.token);if(typeof h=="boolean"){h&&this.editor.focus(),a.dispose();return}this.editor.focus();const f=i5(o.provideRenameEdits(h.newName,a.token),a.token).then(g=>B0(this,void 0,void 0,function*(){if(!(!g||!this.editor.hasModel())){if(g.rejectReason){this._notificationService.info(g.rejectReason);return}this.editor.setSelection(V.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(g,{editor:this.editor,showPreview:h.wantsPreview,label:C("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,h.newName),code:"undoredo.rename",quotableLabel:C("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,h.newName),respectAutoSaveConfig:!0}).then(p=>{p.ariaSummary&&Cs(C("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,h.newName,p.ariaSummary))}).catch(p=>{this._notificationService.error(C("rename.failedApply","Rename failed to apply edits")),this._logService.error(p)})}}),g=>{this._notificationService.error(C("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)}};Db.ID="editor.contrib.renameController";Db=TU=Ixt([L_(1,$t),L_(2,Ao),L_(3,oT),L_(4,t_),L_(5,nc),L_(6,mG),L_(7,pt)],Db);class Nxt extends ft{constructor(){super({id:"editor.action.rename",label:C("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:Me.and(Q.writable,Q.hasRenameProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(Jn),[o,r]=Array.isArray(t)&&t||[void 0,void 0];return Rt.isUri(o)&&ae.isIPosition(r)?n.openCodeEditor({resource:o},n.getActiveCodeEditor()).then(s=>{!s||(s.setPosition(r),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=Db.get(t);return n?n.run():Promise.resolve()}}Un(Db.ID,Db,4);ze(Nxt);const jY=Ir.bindToContribution(Db.get);Ye(new jY({id:"acceptRenameInput",precondition:jF,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:3}}));Ye(new jY({id:"acceptRenameInputWithPreview",precondition:Me.and(jF,Me.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:1024+3}}));Ye(new jY({id:"cancelRenameInput",precondition:jF,handler:i=>i.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:Q.focus,primary:9,secondary:[1033]}}));Nf("_executeDocumentRenameProvider",function(i,e,t,...n){const[o]=n;fi(typeof o=="string");const{renameProvider:r}=i.get(pt);return Txt(r,e,t,o)});Nf("_executePrepareRename",function(i,e,t){return B0(this,void 0,void 0,function*(){const{renameProvider:n}=i.get(pt),r=yield new UY(e,t,n).resolveRenameLocation(_n.None);if(r!=null&&r.rejectReason)throw new Error(r.rejectReason);return r})});no.as(ch.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:C("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function Rxt(i){for(let e=0,t=i.length;e0?t[0]:[]}function PSe(i,e,t,n,o){return jv(this,void 0,void 0,function*(){const r=Oxt(i,e),s=yield Promise.all(r.map(a=>jv(this,void 0,void 0,function*(){let l,c=null;try{l=yield a.provideDocumentSemanticTokens(e,a===t?n:null,o)}catch(d){c=d,l=null}return(!l||!KF(l)&&!MSe(l))&&(l=null),new Pxt(a,l,c)})));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null})}function Fxt(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class Bxt{constructor(e,t){this.provider=e,this.tokens=t}}function Wxt(i,e){return i.has(e)}function OSe(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}function KY(i,e,t,n){return jv(this,void 0,void 0,function*(){const o=OSe(i,e),r=yield Promise.all(o.map(s=>jv(this,void 0,void 0,function*(){let a;try{a=yield s.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){$o(l),a=null}return(!a||!KF(a))&&(a=null),new Bxt(s,a)})));for(const s of r)if(s.tokens)return s;return r.length>0?r[0]:null})}Rn.registerCommand("_provideDocumentSemanticTokensLegend",(i,...e)=>jv(void 0,void 0,void 0,function*(){const[t]=e;fi(t instanceof Rt);const n=i.get(Yi).getModel(t);if(!n)return;const{documentSemanticTokensProvider:o}=i.get(pt),r=Fxt(o,n);return r?r[0].getLegend():i.get(_o).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));Rn.registerCommand("_provideDocumentSemanticTokens",(i,...e)=>jv(void 0,void 0,void 0,function*(){const[t]=e;fi(t instanceof Rt);const n=i.get(Yi).getModel(t);if(!n)return;const{documentSemanticTokensProvider:o}=i.get(pt);if(!ASe(o,n))return i.get(_o).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const r=yield PSe(o,n,null,null,_n.None);if(!r)return;const{provider:s,tokens:a}=r;if(!a||!KF(a))return;const l=RSe({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l}));Rn.registerCommand("_provideDocumentRangeSemanticTokensLegend",(i,...e)=>jv(void 0,void 0,void 0,function*(){const[t,n]=e;fi(t instanceof Rt);const o=i.get(Yi).getModel(t);if(!o)return;const{documentRangeSemanticTokensProvider:r}=i.get(pt),s=OSe(r,o);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!n||!V.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=yield KY(r,o,V.lift(n),_n.None);if(!!a)return a.provider.getLegend()}));Rn.registerCommand("_provideDocumentRangeSemanticTokens",(i,...e)=>jv(void 0,void 0,void 0,function*(){const[t,n]=e;fi(t instanceof Rt),fi(V.isIRange(n));const o=i.get(Yi).getModel(t);if(!o)return;const{documentRangeSemanticTokensProvider:r}=i.get(pt),s=yield KY(r,o,V.lift(n),_n.None);if(!(!s||!s.tokens))return RSe({id:0,type:"full",data:s.tokens.data})}));const qY="editor.semanticHighlighting";function NU(i,e,t){var n;const o=(n=t.getValue(qY,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))===null||n===void 0?void 0:n.enabled;return typeof o=="boolean"?o:e.getColorTheme().semanticHighlighting}var FSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Nh=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Jp;let RU=class extends _e{constructor(e,t,n,o,r,s){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new tI(d,e,n,r,s)},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()];NU(d,n,o)?u||a(d):u&&l(d,u)}};this._register(t.onModelAdded(d=>{NU(d,n,o)&&a(d)})),this._register(t.onModelRemoved(d=>{const u=this._watchers[d.uri.toString()];u&&l(d,u)})),this._register(o.onDidChangeConfiguration(d=>{d.affectsConfiguration(qY)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};RU=FSe([Nh(0,I5),Nh(1,Yi),Nh(2,vr),Nh(3,En),Nh(4,qc),Nh(5,pt)],RU);let tI=Jp=class extends _e{constructor(e,t,n,o,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:Jp.REQUEST_MIN_DELAY,max:Jp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new bi(()=>this._fetchDocumentSemanticTokensNow(),Jp.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 s=()=>{si(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)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.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),si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!ASe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Ro,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,o=PSe(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],s=this._model.onDidChangeContent(l=>{r.push(l)}),a=new Ls(!1);o.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:c,tokens:d}=l,u=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,u,r)}},l=>{l&&(sh(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||en(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,o,r){r=Math.min(r,n.length-o,e.length-t);for(let s=0;s{(o.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||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(MSe(t)){if(!r){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:r.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=r.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){n.warnInvalidEditStart(r.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=d-(f.start+f.deleteCount);g>0&&(Jp._copy(l,d-g,c,u-g,g),u-=g),f.data&&(Jp._copy(f.data,0,c,u-f.data.length,f.data.length),u-=f.data.length),d=f.start}d>0&&Jp._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(KF(t)){this._currentDocumentResponse=new Vxt(e,t.resultId,t.data);const a=_1e(t,n,this._model.getLanguageId());if(o.length>0)for(const l of o)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);s()}};tI.REQUEST_MIN_DELAY=300;tI.REQUEST_MAX_DELAY=2e3;tI=Jp=FSe([Nh(1,I5),Nh(2,vr),Nh(3,qc),Nh(4,pt)],tI);class Vxt{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}Y5(RU);var Hxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},sL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let nI=class extends _e{constructor(e,t,n,o,r,s){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=o,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new bi(()=>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(qY)&&(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,n=this._outstandingRequests.length;tthis._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),o=sr(s=>Promise.resolve(KY(this._provider,e,t,s))),r=new Ls(!1);return o.then(s=>{if(this._debounceInformation.update(e,r.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,_1e(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(o),()=>this._removeOutstandingRequest(o)),o}};nI.ID="editor.contrib.viewportSemanticTokens";nI=Hxt([sL(1,I5),sL(2,vr),sL(3,En),sL(4,qc),sL(5,pt)],nI);Un(nI.ID,nI,1);class $xt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const o of t){const r=[];n.push(r),this.selectSubwords&&this._addInWordRanges(r,e,o),this._addWordRanges(r,e,o),this._addWhitespaceLine(r,e,o),r.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const o=t.getWordAtPosition(n);if(!o)return;const{word:r,startColumn:s}=o,a=n.column-s;let l=a,c=a,d=0;for(;l>=0;l--){const u=r.charCodeAt(l);if(l!==a&&(u===95||u===45))break;if(wm(u)&&kh(d))break;d=u}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new V(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var zxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Uxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qF=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},MU;class GY{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 n=new GY(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let Jw=MU=class{static get(e){return e.getContribution(MU.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 qF(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||(yield WSe(this._languageFeaturesService.selectionRangeProvider,n,t.map(r=>r.getPosition()),this._editor.getOption(112),_n.None).then(r=>{var s;if(!(!ws(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!Lo(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),r[a].unshift(t[a]);this._state=r.map(a=>new GY(0,a)),(s=this._selectionListener)===null||s===void 0||s.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(r=>r.mov(e));const o=this._state.map(r=>gt.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(o)}finally{this._ignoreSelection=!1}})}};Jw.ID="editor.contrib.smartSelectController";Jw=MU=zxt([Uxt(1,pt)],Jw);class BSe extends ft{constructor(e,t){super(t),this._forward=e}run(e,t){return qF(this,void 0,void 0,function*(){const n=Jw.get(t);n&&(yield n.run(this._forward))})}}class jxt extends BSe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:C("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Rn.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Kxt extends BSe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:C("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}Un(Jw.ID,Jw,4);ze(jxt);ze(Kxt);function WSe(i,e,t,n,o){return qF(this,void 0,void 0,function*(){const r=i.all(e).concat(new $xt(n.selectSubwords));r.length===1&&r.unshift(new Rl);const s=[],a=[];for(const l of r)s.push(Promise.resolve(l.provideSelectionRanges(e,t,o)).then(c=>{if(ws(c)&&c.length===t.length)for(let d=0;d{if(l.length===0)return[];l.sort((h,f)=>ae.isBefore(h.getStartPosition(),f.getStartPosition())?1:ae.isBefore(f.getStartPosition(),h.getStartPosition())||ae.isBefore(h.getEndPosition(),f.getEndPosition())?-1:ae.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let d;for(const h of l)(!d||V.containsRange(h,d)&&!V.equalsRange(h,d))&&(c.push(h),d=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const u=[c[0]];for(let h=1;hi}),w7="data-sticky-line-index",Xce="data-sticky-is-line",Xxt="data-sticky-is-line-number",Yce="data-sticky-is-folding-icon";class Yxt extends _e{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 Fv),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(114)&&t(),n.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{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,n=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&n===1/0)return;this._previousState=e;const o=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const s=[...e.startLineNumbers];e.showEndForLine!==null&&(s[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=s}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(o,t,n)}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Ur(this._lineNumbersDomNode),Ur(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const n=t.foldingIcon;!n||n.setVisible(e?!0:n.isCollapsed)}}_renderRootNode(e,t,n=1/0){return Gxt(this,void 0,void 0,function*(){const o=this._editor.getLayoutInfo();for(const[s,a]of this._lineNumbers.entries()){const l=e[s],c=a>=n||(l==null?void 0:l.lineNumber)!==a?this._renderChildNode(s,a,t,o):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 r=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(r===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${r}px`,this._linesDomNodeScrollable.style.height=`${r}px`,this._rootDomNode.style.height=`${r}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)})}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(ke(this._lineNumbersDomNode,et.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ke(this._lineNumbersDomNode,et.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,o){const r=this._editor._getViewModel();if(!r)return;const s=r.coordinatesConverter.convertModelPositionToViewPosition(new ae(t,1)).lineNumber,a=r.getViewLineRenderingData(s),l=this._editor.getOption(67);let c;try{c=rl.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const d=new Jv(!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 yS(2e3),h=qI(d,u);let f;Gce?f=Gce.createHTML(u.build()):f=u.build();const g=document.createElement("span");g.setAttribute(w7,String(e)),g.setAttribute(Xce,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(w7,String(e)),p.setAttribute(Xxt,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const v=o.contentLeft;p.style.width=`${v}px`;const m=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?m.innerText=t.toString():l.renderType===2&&(m.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),m.className="sticky-line-number-inner",m.style.lineHeight=`${this._lineHeight}px`,m.style.width=`${o.lineNumbersWidth}px`,m.style.paddingLeft=`${o.lineNumbersLeft}px`,p.appendChild(m);const _=this._renderFoldingIconForLine(n,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(m),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const y=new Zxt(e,t,g,p,_,h.characterMapping);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;const n=e.index,o=e.lineDomNode,r=e.lineNumberDomNode,s=n===this._lineNumbers.length-1,a="0",l="1";o.style.zIndex=s?a:l,r.style.zIndex=s?a:l;const c=`${n*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,d=`${n*this._lineHeight}px`;return o.style.top=s?c:d,r.style.top=s?c:d,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(109);if(!e||n==="never")return;const o=e.regions,r=o.findRange(t),s=o.getStartLineNumber(r);if(!(t===s))return;const l=o.isCollapsed(r),c=new Qxt(l,s,o.getEndLineNumber(r),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(Yce,""),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 n=NG(t.characterMapping,e,0);return new ae(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t,n;return(n=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&n!==void 0?n: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,w7);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Xce)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Yce)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class Zxt{constructor(e,t,n,o,r,s){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=o,this.foldingIcon=r,this.characterMapping=s}}class Qxt{constructor(e,t,n,o){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=o,this.domNode=document.createElement("div"),this.domNode.style.width=`${o}px`,this.domNode.style.height=`${o}px`,this.domNode.className=Mt.asClassName(e?DF:EF)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class WE{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class AO{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class VSe{constructor(e,t,n,o){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=o}}var GF=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iI=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Zce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},VE;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(VE||(VE={}));var Pm;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(Pm||(Pm={}));let AU=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=n,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Wd(300)),this._updateOperation=this._register(new Be);const r=new PU(n),s=new FU(this._editor,n),a=new OU(this._editor,t);switch(o){case VE.OUTLINE_MODEL:this._modelProviders.push(r),this._modelProviders.push(s),this._modelProviders.push(a);break;case VE.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case VE.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,n){return Zce(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(()=>Zce(this,void 0,void 0,function*(){for(const o of this._modelProviders){const{statusPromise:r,modelPromise:s}=o.computeStickyModel(e,t,n);this._modelPromise=s;const a=yield r;if(this._modelPromise!==s)return null;switch(a){case Pm.CANCELED:return this._updateOperation.clear(),null;case Pm.VALID:return o.stickyModel}}return null})).catch(o=>(en(o),null))})}};AU=GF([iI(1,Ti),iI(2,pt)],AU);class HSe{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Pm.INVALID}computeStickyModel(e,t,n){if(n.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const o=sr(r=>this.createModelFromProvider(e,t,r));return{statusPromise:o.then(r=>this.isModelValid(r)?n.isCancellationRequested?Pm.CANCELED:(this._stickyModel=this.createStickyModel(e,t,n,r),Pm.VALID):this._invalid()).then(void 0,r=>(en(r),Pm.CANCELED)),modelPromise:o}}isModelValid(e){return!0}isProviderValid(e){return!0}}let PU=class extends HSe{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,n){return _g.create(this._languageFeaturesService.documentSymbolProvider,e,n)}createStickyModel(e,t,n,o){var r;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(o,(r=this._stickyModel)===null||r===void 0?void 0:r.outlineProviderId);return new VSe(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(vn.first(e.children.values())instanceof dSe){const a=vn.find(e.children.values(),l=>l.id===t);if(a)n=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,n=d.children}}else n=e.children;const o=[],r=Array.from(n.values()).sort((a,l)=>{const c=new WE(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new WE(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,d)});for(const a of r)o.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new AO(void 0,o,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const s of r.children.values())n.push(this._stickyModelFromOutlineElement(s,r.symbol.selectionRange.startLineNumber));n.sort((r,s)=>this._comparator(r.range,s.range));const o=new WE(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new AO(o,n,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 n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof nU?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};PU=GF([iI(0,pt)],PU);class $Se extends HSe{constructor(e){super(),this._foldingLimitReporter=new aSe(e)}createStickyModel(e,t,n,o){const r=this._fromFoldingRegions(o);return new VSe(e.uri,t,r,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],o=new AO(void 0,[],void 0);for(let r=0;r0}createModelFromProvider(e,t,n){const o=xf.getFoldingRangeProviders(this._languageFeaturesService,e);return new RY(e,o,()=>this.createModelFromProvider(e,t,n),this._foldingLimitReporter,void 0).compute(n)}};FU=GF([iI(1,pt)],FU);var Jxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Qce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Jce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class eLt{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let BU=class extends _e{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new le),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 bi(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(o=>{o.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 AU(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 Jce(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Ro,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return Jce(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(),n=t.getVersionId(),o=yield this._stickyModelProvider.update(t,n,e);e.isCancellationRequested||(this._model=o)})}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,o,r){if(t.children.length===0)return;let s=r;const a=[];for(let d=0;dd-u)),c=this.updateIndex(ED(a,e.startLineNumber+o,(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!==s&&(s=h,n.push(new eLt(h,f-1,o+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,n,o+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,n,o,r)}}getCandidateStickyLinesIntersecting(e){var t,n;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let o=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,o,0,-1);const r=(n=this._editor._getViewModel())===null||n===void 0?void 0:n.getHiddenAreas();if(r)for(const s of r)o=o.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return o}};BU=Jxt([Qce(1,pt),Qce(2,Ti)],BU);var tLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},S7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},WU;let Lf=WU=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=o,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 Yxt(this._editor),this._stickyLineCandidateProvider=new BU(this._editor,n,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new qce([],[],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(ke(l,et.CONTEXT_MENU,d=>S7(this,void 0,void 0,function*(){this._onContextMenu(d)}))),this._stickyScrollFocusedContextKey=Q.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=Q.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(pf(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(ke(l,et.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(WU.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(V.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Be),t=this._register(new uF(this._editor,{extractLineNumberFromMouseEvent:r=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return s?s.lineNumber:0}})),n=r=>{if(!this._editor.hasModel()||r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return null;const s=r.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new V(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},o=this._stickyScrollWidget.getDomNode();this._register(No(o,et.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(c===null)return;const d=new ae(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(c===null)return;l=new ae(c,1)}this._revealPosition(l)})),this._register(No(o,et.MOUSE_MOVE,r=>{if(r.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(ke(o,et.MOUSE_LEAVE,r=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,s])=>{const a=n(r);if(!a||!r.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 Ro;e.add(zt(()=>d.dispose(!0)));let u;vF(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ae(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(zt(()=>{u.style.textDecoration="none"}))):u||(u=f,u.style.textDecoration="underline",e.add(zt(()=>{u.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(r=>S7(this,void 0,void 0,function*(){if(r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);!s||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(vSe,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const t=new kc(e);this._contextMenuService.showContextMenu({menuId:Z.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;nSe(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const o=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(o),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(n=>{n.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),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 n of t)for(const o of e.ranges)if(n>=o.fromLineNumber&&n<=o.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,n;return S7(this,void 0,void 0,function*(){const o=this._editor.getModel();if(!o||o.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const r=this._stickyLineCandidateProvider.getVersionId();if(r===void 0||r===o.getVersionId())if(this._foldingModel=(n=yield(t=xf.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel())!==null&&n!==void 0?n: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 s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(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),n=this._editor.getScrollTop();let o=0;const r=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new WE(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,v=this._editor.getBottomForLineNumber(u)-n,m=this._editor.getTopForLineNumber(h)-n,_=this._editor.getBottomForLineNumber(h)-n;if(g>m&&g<=_){r.push(u),s.push(h+1),o=_-p;break}else p>v&&p<=_&&(r.push(u),s.push(h+1));if(r.length===t)break}}}return this._endLineNumbers=s,new qce(r,s,o,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Lf.ID="store.contrib.stickyScrollController";Lf=WU=tLt([oC(1,Kd),oC(2,pt),oC(3,$t),oC(4,Ti),oC(5,qc),oC(6,Ut)],Lf);var nLt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class iLt extends ec{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:C("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:C({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:qxt.View,toggled:{condition:Me.equals("config.editor.stickyScroll.enabled",!0),title:C("stickyScroll","Sticky Scroll"),mnemonicTitle:C({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:Z.CommandPalette},{id:Z.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Z.StickyScrollContext}]})}run(e){return nLt(this,void 0,void 0,function*(){const t=e.get(En),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)})}}const XF=100;class oLt extends lh{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:C("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:C({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:Me.and(Me.has("config.editor.stickyScroll.enabled"),Q.stickyScrollVisible),menu:[{id:Z.CommandPalette}]})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.focus()}}class rLt extends lh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:C("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:XF,primary:18}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.focusNext()}}class sLt extends lh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:C("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:XF,primary:16}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.focusPrevious()}}class aLt extends lh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:C("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:XF,primary:3}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.goToFocused()}}class lLt extends lh{constructor(){super({id:"editor.action.selectEditor",title:{value:C("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:XF,primary:9}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.selectEditor()}}Un(Lf.ID,Lf,1);$i(iLt);$i(oLt);$i(sLt);$i(rLt);$i(aLt);$i(lLt);var XY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},W0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cLt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},B_;class dLt{constructor(e,t,n,o,r,s){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=o,this.command=r,this.completion=s}}let VU=class extends IYe{constructor(e,t,n,o,r,s){super(r.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=o,this._suggestMemoryService=s}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn=0&&l.resolve(_n.None)}return t}};VU=XY([W0(5,NF)],VU);let HU=class{constructor(e,t,n,o){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=n,this._suggestMemoryService=o}provideInlineCompletions(e,t,n,o){var r;return cLt(this,void 0,void 0,function*(){if(n.selectedSuggestionInfo)return;const s=this._getEditorOption(88,e);if(JC.isAllOff(s))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(JC.valueFor(s,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 V(t.lineNumber,1,t.lineNumber,t.column));if(!d&&((r=this._lastResult)===null||r===void 0?void 0:r.canBeReused(e,t.lineNumber,c))){const f=new Hce(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),u=this._lastResult}else{const f=yield PY(this._languageFeatureService.completionProvider,e,t,new jk(void 0,void 0,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},o);let g;f.needsClipboard&&(g=yield this._clipboardService.readText());const p=new fm(f.items,t.column,new Hce(h,0),xu.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},g);u=new VU(e,t.lineNumber,c,p,f,this._suggestMemoryService)}return this._lastResult=u,u})}handleItemDidShow(e,t){t.completion.resolve(_n.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var n;const o=e.getValueInRange(V.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((n=s.triggerCharacters)===null||n===void 0)&&n.includes(o)&&r.add(s);if(r.size!==0)return{providers:r,ch:o}}};HU=XY([W0(1,pt),W0(2,Sp),W0(3,NF)],HU);let PO=B_=class{constructor(e,t,n,o){if(++B_._counter===1){const r=o.createInstance(HU,(s,a)=>{var l;return((l=n.listCodeEditors().find(d=>d.getModel()===a))!==null&&l!==void 0?l:e).getOption(s)});B_._disposable=t.inlineCompletionsProvider.register("*",r)}}dispose(){var e;--B_._counter===0&&((e=B_._disposable)===null||e===void 0||e.dispose(),B_._disposable=void 0)}};PO._counter=0;PO=B_=XY([W0(1,pt),W0(2,Jn),W0(3,$t)],PO);Un("suggest.inlineCompletionsProvider",PO,0);class uLt extends ft{constructor(){super({id:"editor.action.forceRetokenize",label:C("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const o=new Ls;n.tokenization.forceTokenization(n.getLineCount()),o.stop(),console.log(`tokenization took ${o.elapsed()}`)}}ze(uLt);class YF extends ec{constructor(){super({id:YF.ID,title:{value:C({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=!Sw.getTabFocusMode();Sw.setTabFocusMode(t),Cs(t?C("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):C("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}YF.ID="editor.action.toggleTabFocusMode";$i(YF);var hLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fLt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let $U=class extends _e{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,n={},o){var r;super(),this._link=t,this._enabled=!0,this.el=Ae(e,He("a.monaco-link",{tabIndex:(r=t.tabIndex)!==null&&r!==void 0?r:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new xn(this.el,"click")),a=this._register(new xn(this.el,"keypress")),l=st.chain(a.event,u=>u.map(h=>new Pi(h)).filter(h=>h.keyCode===3)),c=this._register(new xn(this.el,Di.Tap)).event;this._register(Ei.addTarget(this.el));const d=st.any(s.event,l,c);this._register(d(u=>{!this.enabled||(un.stop(u,!0),n!=null&&n.opener?n.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};$U=hLt([fLt(3,ml)],$U);var zSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},USe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const gLt=26;let zU=class extends _e{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(UU))}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,gLt)}};zU=zSe([USe(1,$t)],zU);let UU=class extends _e{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(hp,{}),this.element=He("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=He("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ur(this.element)}show(e){Ur(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=Ae(this.element,He("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(He(`div${Mt.asCSSSelector(e.icon)}`));const o=Ae(this.element,He("div.message-container"));if(o.setAttribute("aria-hidden","true"),o.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ae(this.element,He("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance($U,this.messageActionsContainer,Object.assign(Object.assign({},s),{tabIndex:-1}),{}));const r=Ae(this.element,He("div.action-container"));this.actionBar=this._register(new zc(r)),this.actionBar.push(this._register(new ca("banner.close","Close Banner",Mt.asClassName(ICe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};UU=zSe([USe(0,$t)],UU);var YY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},$y=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ms=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const pLt=Eo("extensions-warning-message",Xe.warning,C("warningIcon","Icon shown with a warning message in the extensions editor."));let eS=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const s=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new BS};else if(r.ambiguousCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new r_};else if(r.invisibleCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new FS};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:pLt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(o.createInstance(zU,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(n.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.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=mLt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!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(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?NXe:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new jU(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new vLt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};eS.ID="editor.contrib.unicodeHighlighter";eS=YY([$y(1,Xd),$y(2,D1e),$y(3,$t)],eS);function mLt(i,e){return{nonBasicASCII:e.nonBasicASCII===kl?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===kl?!i:e.includeComments,includeStrings:e.includeStrings===kl?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let jU=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=o,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new bi(()=>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 n=[];if(!t.hasMore)for(const o of t.ranges)n.push({range:o,options:OO.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!QG(t,e))return null;const n=t.getValueInRange(e.range);return{reason:jSe(n,this._options),inComment:JG(t,e),inString:eX(t,e)}}};jU=YY([$y(3,Xd)],jU);class vLt extends _e{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new bi(()=>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=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const o of e){const r=hG.computeUnicodeHighlights(this._model,this._options,o);for(const s of r.ranges)n.ranges.push(s);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||r.hasMore}if(!n.hasMore)for(const o of n.ranges)t.push({range:o,options:OO.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return QG(t,e)?{reason:jSe(n,this._options),inComment:JG(t,e),inString:eX(t,e)}:null}}let KU=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),o=this._editor.getContribution(eS.ID);if(!o)return[];const r=[],s=new Set;let a=300;for(const l of t){const c=o.getDecorationInfo(l);if(!c)continue;const u=n.getValueInRange(l.range).codePointAt(0),h=x7(u);let f;switch(c.reason.kind){case 0:{$I(c.reason.confusableWith)?f=C("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,x7(c.reason.confusableWith.codePointAt(0))):f=C("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,x7(c.reason.confusableWith.codePointAt(0)));break}case 1:f=C("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=C("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:u,reason:c.reason,inComment:c.inComment,inString:c.inString},p=C("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${ET.ID}?${encodeURIComponent(JSON.stringify(g))}`,m=new os("",!0).appendMarkdown(f).appendText(" ").appendLink(v,p);r.push(new Du(this,l.range,[m],!1,a++))}return r}renderHoverParts(e,t){return ywe(e,t,this._editor,this._languageService,this._openerService)}};KU=YY([$y(1,Ki),$y(2,ml)],KU);function qU(i){return`U+${i.toString(16).padStart(4,"0")}`}function x7(i){let e=`\`${qU(i)}\``;return cf.isInvisibleCharacter(i)||(e+=` "${`${_Lt(i)}`}"`),e}function _Lt(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function jSe(i,e){return hG.computeUnicodeHighlightReason(i,e)}class OO{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let o=this.map.get(n);return o||(o=Jt.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,o)),o}}OO.instance=new OO;class bLt extends ft{constructor(){super({id:r_.ID,label:C("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.includeComments,!1,2)})}}class CLt extends ft{constructor(){super({id:r_.ID,label:C("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.includeStrings,!1,2)})}}class r_ extends ft{constructor(){super({id:r_.ID,label:C("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.ambiguousCharacters,!1,2)})}}r_.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class FS extends ft{constructor(){super({id:FS.ID,label:C("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.invisibleCharacters,!1,2)})}}FS.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class BS extends ft{constructor(){super({id:BS.ID,label:C("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.nonBasicASCII,!1,2)})}}BS.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class ET extends ft{constructor(){super({id:ET.ID,label:C("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,n){return ms(this,void 0,void 0,function*(){const{codePoint:o,reason:r,inString:s,inComment:a}=n,l=String.fromCodePoint(o),c=e.get(dh),d=e.get(En);function u(g){return cf.isInvisibleCharacter(g)?C("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",qU(g)):C("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${qU(g)} "${l}"`)}const h=[];if(r.kind===0)for(const g of r.notAmbiguousInLocales)h.push({label:C("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:()=>ms(this,void 0,void 0,function*(){wLt(d,[g])})});if(h.push({label:u(o),run:()=>yLt(d,[o])}),a){const g=new bLt;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(s){const g=new CLt;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}if(r.kind===0){const g=new r_;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(r.kind===1){const g=new FS;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(r.kind===2){const g=new BS;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(d)})})}else SLt(r);const f=yield c.pick(h,{title:C("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});f&&(yield f.run())})}}ET.ID="editor.action.unicodeHighlight.showExcludeOptions";function yLt(i,e){return ms(this,void 0,void 0,function*(){const t=i.getValue(Ta.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const o of e)n[String.fromCodePoint(o)]=!0;yield i.updateValue(Ta.allowedCharacters,n,2)})}function wLt(i,e){var t;return ms(this,void 0,void 0,function*(){const n=(t=i.inspect(Ta.allowedLocales).user)===null||t===void 0?void 0:t.value;let o;typeof n=="object"&&n?o=Object.assign({},n):o={};for(const r of e)o[r]=!0;yield i.updateValue(Ta.allowedLocales,o,2)})}function SLt(i){throw new Error(`Unexpected value: ${i}`)}ze(r_);ze(FS);ze(BS);ze(ET);Un(eS.ID,eS,1);n1.register(KU);var xLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ede=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},LLt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const KSe="ignoreUnusualLineTerminators";function ELt(i,e,t){i.setModelProperty(e.uri,KSe,t)}function DLt(i,e){return i.getModelProperty(e.uri,KSe)}let oI=class extends _e{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(o=>{o.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return LLt(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||DLt(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=yield this._dialogService.confirm({title:C("unusualLineTerminators.title","Unusual Line Terminators"),message:C("unusualLineTerminators.message","Detected unusual line terminators"),detail:C("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`.",$c(e.uri)),primaryButton:C({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:C("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){ELt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};oI.ID="editor.contrib.unusualLineTerminatorsDetector";oI=xLt([ede(1,iT),ede(2,Jn)],oI);Un(oI.ID,oI,1);var kLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tde=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},GU;const ZF=new lt("hasWordHighlights",!1);function qSe(i,e,t,n){const o=i.ordered(e);return D0e(o.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,n)).then(void 0,$o)),ws)}class GSe{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=sr(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new V(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const o=t.startLineNumber,r=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=Boolean(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,d=n.length;!l&&c=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class ILt extends GSe{constructor(e,t,n,o){super(e,t,n),this._providers=o}_compute(e,t,n,o){return qSe(this._providers,e,t.getPosition(),o).then(r=>r||[])}}class TLt extends GSe{constructor(e,t,n){super(e,t,n),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,n,o){return xv(250,o).then(()=>{if(!t.isEmpty())return[];const r=e.getWordAtPosition(t.getPosition());return!r||r.word.length>1e3?[]:e.findMatches(r.word,!0,!1,!0,n,!1).map(a=>({range:a.range,kind:MD.Text}))})}isValid(e,t,n){const o=t.isEmpty();return this._selectionIsEmpty!==o?!1:super.isValid(e,t,n)}}function NLt(i,e,t,n){return i.has(e)?new ILt(e,t,n,i):new TLt(e,t,n)}Nf("_executeDocumentHighlights",(i,e,t)=>{const n=i.get(pt);return qSe(n.documentHighlightProvider,e,t,_n.None)});class RLt{constructor(e,t,n,o){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=n,this._hasWordHighlights=ZF.bindTo(o),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||!this.occurrencesHighlight||this._onPositionChanged(r)})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const s=this.editor.getOption(80);this.occurrencesHighlight!==s&&(this.occurrencesHighlight=s,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(V.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,o=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const r=this._getWord();if(r){const s=this.editor.getModel().getLineContent(o.startLineNumber);Cs(`${s}, ${n+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,o=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const r=this._getWord();if(r){const s=this.editor.getModel().getLineContent(o.startLineNumber);Cs(`${s}, ${n+1} of ${e.length} for '${r.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,n=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:n})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const t=e.startColumn,n=e.endColumn,o=this._getWord();if(!o||o.startColumn>t||o.endColumn{s===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},en)}}_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:ixt(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 kb=GU=class extends _e{static get(e){return e.getContribution(GU.ID)}constructor(e,t,n){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new RLt(e,n.documentHighlightProvider,()=>vn.map(this.linkedContributions,r=>r.wordHighlighter),t))};this._register(e.onDidChangeModel(r=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),o()})),o()}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()}};kb.ID="editor.contrib.wordHighlighter";kb=GU=kLt([tde(1,Ut),tde(2,pt)],kb);class XSe extends ft{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=kb.get(t);!n||(this._isNext?n.moveNext():n.moveBack())}}class MLt extends XSe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:C("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:ZF,kbOpts:{kbExpr:Q.editorTextFocus,primary:65,weight:100}})}}class ALt extends XSe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:C("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:ZF,kbOpts:{kbExpr:Q.editorTextFocus,primary:1089,weight:100}})}}class PLt extends ft{constructor(){super({id:"editor.action.wordHighlight.trigger",label:C("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:ZF.toNegated(),kbOpts:{kbExpr:Q.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const o=kb.get(t);!o||o.restoreViewState(!0)}}Un(kb.ID,kb,0);ze(MLt);ze(ALt);ze(PLt);class QF extends Ir{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const o=Vc(t.getOption(129)),r=t.getModel(),a=t.getSelections().map(l=>{const c=new ae(l.positionLineNumber,l.positionColumn),d=this._move(o,r,c,this._wordNavigationType);return this._moveTo(l,d,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>kn.fromModelSelection(l))),a.length===1){const l=new ae(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,n){return n?new gt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new gt(t.lineNumber,t.column,t.lineNumber,t.column)}}class s_ extends QF{_move(e,t,n,o){return Qn.moveWordLeft(e,t,n,o)}}class a_ extends QF{_move(e,t,n,o){return Qn.moveWordRight(e,t,n,o)}}class OLt extends s_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class FLt extends s_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class BLt extends s_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(GI,V5))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class WLt extends s_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class VLt extends s_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class HLt extends s_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(GI,V5))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class $Lt extends s_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class zLt extends s_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class ULt extends a_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class jLt extends a_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(GI,V5))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class KLt extends a_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class qLt extends a_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class GLt extends a_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(GI,V5))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class XLt extends a_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class YLt extends a_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class ZLt extends a_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class JF extends Ir{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const o=e.get(Ti);if(!t.hasModel())return;const r=Vc(t.getOption(129)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),d=o.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:r,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Qr(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class ZY extends JF{_delete(e,t){const n=Qn.deleteWordLeft(e,t);return n||new V(1,1,1,1)}}class QY extends JF{_delete(e,t){const n=Qn.deleteWordRight(e,t);if(n)return n;const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return new V(o,r,o,r)}}class QLt extends ZY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:Q.writable})}}class JLt extends ZY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:Q.writable})}}class eEt extends ZY{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class tEt extends QY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:Q.writable})}}class nEt extends QY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:Q.writable})}}class iEt extends QY{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class oEt extends ft{constructor(){super({id:"deleteInsideWord",precondition:Q.writable,label:C("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const o=Vc(t.getOption(129)),r=t.getModel(),a=t.getSelections().map(l=>{const c=Qn.deleteInsideWord(o,r,l);return new Qr(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ye(new OLt);Ye(new FLt);Ye(new BLt);Ye(new WLt);Ye(new VLt);Ye(new HLt);Ye(new ULt);Ye(new jLt);Ye(new KLt);Ye(new qLt);Ye(new GLt);Ye(new XLt);Ye(new $Lt);Ye(new zLt);Ye(new YLt);Ye(new ZLt);Ye(new QLt);Ye(new JLt);Ye(new eEt);Ye(new tEt);Ye(new nEt);Ye(new iEt);ze(oEt);class rEt extends JF{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=C5.deleteWordPartLeft(e);return n||new V(1,1,1,1)}}class sEt extends JF{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=C5.deleteWordPartRight(e);if(n)return n;const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return new V(o,r,o,r)}}class YSe extends QF{_move(e,t,n,o){return C5.moveWordPartLeft(e,t,n)}}class aEt extends YSe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Rn.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class lEt extends YSe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Rn.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class ZSe extends QF{_move(e,t,n,o){return C5.moveWordPartRight(e,t,n)}}class cEt extends ZSe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class dEt extends ZSe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Ye(new rEt);Ye(new sEt);Ye(new aEt);Ye(new lEt);Ye(new cEt);Ye(new dEt);class XU extends _e{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=cl.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new os(C("editor.simple.readonly","Cannot edit in read-only input")):t=new os(C("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}XU.ID="editor.contrib.readOnlyMessageController";Un(XU.ID,XU,2);class YU extends _e{constructor(e){super(),this.editor=e,this.widget=null,Ku&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new e3(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}YU.ID="editor.contrib.iPadShowKeyboard";class e3 extends _e{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ke(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ke(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return e3.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}e3.ID="editor.contrib.ShowKeyboardWidget";Un(YU.ID,YU,3);var uEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nde=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ZU;let tS=ZU=class extends _e{static get(e){return e.getContribution(ZU.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(o=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(o=>this.stop())),this._register(oo.onDidChange(o=>this.stop())),this._register(this._editor.onKeyUp(o=>o.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||!this._editor.hasModel()||(this._widget=new t3(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};tS.ID="editor.contrib.inspectTokens";tS=ZU=uEt([nde(1,ic),nde(2,Ki)],tS);class hEt extends ft{constructor(){super({id:"editor.action.inspectTokens",label:XH.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=tS.get(t);n==null||n.launch()}}function fEt(i){let e="";for(let t=0,n=i.length;tww,tokenize:(o,r,s)=>_G(e,s),tokenizeEncoded:(o,r,s)=>f5(n,s)}}class t3 extends _e{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=gEt(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return t3._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let o=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){o=l;break}const r=this._model.getLineContent(e.lineNumber);let s="";if(n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ide=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},VL;let FO=VL=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=no.as(Xb.Quickaccess)}provide(e){const t=new Be;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const o=this.registry.getQuickAccessProvider(n.substr(VL.PREFIX.length));o&&o.prefix&&o.prefix!==VL.PREFIX&&this.quickInputService.quickAccess.show(o.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==VL.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,o=n||"\u2026";return{prefix:n,label:o,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:C("helpPickAriaLabel","{0}, {1}",o,t.description),description:t.description}})}};FO.PREFIX="?";FO=VL=pEt([ide(0,dh),ide(1,xi)],FO);no.as(Xb.Quickaccess).registerQuickAccessProvider({ctor:FO,prefix:"",helpEntries:[{description:YH.helpQuickAccessActionLabel}]});class QSe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var n;const o=new Be;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=o.add(new Kr);return r.value=this.doProvide(e,t),o.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),o}doProvide(e,t){var n;const o=new Be,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const s={editor:r},a=nye(r);if(a){let l=(n=r.saveViewState())!==null&&n!==void 0?n:void 0;o.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=r.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&r===this.activeTextEditorControl&&r.restoreViewState(l)},o.add(yv(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}o.add(zt(()=>this.clearDecorations(r))),o.add(this.provideWithTextEditor(s,e,t))}else o.add(this.provideWithoutTextEditor(e,t));return o}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&kv(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return tye(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const o=[];this.rangeHighlightDecorationId&&(o.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),o.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const r=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:ro(xbe),position:Yl.Full}}}],[s,a]=n.deltaDecorations(o,r);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class n3 extends QSe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=C("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,_e.None}provideWithTextEditor(e,t,n){const o=e.editor,r=new Be;r.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(o,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(o,t.value.trim().substr(n3.PREFIX.length)),c=this.getPickLabel(o,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(o,l.lineNumber)){this.clearDecorations(o);return}const d=this.toRange(l.lineNumber,l.column);o.revealRangeInCenter(d,0),this.addDecorations(o,d)};s(),r.add(t.onDidChangeValue(()=>s()));const a=nye(o);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),r.add(zt(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),o=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:o+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?C("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):C("gotoLineLabel","Go to line {0}.",t);const o=e.getPosition()||{lineNumber:1,column:1},r=this.lineCount(e);return r>1?C("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",o.lineNumber,o.column,r):C("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",o.lineNumber,o.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,n){if(!n||typeof n!="number")return!1;const o=this.getModel(e);if(!o)return!1;const r={lineNumber:t,column:n};return o.validatePosition(r).equals(r)}lineCount(e){var t,n;return(n=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&n!==void 0?n:0}}n3.PREFIX=":";var mEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},vEt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let rI=class extends n3{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=st.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};rI=mEt([vEt(0,Jn)],rI);class DT extends ft{constructor(){super({id:DT.ID,label:NP.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(dh).quickAccess.show(rI.PREFIX)}}DT.ID="editor.action.gotoLine";ze(DT);no.as(Xb.Quickaccess).registerQuickAccessProvider({ctor:rI,prefix:rI.PREFIX,helpEntries:[{description:NP.gotoLineActionLabel,commandId:DT.ID}]});const JSe=[void 0,[]];function L7(i,e,t=0,n=0){const o=e;return o.values&&o.values.length>1?_Et(i,o.values,t,n):exe(i,e,t,n)}function _Et(i,e,t,n){let o=0;const r=[];for(const s of e){const[a,l]=exe(i,s,t,n);if(typeof a!="number")return JSe;o+=a,r.push(...l)}return[o,bEt(r)]}function exe(i,e,t,n){const o=sb(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return o?[o[0],rT(o)]:JSe}Object.freeze({score:0});function bEt(i){const e=i.sort((o,r)=>o.start-r.start),t=[];let n;for(const o of e)!n||!CEt(n,o)?(n=o,t.push(o)):(n.start=Math.min(n.start,o.start),n.end=Math.max(n.end,o.end));return t}function CEt(i,e){return!(i.end=0,s=ode(i);let a;const l=i.split(txe);if(l.length>1)for(const c of l){const d=ode(c),{pathNormalized:u,normalized:h,normalizedLowercase:f}=rde(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:u,normalized:h,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:o,values:a,containsPathSeparator:r,expectContiguousMatch:s}}function rde(i){let e;ls?e=i.replace(/\//g,Bu):e=i.replace(/\\/g,Bu);const t=pZe(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function sde(i){return Array.isArray(i)?QU(i.map(e=>e.original).join(txe)):QU(i.original)}var yEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ade=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},aL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},zy;let uf=zy=class extends QSe{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,C("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),_e.None}provideWithTextEditor(e,t,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,n):this.doProvideWithoutEditorSymbols(e,r,t,n):_e.None}doProvideWithoutEditorSymbols(e,t,n,o){const r=new Be;return this.provideLabelPick(n,C("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),aL(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,r))||o.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,n,o))}),r}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return aL(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const n=new o5,o=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(o.dispose(),n.complete(!0))}));return t.add(zt(()=>n.complete(!1))),n.p})}doProvideWithEditorSymbols(e,t,n,o){var r;const s=e.editor,a=new Be;a.add(n.onDidAccept(u=>{const[h]=n.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,preserveFocus:u.inBackground}),u.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,o);let c;const d=u=>aL(this,void 0,void 0,function*(){c==null||c.dispose(!0),n.busy=!1,c=new Ro(o),n.busy=!0;try{const h=QU(n.value.substr(zy.PREFIX.length).trim()),f=yield this.doGetSymbolPicks(l,h,void 0,c.token);if(o.isCancellationRequested)return;if(f.length>0){if(n.items=f,u&&h.original.length===0){const g=nP(f,p=>Boolean(p.type!=="separator"&&p.range&&V.containsPosition(p.range.decoration,u)));g&&(n.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(n,C("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,C("noSymbolResults","No editor symbols"))}finally{o.isCancellationRequested||(n.busy=!1)}});return a.add(n.onDidChangeValue(()=>d(void 0))),d((r=s.getSelection())===null||r===void 0?void 0:r.getPosition()),a.add(n.onDidChangeActive(()=>{const[u]=n.activeItems;u&&u.range&&(s.revealRangeInCenter(u.range.selection,0),this.addDecorations(s,u.range.decoration))})),a}doGetSymbolPicks(e,t,n,o){var r,s;return aL(this,void 0,void 0,function*(){const a=yield e;if(o.isCancellationRequested)return[];const l=t.original.indexOf(zy.SCOPE_PREFIX)===0,c=l?1:0;let d,u;t.values&&t.values.length>1?(d=sde(t.values[0]),u=sde(t.values.slice(1))):d=t;let h;const f=(s=(r=this.options)===null||r===void 0?void 0:r.openSideBySideDirection)===null||s===void 0?void 0:s.call(r);f&&(h=[{iconClass:f==="right"?Mt.asClassName(Xe.splitHorizontal):Mt.asClassName(Xe.splitVertical),tooltip:f==="right"?C("openToSide","Open to the Side"):C("openToBottom","Open to the Bottom")}]);const g=[];for(let m=0;mc){let P=!1;if(d!==t&&([E,I]=L7(w,Object.assign(Object.assign({},t),{values:void 0}),c,L),typeof E=="number"&&(P=!0)),typeof E!="number"&&([E,I]=L7(w,d,c,L),typeof E!="number"))continue;if(!P&&u){if(D&&u.original.length>0&&([k,R]=L7(D,u)),typeof k!="number")continue;typeof E=="number"&&(E+=k)}}const A=_.tags&&_.tags.indexOf(1)>=0;g.push({index:m,kind:_.kind,score:E,label:w,ariaLabel:cZe(_.name,_.kind),description:D,highlights:A?void 0:{label:I,description:R},range:{selection:V.collapseToStart(_.selectionRange),decoration:_.range},strikethrough:A,buttons:h})}const p=g.sort((m,_)=>l?this.compareByKindAndScore(m,_):this.compareByScore(m,_));let v=[];if(l){let w=function(){_&&typeof m=="number"&&y>0&&(_.label=Z0(D7[m]||E7,y))},m,_,y=0;for(const L of p)m!==L.kind?(w(),m=L.kind,y=1,_={type:"separator"},v.push(_)):y++,v.push(L);w()}else p.length>0&&(v=[{label:C("symbols","symbols ({0})",g.length),type:"separator"},...p]);return v})}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 n=D7[e.kind]||E7,o=D7[t.kind]||E7,r=n.localeCompare(o);return r===0?this.compareByScore(e,t):r}getDocumentSymbols(e,t){return aL(this,void 0,void 0,function*(){const n=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()})}};uf.PREFIX="@";uf.SCOPE_PREFIX=":";uf.PREFIX_BY_CATEGORY=`${zy.PREFIX}${zy.SCOPE_PREFIX}`;uf=zy=yEt([ade(0,pt),ade(1,kF)],uf);const E7=C("property","properties ({0})"),D7={[5]:C("method","methods ({0})"),[11]:C("function","functions ({0})"),[8]:C("_constructor","constructors ({0})"),[12]:C("variable","variables ({0})"),[4]:C("class","classes ({0})"),[22]:C("struct","structs ({0})"),[23]:C("event","events ({0})"),[24]:C("operator","operators ({0})"),[10]:C("interface","interfaces ({0})"),[2]:C("namespace","namespaces ({0})"),[3]:C("package","packages ({0})"),[25]:C("typeParameter","type parameters ({0})"),[1]:C("modules","modules ({0})"),[6]:C("property","properties ({0})"),[9]:C("enum","enumerations ({0})"),[21]:C("enumMember","enumeration members ({0})"),[14]:C("string","strings ({0})"),[0]:C("file","files ({0})"),[17]:C("array","arrays ({0})"),[15]:C("number","numbers ({0})"),[16]:C("boolean","booleans ({0})"),[18]:C("object","objects ({0})"),[19]:C("key","keys ({0})"),[7]:C("field","fields ({0})"),[13]:C("constant","constants ({0})")};var wEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},k7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let JU=class extends uf{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=st.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};JU=wEt([k7(0,Jn),k7(1,pt),k7(2,kF)],JU);class kT extends ft{constructor(){super({id:kT.ID,label:gk.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:Q.hasDocumentSymbolProvider,kbOpts:{kbExpr:Q.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(dh).quickAccess.show(uf.PREFIX,{itemActivation:vu.NONE})}}kT.ID="editor.action.quickOutline";ze(kT);no.as(Xb.Quickaccess).registerQuickAccessProvider({ctor:JU,prefix:uf.PREFIX,helpEntries:[{description:gk.quickOutlineActionLabel,prefix:uf.PREFIX,commandId:kT.ID},{description:gk.quickOutlineByCategoryActionLabel,prefix:uf.PREFIX_BY_CATEGORY}]});function I7(i,e){return e&&(i.stack||i.stacktrace)?C("stackTrace.format","{0}: {1}",cde(i),lde(i.stack)||lde(i.stacktrace)):cde(i)}function lde(i){return Array.isArray(i)?i.join(` +`):i}function cde(i){return i.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof i.code=="string"&&typeof i.errno=="number"&&typeof i.syscall=="string"?C("nodeExceptionMessage","A system error occurred ({0})",i.message):i.message||C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function nxe(i=null,e=!1){if(!i)return C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(i)){const t=hf(i),n=nxe(t[0],e);return t.length>1?C("error.moreErrors","{0} ({1} errors in total)",n,t.length):n}if(la(i))return i;if(i.detail){const t=i.detail;if(t.error)return I7(t.error,e);if(t.exception)return I7(t.exception,e)}return i.stack?I7(i,e):i.message?i.message:C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function SEt(i){var e;const t=new Map;for(const n of i)t.set(n,((e=t.get(n))!==null&&e!==void 0?e:0)+1);return t}class HE{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),o=new Map,r=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,o);c>0&&r.push({key:s,score:c})}}return r}static termFrequencies(e){return SEt(HE.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);const o=n.split(new RegExp("(?<=[a-z])(?=[A-Z])","g"));if(o.length>1)for(const r of o)r.length>2&&/\p{Letter}{3,}/gu.test(r)&&(yield t(r))}}updateDocuments(e){var t;for(const{key:n}of e)this.deleteDocument(n);for(const n of e){const o=[];for(const r of n.textChunks){const s=HE.termFrequencies(r);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);o.push({text:r,tf:s})}this.chunkCount+=o.length,this.documents.set(n.key,{chunks:o})}return this}deleteDocument(e){const t=this.documents.get(e);if(!!t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const o of n.tf.keys()){const r=this.chunkOccurrences.get(o);if(typeof r=="number"){const s=r-1;s<=0?this.chunkOccurrences.delete(o):this.chunkOccurrences.set(o,s)}}}}computeSimilarityScore(e,t,n){let o=0;for(const[r,s]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let l=n.get(r);typeof l!="number"&&(l=this.computeIdf(r),n.set(r,l)),o+=a*l*s}return o}computeEmbedding(e){const t=HE.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const n=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return n>0?Math.log((this.chunkCount+1)/n):0}computeTfidf(e){const t=Object.create(null);for(const[n,o]of e){const r=this.computeIdf(n);r>0&&(t[n]=o*r)}return t}}function xEt(i){var e,t;const n=i.slice(0);n.sort((r,s)=>s.score-r.score);const o=(t=(e=n[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(o>0)for(const r of n)r.score/=o;return n}var lL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},ey;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(ey||(ey={}));function T7(i){const e=i;return Array.isArray(e.items)}function dde(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class LEt extends _e{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var o;const r=new Be;e.canAcceptInBackground=!!(!((o=this.options)===null||o===void 0)&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=r.add(new Kr),l=()=>lL(this,void 0,void 0,function*(){const c=a.value=new Be;s==null||s.dispose(!0),e.busy=!1,s=new Ro(t);const d=s.token,u=e.value.substr(this.prefix.length).trim(),h=this._getPicks(u,c,d,n),f=(p,v)=>{var m;let _,y;if(T7(p)?(_=p.items,y=p.active):_=p,_.length===0){if(v)return!1;(u.length>0||e.hideInput)&&((m=this.options)===null||m===void 0?void 0:m.noResultsPick)&&(ID(this.options.noResultsPick)?_=[this.options.noResultsPick(u)]:_=[this.options.noResultsPick])}return e.items=_,y&&(e.activeItems=[y]),!0},g=p=>lL(this,void 0,void 0,function*(){let v=!1,m=!1;yield Promise.all([(()=>lL(this,void 0,void 0,function*(){typeof p.mergeDelay=="number"&&(yield xv(p.mergeDelay),d.isCancellationRequested)||m||(v=f(p.picks,!0))}))(),(()=>lL(this,void 0,void 0,function*(){e.busy=!0;try{const _=yield p.additionalPicks;if(d.isCancellationRequested)return;let y,w;T7(p.picks)?(y=p.picks.items,w=p.picks.active):y=p.picks;let L,D;if(T7(_)?(L=_.items,D=_.active):L=_,L.length>0||!v){let E;if(!w&&!D){const I=e.activeItems[0];I&&y.indexOf(I)!==-1&&(E=I)}f({items:[...y,...L],active:w||D||E})}}finally{d.isCancellationRequested||(e.busy=!1),m=!0}}))()])});if(h!==null)if(dde(h))yield g(h);else if(!(h instanceof Promise))f(h);else{e.busy=!0;try{const p=yield h;if(d.isCancellationRequested)return;dde(p)?yield g(p):f(p)}finally{d.isCancellationRequested||(e.busy=!1)}}});return r.add(e.onDidChangeValue(()=>l())),l(),r.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))})),r.add(e.onDidTriggerItemButton(({button:c,item:d})=>lL(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 ey.NO_ACTION:break;case ey.CLOSE_PICKER:e.hide();break;case ey.REFRESH_PICKER:l();break;case ey.REMOVE_ITEM:{const v=e.items.indexOf(d);if(v!==-1){const m=e.items.slice(),_=m.splice(v,1),y=e.activeItems.filter(L=>L!==_[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,y&&(e.activeItems=y),e.keepScrollPosition=w}break}}}}}))),r}}var ixe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Y_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},N7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},W_,hr;let Ib=W_=class extends LEt{constructor(e,t,n,o,r,s){super(W_.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=o,this.telemetryService=r,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(Tb)),this.options=e}_getPicks(e,t,n,o){var r,s,a,l;return N7(this,void 0,void 0,function*(){const c=yield this.getCommandPicks(n);if(n.isCancellationRequested)return[];const d=yv(()=>{const m=new HE;m.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[y.label+(y.commandAlias?` ${y.commandAlias}`:"")]})));const _=m.calculateScores(e,n);return xEt(_).filter(y=>y.score>W_.TFIDF_THRESHOLD).slice(0,W_.TFIDF_MAX_RESULTS)}),u=[];for(const m of c){const _=(r=W_.WORD_FILTER(e,m.label))!==null&&r!==void 0?r:void 0,y=m.commandAlias&&(s=W_.WORD_FILTER(e,m.commandAlias))!==null&&s!==void 0?s:void 0;if(_||y)m.highlights={label:_,detail:this.options.showAlias?y:void 0},u.push(m);else if(e===m.commandId)u.push(m);else if(e.length>=3){const w=d();if(n.isCancellationRequested)return[];const L=w.find(D=>D.key===m.commandId);L&&(m.tfIdfScore=L.score,u.push(m))}}const h=new Map;for(const m of u){const _=h.get(m.label);_?(m.description=m.commandId,_.description=_.commandId):h.set(m.label,m)}u.sort((m,_)=>{if(m.tfIdfScore&&_.tfIdfScore)return m.tfIdfScore===_.tfIdfScore?m.label.localeCompare(_.label):_.tfIdfScore-m.tfIdfScore;if(m.tfIdfScore)return 1;if(_.tfIdfScore)return-1;const y=this.commandsHistory.peek(m.commandId),w=this.commandsHistory.peek(_.commandId);if(y&&w)return y>w?-1:1;if(y)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(m.commandId),D=this.options.suggestedCommandIds.has(_.commandId);if(L&&D)return 0;if(L)return-1;if(D)return 1}return m.label.localeCompare(_.label)});const f=[];let g=!1,p=!0,v=!!this.options.suggestedCommandIds;for(let m=0;mN7(this,void 0,void 0,function*(){var m;const _=yield this.getAdditionalCommandPicks(c,u,e,n);if(n.isCancellationRequested)return[];const y=_.map(w=>this.toCommandPick(w,o));return p&&((m=y[0])===null||m===void 0?void 0:m.type)!=="separator"&&y.unshift({type:"separator",label:C("suggested","similar commands")}),y}))()}:f})}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),o=n?C("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:o,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:()=>N7(this,void 0,void 0,function*(){var r,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(r=t==null?void 0:t.from)!==null&&r!==void 0?r:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(a){sh(a)||this.dialogService.error(C("canNotRun","Command '{0}' resulted in an error",e.label),nxe(a))}})})}};Ib.PREFIX=">";Ib.TFIDF_THRESHOLD=.5;Ib.TFIDF_MAX_RESULTS=5;Ib.WORD_FILTER=dX(_k,wdt,T1e);Ib=W_=ixe([Y_(1,$t),Y_(2,xi),Y_(3,_o),Y_(4,tc),Y_(5,iT)],Ib);let Tb=hr=class extends _e{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=hr.getConfiguredCommandHistoryLength(this.configurationService),hr.cache&&hr.cache.limit!==this.configuredCommandsHistoryLength&&(hr.cache.limit=this.configuredCommandsHistoryLength,hr.saveState(this.storageService)))}load(){const e=this.storageService.get(hr.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const n=hr.cache=new Qv(this.configuredCommandsHistoryLength,1);if(t){let o;t.usesLRU?o=t.entries:o=t.entries.sort((r,s)=>r.value-s.value),o.forEach(r=>n.set(r.key,r.value))}hr.counter=this.storageService.getNumber(hr.PREF_KEY_COUNTER,0,hr.counter)}push(e){!hr.cache||(hr.cache.set(e,hr.counter++),hr.saveState(this.storageService))}peek(e){var t;return(t=hr.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!hr.cache)return;const t={usesLRU:!0,entries:[]};hr.cache.forEach((n,o)=>t.entries.push({key:o,value:n})),e.store(hr.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(hr.PREF_KEY_COUNTER,hr.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,n;const r=(n=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||n===void 0?void 0:n.history;return typeof r=="number"?r:hr.DEFAULT_COMMANDS_HISTORY_LENGTH}};Tb.DEFAULT_COMMANDS_HISTORY_LENGTH=50;Tb.PREF_KEY_CACHE="commandPalette.mru.cache";Tb.PREF_KEY_COUNTER="commandPalette.mru.counter";Tb.counter=1;Tb=hr=ixe([Y_(0,Gd),Y_(1,En)],Tb);class EEt extends Ib{constructor(e,t,n,o,r,s){super(e,t,n,o,r,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions())t.push({commandId:n.id,commandAlias:n.alias,label:mX(n.label)||n.id});return t}}var DEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},rC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ude=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(d){try{c(n.next(d))}catch(u){s(u)}}function l(d){try{c(n.throw(d))}catch(u){s(u)}}function c(d){d.done?r(d.value):o(d.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let sI=class extends EEt{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,n,o,r,s){super({showAlias:!1},e,n,o,r,s),this.codeEditorService=t}getCommandPicks(){return ude(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return ude(this,void 0,void 0,function*(){return[]})}};sI=DEt([rC(0,$t),rC(1,Jn),rC(2,xi),rC(3,_o),rC(4,tc),rC(5,iT)],sI);class IT extends ft{constructor(){super({id:IT.ID,label:RP.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(dh).quickAccess.show(sI.PREFIX)}}IT.ID="editor.action.quickCommand";ze(IT);no.as(Xb.Quickaccess).registerQuickAccessProvider({ctor:sI,prefix:sI.PREFIX,helpEntries:[{description:RP.quickCommandHelp,commandId:IT.ID}]});var kEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},sC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ej=class extends Wv{constructor(e,t,n,o,r,s,a){super(!0,e,t,n,o,r,s,a)}};ej=kEt([sC(1,Ut),sC(2,Jn),sC(3,Ao),sC(4,$t),sC(5,Gd),sC(6,En)],ej);Un(Wv.ID,ej,4);class IEt extends ft{constructor(){super({id:"editor.action.toggleHighContrast",label:ZH.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(ic),o=n.getColorTheme();Hu(o.type)?(n.setTheme(this._originalThemeName||(Ew(o.type)?By:Ig)),this._originalThemeName=null):(n.setTheme(Ew(o.type)?A0:P0),this._originalThemeName=o.themeName)}}ze(IEt);function TEt(){return new Worker("/eos/assets/editor.worker.efc65e0b.js",{type:"module"})}function NEt(){return new Worker("/eos/assets/json.worker.b6a074fe.js",{type:"module"})}function REt(){return new Worker("/eos/assets/css.worker.903adc4e.js",{type:"module"})}function MEt(){return new Worker("/eos/assets/html.worker.dd9c9e9a.js",{type:"module"})}function AEt(){return new Worker("/eos/assets/ts.worker.d675a6ca.js",{type:"module"})}self.MonacoEnvironment={getWorker(i,e){return e==="json"?new NEt:e==="css"||e==="scss"||e==="less"?new REt:e==="html"||e==="handlebars"||e==="razor"?new MEt:e==="typescript"||e==="javascript"?new AEt:new TEt}};aye.typescript.typescriptDefaults.setEagerModelSync(!0);function PEt(i,e){const{code:t,className:n,readonly:o,language:r}=i,[s,a]=x.exports.useState(null),l=x.exports.useRef(null);return x.exports.useEffect(()=>(l&&a(c=>c||sye.create(l.current,{value:t,language:r,readOnly:o})),()=>s==null?void 0:s.dispose()),[l.current]),iFe(()=>{async function c(){var d;s&&(s.setValue(t),o&&s.updateOptions({readOnly:!1}),await((d=s.getAction("editor.action.formatDocument"))==null?void 0:d.run()),o&&s.updateOptions({readOnly:!0}))}c()},[t]),x.exports.useImperativeHandle(e,()=>({editor:s}),[s]),he("div",{className:Ue(Nvt.editor,n),ref:l})}const oxe=x.exports.forwardRef(PEt);function OEt(i){const{node:e}=i,[t,n]=x.exports.useState(!1),o=i3(),[r,s]=x.exports.useState(""),a=x.exports.useRef(null),l=fr(e);return fn("div",{className:noe.container,children:[he("span",{style:{color:"white",cursor:"pointer",display:"block",textAlign:"center"},onClick:()=>{var c;s(((c=e.data)==null?void 0:c.customCode)||(l==null?void 0:l.getInitCustomCode())||""),n(!0)},children:"\u70B9\u51FB\u7F16\u8F91"}),he(Eq,{title:"Basic Modal",open:t,onOk:()=>{n(!1),o.updateNode(e.id,c=>{var d,u;return(l==null?void 0:l.updateData(c,{customCode:((u=(d=a.current)==null?void 0:d.editor)==null?void 0:u.getValue())||""}))||c})},onCancel:()=>{n(!1)},destroyOnClose:!0,children:he(oxe,{ref:a,code:r,language:"javascript",className:noe.editor})})]})}class rxe extends vp{constructor(){super({operatorName:"Transform",operatorType:"TransformOperator",nodeType:oh.Node});bt(this,"nodeColor","#F3F8FF")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",hint:"output",label:"output"}),new ri({type:"target",hint:"input",label:"input"})]}})}generateBlockDeclarations(t){var l,c,d,u,h,f,g,p;const{node:n,nodeGraph:o}=t,r=((d=(c=(l=n.data.endPointOptions)==null?void 0:l.endPointList)==null?void 0:c.find(v=>v.hint==="output"))==null?void 0:d.id)||"",s=((f=(h=(u=n.data.endPointOptions)==null?void 0:u.endPointList)==null?void 0:h.find(v=>v.hint==="input"))==null?void 0:f.id)||"",a=((p=(g=o.findSourceNodes(n.id))==null?void 0:g.find(v=>v.handleId===s))==null?void 0:p.relatedHandleId)||"";return[`${r?`const ${Cd(r)} = `:""}${pS}.transform( ${Cd(a)}, (...args) => { const module = { exports: {} }; @@ -1116,20 +1116,20 @@ The flag will not be saved for the future. } )`]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}getInitCustomCode(){return`module.exports = function transform(input) { return input; -}`}renderCustomLabel(t){return he(AEt,{node:t})}}class PEt extends rxe{constructor(){super();bt(this,"nodeColor","#F3F8FF");this.defaultOperatorData.operatorName="Effect",this.defaultOperatorData.operatorType="EffectOperator"}create(){const t=super.create();return this.updateData(t,{endPointOptions:{endPointList:[new ri({type:"target",hint:"input",label:"input"})]}})}getInitCustomCode(){return`module.exports = function effect(input) { +}`}renderCustomLabel(t){return he(OEt,{node:t})}}class FEt extends rxe{constructor(){super();bt(this,"nodeColor","#F3F8FF");this.defaultOperatorData.operatorName="Effect",this.defaultOperatorData.operatorType="EffectOperator"}create(){const t=super.create();return this.updateData(t,{endPointOptions:{endPointList:[new ri({type:"target",hint:"input",label:"input"})]}})}getInitCustomCode(){return`module.exports = function effect(input) { -}`}}class OEt extends mp{constructor(){super({operatorName:"Merge",operatorType:"MergeOperator",nodeType:oh.Node});bt(this,"nodeColor","#C21292")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",hint:"output",children:[new ri({label:"output",hint:"output",variableType:"array",type:"source"})]}),new ri({type:"group",hint:"input",label:"Stream",defaultChildData:{hint:"input",type:"target",ignoreDegree:!0},allowAddAndRemoveChildren:!0,children:[new ri({hint:"input",type:"target",ignoreDegree:!0})]})]}})}getHintPorts(t,n){var o,r,s;return(s=(r=(o=t.data.endPointOptions)==null?void 0:o.endPointList)==null?void 0:r.find(a=>a.hint===n))==null?void 0:s.children}getIgnoreDegreeIds(t){var o;return((o=this.getHintPorts(t,"input"))==null?void 0:o.map(r=>r.id))||[]}generateBlockDeclarations(t){var a,l,c;const{node:n,formatVariableName:o}=t,r=((l=(a=this.getHintPorts(n,"output"))==null?void 0:a.find(d=>d.hint==="output"))==null?void 0:l.id)||"",s=((c=this.getHintPorts(n,"input"))==null?void 0:c.map(d=>d.id))||[];return[...s.map(d=>`const ${o(d)} = new ${jm}.ModelState(undefined)`),`const ${o(r)} = ${pS}.merge( +}`}}class BEt extends vp{constructor(){super({operatorName:"Merge",operatorType:"MergeOperator",nodeType:oh.Node});bt(this,"nodeColor","#C21292")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",hint:"output",children:[new ri({label:"output",hint:"output",variableType:"array",type:"source"})]}),new ri({type:"group",hint:"input",label:"Stream",defaultChildData:{hint:"input",type:"target",ignoreDegree:!0},allowAddAndRemoveChildren:!0,children:[new ri({hint:"input",type:"target",ignoreDegree:!0})]})]}})}getHintPorts(t,n){var o,r,s;return(s=(r=(o=t.data.endPointOptions)==null?void 0:o.endPointList)==null?void 0:r.find(a=>a.hint===n))==null?void 0:s.children}getIgnoreDegreeIds(t){var o;return((o=this.getHintPorts(t,"input"))==null?void 0:o.map(r=>r.id))||[]}generateBlockDeclarations(t){var a,l,c;const{node:n,formatVariableName:o}=t,r=((l=(a=this.getHintPorts(n,"output"))==null?void 0:a.find(d=>d.hint==="output"))==null?void 0:l.id)||"",s=((c=this.getHintPorts(n,"input"))==null?void 0:c.map(d=>d.id))||[];return[...s.map(d=>`const ${o(d)} = new ${Km}.ModelState(undefined)`),`const ${o(r)} = ${pS}.merge( [${s.map(d=>o(d)).join(",")}], )`]}generateBlockOutput(t){return[]}generateBlockRelation(t){var d;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((d=this.getHintPorts(n,"input"))==null?void 0:d.map(u=>u.id))||[],a=r.findSourceNodes(n.id)||[],l=new Map(a.map(u=>[u.handleId,u]));return[...s.map(u=>{var h;return{inputId:u,targetId:((h=l.get(u))==null?void 0:h.relatedHandleId)||""}}).filter(u=>u.inputId&&u.targetId).map(({inputId:u,targetId:h})=>`${o(h)}.subscribe((action) => { ${o(u)}.next(action.concat({ payload: action.payload, path: '${JSON.stringify({currentNodeId:n.id,fromPortId:h,toPortId:u})}' })); - });`)]}}Mq([new eXe,new tXe,new rXe,new i_e,new JGe,new nXe,new sXe,new rxe,new PEt,new OEt]);const N7=new xI("App"),QY=She({nodes:[],setNodes:()=>{},updateNode:()=>{},edges:[],setEdges:()=>{},updateEdge:()=>{},defaultLayer:N7,layer:N7,setLayer:()=>{},setDefaultLayer:()=>{},activeLayerId:N7.id,setActiveLayerId:()=>{}});function TT(){return Lhe(QY)}function el(i){return xhe(QY,i)}function NT(){const{nodes:i,edges:e,updateEdge:t,updateNode:n,setActiveLayerId:o,setLayer:r,setEdges:s,layer:a,activeLayerId:l,defaultLayer:c,setDefaultLayer:d}=TT(),u=pA({nodes:i,edges:e,layer:a,activeLayerId:l,defaultLayer:c}),h=pA({updateEdge:t,updateNode:n,setEdges:s,setActiveLayerId:o,setLayer:r,setDefaultLayer:d});return{currentStateRef:u,actionsRef:h}}function FEt(){const i=el(o=>o.nodes),e=el(o=>o.edges),t=el(o=>o.layer),n=el(o=>o.defaultLayer);return{nodes:i,edges:e,layer:t,defaultLayer:n}}function n3(){const i=el(a=>a.setEdges),e=el(a=>a.setNodes),t=el(a=>a.updateEdge),n=el(a=>a.updateNode),o=el(a=>a.setLayer),r=el(a=>a.setDefaultLayer),s=el(a=>a.setActiveLayerId);return{setEdges:i,setNodes:e,updateEdge:t,updateNode:n,setLayer:o,setActiveLayerId:s,setDefaultLayer:r}}const BEt=i=>{const{children:e}=i,[t,n]=x.exports.useState(()=>new xI("App")),[o,r]=x.exports.useState(t),s=x.exports.useRef(t),a=s.current,[l,c]=x.exports.useState(a.id),d=wc(a,l),u=(d==null?void 0:d.nodes)||[],h=(d==null?void 0:d.edges)||[],f=T_(function(E){var I;if(s.current=typeof E=="function"?E(s.current):E,n(s.current),(I=s.current)!=null&&I.relativeOperatorType){const k=Aq(s.current.relativeOperatorType);k==null||k.updateContent({layer:s.current})}}),g=T_(function(E,I){f(k=>{const R=wc(k,(I==null?void 0:I.layerId)||l);if(R){R.nodes=typeof E=="function"?E(R.nodes):E;const A=new Set(R.nodes.map(P=>P.id));R.children=R.children.filter(P=>P.relativeNodeId&&A.has(P.relativeNodeId))}return{...k}})}),p=T_(function(E,I){f(k=>{const R=wc(k,(I==null?void 0:I.layerId)||l);return R&&(R.edges=typeof E=="function"?E(R.edges):E),{...k}})}),v=x5e(),m=T_(function(E,I,k){!E||p(R=>{var H;const A=R.findIndex(B=>B.id===E);if(A<0)return R;const P=[...R],N=(H=P.splice(A,1))==null?void 0:H[0],M=typeof I=="function"?I(N):I;return P.concat(M)},k)}),_=T_(function(E,I,k){if(!E)return;const{updateInternal:R,layerId:A}=k||{};g(P=>{var F;const N=P.findIndex($=>$.id===E);if(N<0)return P;const M=[...P],H=(F=M.splice(N,1))==null?void 0:F[0],B=typeof I=="function"?I(H):I;return M.concat(B)},{layerId:A}),R&&setTimeout(()=>{v(E)},0)}),y=pA({nodes:u,edges:h,layer:a,activeLayerId:l,defaultLayer:o}),w=pA({updateEdge:m,updateNode:_,setEdges:p,setActiveLayerId:()=>{},setLayer:f,setDefaultLayer:r}),L=T_(D=>{const E=l;c(D),setTimeout(()=>{const I=wc(a,E);if(I!=null&&I.parentLayerId){const k=wc(a,I.parentLayerId),R=k==null?void 0:k.nodes.find(A=>A.id===I.relativeNodeId);if(R){const A=fr(R);A==null||A.refreshNode({node:R,actions:w.current,currentState:y.current})}}})});return he(QY.Provider,{value:{nodes:u,edges:h,updateEdge:m,updateNode:_,setEdges:p,setNodes:g,layer:a,defaultLayer:o,activeLayerId:l,setDefaultLayer:r,setLayer:f,setActiveLayerId:L},children:e})},WEt=i=>{const{children:e}=i;return he(CK,{children:he(BEt,{children:e})})},sxe=She({operators:[],refreshOperators:()=>{}});function VEt(i){const[e,t]=x.exports.useState(eoe()),n=T_(()=>{t(eoe())});return he(sxe.Provider,{value:{operators:e,refreshOperators:n},children:i==null?void 0:i.children})}function JY(){return Lhe(sxe)}var HEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM340 683v77c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-77c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198V264c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v221c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8s0 .1.1.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8 0 0 0 .1-.1.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7zM620 539v221c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V539c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198v-77c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v77c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8v.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8v.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7z"}}]},name:"control",theme:"outlined"},$Et=HEt,zEt=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:$Et}))},UEt=x.exports.forwardRef(zEt),jEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"},KEt=jEt,qEt=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:KEt}))},GEt=x.exports.forwardRef(qEt),XEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M841 370c3-3.3 2.7-8.3-.6-11.3a8.24 8.24 0 00-5.3-2.1h-72.6c-2.4 0-4.6 1-6.1 2.8L633.5 504.6a7.96 7.96 0 01-13.4-1.9l-63.5-141.3a7.9 7.9 0 00-7.3-4.7H380.7l.9-4.7 8-42.3c10.5-55.4 38-81.4 85.8-81.4 18.6 0 35.5 1.7 48.8 4.7l14.1-66.8c-22.6-4.7-35.2-6.1-54.9-6.1-103.3 0-156.4 44.3-175.9 147.3l-9.4 49.4h-97.6c-3.8 0-7.1 2.7-7.8 6.4L181.9 415a8.07 8.07 0 007.8 9.7H284l-89 429.9a8.07 8.07 0 007.8 9.7H269c3.8 0 7.1-2.7 7.8-6.4l89.7-433.1h135.8l68.2 139.1c1.4 2.9 1 6.4-1.2 8.8l-180.6 203c-2.9 3.3-2.6 8.4.7 11.3 1.5 1.3 3.4 2 5.3 2h72.7c2.4 0 4.6-1 6.1-2.8l123.7-146.7c2.8-3.4 7.9-3.8 11.3-1 .9.8 1.6 1.7 2.1 2.8L676.4 784c1.3 2.8 4.1 4.7 7.3 4.7h64.6a8.02 8.02 0 007.2-11.5l-95.2-198.9c-1.4-2.9-.9-6.4 1.3-8.8L841 370z"}}]},name:"function",theme:"outlined"},YEt=XEt,ZEt=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:YEt}))},QEt=x.exports.forwardRef(ZEt);class axe extends mp{constructor(t){super({operatorName:t,operatorType:`Custom_${SI()}`,nodeType:oh.Node});bt(this,"description","\u53CC\u51FB\u7F16\u8F91");bt(this,"nodeColor","#DF826C");bt(this,"isCustom",!0);bt(this,"content");this.content={layer:new xI(t)},this.content.layer.relativeOperatorType=this.operatorType}getOperatorId(){return`custom_operator_${this.content.layer.id}`}updateContent(t){this.content=t}create(){const t=lge(),{endPointList:n}=jW(this.content.layer,t);return super.create({endPointOptions:{endPointList:n}},{id:t})}generateBlockDeclarations(t){var a;const{node:n,nodeGraph:o,formatVariableName:r,formatBlockVarName:s}=t;return[`const temp_${r(n.id)} = context.mount(${s(this.getOperatorId())}, { + });`)]}}Aq([new nXe,new iXe,new aXe,new i_e,new tXe,new oXe,new lXe,new rxe,new FEt,new BEt]);const R7=new xI("App"),JY=xhe({nodes:[],setNodes:()=>{},updateNode:()=>{},edges:[],setEdges:()=>{},updateEdge:()=>{},defaultLayer:R7,layer:R7,setLayer:()=>{},setDefaultLayer:()=>{},activeLayerId:R7.id,setActiveLayerId:()=>{}});function TT(){return Ehe(JY)}function el(i){return Lhe(JY,i)}function NT(){const{nodes:i,edges:e,updateEdge:t,updateNode:n,setActiveLayerId:o,setLayer:r,setEdges:s,layer:a,activeLayerId:l,defaultLayer:c,setDefaultLayer:d}=TT(),u=pA({nodes:i,edges:e,layer:a,activeLayerId:l,defaultLayer:c}),h=pA({updateEdge:t,updateNode:n,setEdges:s,setActiveLayerId:o,setLayer:r,setDefaultLayer:d});return{currentStateRef:u,actionsRef:h}}function WEt(){const i=el(o=>o.nodes),e=el(o=>o.edges),t=el(o=>o.layer),n=el(o=>o.defaultLayer);return{nodes:i,edges:e,layer:t,defaultLayer:n}}function i3(){const i=el(a=>a.setEdges),e=el(a=>a.setNodes),t=el(a=>a.updateEdge),n=el(a=>a.updateNode),o=el(a=>a.setLayer),r=el(a=>a.setDefaultLayer),s=el(a=>a.setActiveLayerId);return{setEdges:i,setNodes:e,updateEdge:t,updateNode:n,setLayer:o,setActiveLayerId:s,setDefaultLayer:r}}const VEt=i=>{const{children:e}=i,[t,n]=x.exports.useState(()=>new xI("App")),[o,r]=x.exports.useState(t),s=x.exports.useRef(t),a=s.current,[l,c]=x.exports.useState(a.id),d=wc(a,l),u=(d==null?void 0:d.nodes)||[],h=(d==null?void 0:d.edges)||[],f=T_(function(E){var I;if(s.current=typeof E=="function"?E(s.current):E,n(s.current),(I=s.current)!=null&&I.relativeOperatorType){const k=Pq(s.current.relativeOperatorType);k==null||k.updateContent({layer:s.current})}}),g=T_(function(E,I){f(k=>{const R=wc(k,(I==null?void 0:I.layerId)||l);if(R){R.nodes=typeof E=="function"?E(R.nodes):E;const A=new Set(R.nodes.map(P=>P.id));R.children=R.children.filter(P=>P.relativeNodeId&&A.has(P.relativeNodeId))}return{...k}})}),p=T_(function(E,I){f(k=>{const R=wc(k,(I==null?void 0:I.layerId)||l);return R&&(R.edges=typeof E=="function"?E(R.edges):E),{...k}})}),v=x5e(),m=T_(function(E,I,k){!E||p(R=>{var H;const A=R.findIndex(B=>B.id===E);if(A<0)return R;const P=[...R],N=(H=P.splice(A,1))==null?void 0:H[0],M=typeof I=="function"?I(N):I;return P.concat(M)},k)}),_=T_(function(E,I,k){if(!E)return;const{updateInternal:R,layerId:A}=k||{};g(P=>{var F;const N=P.findIndex($=>$.id===E);if(N<0)return P;const M=[...P],H=(F=M.splice(N,1))==null?void 0:F[0],B=typeof I=="function"?I(H):I;return M.concat(B)},{layerId:A}),R&&setTimeout(()=>{v(E)},0)}),y=pA({nodes:u,edges:h,layer:a,activeLayerId:l,defaultLayer:o}),w=pA({updateEdge:m,updateNode:_,setEdges:p,setActiveLayerId:()=>{},setLayer:f,setDefaultLayer:r}),L=T_(D=>{const E=l;c(D),setTimeout(()=>{const I=wc(a,E);if(I!=null&&I.parentLayerId){const k=wc(a,I.parentLayerId),R=k==null?void 0:k.nodes.find(A=>A.id===I.relativeNodeId);if(R){const A=fr(R);A==null||A.refreshNode({node:R,actions:w.current,currentState:y.current})}}})});return he(JY.Provider,{value:{nodes:u,edges:h,updateEdge:m,updateNode:_,setEdges:p,setNodes:g,layer:a,defaultLayer:o,activeLayerId:l,setDefaultLayer:r,setLayer:f,setActiveLayerId:L},children:e})},HEt=i=>{const{children:e}=i;return he(yK,{children:he(VEt,{children:e})})},sxe=xhe({operators:[],refreshOperators:()=>{}});function $Et(i){const[e,t]=x.exports.useState(toe()),n=T_(()=>{t(toe())});return he(sxe.Provider,{value:{operators:e,refreshOperators:n},children:i==null?void 0:i.children})}function eZ(){return Ehe(sxe)}var zEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM340 683v77c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-77c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198V264c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v221c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8s0 .1.1.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8 0 0 0 .1-.1.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7zM620 539v221c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V539c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198v-77c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v77c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8v.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8v.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7z"}}]},name:"control",theme:"outlined"},UEt=zEt,jEt=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:UEt}))},KEt=x.exports.forwardRef(jEt),qEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"},GEt=qEt,XEt=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:GEt}))},YEt=x.exports.forwardRef(XEt),ZEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M841 370c3-3.3 2.7-8.3-.6-11.3a8.24 8.24 0 00-5.3-2.1h-72.6c-2.4 0-4.6 1-6.1 2.8L633.5 504.6a7.96 7.96 0 01-13.4-1.9l-63.5-141.3a7.9 7.9 0 00-7.3-4.7H380.7l.9-4.7 8-42.3c10.5-55.4 38-81.4 85.8-81.4 18.6 0 35.5 1.7 48.8 4.7l14.1-66.8c-22.6-4.7-35.2-6.1-54.9-6.1-103.3 0-156.4 44.3-175.9 147.3l-9.4 49.4h-97.6c-3.8 0-7.1 2.7-7.8 6.4L181.9 415a8.07 8.07 0 007.8 9.7H284l-89 429.9a8.07 8.07 0 007.8 9.7H269c3.8 0 7.1-2.7 7.8-6.4l89.7-433.1h135.8l68.2 139.1c1.4 2.9 1 6.4-1.2 8.8l-180.6 203c-2.9 3.3-2.6 8.4.7 11.3 1.5 1.3 3.4 2 5.3 2h72.7c2.4 0 4.6-1 6.1-2.8l123.7-146.7c2.8-3.4 7.9-3.8 11.3-1 .9.8 1.6 1.7 2.1 2.8L676.4 784c1.3 2.8 4.1 4.7 7.3 4.7h64.6a8.02 8.02 0 007.2-11.5l-95.2-198.9c-1.4-2.9-.9-6.4 1.3-8.8L841 370z"}}]},name:"function",theme:"outlined"},QEt=ZEt,JEt=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:QEt}))},eDt=x.exports.forwardRef(JEt);class axe extends vp{constructor(t){super({operatorName:t,operatorType:`Custom_${SI()}`,nodeType:oh.Node});bt(this,"description","\u53CC\u51FB\u7F16\u8F91");bt(this,"nodeColor","#DF826C");bt(this,"isCustom",!0);bt(this,"content");this.content={layer:new xI(t)},this.content.layer.relativeOperatorType=this.operatorType}getOperatorId(){return`custom_operator_${this.content.layer.id}`}updateContent(t){this.content=t}create(){const t=cge(),{endPointList:n}=KW(this.content.layer,t);return super.create({endPointOptions:{endPointList:n}},{id:t})}generateBlockDeclarations(t){var a;const{node:n,nodeGraph:o,formatVariableName:r,formatBlockVarName:s}=t;return[`const temp_${r(n.id)} = context.mount(${s(this.getOperatorId())}, { ${s_e(n).map(l=>{var d,u;const c=(u=(d=o.findSourceNodes(n.id))==null?void 0:d.find(h=>h.handleId===l.id))==null?void 0:u.relatedHandleId;return c?`['${l.variableName}']: ${r(c||"")}`:""}).filter(Boolean).join(`, `)} - })`,...(a=r_e(n)||[])==null?void 0:a.map(l=>`const ${r(l.id)} = temp_${r(n.id)}.output['${l.variableName}']`)]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}getExtraAppContainers(){return[{appContainerId:this.getOperatorId(),data:this.content}]}onNodeDoubleClick(t){const{actions:n,currentState:o}=t;o.defaultLayer.id===o.layer.id&&n.setDefaultLayer(o.layer),n.setLayer(this.content.layer),n.setActiveLayerId(this.content.layer.id)}refreshNode(t){var s;const{node:n,currentState:o}=t,{endPointList:r}=jW(this.content.layer,n.id);r&&t.actions.updateNode(n.id,a=>this.updateData(a,{endPointOptions:{endPointList:r}}),{updateInternal:!0,layerId:(s=o.layer)==null?void 0:s.id})}onLayerChange(t){var r;const{currentState:n}=t,o=(r=n.layer.nodes)==null?void 0:r.filter(s=>{var a;return((a=s.data)==null?void 0:a.operatorType)===this.operatorType});o==null||o.forEach(s=>{this.refreshNode({node:s,...t})})}onNodeFocus(t){this==null||this.refreshNode(t)}}const JEt="_container_1dqeq_1",eDt="_content_1dqeq_6";var CR={container:JEt,content:eDt,"operator-item":"_operator-item_1dqeq_10"};const ej="operator_type",tDt=()=>{const i=(n,o)=>r=>{r.dataTransfer.setData(n,o),r.dataTransfer.dropEffect="copy",r.dataTransfer.effectAllowed="all"},{operators:e,refreshOperators:t}=JY();return fn("div",{className:CR.container,children:[he("div",{className:CR.title,children:"Operators"}),fn("div",{className:CR.content,children:[he(ts,{size:"small",type:"link",onClick:()=>{let n="";function o(){if(!n){Xs.warning("Please input name");return}const a=new axe(n);Mq([a]),t()}let r;const s=Lq.info({title:"Custom Operator Name",content:he("div",{children:he(dw,{ref:a=>{r=a},onChange:a=>{n=a.target.value||""},onKeyPress:a=>{a.key==="Enter"&&(s.destroy(),o())}})}),onOk(){o()}});setTimeout(()=>{var a;console.log("inputRef",r),(a=r==null?void 0:r.input)==null||a.focus()},200)},children:"Add Custom"}),e.map(n=>fn("div",{className:CR["operator-item"],draggable:!0,onDragStart:i(ej,n.operatorType),children:[n.isCustom?"Custom:":"",n.operatorName]},n.operatorType))]})]})};function lxe(i){var t;return{key:i.id,title:i.name,children:(t=i.children)==null?void 0:t.map(n=>lxe(n))}}function nDt(){const{layer:i,activeLayerId:e,setActiveLayerId:t}=TT(),n=[lxe(i)];return fn("div",{children:[he("div",{children:"Layer Panel"}),he(NGe,{selectedKeys:[e],showLine:{showLeafIcon:!0},showIcon:!1,defaultExpandedKeys:[],onSelect:(r,s)=>{r!=null&&r[0]&&t(String(r==null?void 0:r[0]))},treeData:n})]})}const R7={id:"52c9a455-3b00-4240-acdc-501de8dd190d",name:"App",children:[],nodes:[{position:{x:511,y:292},id:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",type:"Node",data:{operatorName:"State",operatorType:"StateOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"3ffde193-f535-411e-8283-4616d3e29921",type:"source",variableName:"data_dkmt4",label:"data",hint:"data"},{id:"1e005bc7-6141-458a-a28a-14e2009ee1e7",type:"target",variableName:"update_w1acx",label:"update",hint:"update"}]},value:0,valueType:"number"},width:118,height:136,dragging:!1,selected:!1,positionAbsolute:{x:511,y:292}},{position:{x:725,y:290},id:"$flow_b821e643-ec8e-4422-89a4-dbd1703a1966",type:"Node",data:{operatorName:"Output",operatorType:"OutputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"9104b74e-7f0e-49db-828d-425ccac211ed",type:"group",variableName:"state_nsrsc",label:"State",hint:"state",children:[{id:"b85cf0aa-c815-46e5-9c82-2991ee90bde5",type:"target",variableName:"state_ntaik",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"}},{id:"99dcb167-03be-4d95-a794-d2fb2b96598a",type:"group",variableName:"event_u7nsf",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"}}]}},width:118,height:148,dragging:!1,selected:!1,positionAbsolute:{x:725,y:290}},{position:{x:345,y:266},id:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",type:"Node",data:{operatorName:"Merge",operatorType:"MergeOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"3b25197b-83b3-47f6-ba2f-7d5478412086",type:"group",variableName:"output_zdn7f",hint:"output",children:[{id:"73b965fd-7fd6-4c4c-ac31-916ab3130ab3",type:"source",variableName:"output_awo8m",label:"output",hint:"output",variableType:"array"}]},{id:"ae846f6e-9501-4e0a-a7db-1a6a8f2bb81e",type:"group",variableName:"input_4oq90",label:"Stream",hint:"input",children:[{id:"b63e542a-214b-4918-9388-778413d921e3",type:"target",variableName:"input_6yw48",hint:"input"},{id:"8dd0dad0-0135-487d-9417-a05d5130e188",type:"target",variableName:"input_blxty",hint:"input"},{id:"c29b921d-acd8-4d73-9b7e-c0dbd19318c8",type:"target",variableName:"input_wdsfj",hint:"input"}],allowAddAndRemoveChildren:!0,defaultChildData:{hint:"input",type:"target"}}]}},width:118,height:163,dragging:!1,selected:!1,positionAbsolute:{x:345,y:266}},{position:{x:108,y:315},id:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",type:"Node",data:{operatorName:"Input",operatorType:"InputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5a102ff6-a37a-45b9-a4b4-a38fd7369e7a",type:"group",variableName:"state_buhhs",label:"State",hint:"state",children:[{id:"5bebcd05-9d98-42e9-9679-fa5cc14bc24f",type:"source",variableName:"state_fsap1",hint:"state"},{id:"8327475f-80bc-41e4-84d5-595861bb03ad",type:"source",variableName:"state_nbpuh",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"}},{id:"8735a717-072b-43b2-b6bc-91929f24bc88",type:"group",variableName:"event_ahxxk",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"}},{id:"a971b98d-5918-43ad-a586-4d0e357be2ab",type:"group",variableName:"lifecycle_6pwm1",label:"Lifecycle",hint:"lifecycle",children:[{id:"c4638ffc-aae2-41ab-b9f5-63cb314e84bc",type:"source",variableName:"beforeMount"},{id:"bf5bf823-cc10-4760-9857-fe0d123831ab",type:"source",variableName:"mount"},{id:"0cad4c93-a41a-4b0b-b884-04f6728b7196",type:"source",variableName:"beforeUnmount"},{id:"efd54e65-8abe-4b26-b745-6b80779c5c18",type:"source",variableName:"unmount"}],allowAddAndRemoveChildren:!1}]}},width:118,height:248,dragging:!1,selected:!1,positionAbsolute:{x:108,y:315}},{position:{x:365,y:571},id:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",type:"Node",data:{operatorName:"Transform",operatorType:"TransformOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"ce9317fd-de38-44d0-8082-87428483a6ff",type:"source",variableName:"output_i5pnm",label:"output",hint:"output"},{id:"05b3e305-15eb-4c9f-a092-f6d8e4181236",type:"target",variableName:"input_mferc",label:"input",hint:"input"}]},customCode:`module.exports = async function transform(input) { + })`,...(a=r_e(n)||[])==null?void 0:a.map(l=>`const ${r(l.id)} = temp_${r(n.id)}.output['${l.variableName}']`)]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}getExtraAppContainers(){return[{appContainerId:this.getOperatorId(),data:this.content}]}onNodeDoubleClick(t){const{actions:n,currentState:o}=t;o.defaultLayer.id===o.layer.id&&n.setDefaultLayer(o.layer),n.setLayer(this.content.layer),n.setActiveLayerId(this.content.layer.id)}refreshNode(t){var s;const{node:n,currentState:o}=t,{endPointList:r}=KW(this.content.layer,n.id);r&&t.actions.updateNode(n.id,a=>this.updateData(a,{endPointOptions:{endPointList:r}}),{updateInternal:!0,layerId:(s=o.layer)==null?void 0:s.id})}onLayerChange(t){var r;const{currentState:n}=t,o=(r=n.layer.nodes)==null?void 0:r.filter(s=>{var a;return((a=s.data)==null?void 0:a.operatorType)===this.operatorType});o==null||o.forEach(s=>{this.refreshNode({node:s,...t})})}onNodeFocus(t){this==null||this.refreshNode(t)}}const tDt="_container_1dqeq_1",nDt="_content_1dqeq_6";var CR={container:tDt,content:nDt,"operator-item":"_operator-item_1dqeq_10"};const tj="operator_type",iDt=()=>{const i=(n,o)=>r=>{r.dataTransfer.setData(n,o),r.dataTransfer.dropEffect="copy",r.dataTransfer.effectAllowed="all"},{operators:e,refreshOperators:t}=eZ();return fn("div",{className:CR.container,children:[he("div",{className:CR.title,children:"Operators"}),fn("div",{className:CR.content,children:[he(ts,{size:"small",type:"link",onClick:()=>{let n="";function o(){if(!n){Xs.warning("Please input name");return}const a=new axe(n);Aq([a]),t()}let r;const s=Eq.info({title:"Custom Operator Name",content:he("div",{children:he(dw,{ref:a=>{r=a},onChange:a=>{n=a.target.value||""},onKeyPress:a=>{a.key==="Enter"&&(s.destroy(),o())}})}),onOk(){o()}});setTimeout(()=>{var a;console.log("inputRef",r),(a=r==null?void 0:r.input)==null||a.focus()},200)},children:"Add Custom"}),e.map(n=>fn("div",{className:CR["operator-item"],draggable:!0,onDragStart:i(tj,n.operatorType),children:[n.isCustom?"Custom:":"",n.operatorName]},n.operatorType))]})]})};function lxe(i){var t;return{key:i.id,title:i.name,children:(t=i.children)==null?void 0:t.map(n=>lxe(n))}}function oDt(){const{layer:i,activeLayerId:e,setActiveLayerId:t}=TT(),n=[lxe(i)];return fn("div",{children:[he("div",{children:"Layer Panel"}),he(NGe,{selectedKeys:[e],showLine:{showLeafIcon:!0},showIcon:!1,defaultExpandedKeys:[],onSelect:(r,s)=>{r!=null&&r[0]&&t(String(r==null?void 0:r[0]))},treeData:n})]})}const M7={id:"52c9a455-3b00-4240-acdc-501de8dd190d",name:"App",children:[],nodes:[{position:{x:511,y:292},id:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",type:"Node",data:{operatorName:"State",operatorType:"StateOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"3ffde193-f535-411e-8283-4616d3e29921",type:"source",variableName:"data_dkmt4",label:"data",hint:"data"},{id:"1e005bc7-6141-458a-a28a-14e2009ee1e7",type:"target",variableName:"update_w1acx",label:"update",hint:"update"}]},value:0,valueType:"number"},width:118,height:136,dragging:!1,selected:!1,positionAbsolute:{x:511,y:292}},{position:{x:725,y:290},id:"$flow_b821e643-ec8e-4422-89a4-dbd1703a1966",type:"Node",data:{operatorName:"Output",operatorType:"OutputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"9104b74e-7f0e-49db-828d-425ccac211ed",type:"group",variableName:"state_nsrsc",label:"State",hint:"state",children:[{id:"b85cf0aa-c815-46e5-9c82-2991ee90bde5",type:"target",variableName:"state_ntaik",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"}},{id:"99dcb167-03be-4d95-a794-d2fb2b96598a",type:"group",variableName:"event_u7nsf",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"}}]}},width:118,height:148,dragging:!1,selected:!1,positionAbsolute:{x:725,y:290}},{position:{x:345,y:266},id:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",type:"Node",data:{operatorName:"Merge",operatorType:"MergeOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"3b25197b-83b3-47f6-ba2f-7d5478412086",type:"group",variableName:"output_zdn7f",hint:"output",children:[{id:"73b965fd-7fd6-4c4c-ac31-916ab3130ab3",type:"source",variableName:"output_awo8m",label:"output",hint:"output",variableType:"array"}]},{id:"ae846f6e-9501-4e0a-a7db-1a6a8f2bb81e",type:"group",variableName:"input_4oq90",label:"Stream",hint:"input",children:[{id:"b63e542a-214b-4918-9388-778413d921e3",type:"target",variableName:"input_6yw48",hint:"input"},{id:"8dd0dad0-0135-487d-9417-a05d5130e188",type:"target",variableName:"input_blxty",hint:"input"},{id:"c29b921d-acd8-4d73-9b7e-c0dbd19318c8",type:"target",variableName:"input_wdsfj",hint:"input"}],allowAddAndRemoveChildren:!0,defaultChildData:{hint:"input",type:"target"}}]}},width:118,height:163,dragging:!1,selected:!1,positionAbsolute:{x:345,y:266}},{position:{x:108,y:315},id:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",type:"Node",data:{operatorName:"Input",operatorType:"InputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5a102ff6-a37a-45b9-a4b4-a38fd7369e7a",type:"group",variableName:"state_buhhs",label:"State",hint:"state",children:[{id:"5bebcd05-9d98-42e9-9679-fa5cc14bc24f",type:"source",variableName:"state_fsap1",hint:"state"},{id:"8327475f-80bc-41e4-84d5-595861bb03ad",type:"source",variableName:"state_nbpuh",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"}},{id:"8735a717-072b-43b2-b6bc-91929f24bc88",type:"group",variableName:"event_ahxxk",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"}},{id:"a971b98d-5918-43ad-a586-4d0e357be2ab",type:"group",variableName:"lifecycle_6pwm1",label:"Lifecycle",hint:"lifecycle",children:[{id:"c4638ffc-aae2-41ab-b9f5-63cb314e84bc",type:"source",variableName:"beforeMount"},{id:"bf5bf823-cc10-4760-9857-fe0d123831ab",type:"source",variableName:"mount"},{id:"0cad4c93-a41a-4b0b-b884-04f6728b7196",type:"source",variableName:"beforeUnmount"},{id:"efd54e65-8abe-4b26-b745-6b80779c5c18",type:"source",variableName:"unmount"}],allowAddAndRemoveChildren:!1}]}},width:118,height:248,dragging:!1,selected:!1,positionAbsolute:{x:108,y:315}},{position:{x:365,y:571},id:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",type:"Node",data:{operatorName:"Transform",operatorType:"TransformOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"ce9317fd-de38-44d0-8082-87428483a6ff",type:"source",variableName:"output_i5pnm",label:"output",hint:"output"},{id:"05b3e305-15eb-4c9f-a092-f6d8e4181236",type:"target",variableName:"input_mferc",label:"input",hint:"input"}]},customCode:`module.exports = async function transform(input) { await new Promise(resolve => setTimeout(resolve, 5000)) }`,nodeLabel:"Sleep"},dragging:!1,width:118,height:136,selected:!1,positionAbsolute:{x:365,y:571}},{position:{x:572,y:522.6000000000001},id:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",type:"Node",data:{operatorName:"Combine",operatorType:"CombineOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"f22d87eb-a28b-4508-b24d-79e742dc7813",type:"group",variableName:"output_3huje",hint:"output",children:[{id:"2ce6eb2b-657e-4da2-b157-618523490b8b",type:"source",variableName:"output_isiqc",label:"output",hint:"output",variableType:"array"}]},{id:"2c727e8a-7add-45be-99c2-2b1a474aff30",type:"group",variableName:"mainInput_9xcls",label:"Main Stream",hint:"mainInput",children:[{id:"ee0cc676-e56b-4e1f-b075-2684dc50a33d",type:"target",variableName:"mainSource_fexm5",hint:"mainSource"}],allowAddAndRemoveChildren:!0,defaultChildData:{hint:"mainSource",type:"target"}},{id:"d23c4d13-9992-4198-90b6-33279f08fcb3",type:"group",variableName:"appendInput_nfxld",label:"Append Stream",hint:"appendInput",children:[{id:"a273cc22-9082-4ab4-a592-7df312deb4f7",type:"target",variableName:"appendSource_70qn2",hint:"appendSource"}],allowAddAndRemoveChildren:!0,defaultChildData:{hint:"appendSource",type:"target"}}]}},dragging:!1,width:141,height:194,selected:!1,positionAbsolute:{x:572,y:522.6000000000001}},{position:{x:784,y:532},id:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",type:"Node",data:{operatorName:"Transform",operatorType:"TransformOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5e602cc8-1454-474f-8c75-0747f7a8c19b",type:"source",variableName:"output_akian",label:"output",hint:"output"},{id:"fb957bad-04d7-485b-bc97-b31dbf1c191b",type:"target",variableName:"input_nhkro",label:"input",hint:"input"}]},customCode:`module.exports = function transform(input) { return input[1] + 1; -}`,nodeLabel:"Plus 1"},dragging:!1,width:118,height:136,selected:!0,positionAbsolute:{x:784,y:532}}],edges:[{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_b821e643-ec8e-4422-89a4-dbd1703a1966",targetHandle:"b85cf0aa-c815-46e5-9c82-2991ee90bde5",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_b821e643-ec8e-4422-89a4-dbd1703a1966b85cf0aa-c815-46e5-9c82-2991ee90bde5"},{animated:!0,source:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",sourceHandle:"73b965fd-7fd6-4c4c-ac31-916ab3130ab3",target:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",targetHandle:"1e005bc7-6141-458a-a28a-14e2009ee1e7",id:"reactflow__edge-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f73b965fd-7fd6-4c4c-ac31-916ab3130ab3-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f1e005bc7-6141-458a-a28a-14e2009ee1e7"},{animated:!0,source:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",sourceHandle:"5bebcd05-9d98-42e9-9679-fa5cc14bc24f",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"b63e542a-214b-4918-9388-778413d921e3",id:"reactflow__edge-$flow_17f541a4-f480-45c5-a6bd-ab654945e5125bebcd05-9d98-42e9-9679-fa5cc14bc24f-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582fb63e542a-214b-4918-9388-778413d921e3"},{animated:!0,source:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",sourceHandle:"8327475f-80bc-41e4-84d5-595861bb03ad",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"8dd0dad0-0135-487d-9417-a05d5130e188",id:"reactflow__edge-$flow_17f541a4-f480-45c5-a6bd-ab654945e5128327475f-80bc-41e4-84d5-595861bb03ad-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f8dd0dad0-0135-487d-9417-a05d5130e188"},{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",targetHandle:"05b3e305-15eb-4c9f-a092-f6d8e4181236",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f19205b3e305-15eb-4c9f-a092-f6d8e4181236"},{animated:!0,source:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",sourceHandle:"5e602cc8-1454-474f-8c75-0747f7a8c19b",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"c29b921d-acd8-4d73-9b7e-c0dbd19318c8",id:"reactflow__edge-$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d5e602cc8-1454-474f-8c75-0747f7a8c19b-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582fc29b921d-acd8-4d73-9b7e-c0dbd19318c8"},{animated:!0,source:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",sourceHandle:"ce9317fd-de38-44d0-8082-87428483a6ff",target:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",targetHandle:"ee0cc676-e56b-4e1f-b075-2684dc50a33d",id:"reactflow__edge-$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192ce9317fd-de38-44d0-8082-87428483a6ff-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6ee0cc676-e56b-4e1f-b075-2684dc50a33d"},{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",targetHandle:"a273cc22-9082-4ab4-a592-7df312deb4f7",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6a273cc22-9082-4ab4-a592-7df312deb4f7"},{animated:!0,source:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",sourceHandle:"2ce6eb2b-657e-4da2-b157-618523490b8b",target:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",targetHandle:"fb957bad-04d7-485b-bc97-b31dbf1c191b",id:"reactflow__edge-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e62ce6eb2b-657e-4da2-b157-618523490b8b-$flow_7c4ec381-82eb-418e-b299-feb1cd7c107dfb957bad-04d7-485b-bc97-b31dbf1c191b"}]},M7={id:"ffcec994-0f74-4f54-aeb7-438885dbcc72",name:"App",children:[],nodes:[{position:{x:644,y:102},id:"$flow_d59e81da-225c-40d2-9103-ee3e129514fa",type:"Node",data:{operatorName:"Output",operatorType:"OutputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"20d9f812-f682-4b09-a201-7711882af890",type:"group",variableName:"state_rpxcg",label:"State",hint:"state",children:[{id:"4dc98fc8-57b9-4c30-8425-d33e602810cd",type:"target",variableName:"state_k9vor",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"}},{id:"abbf9ce7-b6a2-4d08-8a5c-90a76d044964",type:"group",variableName:"event_u8t6g",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"}}]}},width:118,height:148,dragging:!1},{position:{x:413,y:81},id:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",type:"Node",data:{operatorName:"Sum",operatorType:"SumOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5d36decd-40e9-4f0f-b919-4af7a33bb481",type:"source",variableName:"output_7c53x",label:"output",hint:"output"},{id:"98aa0131-1975-4cb0-9c35-46280f69a014",type:"group",variableName:"input_3wldr",hint:"input",children:[{id:"90c2a56d-c4df-4430-a4e2-cfcdb6cac3b3",type:"target",variableName:"input_zkw5x",label:"input",hint:"input"},{id:"f85709d5-0f20-4ab8-a719-03e4130d8ec3",type:"target",variableName:"input_tntx3",label:"input",hint:"input"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",label:"input",hint:"input"}}]}},width:118,height:136,dragging:!1,selected:!1,positionAbsolute:{x:413,y:81}},{position:{x:130,y:65},id:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",type:"Node",data:{operatorName:"Input",operatorType:"InputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"4b6c72b1-30a9-42c8-b5df-3e37d3acc958",type:"group",variableName:"state_pq4d3",label:"State",hint:"state",children:[{id:"1ba05470-5941-4e80-9c49-11c4bc2542fd",type:"source",variableName:"state_1naae",hint:"state"},{id:"371ff3fd-e734-48d6-a05e-371ab850313a",type:"source",variableName:"state_4lmjx",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"}},{id:"8827904c-48b0-4409-9489-1a73fcb99a64",type:"group",variableName:"event_dlev2",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"}},{id:"e0c20603-88e0-4130-a583-f7cde637dff8",type:"group",variableName:"lifecycle_l5z4n",label:"Lifecycle",hint:"lifecycle",children:[{id:"bdb74a8d-d29a-4a62-8d20-ad3a1dad8450",type:"source",variableName:"beforeMount"},{id:"82a9bb07-5619-4717-8618-a8c8cc03959a",type:"source",variableName:"mount"},{id:"d8525b49-242b-4572-8bd7-399bec64b338",type:"source",variableName:"beforeUnmount"},{id:"b6d06207-e8ea-47f8-af2c-fe2c60a328de",type:"source",variableName:"unmount"}],allowAddAndRemoveChildren:!1}]}},width:118,height:248,dragging:!1,selected:!1,positionAbsolute:{x:130,y:65}}],edges:[{animated:!0,source:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",sourceHandle:"1ba05470-5941-4e80-9c49-11c4bc2542fd",target:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",targetHandle:"90c2a56d-c4df-4430-a4e2-cfcdb6cac3b3",id:"reactflow__edge-$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed1ba05470-5941-4e80-9c49-11c4bc2542fd-$flow_ba963a6d-a83c-4609-830f-48ef8d51740290c2a56d-c4df-4430-a4e2-cfcdb6cac3b3"},{animated:!0,source:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",sourceHandle:"371ff3fd-e734-48d6-a05e-371ab850313a",target:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",targetHandle:"f85709d5-0f20-4ab8-a719-03e4130d8ec3",id:"reactflow__edge-$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed371ff3fd-e734-48d6-a05e-371ab850313a-$flow_ba963a6d-a83c-4609-830f-48ef8d517402f85709d5-0f20-4ab8-a719-03e4130d8ec3"},{animated:!0,source:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",sourceHandle:"5d36decd-40e9-4f0f-b919-4af7a33bb481",target:"$flow_d59e81da-225c-40d2-9103-ee3e129514fa",targetHandle:"4dc98fc8-57b9-4c30-8425-d33e602810cd",id:"reactflow__edge-$flow_ba963a6d-a83c-4609-830f-48ef8d5174025d36decd-40e9-4f0f-b919-4af7a33bb481-$flow_d59e81da-225c-40d2-9103-ee3e129514fa4dc98fc8-57b9-4c30-8425-d33e602810cd"}]},cxe="layer_storage";function iDt(i){localStorage.setItem(cxe,JSON.stringify(i))}function oDt(){return JSON.parse(localStorage.getItem(cxe)||"")}function rDt(){const{layer:i,setLayer:e,setActiveLayerId:t,setDefaultLayer:n}=TT(),{actionsRef:o,currentStateRef:r}=NT(),{operators:s,refreshOperators:a}=JY();async function l(){try{if(i.parentLayerId){const c=wc(i,i.parentLayerId),d=c==null?void 0:c.nodes.find(u=>u.id===i.relativeNodeId);if(d){const u=fr(d);u==null||u.refreshNode({node:d,actions:o.current,currentState:r.current})}}await xFe(200),iDt({layer:r.current.layer,customOperators:s.filter(c=>c.isCustom)}),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}}return fn("div",{style:{display:"grid",gridAutoFlow:"row",gap:4},children:[he(ts,{type:"text",onClick:()=>{l()},children:"Save"}),he(ts,{type:"text",onClick:()=>{try{const c=oDt(),d=c.layer;e(d),n(d),t(d.id);const u=c.customOperators.map(h=>{const f=new axe(h.operatorName);return Object.assign(f,h),f});Mq(u),a(),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Load"}),he(ts,{type:"text",onClick:()=>{try{const c=new xI("App");e(c),n(c),t(c.id),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Reset"}),he(ts,{type:"text",onClick:()=>{console.log(i)},children:"Log"}),he(ts,{type:"text",onClick:()=>{try{e(R7),n(R7),t(R7.id),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Load Loop Demo"}),he(ts,{type:"text",onClick:()=>{try{e(M7),n(M7),t(M7.id),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Load Sum Demo"})]})}const sDt="_container_1n7r9_1";var aDt={container:sDt};function lDt(){return he("div",{className:aDt.container,children:he(dje,{size:"small",tabPosition:"left",items:[{label:he(QEt,{rev:""}),key:"Operators",children:he(tDt,{})},{label:he(GEt,{rev:""}),key:"Layers",children:he(nDt,{})},{label:he(UEt,{rev:""}),key:"commands",children:he(rDt,{})}]})})}var cDt="\0",E_="\0",ude="",Il,y0,_c,lI,Ky,qy,gd,Eh,fm,Dh,gm,bg,Cg,Gy,Xy,yg,fu,cI,tj;class dDt{constructor(e){Oo(this,cI);Oo(this,Il,!0);Oo(this,y0,!1);Oo(this,_c,!1);Oo(this,lI,void 0);Oo(this,Ky,()=>{});Oo(this,qy,()=>{});Oo(this,gd,{});Oo(this,Eh,{});Oo(this,fm,{});Oo(this,Dh,{});Oo(this,gm,{});Oo(this,bg,{});Oo(this,Cg,{});Oo(this,Gy,0);Oo(this,Xy,0);Oo(this,yg,void 0);Oo(this,fu,void 0);e&&(ad(this,Il,e.hasOwnProperty("directed")?e.directed:!0),ad(this,y0,e.hasOwnProperty("multigraph")?e.multigraph:!1),ad(this,_c,e.hasOwnProperty("compound")?e.compound:!1)),ht(this,_c)&&(ad(this,yg,{}),ad(this,fu,{}),ht(this,fu)[E_]={})}isDirected(){return ht(this,Il)}isMultigraph(){return ht(this,y0)}isCompound(){return ht(this,_c)}setGraph(e){return ad(this,lI,e),this}graph(){return ht(this,lI)}setDefaultNodeLabel(e){return ad(this,Ky,e),typeof e!="function"&&ad(this,Ky,()=>e),this}nodeCount(){return ht(this,Gy)}nodes(){return Object.keys(ht(this,gd))}sources(){var e=this;return this.nodes().filter(t=>Object.keys(ht(e,Eh)[t]).length===0)}sinks(){var e=this;return this.nodes().filter(t=>Object.keys(ht(e,Dh)[t]).length===0)}setNodes(e,t){var n=arguments,o=this;return e.forEach(function(r){n.length>1?o.setNode(r,t):o.setNode(r)}),this}setNode(e,t){return ht(this,gd).hasOwnProperty(e)?(arguments.length>1&&(ht(this,gd)[e]=t),this):(ht(this,gd)[e]=arguments.length>1?t:ht(this,Ky).call(this,e),ht(this,_c)&&(ht(this,yg)[e]=E_,ht(this,fu)[e]={},ht(this,fu)[E_][e]=!0),ht(this,Eh)[e]={},ht(this,fm)[e]={},ht(this,Dh)[e]={},ht(this,gm)[e]={},++ox(this,Gy)._,this)}node(e){return ht(this,gd)[e]}hasNode(e){return ht(this,gd).hasOwnProperty(e)}removeNode(e){var t=this;if(ht(this,gd).hasOwnProperty(e)){var n=o=>t.removeEdge(ht(t,bg)[o]);delete ht(this,gd)[e],ht(this,_c)&&(mh(this,cI,tj).call(this,e),delete ht(this,yg)[e],this.children(e).forEach(function(o){t.setParent(o)}),delete ht(this,fu)[e]),Object.keys(ht(this,Eh)[e]).forEach(n),delete ht(this,Eh)[e],delete ht(this,fm)[e],Object.keys(ht(this,Dh)[e]).forEach(n),delete ht(this,Dh)[e],delete ht(this,gm)[e],--ox(this,Gy)._}return this}setParent(e,t){if(!ht(this,_c))throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t=E_;else{t+="";for(var n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),mh(this,cI,tj).call(this,e),ht(this,yg)[e]=t,ht(this,fu)[t][e]=!0,this}parent(e){if(ht(this,_c)){var t=ht(this,yg)[e];if(t!==E_)return t}}children(e=E_){if(ht(this,_c)){var t=ht(this,fu)[e];if(t)return Object.keys(t)}else{if(e===E_)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=ht(this,fm)[e];if(t)return Object.keys(t)}successors(e){var t=ht(this,gm)[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const o=new Set(t);for(var n of this.successors(e))o.add(n);return Array.from(o.values())}}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:ht(this,Il),multigraph:ht(this,y0),compound:ht(this,_c)});t.setGraph(this.graph());var n=this;Object.entries(ht(this,gd)).forEach(function([s,a]){e(s)&&t.setNode(s,a)}),Object.values(ht(this,bg)).forEach(function(s){t.hasNode(s.v)&&t.hasNode(s.w)&&t.setEdge(s,n.edge(s))});var o={};function r(s){var a=n.parent(s);return a===void 0||t.hasNode(a)?(o[s]=a,a):a in o?o[a]:r(a)}return ht(this,_c)&&t.nodes().forEach(s=>t.setParent(s,r(s))),t}setDefaultEdgeLabel(e){return ad(this,qy,e),typeof e!="function"&&ad(this,qy,()=>e),this}edgeCount(){return ht(this,Xy)}edges(){return Object.values(ht(this,bg))}setPath(e,t){var n=this,o=arguments;return e.reduce(function(r,s){return o.length>1?n.setEdge(r,s,t):n.setEdge(r,s),s}),this}setEdge(){var e,t,n,o,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,t=s.w,n=s.name,arguments.length===2&&(o=arguments[1],r=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],r=!0)),e=""+e,t=""+t,n!==void 0&&(n=""+n);var a=HL(ht(this,Il),e,t,n);if(ht(this,Cg).hasOwnProperty(a))return r&&(ht(this,Cg)[a]=o),this;if(n!==void 0&&!ht(this,y0))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),ht(this,Cg)[a]=r?o:ht(this,qy).call(this,e,t,n);var l=uDt(ht(this,Il),e,t,n);return e=l.v,t=l.w,Object.freeze(l),ht(this,bg)[a]=l,hde(ht(this,fm)[t],e),hde(ht(this,gm)[e],t),ht(this,Eh)[t][a]=l,ht(this,Dh)[e][a]=l,ox(this,Xy)._++,this}edge(e,t,n){var o=arguments.length===1?A7(ht(this,Il),arguments[0]):HL(ht(this,Il),e,t,n);return ht(this,Cg)[o]}edgeAsObj(){const e=this.edge(...arguments);return typeof e!="object"?{label:e}:e}hasEdge(e,t,n){var o=arguments.length===1?A7(ht(this,Il),arguments[0]):HL(ht(this,Il),e,t,n);return ht(this,Cg).hasOwnProperty(o)}removeEdge(e,t,n){var o=arguments.length===1?A7(ht(this,Il),arguments[0]):HL(ht(this,Il),e,t,n),r=ht(this,bg)[o];return r&&(e=r.v,t=r.w,delete ht(this,Cg)[o],delete ht(this,bg)[o],fde(ht(this,fm)[t],e),fde(ht(this,gm)[e],t),delete ht(this,Eh)[t][o],delete ht(this,Dh)[e][o],ox(this,Xy)._--),this}inEdges(e,t){var n=ht(this,Eh)[e];if(n){var o=Object.values(n);return t?o.filter(r=>r.v===t):o}}outEdges(e,t){var n=ht(this,Dh)[e];if(n){var o=Object.values(n);return t?o.filter(r=>r.w===t):o}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}Il=new WeakMap,y0=new WeakMap,_c=new WeakMap,lI=new WeakMap,Ky=new WeakMap,qy=new WeakMap,gd=new WeakMap,Eh=new WeakMap,fm=new WeakMap,Dh=new WeakMap,gm=new WeakMap,bg=new WeakMap,Cg=new WeakMap,Gy=new WeakMap,Xy=new WeakMap,yg=new WeakMap,fu=new WeakMap,cI=new WeakSet,tj=function(e){delete ht(this,fu)[ht(this,yg)[e]][e]};function hde(i,e){i[e]?i[e]++:i[e]=1}function fde(i,e){--i[e]||delete i[e]}function HL(i,e,t,n){var o=""+e,r=""+t;if(!i&&o>r){var s=o;o=r,r=s}return o+ude+r+ude+(n===void 0?cDt:n)}function uDt(i,e,t,n){var o=""+e,r=""+t;if(!i&&o>r){var s=o;o=r,r=s}var a={v:o,w:r};return n&&(a.name=n),a}function A7(i,e){return HL(i,e.v,e.w,e.name)}var eZ=dDt,hDt="2.1.13",fDt={Graph:eZ,version:hDt},gDt=eZ,pDt={write:mDt,read:bDt};function mDt(i){var e={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:vDt(i),edges:_Dt(i)};return i.graph()!==void 0&&(e.value=structuredClone(i.graph())),e}function vDt(i){return i.nodes().map(function(e){var t=i.node(e),n=i.parent(e),o={v:e};return t!==void 0&&(o.value=t),n!==void 0&&(o.parent=n),o})}function _Dt(i){return i.edges().map(function(e){var t=i.edge(e),n={v:e.v,w:e.w};return e.name!==void 0&&(n.name=e.name),t!==void 0&&(n.value=t),n})}function bDt(i){var e=new gDt(i.options).setGraph(i.value);return i.nodes.forEach(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),i.edges.forEach(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var CDt=yDt;function yDt(i){var e={},t=[],n;function o(r){e.hasOwnProperty(r)||(e[r]=!0,n.push(r),i.successors(r).forEach(o),i.predecessors(r).forEach(o))}return i.nodes().forEach(function(r){n=[],o(r),n.length&&t.push(n)}),t}var La,wg,dI,nj,uI,ij,Yy,OM;class wDt{constructor(){Oo(this,dI);Oo(this,uI);Oo(this,Yy);Oo(this,La,[]);Oo(this,wg,{})}size(){return ht(this,La).length}keys(){return ht(this,La).map(function(e){return e.key})}has(e){return ht(this,wg).hasOwnProperty(e)}priority(e){var t=ht(this,wg)[e];if(t!==void 0)return ht(this,La)[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return ht(this,La)[0].key}add(e,t){var n=ht(this,wg);if(e=String(e),!n.hasOwnProperty(e)){var o=ht(this,La),r=o.length;return n[e]=r,o.push({key:e,priority:t}),mh(this,uI,ij).call(this,r),!0}return!1}removeMin(){mh(this,Yy,OM).call(this,0,ht(this,La).length-1);var e=ht(this,La).pop();return delete ht(this,wg)[e.key],mh(this,dI,nj).call(this,0),e.key}decrease(e,t){var n=ht(this,wg)[e];if(t>ht(this,La)[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+ht(this,La)[n].priority+" New: "+t);ht(this,La)[n].priority=t,mh(this,uI,ij).call(this,n)}}La=new WeakMap,wg=new WeakMap,dI=new WeakSet,nj=function(e){var t=ht(this,La),n=2*e,o=n+1,r=e;n>1,!(t[o].priority1;function LDt(i,e,t,n){return EDt(i,String(e),t||xDt,n||function(o){return i.outEdges(o)})}function EDt(i,e,t,n){var o={},r=new SDt,s,a,l=function(c){var d=c.v!==s?c.v:c.w,u=o[d],h=t(c),f=a.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+h);f0&&(s=r.removeMin(),a=o[s],a.distance!==Number.POSITIVE_INFINITY);)n(s).forEach(l);return o}var DDt=uxe,kDt=IDt;function IDt(i,e,t){return i.nodes().reduce(function(n,o){return n[o]=DDt(i,o,e,t),n},{})}var hxe=TDt;function TDt(i){var e=0,t=[],n={},o=[];function r(s){var a=n[s]={onStack:!0,lowlink:e,index:e++};if(t.push(s),i.successors(s).forEach(function(d){n.hasOwnProperty(d)?n[d].onStack&&(a.lowlink=Math.min(a.lowlink,n[d].index)):(r(d),a.lowlink=Math.min(a.lowlink,n[d].lowlink))}),a.lowlink===a.index){var l=[],c;do c=t.pop(),n[c].onStack=!1,l.push(c);while(s!==c);o.push(l)}}return i.nodes().forEach(function(s){n.hasOwnProperty(s)||r(s)}),o}var NDt=hxe,RDt=MDt;function MDt(i){return NDt(i).filter(function(e){return e.length>1||e.length===1&&i.hasEdge(e[0],e[0])})}var ADt=ODt,PDt=()=>1;function ODt(i,e,t){return FDt(i,e||PDt,t||function(n){return i.outEdges(n)})}function FDt(i,e,t){var n={},o=i.nodes();return o.forEach(function(r){n[r]={},n[r][r]={distance:0},o.forEach(function(s){r!==s&&(n[r][s]={distance:Number.POSITIVE_INFINITY})}),t(r).forEach(function(s){var a=s.v===r?s.w:s.v,l=e(s);n[r][a]={distance:l,predecessor:r}})}),o.forEach(function(r){var s=n[r];o.forEach(function(a){var l=n[a];o.forEach(function(c){var d=l[r],u=s[c],h=l[c],f=d.distance+u.distance;fi.successors(a):a=>i.neighbors(a),o=t==="post"?HDt:$Dt,r=[],s={};return e.forEach(a=>{if(!i.hasNode(a))throw new Error("Graph does not have node: "+a);o(a,n,s,r)}),r}function HDt(i,e,t,n){for(var o=[[i,!1]];o.length>0;){var r=o.pop();r[1]?n.push(r[0]):t.hasOwnProperty(r[0])||(t[r[0]]=!0,o.push([r[0],!0]),mxe(e(r[0]),s=>o.push([s,!1])))}}function $Dt(i,e,t,n){for(var o=[i];o.length>0;){var r=o.pop();t.hasOwnProperty(r)||(t[r]=!0,n.push(r),mxe(e(r),s=>o.push(s)))}}function mxe(i,e){for(var t=i.length;t--;)e(i[t],t,i);return i}var zDt=pxe,UDt=jDt;function jDt(i,e){return zDt(i,e,"post")}var KDt=pxe,qDt=GDt;function GDt(i,e){return KDt(i,e,"pre")}var XDt=eZ,YDt=dxe,ZDt=QDt;function QDt(i,e){var t=new XDt,n={},o=new YDt,r;function s(l){var c=l.v===r?l.w:l.v,d=o.priority(c);if(d!==void 0){var u=e(l);u0;){if(r=o.removeMin(),n.hasOwnProperty(r))t.setEdge(r,n[r]);else{if(a)throw new Error("Input graph is not connected: "+i);a=!0}i.nodeEdges(r).forEach(s)}return t}var JDt={components:CDt,dijkstra:uxe,dijkstraAll:kDt,findCycles:RDt,floydWarshall:ADt,isAcyclic:BDt,postorder:UDt,preorder:qDt,prim:ZDt,tarjan:hxe,topsort:gxe},pde=fDt,hh={Graph:pde.Graph,json:pDt,alg:JDt,version:pde.version};class ekt{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return mde(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&mde(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,tkt)),n=n._prev;return"["+e.join(", ")+"]"}}function mde(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function tkt(i,e){if(i!=="_next"&&i!=="_prev")return e}var nkt=ekt;let ikt=hh.Graph,okt=nkt;var rkt=akt;let skt=()=>1;function akt(i,e){if(i.nodeCount()<=1)return[];let t=ckt(i,e||skt);return lkt(t.graph,t.buckets,t.zeroIdx).flatMap(o=>i.outEdges(o.v,o.w))}function lkt(i,e,t){let n=[],o=e[e.length-1],r=e[0],s;for(;i.nodeCount();){for(;s=r.dequeue();)P7(i,e,t,s);for(;s=o.dequeue();)P7(i,e,t,s);if(i.nodeCount()){for(let a=e.length-2;a>0;--a)if(s=e[a].dequeue(),s){n=n.concat(P7(i,e,t,s,!0));break}}}return n}function P7(i,e,t,n,o){let r=o?[]:void 0;return i.inEdges(n.v).forEach(s=>{let a=i.edge(s),l=i.node(s.v);o&&r.push({v:s.v,w:s.w}),l.out-=a,rj(e,t,l)}),i.outEdges(n.v).forEach(s=>{let a=i.edge(s),l=s.w,c=i.node(l);c.in-=a,rj(e,t,c)}),i.removeNode(n.v),r}function ckt(i,e){let t=new ikt,n=0,o=0;i.nodes().forEach(a=>{t.setNode(a,{v:a,in:0,out:0})}),i.edges().forEach(a=>{let l=t.edge(a.v,a.w)||0,c=e(a),d=l+c;t.setEdge(a.v,a.w,d),o=Math.max(o,t.node(a.v).out+=c),n=Math.max(n,t.node(a.w).in+=c)});let r=dkt(o+n+3).map(()=>new okt),s=n+1;return t.nodes().forEach(a=>{rj(r,s,t.node(a))}),{graph:t,buckets:r,zeroIdx:s}}function rj(i,e,t){t.out?t.in?i[t.out-t.in+e].enqueue(t):i[i.length-1].enqueue(t):i[0].enqueue(t)}function dkt(i){const e=[];for(let t=0;te.setNode(t,i.node(t))),i.edges().forEach(t=>{let n=e.edge(t.v,t.w)||{weight:0,minlen:1},o=i.edge(t);e.setEdge(t.v,t.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),e}function hkt(i){let e=new vxe({multigraph:i.isMultigraph()}).setGraph(i.graph());return i.nodes().forEach(t=>{i.children(t).length||e.setNode(t,i.node(t))}),i.edges().forEach(t=>{e.setEdge(t,i.edge(t))}),e}function fkt(i){let e=i.nodes().map(t=>{let n={};return i.outEdges(t).forEach(o=>{n[o.w]=(n[o.w]||0)+i.edge(o).weight}),n});return tZ(i.nodes(),e)}function gkt(i){let e=i.nodes().map(t=>{let n={};return i.inEdges(t).forEach(o=>{n[o.v]=(n[o.v]||0)+i.edge(o).weight}),n});return tZ(i.nodes(),e)}function pkt(i,e){let t=i.x,n=i.y,o=e.x-t,r=e.y-n,s=i.width/2,a=i.height/2;if(!o&&!r)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(r)*s>Math.abs(o)*a?(r<0&&(a=-a),l=a*o/r,c=a):(o<0&&(s=-s),l=s,c=s*r/o),{x:t+l,y:n+c}}function mkt(i){let e=yxe(bxe(i)+1).map(()=>[]);return i.nodes().forEach(t=>{let n=i.node(t),o=n.rank;o!==void 0&&(e[o][n.order]=t)}),e}function vkt(i){let e=Math.min(...i.nodes().map(t=>{let n=i.node(t).rank;return n===void 0?Number.MAX_VALUE:n}));i.nodes().forEach(t=>{let n=i.node(t);n.hasOwnProperty("rank")&&(n.rank-=e)})}function _kt(i){let e=Math.min(...i.nodes().map(r=>i.node(r).rank)),t=[];i.nodes().forEach(r=>{let s=i.node(r).rank-e;t[s]||(t[s]=[]),t[s].push(r)});let n=0,o=i.graph().nodeRankFactor;Array.from(t).forEach((r,s)=>{r===void 0&&s%o!==0?--n:r!==void 0&&n&&r.forEach(a=>i.node(a).rank+=n)})}function bkt(i,e,t,n){let o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=n),_xe(i,"border",o,e)}function bxe(i){return Math.max(...i.nodes().map(e=>{let t=i.node(e).rank;return t===void 0?Number.MIN_VALUE:t}))}function Ckt(i,e){let t={lhs:[],rhs:[]};return i.forEach(n=>{e(n)?t.lhs.push(n):t.rhs.push(n)}),t}function ykt(i,e){let t=Date.now();try{return e()}finally{console.log(i+" time: "+(Date.now()-t)+"ms")}}function wkt(i,e){return e()}let Skt=0;function Cxe(i){var e=++Skt;return toString(i)+e}function yxe(i,e,t=1){e==null&&(e=i,i=0);let n=r=>ren[e]),Object.entries(i).reduce((n,[o,r])=>(n[o]=t(r,o),n),{})}function tZ(i,e){return i.reduce((t,n,o)=>(t[n]=e[o],t),{})}let Ekt=rkt,Dkt=Ds.uniqueId;var kkt={run:Ikt,undo:Nkt};function Ikt(i){(i.graph().acyclicer==="greedy"?Ekt(i,t(i)):Tkt(i)).forEach(n=>{let o=i.edge(n);i.removeEdge(n),o.forwardName=n.name,o.reversed=!0,i.setEdge(n.w,n.v,o,Dkt("rev"))});function t(n){return o=>n.edge(o).weight}}function Tkt(i){let e=[],t={},n={};function o(r){n.hasOwnProperty(r)||(n[r]=!0,t[r]=!0,i.outEdges(r).forEach(s=>{t.hasOwnProperty(s.w)?e.push(s):o(s.w)}),delete t[r])}return i.nodes().forEach(o),e}function Nkt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.reversed){i.removeEdge(e);let n=t.forwardName;delete t.reversed,delete t.forwardName,i.setEdge(e.w,e.v,t,n)}})}let Rkt=Ds;var Mkt={run:Akt,undo:Okt};function Akt(i){i.graph().dummyChains=[],i.edges().forEach(e=>Pkt(i,e))}function Pkt(i,e){let t=e.v,n=i.node(t).rank,o=e.w,r=i.node(o).rank,s=e.name,a=i.edge(e),l=a.labelRank;if(r===n+1)return;i.removeEdge(e);let c,d,u;for(u=0,++n;n{let t=i.node(e),n=t.edgeLabel,o;for(i.setEdge(t.edgeObj,n);t.dummy;)o=i.successors(e)[0],i.removeNode(e),n.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(n.x=t.x,n.y=t.y,n.width=t.width,n.height=t.height),e=o,t=i.node(e)})}var i3={longestPath:Fkt,slack:Bkt};function Fkt(i){var e={};function t(n){var o=i.node(n);if(e.hasOwnProperty(n))return o.rank;e[n]=!0;var r=Math.min(...i.outEdges(n).map(s=>s==null?Number.POSITIVE_INFINITY:t(s.w)-i.edge(s).minlen));return r===Number.POSITIVE_INFINITY&&(r=0),o.rank=r}i.sources().forEach(t)}function Bkt(i,e){return i.node(e.w).rank-i.node(e.v).rank-i.edge(e).minlen}var Wkt=hh.Graph,BO=i3.slack,wxe=Vkt;function Vkt(i){var e=new Wkt({directed:!1}),t=i.nodes()[0],n=i.nodeCount();e.setNode(t,{});for(var o,r;Hkt(e,i){var r=o.v,s=n===r?o.w:r;!i.hasNode(s)&&!BO(e,o)&&(i.setNode(s,{}),i.setEdge(n,s,{}),t(s))})}return i.nodes().forEach(t),i.nodeCount()}function $kt(i,e){return e.edges().reduce((n,o)=>{let r=Number.POSITIVE_INFINITY;return i.hasNode(o.v)!==i.hasNode(o.w)&&(r=BO(e,o)),re.node(n).rank+=t)}var Ukt=wxe,vde=i3.slack,jkt=i3.longestPath,Kkt=hh.alg.preorder,qkt=hh.alg.postorder,Gkt=Ds.simplify,Xkt=o1;o1.initLowLimValues=iZ;o1.initCutValues=nZ;o1.calcCutValue=Sxe;o1.leaveEdge=Lxe;o1.enterEdge=Exe;o1.exchangeEdges=Dxe;function o1(i){i=Gkt(i),jkt(i);var e=Ukt(i);iZ(e),nZ(e,i);for(var t,n;t=Lxe(e);)n=Exe(e,i,t),Dxe(e,i,t,n)}function nZ(i,e){var t=qkt(i,i.nodes());t=t.slice(0,t.length-1),t.forEach(n=>Ykt(i,e,n))}function Ykt(i,e,t){var n=i.node(t),o=n.parent;i.edge(t,o).cutvalue=Sxe(i,e,t)}function Sxe(i,e,t){var n=i.node(t),o=n.parent,r=!0,s=e.edge(t,o),a=0;return s||(r=!1,s=e.edge(o,t)),a=s.weight,e.nodeEdges(t).forEach(l=>{var c=l.v===t,d=c?l.w:l.v;if(d!==o){var u=c===r,h=e.edge(l).weight;if(a+=u?h:-h,Qkt(i,t,d)){var f=i.edge(t,d).cutvalue;a+=u?-f:f}}}),a}function iZ(i,e){arguments.length<2&&(e=i.nodes()[0]),xxe(i,{},1,e)}function xxe(i,e,t,n,o){var r=t,s=i.node(n);return e[n]=!0,i.neighbors(n).forEach(a=>{e.hasOwnProperty(a)||(t=xxe(i,e,t,a,n))}),s.low=r,s.lim=t++,o?s.parent=o:delete s.parent,t}function Lxe(i){return i.edges().find(e=>i.edge(e).cutvalue<0)}function Exe(i,e,t){var n=t.v,o=t.w;e.hasEdge(n,o)||(n=t.w,o=t.v);var r=i.node(n),s=i.node(o),a=r,l=!1;r.lim>s.lim&&(a=s,l=!0);var c=e.edges().filter(d=>l===_de(i,i.node(d.v),a)&&l!==_de(i,i.node(d.w),a));return c.reduce((d,u)=>vde(e,u)!e.node(o).parent),n=Kkt(i,t);n=n.slice(1),n.forEach(o=>{var r=i.node(o).parent,s=e.edge(o,r),a=!1;s||(s=e.edge(r,o),a=!0),e.node(o).rank=e.node(r).rank+(a?s.minlen:-s.minlen)})}function Qkt(i,e,t){return i.hasEdge(e,t)}function _de(i,e,t){return t.low<=e.lim&&e.lim<=t.lim}var Jkt=i3,kxe=Jkt.longestPath,eIt=wxe,tIt=Xkt,nIt=iIt;function iIt(i){switch(i.graph().ranker){case"network-simplex":bde(i);break;case"tight-tree":rIt(i);break;case"longest-path":oIt(i);break;default:bde(i)}}var oIt=kxe;function rIt(i){kxe(i),eIt(i)}function bde(i){tIt(i)}var sIt=aIt;function aIt(i){let e=cIt(i);i.graph().dummyChains.forEach(t=>{let n=i.node(t),o=n.edgeObj,r=lIt(i,e,o.v,o.w),s=r.path,a=r.lca,l=0,c=s[l],d=!0;for(;t!==o.w;){if(n=i.node(t),d){for(;(c=s[l])!==a&&i.node(c).maxRanks||a>e[l].lim));for(c=l,l=n;(l=i.parent(l))!==c;)r.push(l);return{path:o.concat(r.reverse()),lca:c}}function cIt(i){let e={},t=0;function n(o){let r=t;i.children(o).forEach(n),e[o]={low:r,lim:t++}}return i.children().forEach(n),e}let sj=Ds;var dIt={run:uIt,cleanup:gIt};function uIt(i){let e=sj.addDummyNode(i,"root",{},"_root"),t=hIt(i),n=Math.max(...Object.values(t))-1,o=2*n+1;i.graph().nestingRoot=e,i.edges().forEach(s=>i.edge(s).minlen*=o);let r=fIt(i)+1;i.children().forEach(s=>Ixe(i,e,o,r,n,t,s)),i.graph().nodeRankFactor=o}function Ixe(i,e,t,n,o,r,s){let a=i.children(s);if(!a.length){s!==e&&i.setEdge(e,s,{weight:0,minlen:t});return}let l=sj.addBorderNode(i,"_bt"),c=sj.addBorderNode(i,"_bb"),d=i.node(s);i.setParent(l,s),d.borderTop=l,i.setParent(c,s),d.borderBottom=c,a.forEach(u=>{Ixe(i,e,t,n,o,r,u);let h=i.node(u),f=h.borderTop?h.borderTop:u,g=h.borderBottom?h.borderBottom:u,p=h.borderTop?n:2*n,v=f!==g?1:o-r[s]+1;i.setEdge(l,f,{weight:p,minlen:v,nestingEdge:!0}),i.setEdge(g,c,{weight:p,minlen:v,nestingEdge:!0})}),i.parent(s)||i.setEdge(e,l,{weight:0,minlen:o+r[s]})}function hIt(i){var e={};function t(n,o){var r=i.children(n);r&&r.length&&r.forEach(s=>t(s,o+1)),e[n]=o}return i.children().forEach(n=>t(n,1)),e}function fIt(i){return i.edges().reduce((e,t)=>e+i.edge(t).weight,0)}function gIt(i){var e=i.graph();i.removeNode(e.nestingRoot),delete e.nestingRoot,i.edges().forEach(t=>{var n=i.edge(t);n.nestingEdge&&i.removeEdge(t)})}let pIt=Ds;var mIt=vIt;function vIt(i){function e(t){let n=i.children(t),o=i.node(t);if(n.length&&n.forEach(e),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(let r=o.minRank,s=o.maxRank+1;ryde(i.node(e))),i.edges().forEach(e=>yde(i.edge(e)))}function yde(i){let e=i.width;i.width=i.height,i.height=e}function yIt(i){i.nodes().forEach(e=>O7(i.node(e))),i.edges().forEach(e=>{let t=i.edge(e);t.points.forEach(O7),t.hasOwnProperty("y")&&O7(t)})}function O7(i){i.y=-i.y}function wIt(i){i.nodes().forEach(e=>F7(i.node(e))),i.edges().forEach(e=>{let t=i.edge(e);t.points.forEach(F7),t.hasOwnProperty("x")&&F7(t)})}function F7(i){let e=i.x;i.x=i.y,i.y=e}let SIt=Ds;var xIt=LIt;function LIt(i){let e={},t=i.nodes().filter(a=>!i.children(a).length),n=Math.max(...t.map(a=>i.node(a).rank)),o=SIt.range(n+1).map(()=>[]);function r(a){if(e[a])return;e[a]=!0;let l=i.node(a);o[l.rank].push(a),i.successors(a).forEach(r)}return t.sort((a,l)=>i.node(a).rank-i.node(l).rank).forEach(r),o}let EIt=Ds.zipObject;var DIt=kIt;function kIt(i,e){let t=0;for(let n=1;nd)),o=e.flatMap(c=>i.outEdges(c).map(d=>({pos:n[d.w],weight:i.edge(d).weight})).sort((d,u)=>d.pos-u.pos)),r=1;for(;r{let d=c.pos+r;a[d]+=c.weight;let u=0;for(;d>0;)d%2&&(u+=a[d+1]),d=d-1>>1,a[d]+=c.weight;l+=c.weight*u}),l}var TIt=NIt;function NIt(i,e=[]){return e.map(t=>{let n=i.inEdges(t);if(n.length){let o=n.reduce((r,s)=>{let a=i.edge(s),l=i.node(s.v);return{sum:r.sum+a.weight*l.order,weight:r.weight+a.weight}},{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:t}})}let RIt=Ds;var MIt=AIt;function AIt(i,e){let t={};i.forEach((o,r)=>{let s=t[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:r};o.barycenter!==void 0&&(s.barycenter=o.barycenter,s.weight=o.weight)}),e.edges().forEach(o=>{let r=t[o.v],s=t[o.w];r!==void 0&&s!==void 0&&(s.indegree++,r.out.push(t[o.w]))});let n=Object.values(t).filter(o=>!o.indegree);return PIt(n)}function PIt(i){let e=[];function t(o){return r=>{r.merged||(r.barycenter===void 0||o.barycenter===void 0||r.barycenter>=o.barycenter)&&OIt(o,r)}}function n(o){return r=>{r.in.push(o),--r.indegree===0&&i.push(r)}}for(;i.length;){let o=i.pop();e.push(o),o.in.reverse().forEach(t(o)),o.out.forEach(n(o))}return e.filter(o=>!o.merged).map(o=>RIt.pick(o,["vs","i","barycenter","weight"]))}function OIt(i,e){let t=0,n=0;i.weight&&(t+=i.barycenter*i.weight,n+=i.weight),e.weight&&(t+=e.barycenter*e.weight,n+=e.weight),i.vs=e.vs.concat(i.vs),i.barycenter=t/n,i.weight=n,i.i=Math.min(e.i,i.i),e.merged=!0}let FIt=Ds;var BIt=WIt;function WIt(i,e){let t=FIt.partition(i,d=>d.hasOwnProperty("barycenter")),n=t.lhs,o=t.rhs.sort((d,u)=>u.i-d.i),r=[],s=0,a=0,l=0;n.sort(VIt(!!e)),l=wde(r,o,l),n.forEach(d=>{l+=d.vs.length,r.push(d.vs),s+=d.barycenter*d.weight,a+=d.weight,l=wde(r,o,l)});let c={vs:r.flat(!0)};return a&&(c.barycenter=s/a,c.weight=a),c}function wde(i,e,t){let n;for(;e.length&&(n=e[e.length-1]).i<=t;)e.pop(),i.push(n.vs),t++;return t}function VIt(i){return(e,t)=>e.barycentert.barycenter?1:i?t.i-e.i:e.i-t.i}let HIt=TIt,$It=MIt,zIt=BIt;var UIt=Nxe;function Nxe(i,e,t,n){let o=i.children(e),r=i.node(e),s=r?r.borderLeft:void 0,a=r?r.borderRight:void 0,l={};s&&(o=o.filter(h=>h!==s&&h!==a));let c=HIt(i,o);c.forEach(h=>{if(i.children(h.v).length){let f=Nxe(i,h.v,t,n);l[h.v]=f,f.hasOwnProperty("barycenter")&&KIt(h,f)}});let d=$It(c,t);jIt(d,l);let u=zIt(d,n);if(s&&(u.vs=[s,u.vs,a].flat(!0),i.predecessors(s).length)){let h=i.node(i.predecessors(s)[0]),f=i.node(i.predecessors(a)[0]);u.hasOwnProperty("barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+h.order+f.order)/(u.weight+2),u.weight+=2}return u}function jIt(i,e){i.forEach(t=>{t.vs=t.vs.flatMap(n=>e[n]?e[n].vs:n)})}function KIt(i,e){i.barycenter!==void 0?(i.barycenter=(i.barycenter*i.weight+e.barycenter*e.weight)/(i.weight+e.weight),i.weight+=e.weight):(i.barycenter=e.barycenter,i.weight=e.weight)}let qIt=hh.Graph,GIt=Ds;var XIt=YIt;function YIt(i,e,t){let n=ZIt(i),o=new qIt({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(r=>i.node(r));return i.nodes().forEach(r=>{let s=i.node(r),a=i.parent(r);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(o.setNode(r),o.setParent(r,a||n),i[t](r).forEach(l=>{let c=l.v===r?l.w:l.v,d=o.edge(c,r),u=d!==void 0?d.weight:0;o.setEdge(c,r,{weight:i.edge(l).weight+u})}),s.hasOwnProperty("minRank")&&o.setNode(r,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),o}function ZIt(i){for(var e;i.hasNode(e=GIt.uniqueId("_root")););return e}var QIt=JIt;function JIt(i,e,t){let n={},o;t.forEach(r=>{let s=i.parent(r),a,l;for(;s;){if(a=i.parent(s),a?(l=n[a],n[a]=s):(l=o,o=s),l&&l!==s){e.setEdge(l,s);return}s=a}})}let eTt=xIt,tTt=DIt,nTt=UIt,iTt=XIt,oTt=QIt,rTt=hh.Graph,yR=Ds;var sTt=aTt;function aTt(i){let e=yR.maxRank(i),t=Sde(i,yR.range(1,e+1),"inEdges"),n=Sde(i,yR.range(e-1,-1,-1),"outEdges"),o=eTt(i);xde(i,o);let r=Number.POSITIVE_INFINITY,s;for(let a=0,l=0;l<4;++a,++l){lTt(a%2?t:n,a%4>=2),o=yR.buildLayerMatrix(i);let c=tTt(i,o);cn.node(s).order=a),oTt(n,t,r.vs)})}function xde(i,e){Object.values(e).forEach(t=>t.forEach((n,o)=>i.node(n).order=o))}let cTt=hh.Graph,aI=Ds;var dTt={positionX:fTt,findType1Conflicts:Rxe,findType2Conflicts:Mxe,addConflict:oZ,hasConflict:Axe,verticalAlignment:Pxe,horizontalCompaction:Oxe,alignCoordinates:Bxe,findSmallestWidthAlignment:Fxe,balance:Wxe};function Rxe(i,e){let t={};function n(o,r){let s=0,a=0,l=o.length,c=r[r.length-1];return r.forEach((d,u)=>{let h=uTt(i,d),f=h?i.node(h).order:l;(h||d===c)&&(r.slice(a,u+1).forEach(g=>{i.predecessors(g).forEach(p=>{let v=i.node(p),m=v.order;(m{d=r[u],i.node(d).dummy&&i.predecessors(d).forEach(h=>{let f=i.node(h);f.dummy&&(f.orderc)&&oZ(t,h,d)})})}function o(r,s){let a=-1,l,c=0;return s.forEach((d,u)=>{if(i.node(d).dummy==="border"){let h=i.predecessors(d);h.length&&(l=i.node(h[0]).order,n(s,c,u,a,l),c=u,a=l)}n(s,c,s.length,l,r.length)}),s}return e.reduce(o),t}function uTt(i,e){if(i.node(e).dummy)return i.predecessors(e).find(t=>i.node(t).dummy)}function oZ(i,e,t){if(e>t){let o=e;e=t,t=o}let n=i[e];n||(i[e]=n={}),n[t]=!0}function Axe(i,e,t){if(e>t){let n=e;e=t,t=n}return!!i[e]&&i[e].hasOwnProperty(t)}function Pxe(i,e,t,n){let o={},r={},s={};return e.forEach(a=>{a.forEach((l,c)=>{o[l]=l,r[l]=l,s[l]=c})}),e.forEach(a=>{let l=-1;a.forEach(c=>{let d=n(c);if(d.length){d=d.sort((h,f)=>s[h]-s[f]);let u=(d.length-1)/2;for(let h=Math.floor(u),f=Math.ceil(u);h<=f;++h){let g=d[h];r[c]===c&&lMath.max(h,r[f.v]+s.edge(f)),0)}function d(u){let h=s.outEdges(u).reduce((g,p)=>Math.min(g,r[p.w]-s.edge(p)),Number.POSITIVE_INFINITY),f=i.node(u);h!==Number.POSITIVE_INFINITY&&f.borderType!==a&&(r[u]=Math.max(r[u],h))}return l(c,s.predecessors.bind(s)),l(d,s.successors.bind(s)),Object.keys(n).forEach(u=>r[u]=r[t[u]]),r}function hTt(i,e,t,n){let o=new cTt,r=i.graph(),s=gTt(r.nodesep,r.edgesep,n);return e.forEach(a=>{let l;a.forEach(c=>{let d=t[c];if(o.setNode(d),l){var u=t[l],h=o.edge(u,d);o.setEdge(u,d,Math.max(s(i,c,l),h||0))}l=c})}),o}function Fxe(i,e){return Object.values(e).reduce((t,n)=>{let o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;Object.entries(n).forEach(([a,l])=>{let c=pTt(i,a)/2;o=Math.max(l+c,o),r=Math.min(l-c,r)});const s=o-r;return s{["l","r"].forEach(s=>{let a=r+s,l=i[a];if(l===e)return;let c=Object.values(l),d=n-Math.min(...c);s!=="l"&&(d=o-Math.max(...c)),d&&(i[a]=aI.mapValues(l,u=>u+d))})})}function Wxe(i,e){return aI.mapValues(i.ul,(t,n)=>{if(e)return i[e.toLowerCase()][n];{let o=Object.values(i).map(r=>r[n]).sort((r,s)=>r-s);return(o[1]+o[2])/2}})}function fTt(i){let e=aI.buildLayerMatrix(i),t=Object.assign(Rxe(i,e),Mxe(i,e)),n={},o;["u","d"].forEach(s=>{o=s==="u"?e:Object.values(e).reverse(),["l","r"].forEach(a=>{a==="r"&&(o=o.map(u=>Object.values(u).reverse()));let l=(s==="u"?i.predecessors:i.successors).bind(i),c=Pxe(i,o,t,l),d=Oxe(i,o,c.root,c.align,a==="r");a==="r"&&(d=aI.mapValues(d,u=>-u)),n[s+a]=d})});let r=Fxe(i,n);return Bxe(n,r),Wxe(n,i.graph().align)}function gTt(i,e,t){return(n,o,r)=>{let s=n.node(o),a=n.node(r),l=0,c;if(l+=s.width/2,s.hasOwnProperty("labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=-s.width/2;break;case"r":c=s.width/2;break}if(c&&(l+=t?c:-c),c=0,l+=(s.dummy?e:i)/2,l+=(a.dummy?e:i)/2,l+=a.width/2,a.hasOwnProperty("labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=a.width/2;break;case"r":c=-a.width/2;break}return c&&(l+=t?c:-c),c=0,l}}function pTt(i,e){return i.node(e).width}let Vxe=Ds,mTt=dTt.positionX;var vTt=_Tt;function _Tt(i){i=Vxe.asNonCompoundGraph(i),bTt(i),Object.entries(mTt(i)).forEach(([e,t])=>i.node(e).x=t)}function bTt(i){let e=Vxe.buildLayerMatrix(i),t=i.graph().ranksep,n=0;e.forEach(o=>{const r=o.reduce((s,a)=>{const l=i.node(a).height;return s>l?s:l},0);o.forEach(s=>i.node(s).y=n+r/2),n+=r+t})}let Lde=kkt,Ede=Mkt,CTt=nIt,yTt=Ds.normalizeRanks,wTt=sIt,STt=Ds.removeEmptyRanks,Dde=dIt,xTt=mIt,kde=_It,LTt=sTt,ETt=vTt,Vd=Ds,DTt=hh.Graph;var kTt=ITt;function ITt(i,e){let t=e&&e.debugTiming?Vd.time:Vd.notime;t("layout",()=>{let n=t(" buildLayoutGraph",()=>WTt(i));t(" runLayout",()=>TTt(n,t)),t(" updateInputGraph",()=>NTt(i,n))})}function TTt(i,e){e(" makeSpaceForEdgeLabels",()=>VTt(i)),e(" removeSelfEdges",()=>XTt(i)),e(" acyclic",()=>Lde.run(i)),e(" nestingGraph.run",()=>Dde.run(i)),e(" rank",()=>CTt(Vd.asNonCompoundGraph(i))),e(" injectEdgeLabelProxies",()=>HTt(i)),e(" removeEmptyRanks",()=>STt(i)),e(" nestingGraph.cleanup",()=>Dde.cleanup(i)),e(" normalizeRanks",()=>yTt(i)),e(" assignRankMinMax",()=>$Tt(i)),e(" removeEdgeLabelProxies",()=>zTt(i)),e(" normalize.run",()=>Ede.run(i)),e(" parentDummyChains",()=>wTt(i)),e(" addBorderSegments",()=>xTt(i)),e(" order",()=>LTt(i)),e(" insertSelfEdges",()=>YTt(i)),e(" adjustCoordinateSystem",()=>kde.adjust(i)),e(" position",()=>ETt(i)),e(" positionSelfEdges",()=>ZTt(i)),e(" removeBorderNodes",()=>GTt(i)),e(" normalize.undo",()=>Ede.undo(i)),e(" fixupEdgeLabelCoords",()=>KTt(i)),e(" undoCoordinateSystem",()=>kde.undo(i)),e(" translateGraph",()=>UTt(i)),e(" assignNodeIntersects",()=>jTt(i)),e(" reversePoints",()=>qTt(i)),e(" acyclic.undo",()=>Lde.undo(i))}function NTt(i,e){i.nodes().forEach(t=>{let n=i.node(t),o=e.node(t);n&&(n.x=o.x,n.y=o.y,n.rank=o.rank,e.children(t).length&&(n.width=o.width,n.height=o.height))}),i.edges().forEach(t=>{let n=i.edge(t),o=e.edge(t);n.points=o.points,o.hasOwnProperty("x")&&(n.x=o.x,n.y=o.y)}),i.graph().width=e.graph().width,i.graph().height=e.graph().height}let RTt=["nodesep","edgesep","ranksep","marginx","marginy"],MTt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ATt=["acyclicer","ranker","rankdir","align"],PTt=["width","height"],Ide={width:0,height:0},OTt=["minlen","weight","width","height","labeloffset"],FTt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},BTt=["labelpos"];function WTt(i){let e=new DTt({multigraph:!0,compound:!0}),t=W7(i.graph());return e.setGraph(Object.assign({},MTt,B7(t,RTt),Vd.pick(t,ATt))),i.nodes().forEach(n=>{let o=W7(i.node(n));const r=B7(o,PTt);Object.keys(Ide).forEach(s=>{r[s]===void 0&&(r[s]=Ide[s])}),e.setNode(n,r),e.setParent(n,i.parent(n))}),i.edges().forEach(n=>{let o=W7(i.edge(n));e.setEdge(n,Object.assign({},FTt,B7(o,OTt),Vd.pick(o,BTt)))}),e}function VTt(i){let e=i.graph();e.ranksep/=2,i.edges().forEach(t=>{let n=i.edge(t);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function HTt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.width&&t.height){let n=i.node(e.v),r={rank:(i.node(e.w).rank-n.rank)/2+n.rank,e};Vd.addDummyNode(i,"edge-proxy",r,"_ep")}})}function $Tt(i){let e=0;i.nodes().forEach(t=>{let n=i.node(t);n.borderTop&&(n.minRank=i.node(n.borderTop).rank,n.maxRank=i.node(n.borderBottom).rank,e=Math.max(e,n.maxRank))}),i.graph().maxRank=e}function zTt(i){i.nodes().forEach(e=>{let t=i.node(e);t.dummy==="edge-proxy"&&(i.edge(t.e).labelRank=t.rank,i.removeNode(e))})}function UTt(i){let e=Number.POSITIVE_INFINITY,t=0,n=Number.POSITIVE_INFINITY,o=0,r=i.graph(),s=r.marginx||0,a=r.marginy||0;function l(c){let d=c.x,u=c.y,h=c.width,f=c.height;e=Math.min(e,d-h/2),t=Math.max(t,d+h/2),n=Math.min(n,u-f/2),o=Math.max(o,u+f/2)}i.nodes().forEach(c=>l(i.node(c))),i.edges().forEach(c=>{let d=i.edge(c);d.hasOwnProperty("x")&&l(d)}),e-=s,n-=a,i.nodes().forEach(c=>{let d=i.node(c);d.x-=e,d.y-=n}),i.edges().forEach(c=>{let d=i.edge(c);d.points.forEach(u=>{u.x-=e,u.y-=n}),d.hasOwnProperty("x")&&(d.x-=e),d.hasOwnProperty("y")&&(d.y-=n)}),r.width=t-e+s,r.height=o-n+a}function jTt(i){i.edges().forEach(e=>{let t=i.edge(e),n=i.node(e.v),o=i.node(e.w),r,s;t.points?(r=t.points[0],s=t.points[t.points.length-1]):(t.points=[],r=o,s=n),t.points.unshift(Vd.intersectRect(n,r)),t.points.push(Vd.intersectRect(o,s))})}function KTt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.hasOwnProperty("x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function qTt(i){i.edges().forEach(e=>{let t=i.edge(e);t.reversed&&t.points.reverse()})}function GTt(i){i.nodes().forEach(e=>{if(i.children(e).length){let t=i.node(e),n=i.node(t.borderTop),o=i.node(t.borderBottom),r=i.node(t.borderLeft[t.borderLeft.length-1]),s=i.node(t.borderRight[t.borderRight.length-1]);t.width=Math.abs(s.x-r.x),t.height=Math.abs(o.y-n.y),t.x=r.x+t.width/2,t.y=n.y+t.height/2}}),i.nodes().forEach(e=>{i.node(e).dummy==="border"&&i.removeNode(e)})}function XTt(i){i.edges().forEach(e=>{if(e.v===e.w){var t=i.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:i.edge(e)}),i.removeEdge(e)}})}function YTt(i){var e=Vd.buildLayerMatrix(i);e.forEach(t=>{var n=0;t.forEach((o,r)=>{var s=i.node(o);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Vd.addDummyNode(i,"selfedge",{width:a.label.width,height:a.label.height,rank:s.rank,order:r+ ++n,e:a.e,label:a.label},"_se")}),delete s.selfEdges})})}function ZTt(i){i.nodes().forEach(e=>{var t=i.node(e);if(t.dummy==="selfedge"){var n=i.node(t.e.v),o=n.x+n.width/2,r=n.y,s=t.x-o,a=n.height/2;i.setEdge(t.e,t.label),i.removeNode(e),t.label.points=[{x:o+2*s/3,y:r-a},{x:o+5*s/6,y:r-a},{x:o+s,y:r},{x:o+5*s/6,y:r+a},{x:o+2*s/3,y:r+a}],t.label.x=t.x,t.label.y=t.y}})}function B7(i,e){return Vd.mapValues(Vd.pick(i,e),Number)}function W7(i){var e={};return i&&Object.entries(i).forEach(([t,n])=>{typeof t=="string"&&(t=t.toLowerCase()),e[t]=n}),e}let QTt=Ds,JTt=hh.Graph;var eNt={debugOrdering:tNt};function tNt(i){let e=QTt.buildLayerMatrix(i),t=new JTt({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(n=>{t.setNode(n,{label:n}),t.setParent(n,"layer"+i.node(n).rank)}),i.edges().forEach(n=>t.setEdge(n.v,n.w,{},n.name)),e.forEach((n,o)=>{let r="layer"+o;t.setNode(r,{rank:"same"}),n.reduce((s,a)=>(t.setEdge(s,a,{style:"invis"}),a))}),t}var nNt="1.0.4",Tde={graphlib:hh,layout:kTt,debug:eNt,util:{time:Ds.time,notime:Ds.notime},version:nNt};const iNt="_container_zefjd_1",oNt="_label_zefjd_9",rNt="_content_zefjd_12",sNt="_selected_zefjd_27",aNt="_node__title_zefjd_30";var D_={container:iNt,label:oNt,content:rNt,selected:sNt,node__title:aNt,"node__operator-description":"_node__operator-description_zefjd_35","value-container":"_value-container_zefjd_38"};const lNt="_container_1hwg2_11",cNt="_wrapper_1hwg2_16";var wR={"port-type-container":"_port-type-container_1hwg2_1","port-type-label":"_port-type-label_1hwg2_6",container:lNt,wrapper:cNt,"add-button":"_add-button_1hwg2_19"};function dNt(i){var s,a;const{node:e}=i,t=(s=e==null?void 0:e.data)==null?void 0:s.endPointOptions,{updateNode:n}=n3(),o=fr(e);function r(l){return l.type!=="source"&&l.type!=="target"?fn("div",{children:["unknown type: ",l.type]},l.id):fn("div",{style:{position:"relative"},children:[he("div",{style:{textAlign:l.type==="source"?"right":"left"},children:l.label||l.variableName}),he(dD,{type:l.type,position:l.type==="source"?mn.Right:mn.Left,id:l.id,isConnectable:!0})]},l.id)}return!((a=t==null?void 0:t.endPointList)!=null&&a.length)||!o?null:he("div",{className:wR.container,children:t.endPointList.map(l=>{var c,d;return l.type==="group"?!((c=l.children)!=null&&c.length)&&!l.allowAddAndRemoveChildren?null:fn("div",{children:[fn("div",{className:wR["port-type-container"],children:[he("div",{className:wR["port-type-label"],children:l.label}),(d=l.children)==null?void 0:d.map(u=>r(u))]}),l.allowAddAndRemoveChildren&&he("span",{className:wR["add-button"],onClick:()=>{!(e!=null&&e.id)||n(e==null?void 0:e.id,u=>(l.children=(l.children||[]).concat(ri.createFromGroup(l)),o.updateData(u,{})))},children:"add"})]},l.id):r(l)})})}function uNt(i){var c,d;const e=fr(i),{currentStateRef:t,actionsRef:n}=NT(),{selected:o,data:r}=i,s=(c=e==null?void 0:e.getNodeProps)==null?void 0:c.call(e,i);function a(){var h;if(!(s!=null&&s.showValue))return null;const u=(h=s==null?void 0:s.getBriefValue)==null?void 0:h.call(s);return u?he("div",{className:D_["value-container"],onClick:()=>{var f;u.hasDetail&&Xs.info(((f=s==null?void 0:s.getDetailValue)==null?void 0:f.call(s))||"")},children:u.value}):null}const l=a();return fn("div",{className:Ue(D_.container,{[D_.selected]:o}),style:{"--color-node-theme":(e==null?void 0:e.nodeColor)||void 0},onClick:()=>{e==null||e.onNodeFocus({node:i,currentState:t.current,actions:n.current})},children:[he("div",{className:D_.label,children:(r==null?void 0:r.nodeLabel)||(r==null?void 0:r.operatorName)}),fn("div",{className:D_.content,onDoubleClick:()=>{e==null||e.onNodeDoubleClick({node:i,currentState:t.current,actions:n.current})},children:[fn("div",{className:D_.node__title,children:[(e==null?void 0:e.description)&&he("div",{className:D_["node__operator-description"],children:e==null?void 0:e.description}),l&&he("div",{children:l}),((d=e==null?void 0:e.renderCustomLabel)==null?void 0:d.call(e,i))||null]}),he(dNt,{node:i})]})]},i.id)}const hNt={[oh.Node]:uNt};var fNt={"main-flow":"_main-flow_acc5o_1"};function gNt(){const{operators:i}=JY(),{actionsRef:e,currentStateRef:t}=NT(),[n,o]=el(l=>{const c=wc(l.layer,l.activeLayerId),d=c!=null&&c.parentLayerId?wc(l.layer,c==null?void 0:c.parentLayerId):void 0;return[d==null?void 0:d.id,d==null?void 0:d.name]}),{setActiveLayerId:r,setLayer:s}=n3(),a=el(l=>{var c,d;if(((c=l.layer)==null?void 0:c.id)!==((d=l.defaultLayer)==null?void 0:d.id))return l.defaultLayer});return fn(ks,{children:[a?he(ts,{type:"text",style:{color:"white"},onClick:()=>{zu.exports.flushSync(()=>{s(a),r(a.id)}),setTimeout(()=>{i.forEach(l=>{var c;(c=l.onLayerChange)==null||c.call(l,{currentState:t.current,actions:e.current})})})},children:"Back To Default"}):null,n&&fn(ts,{type:"text",style:{color:"white"},onClick:()=>{r(n)},children:["\u8FD4\u56DE ",o||n]})]})}const pNt=i=>{const e=fr(i);return e!=null&&e.nodeColor?e==null?void 0:e.nodeColor:"#ff0072"},mNt=(i,e)=>{const t=new Tde.graphlib.Graph().setDefaultEdgeLabel(()=>({}));return t.setGraph({rankdir:"LR"}),e.forEach(n=>t.setEdge(n.source,n.target)),i.forEach(n=>t.setNode(n.id,{...n,width:n.width||void 0,height:n.height||void 0})),Tde.layout(t),{nodes:i.map(n=>{const{x:o,y:r}=t.node(n.id);return{...n,position:{x:o,y:r}}}),edges:e}},vNt=()=>{const{nodes:i,edges:e,setNodes:t,setEdges:n}=TT(),{actionsRef:o,currentStateRef:r}=NT(),s=mo(v=>v.addSelectedEdges),a=v=>{console.log("connection",v),n(m=>_fe(v,m).filter(_=>!(FB(_)&&!SFe(_,v)&&wFe(_,v)))),setTimeout(()=>{const m=e.find(_=>{const y=v;return FB(_)&&_.source===y.source&&_.target===y.target&&(_.sourceHandle===y.sourceHandle||!_.sourceHandle&&!y.sourceHandle)&&(_.targetHandle===y.targetHandle||!_.targetHandle&&!y.targetHandle)});s([m].filter(_=>Boolean(_)).map(_=>_.id))})},l=x.exports.useRef(null),c=mo(v=>v.updateNodePositions),d=x.exports.useRef([]);mo(v=>(d.current=v.getNodes(),d));const u=v=>{var _;const m=v.dataTransfer.getData(ej);if(m){const y=Aq(m);if(y){const w=y.create();if(y.isUnique&&i.find(I=>{var k;return((k=I.data)==null?void 0:k.operatorType)===y.operatorType})){Xs.warning(`\u53EA\u5141\u8BB8\u5B58\u5728\u4E00\u4E2A${y.operatorName}`);return}const{clientX:L,clientY:D}=v,E=(_=l.current)==null?void 0:_.getBoundingClientRect();E&&(w.position={x:L-E.left,y:D-E.y}),t(I=>[...I,w]),setTimeout(()=>{var k,R;const I=d.current.find(A=>A.id===w.id);if(I){const A={x:((k=I==null?void 0:I.position)==null?void 0:k.x)-((I==null?void 0:I.width)||0)/2,y:I.position.y-Math.max(((I==null?void 0:I.height)||0)/5,30)};I.position=A,c([I],!1,!1)}t(A=>(A.find(N=>N.id===w.id)&&(w.style={visibility:"visible"}),[...A])),(R=y==null?void 0:y.onAfterCreate)==null||R.call(y,{node:I,currentState:r.current,actions:o.current})})}}},h=v=>{v.dataTransfer.types.includes(ej)&&v.preventDefault()},f=x.exports.useCallback(v=>{t(m=>Wfe(v,m))},[]),g=x.exports.useCallback(v=>{n(m=>R4e(v,m))},[]),p=x.exports.useCallback(()=>{const v=mNt(i,e);t([...v.nodes]),n([...v.edges])},[i,e]);return he("div",{className:fNt["main-flow"],ref:l,onDrop:u,onDragEnter:h,onDragOver:h,children:fn(Qfe,{nodeTypes:hNt,nodes:i,edges:e,onNodesChange:f,onEdgesChange:g,onConnect:a,zoomOnScroll:!1,defaultEdgeOptions:{animated:!0},children:[he(q5e,{variant:kd.Dots,gap:24,color:"rgba(255,255,255,0.4)",size:2}),he(A5e,{nodeColor:pNt,nodeStrokeWidth:3,zoomable:!0,pannable:!0}),he(H5e,{}),he(aD,{position:"top-left",children:he(gNt,{})}),he(aD,{position:"top-right",children:he(ts,{type:"text",style:{color:"white"},onClick:()=>{p()},children:"layout"})})]})})},_Nt=()=>{var d,u;const e=el(h=>h.nodes).filter(h=>h.selected),t=(e==null?void 0:e.length)===1?e[0]:void 0,n=el(h=>h.nodes.find(f=>f.id===(t==null?void 0:t.id))),o=(d=n==null?void 0:n.data)==null?void 0:d.operatorType,r=fr(n),s=!!t&&o,{updateEdge:a,updateNode:l,setLayer:c}=n3();return fn("div",{children:[he("div",{children:"Attributes"}),s&&((u=r==null?void 0:r.generateAttributeControl)==null?void 0:u.call(r,{node:n,actions:{updateEdge:a,updateNode:l,setLayer:c}}))]})},bNt=()=>{var p,v,m;const{store:i,nodes:e,edges:t}=XGe(),[n,o]=x.exports.useState(),r=x.exports.useRef({}),s=new Rq(e,t),a=e.find(_=>{var y;return((y=fr(_))==null?void 0:y.operatorType)==="InputOperator"}),l=a?(p=fr(a))==null?void 0:p.getStatePort(a):[],c=a?(v=fr(a))==null?void 0:v.getEventPorts(a):[],d=e.find(_=>{var y;return((y=fr(_))==null?void 0:y.operatorType)==="OutputOperator"});x.exports.useEffect(()=>{console.log("store ==> ",i),r.current=Object.fromEntries((l==null?void 0:l.map(y=>[y.variableName,new Ou(void 0)]))||[]);const _=i==null?void 0:i(r.current);console.log("init ==> ",_),o(_)},[i]),x.exports.useEffect(()=>{var y;if(!d)return;const _=(y=fr(d))==null?void 0:y.getEventPorts(d);_==null||_.forEach(w=>{var L;(L=n==null?void 0:n.output[w.variableName||""])==null||L.subscribe(D=>{Xs.info(`value: ${D.payload}`),console.log("events",w,D)})})},[n]);const[u,h]=x.exports.useState(""),[,f]=x.exports.useState([]),g=d?(m=fr(d))==null?void 0:m.getStatePort(d).map(_=>{var w,L;const y=(L=(w=s.findSourceNodes(d.id))==null?void 0:w.find(D=>D.handleId===_.id))==null?void 0:L.relatedHandleId;return{port:_,handleId:y}}):[];return x.exports.useEffect(()=>{g==null||g.map(({port:_})=>{var y;return(y=n==null?void 0:n.output)==null?void 0:y[_.variableName||""]}).forEach(_=>{_==null||_.subscribe(y=>{console.log(y),f([])})})},[n]),he("div",{style:{display:"grid",gap:16,gridAutoFlow:"column",justifyContent:"start",marginBottom:16},children:(n==null?void 0:n.output)&&fn(ks,{children:[he("div",{children:he("div",{style:{display:"grid",gap:12},children:fn("div",{style:{display:"grid",gap:12},children:[l==null?void 0:l.map(_=>fn("div",{children:[_.label||_.variableName,":",he(dw,{onChange:y=>{var L,D;const w=y.target.value;console.log("instance",n),(D=(L=r.current)==null?void 0:L[_.variableName||""])==null||D.next(new _v({payload:Number(w),path:_.variableName||""}))}})]},_.id)),fn("div",{children:["Event Value:",he(dw,{value:u,onChange:_=>{h(_.target.value)},size:"small",placeholder:"\u53D1\u9001\u4E8B\u4EF6\u7684\u53C2\u6570\uFF08\u8BF7\u586B\u5199 JSON\uFF09"})]}),c==null?void 0:c.map(_=>he(ts,{onClick:()=>{var y,w;(w=(y=n==null?void 0:n.output)==null?void 0:y[_.variableName||""])==null||w.next(new _v({payload:JSON.parse(u),path:_.variableName||""}))},children:_.label||_.variableName},_.id))]})})}),fn("div",{children:[he("div",{children:"Output"}),g==null?void 0:g.map(({port:_})=>{var y,w;return he("div",{children:he(wD.Item,{label:_.label||_.variableName,children:JSON.stringify((w=(y=n==null?void 0:n.output)==null?void 0:y[_.variableName||""])==null?void 0:w.current)})},_.id)})]})]})})},CNt="_editor_h950f_1";var yNt={editor:CNt};const wNt=()=>{const{layer:i}=FEt(),[e,t]=x.exports.useState(""),[n,o]=x.exports.useState(""),[r,s]=x.exports.useState({layer:i}),[a,l]=x.exports.useState(!1);return fn("div",{children:[he("div",{children:"Console"}),he("br",{}),fn("div",{style:{display:"grid",gap:16,gridAutoFlow:"column",justifyContent:"start"},children:[he(ts,{type:"link",onClick:()=>{console.log(new Rq(i.nodes,i.edges)),console.log({layer:i})},children:"Console Graph"}),he(ts,{type:"link",onClick:()=>{const c=new Jie;t(c.complie({layer:i}))},children:"Compile"}),he(ts,{type:"link",onClick:()=>{const d=new Jie().complie({layer:i});s(Cc.exports.cloneDeep({layer:i})),t(d),o(d)},children:"Compile and Run"}),he(ts,{type:"link",disabled:!e,onClick:()=>{l(!0)},children:"Show Output"})]}),fn("div",{children:[he("br",{}),he(ZGe,{value:n,nodes:r.layer.nodes,edges:r.layer.edges,children:he(bNt,{})})]}),he(Lq,{open:a,width:"100vw",style:{top:0},onOk:()=>{l(!1)},onCancel:()=>{l(!1)},children:he(oxe,{language:"typescript",readonly:!0,className:yNt.editor,code:e})})]})},SNt="_container_1hju3_1",xNt="_main_1hju3_10",LNt="_console_1hju3_13";var Nde={container:SNt,main:xNt,console:LNt};const ENt=()=>he("div",{className:Nde.container,children:he(VEt,{children:fn(WEt,{children:[he(lDt,{}),he(vNt,{}),he(_Nt,{}),he("div",{className:Nde.console,children:he(wNt,{})})]})})});function DNt(){return he(ks,{children:he(ENt,{})})}iK.render(he(Bt.StrictMode,{children:he(DNt,{})}),document.getElementById("root"));export{gT as m,xye as t}; +}`,nodeLabel:"Plus 1"},dragging:!1,width:118,height:136,selected:!0,positionAbsolute:{x:784,y:532}}],edges:[{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_b821e643-ec8e-4422-89a4-dbd1703a1966",targetHandle:"b85cf0aa-c815-46e5-9c82-2991ee90bde5",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_b821e643-ec8e-4422-89a4-dbd1703a1966b85cf0aa-c815-46e5-9c82-2991ee90bde5"},{animated:!0,source:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",sourceHandle:"73b965fd-7fd6-4c4c-ac31-916ab3130ab3",target:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",targetHandle:"1e005bc7-6141-458a-a28a-14e2009ee1e7",id:"reactflow__edge-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f73b965fd-7fd6-4c4c-ac31-916ab3130ab3-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f1e005bc7-6141-458a-a28a-14e2009ee1e7"},{animated:!0,source:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",sourceHandle:"5bebcd05-9d98-42e9-9679-fa5cc14bc24f",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"b63e542a-214b-4918-9388-778413d921e3",id:"reactflow__edge-$flow_17f541a4-f480-45c5-a6bd-ab654945e5125bebcd05-9d98-42e9-9679-fa5cc14bc24f-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582fb63e542a-214b-4918-9388-778413d921e3"},{animated:!0,source:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",sourceHandle:"8327475f-80bc-41e4-84d5-595861bb03ad",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"8dd0dad0-0135-487d-9417-a05d5130e188",id:"reactflow__edge-$flow_17f541a4-f480-45c5-a6bd-ab654945e5128327475f-80bc-41e4-84d5-595861bb03ad-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f8dd0dad0-0135-487d-9417-a05d5130e188"},{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",targetHandle:"05b3e305-15eb-4c9f-a092-f6d8e4181236",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f19205b3e305-15eb-4c9f-a092-f6d8e4181236"},{animated:!0,source:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",sourceHandle:"5e602cc8-1454-474f-8c75-0747f7a8c19b",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"c29b921d-acd8-4d73-9b7e-c0dbd19318c8",id:"reactflow__edge-$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d5e602cc8-1454-474f-8c75-0747f7a8c19b-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582fc29b921d-acd8-4d73-9b7e-c0dbd19318c8"},{animated:!0,source:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",sourceHandle:"ce9317fd-de38-44d0-8082-87428483a6ff",target:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",targetHandle:"ee0cc676-e56b-4e1f-b075-2684dc50a33d",id:"reactflow__edge-$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192ce9317fd-de38-44d0-8082-87428483a6ff-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6ee0cc676-e56b-4e1f-b075-2684dc50a33d"},{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",targetHandle:"a273cc22-9082-4ab4-a592-7df312deb4f7",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6a273cc22-9082-4ab4-a592-7df312deb4f7"},{animated:!0,source:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",sourceHandle:"2ce6eb2b-657e-4da2-b157-618523490b8b",target:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",targetHandle:"fb957bad-04d7-485b-bc97-b31dbf1c191b",id:"reactflow__edge-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e62ce6eb2b-657e-4da2-b157-618523490b8b-$flow_7c4ec381-82eb-418e-b299-feb1cd7c107dfb957bad-04d7-485b-bc97-b31dbf1c191b"}]},A7={id:"ffcec994-0f74-4f54-aeb7-438885dbcc72",name:"App",children:[],nodes:[{position:{x:644,y:102},id:"$flow_d59e81da-225c-40d2-9103-ee3e129514fa",type:"Node",data:{operatorName:"Output",operatorType:"OutputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"20d9f812-f682-4b09-a201-7711882af890",type:"group",variableName:"state_rpxcg",label:"State",hint:"state",children:[{id:"4dc98fc8-57b9-4c30-8425-d33e602810cd",type:"target",variableName:"state_k9vor",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"}},{id:"abbf9ce7-b6a2-4d08-8a5c-90a76d044964",type:"group",variableName:"event_u8t6g",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"}}]}},width:118,height:148,dragging:!1},{position:{x:413,y:81},id:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",type:"Node",data:{operatorName:"Sum",operatorType:"SumOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5d36decd-40e9-4f0f-b919-4af7a33bb481",type:"source",variableName:"output_7c53x",label:"output",hint:"output"},{id:"98aa0131-1975-4cb0-9c35-46280f69a014",type:"group",variableName:"input_3wldr",hint:"input",children:[{id:"90c2a56d-c4df-4430-a4e2-cfcdb6cac3b3",type:"target",variableName:"input_zkw5x",label:"input",hint:"input"},{id:"f85709d5-0f20-4ab8-a719-03e4130d8ec3",type:"target",variableName:"input_tntx3",label:"input",hint:"input"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",label:"input",hint:"input"}}]}},width:118,height:136,dragging:!1,selected:!1,positionAbsolute:{x:413,y:81}},{position:{x:130,y:65},id:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",type:"Node",data:{operatorName:"Input",operatorType:"InputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"4b6c72b1-30a9-42c8-b5df-3e37d3acc958",type:"group",variableName:"state_pq4d3",label:"State",hint:"state",children:[{id:"1ba05470-5941-4e80-9c49-11c4bc2542fd",type:"source",variableName:"state_1naae",hint:"state"},{id:"371ff3fd-e734-48d6-a05e-371ab850313a",type:"source",variableName:"state_4lmjx",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"}},{id:"8827904c-48b0-4409-9489-1a73fcb99a64",type:"group",variableName:"event_dlev2",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"}},{id:"e0c20603-88e0-4130-a583-f7cde637dff8",type:"group",variableName:"lifecycle_l5z4n",label:"Lifecycle",hint:"lifecycle",children:[{id:"bdb74a8d-d29a-4a62-8d20-ad3a1dad8450",type:"source",variableName:"beforeMount"},{id:"82a9bb07-5619-4717-8618-a8c8cc03959a",type:"source",variableName:"mount"},{id:"d8525b49-242b-4572-8bd7-399bec64b338",type:"source",variableName:"beforeUnmount"},{id:"b6d06207-e8ea-47f8-af2c-fe2c60a328de",type:"source",variableName:"unmount"}],allowAddAndRemoveChildren:!1}]}},width:118,height:248,dragging:!1,selected:!1,positionAbsolute:{x:130,y:65}}],edges:[{animated:!0,source:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",sourceHandle:"1ba05470-5941-4e80-9c49-11c4bc2542fd",target:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",targetHandle:"90c2a56d-c4df-4430-a4e2-cfcdb6cac3b3",id:"reactflow__edge-$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed1ba05470-5941-4e80-9c49-11c4bc2542fd-$flow_ba963a6d-a83c-4609-830f-48ef8d51740290c2a56d-c4df-4430-a4e2-cfcdb6cac3b3"},{animated:!0,source:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",sourceHandle:"371ff3fd-e734-48d6-a05e-371ab850313a",target:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",targetHandle:"f85709d5-0f20-4ab8-a719-03e4130d8ec3",id:"reactflow__edge-$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed371ff3fd-e734-48d6-a05e-371ab850313a-$flow_ba963a6d-a83c-4609-830f-48ef8d517402f85709d5-0f20-4ab8-a719-03e4130d8ec3"},{animated:!0,source:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",sourceHandle:"5d36decd-40e9-4f0f-b919-4af7a33bb481",target:"$flow_d59e81da-225c-40d2-9103-ee3e129514fa",targetHandle:"4dc98fc8-57b9-4c30-8425-d33e602810cd",id:"reactflow__edge-$flow_ba963a6d-a83c-4609-830f-48ef8d5174025d36decd-40e9-4f0f-b919-4af7a33bb481-$flow_d59e81da-225c-40d2-9103-ee3e129514fa4dc98fc8-57b9-4c30-8425-d33e602810cd"}]},cxe="layer_storage";function rDt(i){localStorage.setItem(cxe,JSON.stringify(i))}function sDt(){return JSON.parse(localStorage.getItem(cxe)||"")}function aDt(){const{layer:i,setLayer:e,setActiveLayerId:t,setDefaultLayer:n}=TT(),{actionsRef:o,currentStateRef:r}=NT(),{operators:s,refreshOperators:a}=eZ();async function l(){try{if(i.parentLayerId){const c=wc(i,i.parentLayerId),d=c==null?void 0:c.nodes.find(u=>u.id===i.relativeNodeId);if(d){const u=fr(d);u==null||u.refreshNode({node:d,actions:o.current,currentState:r.current})}}await xFe(200),rDt({layer:r.current.layer,customOperators:s.filter(c=>c.isCustom)}),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}}return fn("div",{style:{display:"grid",gridAutoFlow:"row",gap:4},children:[he(ts,{type:"text",onClick:()=>{l()},children:"Save"}),he(ts,{type:"text",onClick:()=>{try{const c=sDt(),d=c.layer;e(d),n(d),t(d.id);const u=c.customOperators.map(h=>{const f=new axe(h.operatorName);return Object.assign(f,h),f});Aq(u),a(),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Load"}),he(ts,{type:"text",onClick:()=>{try{const c=new xI("App");e(c),n(c),t(c.id),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Reset"}),he(ts,{type:"text",onClick:()=>{console.log(i)},children:"Log"}),he(ts,{type:"text",onClick:()=>{try{e(M7),n(M7),t(M7.id),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Load Loop Demo"}),he(ts,{type:"text",onClick:()=>{try{e(A7),n(A7),t(A7.id),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Load Sum Demo"})]})}const lDt="_container_1n7r9_1";var cDt={container:lDt};function dDt(){return he("div",{className:cDt.container,children:he(dje,{size:"small",tabPosition:"left",items:[{label:he(eDt,{rev:""}),key:"Operators",children:he(iDt,{})},{label:he(YEt,{rev:""}),key:"Layers",children:he(oDt,{})},{label:he(KEt,{rev:""}),key:"commands",children:he(aDt,{})}]})})}var uDt="\0",E_="\0",hde="",Il,y0,_c,lI,Ky,qy,gd,Eh,gm,Dh,pm,bg,Cg,Gy,Xy,yg,fu,cI,nj;class hDt{constructor(e){Oo(this,cI);Oo(this,Il,!0);Oo(this,y0,!1);Oo(this,_c,!1);Oo(this,lI,void 0);Oo(this,Ky,()=>{});Oo(this,qy,()=>{});Oo(this,gd,{});Oo(this,Eh,{});Oo(this,gm,{});Oo(this,Dh,{});Oo(this,pm,{});Oo(this,bg,{});Oo(this,Cg,{});Oo(this,Gy,0);Oo(this,Xy,0);Oo(this,yg,void 0);Oo(this,fu,void 0);e&&(ad(this,Il,e.hasOwnProperty("directed")?e.directed:!0),ad(this,y0,e.hasOwnProperty("multigraph")?e.multigraph:!1),ad(this,_c,e.hasOwnProperty("compound")?e.compound:!1)),ht(this,_c)&&(ad(this,yg,{}),ad(this,fu,{}),ht(this,fu)[E_]={})}isDirected(){return ht(this,Il)}isMultigraph(){return ht(this,y0)}isCompound(){return ht(this,_c)}setGraph(e){return ad(this,lI,e),this}graph(){return ht(this,lI)}setDefaultNodeLabel(e){return ad(this,Ky,e),typeof e!="function"&&ad(this,Ky,()=>e),this}nodeCount(){return ht(this,Gy)}nodes(){return Object.keys(ht(this,gd))}sources(){var e=this;return this.nodes().filter(t=>Object.keys(ht(e,Eh)[t]).length===0)}sinks(){var e=this;return this.nodes().filter(t=>Object.keys(ht(e,Dh)[t]).length===0)}setNodes(e,t){var n=arguments,o=this;return e.forEach(function(r){n.length>1?o.setNode(r,t):o.setNode(r)}),this}setNode(e,t){return ht(this,gd).hasOwnProperty(e)?(arguments.length>1&&(ht(this,gd)[e]=t),this):(ht(this,gd)[e]=arguments.length>1?t:ht(this,Ky).call(this,e),ht(this,_c)&&(ht(this,yg)[e]=E_,ht(this,fu)[e]={},ht(this,fu)[E_][e]=!0),ht(this,Eh)[e]={},ht(this,gm)[e]={},ht(this,Dh)[e]={},ht(this,pm)[e]={},++ox(this,Gy)._,this)}node(e){return ht(this,gd)[e]}hasNode(e){return ht(this,gd).hasOwnProperty(e)}removeNode(e){var t=this;if(ht(this,gd).hasOwnProperty(e)){var n=o=>t.removeEdge(ht(t,bg)[o]);delete ht(this,gd)[e],ht(this,_c)&&(mh(this,cI,nj).call(this,e),delete ht(this,yg)[e],this.children(e).forEach(function(o){t.setParent(o)}),delete ht(this,fu)[e]),Object.keys(ht(this,Eh)[e]).forEach(n),delete ht(this,Eh)[e],delete ht(this,gm)[e],Object.keys(ht(this,Dh)[e]).forEach(n),delete ht(this,Dh)[e],delete ht(this,pm)[e],--ox(this,Gy)._}return this}setParent(e,t){if(!ht(this,_c))throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t=E_;else{t+="";for(var n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),mh(this,cI,nj).call(this,e),ht(this,yg)[e]=t,ht(this,fu)[t][e]=!0,this}parent(e){if(ht(this,_c)){var t=ht(this,yg)[e];if(t!==E_)return t}}children(e=E_){if(ht(this,_c)){var t=ht(this,fu)[e];if(t)return Object.keys(t)}else{if(e===E_)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=ht(this,gm)[e];if(t)return Object.keys(t)}successors(e){var t=ht(this,pm)[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const o=new Set(t);for(var n of this.successors(e))o.add(n);return Array.from(o.values())}}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:ht(this,Il),multigraph:ht(this,y0),compound:ht(this,_c)});t.setGraph(this.graph());var n=this;Object.entries(ht(this,gd)).forEach(function([s,a]){e(s)&&t.setNode(s,a)}),Object.values(ht(this,bg)).forEach(function(s){t.hasNode(s.v)&&t.hasNode(s.w)&&t.setEdge(s,n.edge(s))});var o={};function r(s){var a=n.parent(s);return a===void 0||t.hasNode(a)?(o[s]=a,a):a in o?o[a]:r(a)}return ht(this,_c)&&t.nodes().forEach(s=>t.setParent(s,r(s))),t}setDefaultEdgeLabel(e){return ad(this,qy,e),typeof e!="function"&&ad(this,qy,()=>e),this}edgeCount(){return ht(this,Xy)}edges(){return Object.values(ht(this,bg))}setPath(e,t){var n=this,o=arguments;return e.reduce(function(r,s){return o.length>1?n.setEdge(r,s,t):n.setEdge(r,s),s}),this}setEdge(){var e,t,n,o,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,t=s.w,n=s.name,arguments.length===2&&(o=arguments[1],r=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],r=!0)),e=""+e,t=""+t,n!==void 0&&(n=""+n);var a=HL(ht(this,Il),e,t,n);if(ht(this,Cg).hasOwnProperty(a))return r&&(ht(this,Cg)[a]=o),this;if(n!==void 0&&!ht(this,y0))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),ht(this,Cg)[a]=r?o:ht(this,qy).call(this,e,t,n);var l=fDt(ht(this,Il),e,t,n);return e=l.v,t=l.w,Object.freeze(l),ht(this,bg)[a]=l,fde(ht(this,gm)[t],e),fde(ht(this,pm)[e],t),ht(this,Eh)[t][a]=l,ht(this,Dh)[e][a]=l,ox(this,Xy)._++,this}edge(e,t,n){var o=arguments.length===1?P7(ht(this,Il),arguments[0]):HL(ht(this,Il),e,t,n);return ht(this,Cg)[o]}edgeAsObj(){const e=this.edge(...arguments);return typeof e!="object"?{label:e}:e}hasEdge(e,t,n){var o=arguments.length===1?P7(ht(this,Il),arguments[0]):HL(ht(this,Il),e,t,n);return ht(this,Cg).hasOwnProperty(o)}removeEdge(e,t,n){var o=arguments.length===1?P7(ht(this,Il),arguments[0]):HL(ht(this,Il),e,t,n),r=ht(this,bg)[o];return r&&(e=r.v,t=r.w,delete ht(this,Cg)[o],delete ht(this,bg)[o],gde(ht(this,gm)[t],e),gde(ht(this,pm)[e],t),delete ht(this,Eh)[t][o],delete ht(this,Dh)[e][o],ox(this,Xy)._--),this}inEdges(e,t){var n=ht(this,Eh)[e];if(n){var o=Object.values(n);return t?o.filter(r=>r.v===t):o}}outEdges(e,t){var n=ht(this,Dh)[e];if(n){var o=Object.values(n);return t?o.filter(r=>r.w===t):o}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}Il=new WeakMap,y0=new WeakMap,_c=new WeakMap,lI=new WeakMap,Ky=new WeakMap,qy=new WeakMap,gd=new WeakMap,Eh=new WeakMap,gm=new WeakMap,Dh=new WeakMap,pm=new WeakMap,bg=new WeakMap,Cg=new WeakMap,Gy=new WeakMap,Xy=new WeakMap,yg=new WeakMap,fu=new WeakMap,cI=new WeakSet,nj=function(e){delete ht(this,fu)[ht(this,yg)[e]][e]};function fde(i,e){i[e]?i[e]++:i[e]=1}function gde(i,e){--i[e]||delete i[e]}function HL(i,e,t,n){var o=""+e,r=""+t;if(!i&&o>r){var s=o;o=r,r=s}return o+hde+r+hde+(n===void 0?uDt:n)}function fDt(i,e,t,n){var o=""+e,r=""+t;if(!i&&o>r){var s=o;o=r,r=s}var a={v:o,w:r};return n&&(a.name=n),a}function P7(i,e){return HL(i,e.v,e.w,e.name)}var tZ=hDt,gDt="2.1.13",pDt={Graph:tZ,version:gDt},mDt=tZ,vDt={write:_Dt,read:yDt};function _Dt(i){var e={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:bDt(i),edges:CDt(i)};return i.graph()!==void 0&&(e.value=structuredClone(i.graph())),e}function bDt(i){return i.nodes().map(function(e){var t=i.node(e),n=i.parent(e),o={v:e};return t!==void 0&&(o.value=t),n!==void 0&&(o.parent=n),o})}function CDt(i){return i.edges().map(function(e){var t=i.edge(e),n={v:e.v,w:e.w};return e.name!==void 0&&(n.name=e.name),t!==void 0&&(n.value=t),n})}function yDt(i){var e=new mDt(i.options).setGraph(i.value);return i.nodes.forEach(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),i.edges.forEach(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var wDt=SDt;function SDt(i){var e={},t=[],n;function o(r){e.hasOwnProperty(r)||(e[r]=!0,n.push(r),i.successors(r).forEach(o),i.predecessors(r).forEach(o))}return i.nodes().forEach(function(r){n=[],o(r),n.length&&t.push(n)}),t}var La,wg,dI,ij,uI,oj,Yy,OM;class xDt{constructor(){Oo(this,dI);Oo(this,uI);Oo(this,Yy);Oo(this,La,[]);Oo(this,wg,{})}size(){return ht(this,La).length}keys(){return ht(this,La).map(function(e){return e.key})}has(e){return ht(this,wg).hasOwnProperty(e)}priority(e){var t=ht(this,wg)[e];if(t!==void 0)return ht(this,La)[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return ht(this,La)[0].key}add(e,t){var n=ht(this,wg);if(e=String(e),!n.hasOwnProperty(e)){var o=ht(this,La),r=o.length;return n[e]=r,o.push({key:e,priority:t}),mh(this,uI,oj).call(this,r),!0}return!1}removeMin(){mh(this,Yy,OM).call(this,0,ht(this,La).length-1);var e=ht(this,La).pop();return delete ht(this,wg)[e.key],mh(this,dI,ij).call(this,0),e.key}decrease(e,t){var n=ht(this,wg)[e];if(t>ht(this,La)[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+ht(this,La)[n].priority+" New: "+t);ht(this,La)[n].priority=t,mh(this,uI,oj).call(this,n)}}La=new WeakMap,wg=new WeakMap,dI=new WeakSet,ij=function(e){var t=ht(this,La),n=2*e,o=n+1,r=e;n>1,!(t[o].priority1;function DDt(i,e,t,n){return kDt(i,String(e),t||EDt,n||function(o){return i.outEdges(o)})}function kDt(i,e,t,n){var o={},r=new LDt,s,a,l=function(c){var d=c.v!==s?c.v:c.w,u=o[d],h=t(c),f=a.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+h);f0&&(s=r.removeMin(),a=o[s],a.distance!==Number.POSITIVE_INFINITY);)n(s).forEach(l);return o}var IDt=uxe,TDt=NDt;function NDt(i,e,t){return i.nodes().reduce(function(n,o){return n[o]=IDt(i,o,e,t),n},{})}var hxe=RDt;function RDt(i){var e=0,t=[],n={},o=[];function r(s){var a=n[s]={onStack:!0,lowlink:e,index:e++};if(t.push(s),i.successors(s).forEach(function(d){n.hasOwnProperty(d)?n[d].onStack&&(a.lowlink=Math.min(a.lowlink,n[d].index)):(r(d),a.lowlink=Math.min(a.lowlink,n[d].lowlink))}),a.lowlink===a.index){var l=[],c;do c=t.pop(),n[c].onStack=!1,l.push(c);while(s!==c);o.push(l)}}return i.nodes().forEach(function(s){n.hasOwnProperty(s)||r(s)}),o}var MDt=hxe,ADt=PDt;function PDt(i){return MDt(i).filter(function(e){return e.length>1||e.length===1&&i.hasEdge(e[0],e[0])})}var ODt=BDt,FDt=()=>1;function BDt(i,e,t){return WDt(i,e||FDt,t||function(n){return i.outEdges(n)})}function WDt(i,e,t){var n={},o=i.nodes();return o.forEach(function(r){n[r]={},n[r][r]={distance:0},o.forEach(function(s){r!==s&&(n[r][s]={distance:Number.POSITIVE_INFINITY})}),t(r).forEach(function(s){var a=s.v===r?s.w:s.v,l=e(s);n[r][a]={distance:l,predecessor:r}})}),o.forEach(function(r){var s=n[r];o.forEach(function(a){var l=n[a];o.forEach(function(c){var d=l[r],u=s[c],h=l[c],f=d.distance+u.distance;fi.successors(a):a=>i.neighbors(a),o=t==="post"?zDt:UDt,r=[],s={};return e.forEach(a=>{if(!i.hasNode(a))throw new Error("Graph does not have node: "+a);o(a,n,s,r)}),r}function zDt(i,e,t,n){for(var o=[[i,!1]];o.length>0;){var r=o.pop();r[1]?n.push(r[0]):t.hasOwnProperty(r[0])||(t[r[0]]=!0,o.push([r[0],!0]),mxe(e(r[0]),s=>o.push([s,!1])))}}function UDt(i,e,t,n){for(var o=[i];o.length>0;){var r=o.pop();t.hasOwnProperty(r)||(t[r]=!0,n.push(r),mxe(e(r),s=>o.push(s)))}}function mxe(i,e){for(var t=i.length;t--;)e(i[t],t,i);return i}var jDt=pxe,KDt=qDt;function qDt(i,e){return jDt(i,e,"post")}var GDt=pxe,XDt=YDt;function YDt(i,e){return GDt(i,e,"pre")}var ZDt=tZ,QDt=dxe,JDt=ekt;function ekt(i,e){var t=new ZDt,n={},o=new QDt,r;function s(l){var c=l.v===r?l.w:l.v,d=o.priority(c);if(d!==void 0){var u=e(l);u0;){if(r=o.removeMin(),n.hasOwnProperty(r))t.setEdge(r,n[r]);else{if(a)throw new Error("Input graph is not connected: "+i);a=!0}i.nodeEdges(r).forEach(s)}return t}var tkt={components:wDt,dijkstra:uxe,dijkstraAll:TDt,findCycles:ADt,floydWarshall:ODt,isAcyclic:VDt,postorder:KDt,preorder:XDt,prim:JDt,tarjan:hxe,topsort:gxe},mde=pDt,hh={Graph:mde.Graph,json:vDt,alg:tkt,version:mde.version};class nkt{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return vde(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&vde(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,ikt)),n=n._prev;return"["+e.join(", ")+"]"}}function vde(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function ikt(i,e){if(i!=="_next"&&i!=="_prev")return e}var okt=nkt;let rkt=hh.Graph,skt=okt;var akt=ckt;let lkt=()=>1;function ckt(i,e){if(i.nodeCount()<=1)return[];let t=ukt(i,e||lkt);return dkt(t.graph,t.buckets,t.zeroIdx).flatMap(o=>i.outEdges(o.v,o.w))}function dkt(i,e,t){let n=[],o=e[e.length-1],r=e[0],s;for(;i.nodeCount();){for(;s=r.dequeue();)O7(i,e,t,s);for(;s=o.dequeue();)O7(i,e,t,s);if(i.nodeCount()){for(let a=e.length-2;a>0;--a)if(s=e[a].dequeue(),s){n=n.concat(O7(i,e,t,s,!0));break}}}return n}function O7(i,e,t,n,o){let r=o?[]:void 0;return i.inEdges(n.v).forEach(s=>{let a=i.edge(s),l=i.node(s.v);o&&r.push({v:s.v,w:s.w}),l.out-=a,sj(e,t,l)}),i.outEdges(n.v).forEach(s=>{let a=i.edge(s),l=s.w,c=i.node(l);c.in-=a,sj(e,t,c)}),i.removeNode(n.v),r}function ukt(i,e){let t=new rkt,n=0,o=0;i.nodes().forEach(a=>{t.setNode(a,{v:a,in:0,out:0})}),i.edges().forEach(a=>{let l=t.edge(a.v,a.w)||0,c=e(a),d=l+c;t.setEdge(a.v,a.w,d),o=Math.max(o,t.node(a.v).out+=c),n=Math.max(n,t.node(a.w).in+=c)});let r=hkt(o+n+3).map(()=>new skt),s=n+1;return t.nodes().forEach(a=>{sj(r,s,t.node(a))}),{graph:t,buckets:r,zeroIdx:s}}function sj(i,e,t){t.out?t.in?i[t.out-t.in+e].enqueue(t):i[i.length-1].enqueue(t):i[0].enqueue(t)}function hkt(i){const e=[];for(let t=0;te.setNode(t,i.node(t))),i.edges().forEach(t=>{let n=e.edge(t.v,t.w)||{weight:0,minlen:1},o=i.edge(t);e.setEdge(t.v,t.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),e}function gkt(i){let e=new vxe({multigraph:i.isMultigraph()}).setGraph(i.graph());return i.nodes().forEach(t=>{i.children(t).length||e.setNode(t,i.node(t))}),i.edges().forEach(t=>{e.setEdge(t,i.edge(t))}),e}function pkt(i){let e=i.nodes().map(t=>{let n={};return i.outEdges(t).forEach(o=>{n[o.w]=(n[o.w]||0)+i.edge(o).weight}),n});return nZ(i.nodes(),e)}function mkt(i){let e=i.nodes().map(t=>{let n={};return i.inEdges(t).forEach(o=>{n[o.v]=(n[o.v]||0)+i.edge(o).weight}),n});return nZ(i.nodes(),e)}function vkt(i,e){let t=i.x,n=i.y,o=e.x-t,r=e.y-n,s=i.width/2,a=i.height/2;if(!o&&!r)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(r)*s>Math.abs(o)*a?(r<0&&(a=-a),l=a*o/r,c=a):(o<0&&(s=-s),l=s,c=s*r/o),{x:t+l,y:n+c}}function _kt(i){let e=yxe(bxe(i)+1).map(()=>[]);return i.nodes().forEach(t=>{let n=i.node(t),o=n.rank;o!==void 0&&(e[o][n.order]=t)}),e}function bkt(i){let e=Math.min(...i.nodes().map(t=>{let n=i.node(t).rank;return n===void 0?Number.MAX_VALUE:n}));i.nodes().forEach(t=>{let n=i.node(t);n.hasOwnProperty("rank")&&(n.rank-=e)})}function Ckt(i){let e=Math.min(...i.nodes().map(r=>i.node(r).rank)),t=[];i.nodes().forEach(r=>{let s=i.node(r).rank-e;t[s]||(t[s]=[]),t[s].push(r)});let n=0,o=i.graph().nodeRankFactor;Array.from(t).forEach((r,s)=>{r===void 0&&s%o!==0?--n:r!==void 0&&n&&r.forEach(a=>i.node(a).rank+=n)})}function ykt(i,e,t,n){let o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=n),_xe(i,"border",o,e)}function bxe(i){return Math.max(...i.nodes().map(e=>{let t=i.node(e).rank;return t===void 0?Number.MIN_VALUE:t}))}function wkt(i,e){let t={lhs:[],rhs:[]};return i.forEach(n=>{e(n)?t.lhs.push(n):t.rhs.push(n)}),t}function Skt(i,e){let t=Date.now();try{return e()}finally{console.log(i+" time: "+(Date.now()-t)+"ms")}}function xkt(i,e){return e()}let Lkt=0;function Cxe(i){var e=++Lkt;return toString(i)+e}function yxe(i,e,t=1){e==null&&(e=i,i=0);let n=r=>ren[e]),Object.entries(i).reduce((n,[o,r])=>(n[o]=t(r,o),n),{})}function nZ(i,e){return i.reduce((t,n,o)=>(t[n]=e[o],t),{})}let kkt=akt,Ikt=Ds.uniqueId;var Tkt={run:Nkt,undo:Mkt};function Nkt(i){(i.graph().acyclicer==="greedy"?kkt(i,t(i)):Rkt(i)).forEach(n=>{let o=i.edge(n);i.removeEdge(n),o.forwardName=n.name,o.reversed=!0,i.setEdge(n.w,n.v,o,Ikt("rev"))});function t(n){return o=>n.edge(o).weight}}function Rkt(i){let e=[],t={},n={};function o(r){n.hasOwnProperty(r)||(n[r]=!0,t[r]=!0,i.outEdges(r).forEach(s=>{t.hasOwnProperty(s.w)?e.push(s):o(s.w)}),delete t[r])}return i.nodes().forEach(o),e}function Mkt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.reversed){i.removeEdge(e);let n=t.forwardName;delete t.reversed,delete t.forwardName,i.setEdge(e.w,e.v,t,n)}})}let Akt=Ds;var Pkt={run:Okt,undo:Bkt};function Okt(i){i.graph().dummyChains=[],i.edges().forEach(e=>Fkt(i,e))}function Fkt(i,e){let t=e.v,n=i.node(t).rank,o=e.w,r=i.node(o).rank,s=e.name,a=i.edge(e),l=a.labelRank;if(r===n+1)return;i.removeEdge(e);let c,d,u;for(u=0,++n;n{let t=i.node(e),n=t.edgeLabel,o;for(i.setEdge(t.edgeObj,n);t.dummy;)o=i.successors(e)[0],i.removeNode(e),n.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(n.x=t.x,n.y=t.y,n.width=t.width,n.height=t.height),e=o,t=i.node(e)})}var o3={longestPath:Wkt,slack:Vkt};function Wkt(i){var e={};function t(n){var o=i.node(n);if(e.hasOwnProperty(n))return o.rank;e[n]=!0;var r=Math.min(...i.outEdges(n).map(s=>s==null?Number.POSITIVE_INFINITY:t(s.w)-i.edge(s).minlen));return r===Number.POSITIVE_INFINITY&&(r=0),o.rank=r}i.sources().forEach(t)}function Vkt(i,e){return i.node(e.w).rank-i.node(e.v).rank-i.edge(e).minlen}var Hkt=hh.Graph,BO=o3.slack,wxe=$kt;function $kt(i){var e=new Hkt({directed:!1}),t=i.nodes()[0],n=i.nodeCount();e.setNode(t,{});for(var o,r;zkt(e,i){var r=o.v,s=n===r?o.w:r;!i.hasNode(s)&&!BO(e,o)&&(i.setNode(s,{}),i.setEdge(n,s,{}),t(s))})}return i.nodes().forEach(t),i.nodeCount()}function Ukt(i,e){return e.edges().reduce((n,o)=>{let r=Number.POSITIVE_INFINITY;return i.hasNode(o.v)!==i.hasNode(o.w)&&(r=BO(e,o)),re.node(n).rank+=t)}var Kkt=wxe,_de=o3.slack,qkt=o3.longestPath,Gkt=hh.alg.preorder,Xkt=hh.alg.postorder,Ykt=Ds.simplify,Zkt=o1;o1.initLowLimValues=oZ;o1.initCutValues=iZ;o1.calcCutValue=Sxe;o1.leaveEdge=Lxe;o1.enterEdge=Exe;o1.exchangeEdges=Dxe;function o1(i){i=Ykt(i),qkt(i);var e=Kkt(i);oZ(e),iZ(e,i);for(var t,n;t=Lxe(e);)n=Exe(e,i,t),Dxe(e,i,t,n)}function iZ(i,e){var t=Xkt(i,i.nodes());t=t.slice(0,t.length-1),t.forEach(n=>Qkt(i,e,n))}function Qkt(i,e,t){var n=i.node(t),o=n.parent;i.edge(t,o).cutvalue=Sxe(i,e,t)}function Sxe(i,e,t){var n=i.node(t),o=n.parent,r=!0,s=e.edge(t,o),a=0;return s||(r=!1,s=e.edge(o,t)),a=s.weight,e.nodeEdges(t).forEach(l=>{var c=l.v===t,d=c?l.w:l.v;if(d!==o){var u=c===r,h=e.edge(l).weight;if(a+=u?h:-h,eIt(i,t,d)){var f=i.edge(t,d).cutvalue;a+=u?-f:f}}}),a}function oZ(i,e){arguments.length<2&&(e=i.nodes()[0]),xxe(i,{},1,e)}function xxe(i,e,t,n,o){var r=t,s=i.node(n);return e[n]=!0,i.neighbors(n).forEach(a=>{e.hasOwnProperty(a)||(t=xxe(i,e,t,a,n))}),s.low=r,s.lim=t++,o?s.parent=o:delete s.parent,t}function Lxe(i){return i.edges().find(e=>i.edge(e).cutvalue<0)}function Exe(i,e,t){var n=t.v,o=t.w;e.hasEdge(n,o)||(n=t.w,o=t.v);var r=i.node(n),s=i.node(o),a=r,l=!1;r.lim>s.lim&&(a=s,l=!0);var c=e.edges().filter(d=>l===bde(i,i.node(d.v),a)&&l!==bde(i,i.node(d.w),a));return c.reduce((d,u)=>_de(e,u)<_de(e,d)?u:d)}function Dxe(i,e,t,n){var o=t.v,r=t.w;i.removeEdge(o,r),i.setEdge(n.v,n.w,{}),oZ(i),iZ(i,e),Jkt(i,e)}function Jkt(i,e){var t=i.nodes().find(o=>!e.node(o).parent),n=Gkt(i,t);n=n.slice(1),n.forEach(o=>{var r=i.node(o).parent,s=e.edge(o,r),a=!1;s||(s=e.edge(r,o),a=!0),e.node(o).rank=e.node(r).rank+(a?s.minlen:-s.minlen)})}function eIt(i,e,t){return i.hasEdge(e,t)}function bde(i,e,t){return t.low<=e.lim&&e.lim<=t.lim}var tIt=o3,kxe=tIt.longestPath,nIt=wxe,iIt=Zkt,oIt=rIt;function rIt(i){switch(i.graph().ranker){case"network-simplex":Cde(i);break;case"tight-tree":aIt(i);break;case"longest-path":sIt(i);break;default:Cde(i)}}var sIt=kxe;function aIt(i){kxe(i),nIt(i)}function Cde(i){iIt(i)}var lIt=cIt;function cIt(i){let e=uIt(i);i.graph().dummyChains.forEach(t=>{let n=i.node(t),o=n.edgeObj,r=dIt(i,e,o.v,o.w),s=r.path,a=r.lca,l=0,c=s[l],d=!0;for(;t!==o.w;){if(n=i.node(t),d){for(;(c=s[l])!==a&&i.node(c).maxRanks||a>e[l].lim));for(c=l,l=n;(l=i.parent(l))!==c;)r.push(l);return{path:o.concat(r.reverse()),lca:c}}function uIt(i){let e={},t=0;function n(o){let r=t;i.children(o).forEach(n),e[o]={low:r,lim:t++}}return i.children().forEach(n),e}let aj=Ds;var hIt={run:fIt,cleanup:mIt};function fIt(i){let e=aj.addDummyNode(i,"root",{},"_root"),t=gIt(i),n=Math.max(...Object.values(t))-1,o=2*n+1;i.graph().nestingRoot=e,i.edges().forEach(s=>i.edge(s).minlen*=o);let r=pIt(i)+1;i.children().forEach(s=>Ixe(i,e,o,r,n,t,s)),i.graph().nodeRankFactor=o}function Ixe(i,e,t,n,o,r,s){let a=i.children(s);if(!a.length){s!==e&&i.setEdge(e,s,{weight:0,minlen:t});return}let l=aj.addBorderNode(i,"_bt"),c=aj.addBorderNode(i,"_bb"),d=i.node(s);i.setParent(l,s),d.borderTop=l,i.setParent(c,s),d.borderBottom=c,a.forEach(u=>{Ixe(i,e,t,n,o,r,u);let h=i.node(u),f=h.borderTop?h.borderTop:u,g=h.borderBottom?h.borderBottom:u,p=h.borderTop?n:2*n,v=f!==g?1:o-r[s]+1;i.setEdge(l,f,{weight:p,minlen:v,nestingEdge:!0}),i.setEdge(g,c,{weight:p,minlen:v,nestingEdge:!0})}),i.parent(s)||i.setEdge(e,l,{weight:0,minlen:o+r[s]})}function gIt(i){var e={};function t(n,o){var r=i.children(n);r&&r.length&&r.forEach(s=>t(s,o+1)),e[n]=o}return i.children().forEach(n=>t(n,1)),e}function pIt(i){return i.edges().reduce((e,t)=>e+i.edge(t).weight,0)}function mIt(i){var e=i.graph();i.removeNode(e.nestingRoot),delete e.nestingRoot,i.edges().forEach(t=>{var n=i.edge(t);n.nestingEdge&&i.removeEdge(t)})}let vIt=Ds;var _It=bIt;function bIt(i){function e(t){let n=i.children(t),o=i.node(t);if(n.length&&n.forEach(e),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(let r=o.minRank,s=o.maxRank+1;rwde(i.node(e))),i.edges().forEach(e=>wde(i.edge(e)))}function wde(i){let e=i.width;i.width=i.height,i.height=e}function SIt(i){i.nodes().forEach(e=>F7(i.node(e))),i.edges().forEach(e=>{let t=i.edge(e);t.points.forEach(F7),t.hasOwnProperty("y")&&F7(t)})}function F7(i){i.y=-i.y}function xIt(i){i.nodes().forEach(e=>B7(i.node(e))),i.edges().forEach(e=>{let t=i.edge(e);t.points.forEach(B7),t.hasOwnProperty("x")&&B7(t)})}function B7(i){let e=i.x;i.x=i.y,i.y=e}let LIt=Ds;var EIt=DIt;function DIt(i){let e={},t=i.nodes().filter(a=>!i.children(a).length),n=Math.max(...t.map(a=>i.node(a).rank)),o=LIt.range(n+1).map(()=>[]);function r(a){if(e[a])return;e[a]=!0;let l=i.node(a);o[l.rank].push(a),i.successors(a).forEach(r)}return t.sort((a,l)=>i.node(a).rank-i.node(l).rank).forEach(r),o}let kIt=Ds.zipObject;var IIt=TIt;function TIt(i,e){let t=0;for(let n=1;nd)),o=e.flatMap(c=>i.outEdges(c).map(d=>({pos:n[d.w],weight:i.edge(d).weight})).sort((d,u)=>d.pos-u.pos)),r=1;for(;r{let d=c.pos+r;a[d]+=c.weight;let u=0;for(;d>0;)d%2&&(u+=a[d+1]),d=d-1>>1,a[d]+=c.weight;l+=c.weight*u}),l}var RIt=MIt;function MIt(i,e=[]){return e.map(t=>{let n=i.inEdges(t);if(n.length){let o=n.reduce((r,s)=>{let a=i.edge(s),l=i.node(s.v);return{sum:r.sum+a.weight*l.order,weight:r.weight+a.weight}},{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:t}})}let AIt=Ds;var PIt=OIt;function OIt(i,e){let t={};i.forEach((o,r)=>{let s=t[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:r};o.barycenter!==void 0&&(s.barycenter=o.barycenter,s.weight=o.weight)}),e.edges().forEach(o=>{let r=t[o.v],s=t[o.w];r!==void 0&&s!==void 0&&(s.indegree++,r.out.push(t[o.w]))});let n=Object.values(t).filter(o=>!o.indegree);return FIt(n)}function FIt(i){let e=[];function t(o){return r=>{r.merged||(r.barycenter===void 0||o.barycenter===void 0||r.barycenter>=o.barycenter)&&BIt(o,r)}}function n(o){return r=>{r.in.push(o),--r.indegree===0&&i.push(r)}}for(;i.length;){let o=i.pop();e.push(o),o.in.reverse().forEach(t(o)),o.out.forEach(n(o))}return e.filter(o=>!o.merged).map(o=>AIt.pick(o,["vs","i","barycenter","weight"]))}function BIt(i,e){let t=0,n=0;i.weight&&(t+=i.barycenter*i.weight,n+=i.weight),e.weight&&(t+=e.barycenter*e.weight,n+=e.weight),i.vs=e.vs.concat(i.vs),i.barycenter=t/n,i.weight=n,i.i=Math.min(e.i,i.i),e.merged=!0}let WIt=Ds;var VIt=HIt;function HIt(i,e){let t=WIt.partition(i,d=>d.hasOwnProperty("barycenter")),n=t.lhs,o=t.rhs.sort((d,u)=>u.i-d.i),r=[],s=0,a=0,l=0;n.sort($It(!!e)),l=Sde(r,o,l),n.forEach(d=>{l+=d.vs.length,r.push(d.vs),s+=d.barycenter*d.weight,a+=d.weight,l=Sde(r,o,l)});let c={vs:r.flat(!0)};return a&&(c.barycenter=s/a,c.weight=a),c}function Sde(i,e,t){let n;for(;e.length&&(n=e[e.length-1]).i<=t;)e.pop(),i.push(n.vs),t++;return t}function $It(i){return(e,t)=>e.barycentert.barycenter?1:i?t.i-e.i:e.i-t.i}let zIt=RIt,UIt=PIt,jIt=VIt;var KIt=Nxe;function Nxe(i,e,t,n){let o=i.children(e),r=i.node(e),s=r?r.borderLeft:void 0,a=r?r.borderRight:void 0,l={};s&&(o=o.filter(h=>h!==s&&h!==a));let c=zIt(i,o);c.forEach(h=>{if(i.children(h.v).length){let f=Nxe(i,h.v,t,n);l[h.v]=f,f.hasOwnProperty("barycenter")&&GIt(h,f)}});let d=UIt(c,t);qIt(d,l);let u=jIt(d,n);if(s&&(u.vs=[s,u.vs,a].flat(!0),i.predecessors(s).length)){let h=i.node(i.predecessors(s)[0]),f=i.node(i.predecessors(a)[0]);u.hasOwnProperty("barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+h.order+f.order)/(u.weight+2),u.weight+=2}return u}function qIt(i,e){i.forEach(t=>{t.vs=t.vs.flatMap(n=>e[n]?e[n].vs:n)})}function GIt(i,e){i.barycenter!==void 0?(i.barycenter=(i.barycenter*i.weight+e.barycenter*e.weight)/(i.weight+e.weight),i.weight+=e.weight):(i.barycenter=e.barycenter,i.weight=e.weight)}let XIt=hh.Graph,YIt=Ds;var ZIt=QIt;function QIt(i,e,t){let n=JIt(i),o=new XIt({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(r=>i.node(r));return i.nodes().forEach(r=>{let s=i.node(r),a=i.parent(r);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(o.setNode(r),o.setParent(r,a||n),i[t](r).forEach(l=>{let c=l.v===r?l.w:l.v,d=o.edge(c,r),u=d!==void 0?d.weight:0;o.setEdge(c,r,{weight:i.edge(l).weight+u})}),s.hasOwnProperty("minRank")&&o.setNode(r,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),o}function JIt(i){for(var e;i.hasNode(e=YIt.uniqueId("_root")););return e}var eTt=tTt;function tTt(i,e,t){let n={},o;t.forEach(r=>{let s=i.parent(r),a,l;for(;s;){if(a=i.parent(s),a?(l=n[a],n[a]=s):(l=o,o=s),l&&l!==s){e.setEdge(l,s);return}s=a}})}let nTt=EIt,iTt=IIt,oTt=KIt,rTt=ZIt,sTt=eTt,aTt=hh.Graph,yR=Ds;var lTt=cTt;function cTt(i){let e=yR.maxRank(i),t=xde(i,yR.range(1,e+1),"inEdges"),n=xde(i,yR.range(e-1,-1,-1),"outEdges"),o=nTt(i);Lde(i,o);let r=Number.POSITIVE_INFINITY,s;for(let a=0,l=0;l<4;++a,++l){dTt(a%2?t:n,a%4>=2),o=yR.buildLayerMatrix(i);let c=iTt(i,o);cn.node(s).order=a),sTt(n,t,r.vs)})}function Lde(i,e){Object.values(e).forEach(t=>t.forEach((n,o)=>i.node(n).order=o))}let uTt=hh.Graph,aI=Ds;var hTt={positionX:pTt,findType1Conflicts:Rxe,findType2Conflicts:Mxe,addConflict:rZ,hasConflict:Axe,verticalAlignment:Pxe,horizontalCompaction:Oxe,alignCoordinates:Bxe,findSmallestWidthAlignment:Fxe,balance:Wxe};function Rxe(i,e){let t={};function n(o,r){let s=0,a=0,l=o.length,c=r[r.length-1];return r.forEach((d,u)=>{let h=fTt(i,d),f=h?i.node(h).order:l;(h||d===c)&&(r.slice(a,u+1).forEach(g=>{i.predecessors(g).forEach(p=>{let v=i.node(p),m=v.order;(m{d=r[u],i.node(d).dummy&&i.predecessors(d).forEach(h=>{let f=i.node(h);f.dummy&&(f.orderc)&&rZ(t,h,d)})})}function o(r,s){let a=-1,l,c=0;return s.forEach((d,u)=>{if(i.node(d).dummy==="border"){let h=i.predecessors(d);h.length&&(l=i.node(h[0]).order,n(s,c,u,a,l),c=u,a=l)}n(s,c,s.length,l,r.length)}),s}return e.reduce(o),t}function fTt(i,e){if(i.node(e).dummy)return i.predecessors(e).find(t=>i.node(t).dummy)}function rZ(i,e,t){if(e>t){let o=e;e=t,t=o}let n=i[e];n||(i[e]=n={}),n[t]=!0}function Axe(i,e,t){if(e>t){let n=e;e=t,t=n}return!!i[e]&&i[e].hasOwnProperty(t)}function Pxe(i,e,t,n){let o={},r={},s={};return e.forEach(a=>{a.forEach((l,c)=>{o[l]=l,r[l]=l,s[l]=c})}),e.forEach(a=>{let l=-1;a.forEach(c=>{let d=n(c);if(d.length){d=d.sort((h,f)=>s[h]-s[f]);let u=(d.length-1)/2;for(let h=Math.floor(u),f=Math.ceil(u);h<=f;++h){let g=d[h];r[c]===c&&lMath.max(h,r[f.v]+s.edge(f)),0)}function d(u){let h=s.outEdges(u).reduce((g,p)=>Math.min(g,r[p.w]-s.edge(p)),Number.POSITIVE_INFINITY),f=i.node(u);h!==Number.POSITIVE_INFINITY&&f.borderType!==a&&(r[u]=Math.max(r[u],h))}return l(c,s.predecessors.bind(s)),l(d,s.successors.bind(s)),Object.keys(n).forEach(u=>r[u]=r[t[u]]),r}function gTt(i,e,t,n){let o=new uTt,r=i.graph(),s=mTt(r.nodesep,r.edgesep,n);return e.forEach(a=>{let l;a.forEach(c=>{let d=t[c];if(o.setNode(d),l){var u=t[l],h=o.edge(u,d);o.setEdge(u,d,Math.max(s(i,c,l),h||0))}l=c})}),o}function Fxe(i,e){return Object.values(e).reduce((t,n)=>{let o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;Object.entries(n).forEach(([a,l])=>{let c=vTt(i,a)/2;o=Math.max(l+c,o),r=Math.min(l-c,r)});const s=o-r;return s{["l","r"].forEach(s=>{let a=r+s,l=i[a];if(l===e)return;let c=Object.values(l),d=n-Math.min(...c);s!=="l"&&(d=o-Math.max(...c)),d&&(i[a]=aI.mapValues(l,u=>u+d))})})}function Wxe(i,e){return aI.mapValues(i.ul,(t,n)=>{if(e)return i[e.toLowerCase()][n];{let o=Object.values(i).map(r=>r[n]).sort((r,s)=>r-s);return(o[1]+o[2])/2}})}function pTt(i){let e=aI.buildLayerMatrix(i),t=Object.assign(Rxe(i,e),Mxe(i,e)),n={},o;["u","d"].forEach(s=>{o=s==="u"?e:Object.values(e).reverse(),["l","r"].forEach(a=>{a==="r"&&(o=o.map(u=>Object.values(u).reverse()));let l=(s==="u"?i.predecessors:i.successors).bind(i),c=Pxe(i,o,t,l),d=Oxe(i,o,c.root,c.align,a==="r");a==="r"&&(d=aI.mapValues(d,u=>-u)),n[s+a]=d})});let r=Fxe(i,n);return Bxe(n,r),Wxe(n,i.graph().align)}function mTt(i,e,t){return(n,o,r)=>{let s=n.node(o),a=n.node(r),l=0,c;if(l+=s.width/2,s.hasOwnProperty("labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=-s.width/2;break;case"r":c=s.width/2;break}if(c&&(l+=t?c:-c),c=0,l+=(s.dummy?e:i)/2,l+=(a.dummy?e:i)/2,l+=a.width/2,a.hasOwnProperty("labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=a.width/2;break;case"r":c=-a.width/2;break}return c&&(l+=t?c:-c),c=0,l}}function vTt(i,e){return i.node(e).width}let Vxe=Ds,_Tt=hTt.positionX;var bTt=CTt;function CTt(i){i=Vxe.asNonCompoundGraph(i),yTt(i),Object.entries(_Tt(i)).forEach(([e,t])=>i.node(e).x=t)}function yTt(i){let e=Vxe.buildLayerMatrix(i),t=i.graph().ranksep,n=0;e.forEach(o=>{const r=o.reduce((s,a)=>{const l=i.node(a).height;return s>l?s:l},0);o.forEach(s=>i.node(s).y=n+r/2),n+=r+t})}let Ede=Tkt,Dde=Pkt,wTt=oIt,STt=Ds.normalizeRanks,xTt=lIt,LTt=Ds.removeEmptyRanks,kde=hIt,ETt=_It,Ide=CIt,DTt=lTt,kTt=bTt,Vd=Ds,ITt=hh.Graph;var TTt=NTt;function NTt(i,e){let t=e&&e.debugTiming?Vd.time:Vd.notime;t("layout",()=>{let n=t(" buildLayoutGraph",()=>HTt(i));t(" runLayout",()=>RTt(n,t)),t(" updateInputGraph",()=>MTt(i,n))})}function RTt(i,e){e(" makeSpaceForEdgeLabels",()=>$Tt(i)),e(" removeSelfEdges",()=>ZTt(i)),e(" acyclic",()=>Ede.run(i)),e(" nestingGraph.run",()=>kde.run(i)),e(" rank",()=>wTt(Vd.asNonCompoundGraph(i))),e(" injectEdgeLabelProxies",()=>zTt(i)),e(" removeEmptyRanks",()=>LTt(i)),e(" nestingGraph.cleanup",()=>kde.cleanup(i)),e(" normalizeRanks",()=>STt(i)),e(" assignRankMinMax",()=>UTt(i)),e(" removeEdgeLabelProxies",()=>jTt(i)),e(" normalize.run",()=>Dde.run(i)),e(" parentDummyChains",()=>xTt(i)),e(" addBorderSegments",()=>ETt(i)),e(" order",()=>DTt(i)),e(" insertSelfEdges",()=>QTt(i)),e(" adjustCoordinateSystem",()=>Ide.adjust(i)),e(" position",()=>kTt(i)),e(" positionSelfEdges",()=>JTt(i)),e(" removeBorderNodes",()=>YTt(i)),e(" normalize.undo",()=>Dde.undo(i)),e(" fixupEdgeLabelCoords",()=>GTt(i)),e(" undoCoordinateSystem",()=>Ide.undo(i)),e(" translateGraph",()=>KTt(i)),e(" assignNodeIntersects",()=>qTt(i)),e(" reversePoints",()=>XTt(i)),e(" acyclic.undo",()=>Ede.undo(i))}function MTt(i,e){i.nodes().forEach(t=>{let n=i.node(t),o=e.node(t);n&&(n.x=o.x,n.y=o.y,n.rank=o.rank,e.children(t).length&&(n.width=o.width,n.height=o.height))}),i.edges().forEach(t=>{let n=i.edge(t),o=e.edge(t);n.points=o.points,o.hasOwnProperty("x")&&(n.x=o.x,n.y=o.y)}),i.graph().width=e.graph().width,i.graph().height=e.graph().height}let ATt=["nodesep","edgesep","ranksep","marginx","marginy"],PTt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},OTt=["acyclicer","ranker","rankdir","align"],FTt=["width","height"],Tde={width:0,height:0},BTt=["minlen","weight","width","height","labeloffset"],WTt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},VTt=["labelpos"];function HTt(i){let e=new ITt({multigraph:!0,compound:!0}),t=V7(i.graph());return e.setGraph(Object.assign({},PTt,W7(t,ATt),Vd.pick(t,OTt))),i.nodes().forEach(n=>{let o=V7(i.node(n));const r=W7(o,FTt);Object.keys(Tde).forEach(s=>{r[s]===void 0&&(r[s]=Tde[s])}),e.setNode(n,r),e.setParent(n,i.parent(n))}),i.edges().forEach(n=>{let o=V7(i.edge(n));e.setEdge(n,Object.assign({},WTt,W7(o,BTt),Vd.pick(o,VTt)))}),e}function $Tt(i){let e=i.graph();e.ranksep/=2,i.edges().forEach(t=>{let n=i.edge(t);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function zTt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.width&&t.height){let n=i.node(e.v),r={rank:(i.node(e.w).rank-n.rank)/2+n.rank,e};Vd.addDummyNode(i,"edge-proxy",r,"_ep")}})}function UTt(i){let e=0;i.nodes().forEach(t=>{let n=i.node(t);n.borderTop&&(n.minRank=i.node(n.borderTop).rank,n.maxRank=i.node(n.borderBottom).rank,e=Math.max(e,n.maxRank))}),i.graph().maxRank=e}function jTt(i){i.nodes().forEach(e=>{let t=i.node(e);t.dummy==="edge-proxy"&&(i.edge(t.e).labelRank=t.rank,i.removeNode(e))})}function KTt(i){let e=Number.POSITIVE_INFINITY,t=0,n=Number.POSITIVE_INFINITY,o=0,r=i.graph(),s=r.marginx||0,a=r.marginy||0;function l(c){let d=c.x,u=c.y,h=c.width,f=c.height;e=Math.min(e,d-h/2),t=Math.max(t,d+h/2),n=Math.min(n,u-f/2),o=Math.max(o,u+f/2)}i.nodes().forEach(c=>l(i.node(c))),i.edges().forEach(c=>{let d=i.edge(c);d.hasOwnProperty("x")&&l(d)}),e-=s,n-=a,i.nodes().forEach(c=>{let d=i.node(c);d.x-=e,d.y-=n}),i.edges().forEach(c=>{let d=i.edge(c);d.points.forEach(u=>{u.x-=e,u.y-=n}),d.hasOwnProperty("x")&&(d.x-=e),d.hasOwnProperty("y")&&(d.y-=n)}),r.width=t-e+s,r.height=o-n+a}function qTt(i){i.edges().forEach(e=>{let t=i.edge(e),n=i.node(e.v),o=i.node(e.w),r,s;t.points?(r=t.points[0],s=t.points[t.points.length-1]):(t.points=[],r=o,s=n),t.points.unshift(Vd.intersectRect(n,r)),t.points.push(Vd.intersectRect(o,s))})}function GTt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.hasOwnProperty("x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function XTt(i){i.edges().forEach(e=>{let t=i.edge(e);t.reversed&&t.points.reverse()})}function YTt(i){i.nodes().forEach(e=>{if(i.children(e).length){let t=i.node(e),n=i.node(t.borderTop),o=i.node(t.borderBottom),r=i.node(t.borderLeft[t.borderLeft.length-1]),s=i.node(t.borderRight[t.borderRight.length-1]);t.width=Math.abs(s.x-r.x),t.height=Math.abs(o.y-n.y),t.x=r.x+t.width/2,t.y=n.y+t.height/2}}),i.nodes().forEach(e=>{i.node(e).dummy==="border"&&i.removeNode(e)})}function ZTt(i){i.edges().forEach(e=>{if(e.v===e.w){var t=i.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:i.edge(e)}),i.removeEdge(e)}})}function QTt(i){var e=Vd.buildLayerMatrix(i);e.forEach(t=>{var n=0;t.forEach((o,r)=>{var s=i.node(o);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Vd.addDummyNode(i,"selfedge",{width:a.label.width,height:a.label.height,rank:s.rank,order:r+ ++n,e:a.e,label:a.label},"_se")}),delete s.selfEdges})})}function JTt(i){i.nodes().forEach(e=>{var t=i.node(e);if(t.dummy==="selfedge"){var n=i.node(t.e.v),o=n.x+n.width/2,r=n.y,s=t.x-o,a=n.height/2;i.setEdge(t.e,t.label),i.removeNode(e),t.label.points=[{x:o+2*s/3,y:r-a},{x:o+5*s/6,y:r-a},{x:o+s,y:r},{x:o+5*s/6,y:r+a},{x:o+2*s/3,y:r+a}],t.label.x=t.x,t.label.y=t.y}})}function W7(i,e){return Vd.mapValues(Vd.pick(i,e),Number)}function V7(i){var e={};return i&&Object.entries(i).forEach(([t,n])=>{typeof t=="string"&&(t=t.toLowerCase()),e[t]=n}),e}let eNt=Ds,tNt=hh.Graph;var nNt={debugOrdering:iNt};function iNt(i){let e=eNt.buildLayerMatrix(i),t=new tNt({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(n=>{t.setNode(n,{label:n}),t.setParent(n,"layer"+i.node(n).rank)}),i.edges().forEach(n=>t.setEdge(n.v,n.w,{},n.name)),e.forEach((n,o)=>{let r="layer"+o;t.setNode(r,{rank:"same"}),n.reduce((s,a)=>(t.setEdge(s,a,{style:"invis"}),a))}),t}var oNt="1.0.4",Nde={graphlib:hh,layout:TTt,debug:nNt,util:{time:Ds.time,notime:Ds.notime},version:oNt};const rNt="_container_zefjd_1",sNt="_label_zefjd_9",aNt="_content_zefjd_12",lNt="_selected_zefjd_27",cNt="_node__title_zefjd_30";var D_={container:rNt,label:sNt,content:aNt,selected:lNt,node__title:cNt,"node__operator-description":"_node__operator-description_zefjd_35","value-container":"_value-container_zefjd_38"};const dNt="_container_1hwg2_11",uNt="_wrapper_1hwg2_16";var wR={"port-type-container":"_port-type-container_1hwg2_1","port-type-label":"_port-type-label_1hwg2_6",container:dNt,wrapper:uNt,"add-button":"_add-button_1hwg2_19"};function hNt(i){var s,a;const{node:e}=i,t=(s=e==null?void 0:e.data)==null?void 0:s.endPointOptions,{updateNode:n}=i3(),o=fr(e);function r(l){return l.type!=="source"&&l.type!=="target"?fn("div",{children:["unknown type: ",l.type]},l.id):fn("div",{style:{position:"relative"},children:[he("div",{style:{textAlign:l.type==="source"?"right":"left"},children:l.label||l.variableName}),he(dD,{type:l.type,position:l.type==="source"?mn.Right:mn.Left,id:l.id,isConnectable:!0})]},l.id)}return!((a=t==null?void 0:t.endPointList)!=null&&a.length)||!o?null:he("div",{className:wR.container,children:t.endPointList.map(l=>{var c,d;return l.type==="group"?!((c=l.children)!=null&&c.length)&&!l.allowAddAndRemoveChildren?null:fn("div",{children:[fn("div",{className:wR["port-type-container"],children:[he("div",{className:wR["port-type-label"],children:l.label}),(d=l.children)==null?void 0:d.map(u=>r(u))]}),l.allowAddAndRemoveChildren&&he("span",{className:wR["add-button"],onClick:()=>{!(e!=null&&e.id)||n(e==null?void 0:e.id,u=>(l.children=(l.children||[]).concat(ri.createFromGroup(l)),o.updateData(u,{})))},children:"add"})]},l.id):r(l)})})}function fNt(i){var c,d;const e=fr(i),{currentStateRef:t,actionsRef:n}=NT(),{selected:o,data:r}=i,s=(c=e==null?void 0:e.getNodeProps)==null?void 0:c.call(e,i);function a(){var h;if(!(s!=null&&s.showValue))return null;const u=(h=s==null?void 0:s.getBriefValue)==null?void 0:h.call(s);return u?he("div",{className:D_["value-container"],onClick:()=>{var f;u.hasDetail&&Xs.info(((f=s==null?void 0:s.getDetailValue)==null?void 0:f.call(s))||"")},children:u.value}):null}const l=a();return fn("div",{className:Ue(D_.container,{[D_.selected]:o}),style:{"--color-node-theme":(e==null?void 0:e.nodeColor)||void 0},onClick:()=>{e==null||e.onNodeFocus({node:i,currentState:t.current,actions:n.current})},children:[he("div",{className:D_.label,children:(r==null?void 0:r.nodeLabel)||(r==null?void 0:r.operatorName)}),fn("div",{className:D_.content,onDoubleClick:()=>{e==null||e.onNodeDoubleClick({node:i,currentState:t.current,actions:n.current})},children:[fn("div",{className:D_.node__title,children:[(e==null?void 0:e.description)&&he("div",{className:D_["node__operator-description"],children:e==null?void 0:e.description}),l&&he("div",{children:l}),((d=e==null?void 0:e.renderCustomLabel)==null?void 0:d.call(e,i))||null]}),he(hNt,{node:i})]})]},i.id)}const gNt={[oh.Node]:fNt};var pNt={"main-flow":"_main-flow_acc5o_1"};function mNt(){const{operators:i}=eZ(),{actionsRef:e,currentStateRef:t}=NT(),[n,o]=el(l=>{const c=wc(l.layer,l.activeLayerId),d=c!=null&&c.parentLayerId?wc(l.layer,c==null?void 0:c.parentLayerId):void 0;return[d==null?void 0:d.id,d==null?void 0:d.name]}),{setActiveLayerId:r,setLayer:s}=i3(),a=el(l=>{var c,d;if(((c=l.layer)==null?void 0:c.id)!==((d=l.defaultLayer)==null?void 0:d.id))return l.defaultLayer});return fn(ks,{children:[a?he(ts,{type:"text",style:{color:"white"},onClick:()=>{zu.exports.flushSync(()=>{s(a),r(a.id)}),setTimeout(()=>{i.forEach(l=>{var c;(c=l.onLayerChange)==null||c.call(l,{currentState:t.current,actions:e.current})})})},children:"Back To Default"}):null,n&&fn(ts,{type:"text",style:{color:"white"},onClick:()=>{r(n)},children:["\u8FD4\u56DE ",o||n]})]})}const vNt=i=>{const e=fr(i);return e!=null&&e.nodeColor?e==null?void 0:e.nodeColor:"#ff0072"},_Nt=(i,e)=>{const t=new Nde.graphlib.Graph().setDefaultEdgeLabel(()=>({}));return t.setGraph({rankdir:"LR"}),e.forEach(n=>t.setEdge(n.source,n.target)),i.forEach(n=>t.setNode(n.id,{...n,width:n.width||void 0,height:n.height||void 0})),Nde.layout(t),{nodes:i.map(n=>{const{x:o,y:r}=t.node(n.id);return{...n,position:{x:o,y:r}}}),edges:e}},bNt=()=>{const{nodes:i,edges:e,setNodes:t,setEdges:n}=TT(),{actionsRef:o,currentStateRef:r}=NT(),s=mo(v=>v.addSelectedEdges),a=v=>{console.log("connection",v),n(m=>bfe(v,m).filter(_=>!(BB(_)&&!SFe(_,v)&&wFe(_,v)))),setTimeout(()=>{const m=e.find(_=>{const y=v;return BB(_)&&_.source===y.source&&_.target===y.target&&(_.sourceHandle===y.sourceHandle||!_.sourceHandle&&!y.sourceHandle)&&(_.targetHandle===y.targetHandle||!_.targetHandle&&!y.targetHandle)});s([m].filter(_=>Boolean(_)).map(_=>_.id))})},l=x.exports.useRef(null),c=mo(v=>v.updateNodePositions),d=x.exports.useRef([]);mo(v=>(d.current=v.getNodes(),d));const u=v=>{var _;const m=v.dataTransfer.getData(tj);if(m){const y=Pq(m);if(y){const w=y.create();if(y.isUnique&&i.find(I=>{var k;return((k=I.data)==null?void 0:k.operatorType)===y.operatorType})){Xs.warning(`\u53EA\u5141\u8BB8\u5B58\u5728\u4E00\u4E2A${y.operatorName}`);return}const{clientX:L,clientY:D}=v,E=(_=l.current)==null?void 0:_.getBoundingClientRect();E&&(w.position={x:L-E.left,y:D-E.y}),t(I=>[...I,w]),setTimeout(()=>{var k,R;const I=d.current.find(A=>A.id===w.id);if(I){const A={x:((k=I==null?void 0:I.position)==null?void 0:k.x)-((I==null?void 0:I.width)||0)/2,y:I.position.y-Math.max(((I==null?void 0:I.height)||0)/5,30)};I.position=A,c([I],!1,!1)}t(A=>(A.find(N=>N.id===w.id)&&(w.style={visibility:"visible"}),[...A])),(R=y==null?void 0:y.onAfterCreate)==null||R.call(y,{node:I,currentState:r.current,actions:o.current})})}}},h=v=>{v.dataTransfer.types.includes(tj)&&v.preventDefault()},f=x.exports.useCallback(v=>{t(m=>Vfe(v,m))},[]),g=x.exports.useCallback(v=>{n(m=>R4e(v,m))},[]),p=x.exports.useCallback(()=>{const v=_Nt(i,e);t([...v.nodes]),n([...v.edges])},[i,e]);return he("div",{className:pNt["main-flow"],ref:l,onDrop:u,onDragEnter:h,onDragOver:h,children:fn(Jfe,{nodeTypes:gNt,nodes:i,edges:e,onNodesChange:f,onEdgesChange:g,onConnect:a,zoomOnScroll:!1,defaultEdgeOptions:{animated:!0},children:[he(q5e,{variant:kd.Dots,gap:24,color:"rgba(255,255,255,0.4)",size:2}),he(A5e,{nodeColor:vNt,nodeStrokeWidth:3,zoomable:!0,pannable:!0}),he(H5e,{}),he(aD,{position:"top-left",children:he(mNt,{})}),he(aD,{position:"top-right",children:he(ts,{type:"text",style:{color:"white"},onClick:()=>{p()},children:"layout"})})]})})},CNt=()=>{var d,u;const e=el(h=>h.nodes).filter(h=>h.selected),t=(e==null?void 0:e.length)===1?e[0]:void 0,n=el(h=>h.nodes.find(f=>f.id===(t==null?void 0:t.id))),o=(d=n==null?void 0:n.data)==null?void 0:d.operatorType,r=fr(n),s=!!t&&o,{updateEdge:a,updateNode:l,setLayer:c}=i3();return fn("div",{children:[he("div",{children:"Attributes"}),s&&((u=r==null?void 0:r.generateAttributeControl)==null?void 0:u.call(r,{node:n,actions:{updateEdge:a,updateNode:l,setLayer:c}}))]})},yNt=()=>{var p,v,m;const{store:i,nodes:e,edges:t}=ZGe(),[n,o]=x.exports.useState(),r=x.exports.useRef({}),s=new Mq(e,t),a=e.find(_=>{var y;return((y=fr(_))==null?void 0:y.operatorType)==="InputOperator"}),l=a?(p=fr(a))==null?void 0:p.getStatePort(a):[],c=a?(v=fr(a))==null?void 0:v.getEventPorts(a):[],d=e.find(_=>{var y;return((y=fr(_))==null?void 0:y.operatorType)==="OutputOperator"});x.exports.useEffect(()=>{console.log("store ==> ",i),r.current=Object.fromEntries((l==null?void 0:l.map(y=>[y.variableName,new Ou(void 0)]))||[]);const _=i==null?void 0:i(r.current);console.log("init ==> ",_),o(_)},[i]),x.exports.useEffect(()=>{var y;if(!d)return;const _=(y=fr(d))==null?void 0:y.getEventPorts(d);_==null||_.forEach(w=>{var L;(L=n==null?void 0:n.output[w.variableName||""])==null||L.subscribe(D=>{Xs.info(`value: ${D.payload}`),console.log("events",w,D)})})},[n]);const[u,h]=x.exports.useState(""),[,f]=x.exports.useState([]),g=d?(m=fr(d))==null?void 0:m.getStatePort(d).map(_=>{var w,L;const y=(L=(w=s.findSourceNodes(d.id))==null?void 0:w.find(D=>D.handleId===_.id))==null?void 0:L.relatedHandleId;return{port:_,handleId:y}}):[];return x.exports.useEffect(()=>{g==null||g.map(({port:_})=>{var y;return(y=n==null?void 0:n.output)==null?void 0:y[_.variableName||""]}).forEach(_=>{_==null||_.subscribe(y=>{console.log(y),f([])})})},[n]),he("div",{style:{display:"grid",gap:16,gridAutoFlow:"column",justifyContent:"start",marginBottom:16},children:(n==null?void 0:n.output)&&fn(ks,{children:[he("div",{children:he("div",{style:{display:"grid",gap:12},children:fn("div",{style:{display:"grid",gap:12},children:[l==null?void 0:l.map(_=>fn("div",{children:[_.label||_.variableName,":",he(dw,{onChange:y=>{var L,D;const w=y.target.value;console.log("instance",n),(D=(L=r.current)==null?void 0:L[_.variableName||""])==null||D.next(new ap({payload:Number(w),path:_.variableName||""}))}})]},_.id)),fn("div",{children:["Event Value:",he(dw,{value:u,onChange:_=>{h(_.target.value)},size:"small",placeholder:"\u53D1\u9001\u4E8B\u4EF6\u7684\u53C2\u6570\uFF08\u8BF7\u586B\u5199 JSON\uFF09"})]}),c==null?void 0:c.map(_=>he(ts,{onClick:()=>{var y,w;(w=(y=n==null?void 0:n.output)==null?void 0:y[_.variableName||""])==null||w.next(new ap({payload:JSON.parse(u),path:_.variableName||""}))},children:_.label||_.variableName},_.id))]})})}),fn("div",{children:[he("div",{children:"Output"}),g==null?void 0:g.map(({port:_})=>{var y,w;return he("div",{children:he(wD.Item,{label:_.label||_.variableName,children:JSON.stringify((w=(y=n==null?void 0:n.output)==null?void 0:y[_.variableName||""])==null?void 0:w.current)})},_.id)})]})]})})},wNt="_editor_h950f_1";var SNt={editor:wNt};const xNt=()=>{const{layer:i}=WEt(),[e,t]=x.exports.useState(""),[n,o]=x.exports.useState(""),[r,s]=x.exports.useState({layer:i}),[a,l]=x.exports.useState(!1);return fn("div",{children:[he("div",{children:"Console"}),he("br",{}),fn("div",{style:{display:"grid",gap:16,gridAutoFlow:"column",justifyContent:"start"},children:[he(ts,{type:"link",onClick:()=>{console.log(new Mq(i.nodes,i.edges)),console.log({layer:i})},children:"Console Graph"}),he(ts,{type:"link",onClick:()=>{const c=new eoe;t(c.complie({layer:i}))},children:"Compile"}),he(ts,{type:"link",onClick:()=>{const d=new eoe().complie({layer:i});s(Cc.exports.cloneDeep({layer:i})),t(d),o(d)},children:"Compile and Run"}),he(ts,{type:"link",disabled:!e,onClick:()=>{l(!0)},children:"Show Output"})]}),fn("div",{children:[he("br",{}),he(JGe,{value:n,nodes:r.layer.nodes,edges:r.layer.edges,children:he(yNt,{})})]}),he(Eq,{open:a,width:"100vw",style:{top:0},onOk:()=>{l(!1)},onCancel:()=>{l(!1)},children:he(oxe,{language:"typescript",readonly:!0,className:SNt.editor,code:e})})]})},LNt="_container_1hju3_1",ENt="_main_1hju3_10",DNt="_console_1hju3_13";var Rde={container:LNt,main:ENt,console:DNt};const kNt=()=>he("div",{className:Rde.container,children:he($Et,{children:fn(HEt,{children:[he(dDt,{}),he(bNt,{}),he(CNt,{}),he("div",{className:Rde.console,children:he(xNt,{})})]})})});function INt(){return he(ks,{children:he(kNt,{})})}oK.render(he(Bt.StrictMode,{children:he(INt,{})}),document.getElementById("root"));export{gT as m,xye as t}; diff --git a/assets/javascript.ffc97e56.js b/assets/javascript.85c4a255.js similarity index 89% rename from assets/javascript.ffc97e56.js rename to assets/javascript.85c4a255.js index 36be5ab..c550ff1 100644 --- a/assets/javascript.ffc97e56.js +++ b/assets/javascript.85c4a255.js @@ -1,4 +1,4 @@ -import{conf as t,language as e}from"./typescript.e652792e.js";import"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{conf as t,language as e}from"./typescript.5993deda.js";import"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/jsonMode.db6fe524.js b/assets/jsonMode.ed18ab76.js similarity index 99% rename from assets/jsonMode.db6fe524.js rename to assets/jsonMode.ed18ab76.js index dc8c547..3b8bb17 100644 --- a/assets/jsonMode.db6fe524.js +++ b/assets/jsonMode.ed18ab76.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.af91b668.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.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/liquid.a3ff61c7.js b/assets/liquid.61cc9740.js similarity index 98% rename from assets/liquid.a3ff61c7.js rename to assets/liquid.61cc9740.js index 9fdc2f5..913581c 100644 --- a/assets/liquid.a3ff61c7.js +++ b/assets/liquid.61cc9740.js @@ -1,4 +1,4 @@ -import{m as d}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/mdx.12093909.js b/assets/mdx.1b36e47c.js similarity index 98% rename from assets/mdx.12093909.js rename to assets/mdx.1b36e47c.js index d7e9637..5348fb7 100644 --- a/assets/mdx.12093909.js +++ b/assets/mdx.1b36e47c.js @@ -1,4 +1,4 @@ -import{m as d}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/python.77882a55.js b/assets/python.402e94f8.js similarity index 98% rename from assets/python.77882a55.js rename to assets/python.402e94f8.js index d7096e5..343abcd 100644 --- a/assets/python.77882a55.js +++ b/assets/python.402e94f8.js @@ -1,4 +1,4 @@ -import{m as a}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/razor.65d26acd.js b/assets/razor.d50b3781.js similarity index 99% rename from assets/razor.65d26acd.js rename to assets/razor.d50b3781.js index 265d30b..9f6cdd3 100644 --- a/assets/razor.65d26acd.js +++ b/assets/razor.d50b3781.js @@ -1,4 +1,4 @@ -import{m as s}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/tsMode.3620dac5.js b/assets/tsMode.ec11a955.js similarity index 99% rename from assets/tsMode.3620dac5.js rename to assets/tsMode.ec11a955.js index 53140e9..efca5dc 100644 --- a/assets/tsMode.3620dac5.js +++ b/assets/tsMode.ec11a955.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.af91b668.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.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/typescript.e652792e.js b/assets/typescript.5993deda.js similarity index 98% rename from assets/typescript.e652792e.js rename to assets/typescript.5993deda.js index d857210..8a1b4a4 100644 --- a/assets/typescript.e652792e.js +++ b/assets/typescript.5993deda.js @@ -1,4 +1,4 @@ -import{m as a}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/xml.ea9fa0dc.js b/assets/xml.c84ad9c7.js similarity index 97% rename from assets/xml.ea9fa0dc.js rename to assets/xml.c84ad9c7.js index be0f75e..5dbfd7f 100644 --- a/assets/xml.ea9fa0dc.js +++ b/assets/xml.c84ad9c7.js @@ -1,4 +1,4 @@ -import{m}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m}from"./index.88ac6262.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/yaml.d8459d8e.js b/assets/yaml.75677e06.js similarity index 98% rename from assets/yaml.d8459d8e.js rename to assets/yaml.75677e06.js index 7d6b4be..5e76eaa 100644 --- a/assets/yaml.d8459d8e.js +++ b/assets/yaml.75677e06.js @@ -1,4 +1,4 @@ -import{m as i}from"./index.af91b668.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index.88ac6262.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 68379ba..a7f3666 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ @eos/Flow - +